blob: f4bf9384f104e10df2ec91ff076252bee5a5b344 [file] [log] [blame]
Pavel Kotucekd9aad292017-01-25 08:45:38 +01001/*
Jakub Grajciarcd01fb42020-03-02 13:16:53 +01002 * Copyright (c) 2015-2020 Cisco and/or its affiliates.
Pavel Kotucekd9aad292017-01-25 08:45:38 +01003 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
Jakub Grajciarcd01fb42020-03-02 13:16:53 +010016option version = "2.0.0";
17
Brian Russellb0468302021-02-17 15:51:45 +000018import "vnet/interface_types.api";
Jakub Grajciarcd01fb42020-03-02 13:16:53 +010019import "vnet/policer/policer_types.api";
Dave Barach0d056e52017-09-28 15:11:16 -040020
Brian Russell48e26362021-02-10 13:53:42 +000021/** \brief policer bind: Associate/disassociate a policer with a worker thread.
22 @param client_index - opaque cookie to identify the sender
23 @param context - sender context, to match reply w/ request
24 @param name - policer name to bind
25 @param worker_index - the worker thread to bind to
26 @param bind_enable - Associate/disassociate
27*/
28autoreply define policer_bind
29{
30 u32 client_index;
31 u32 context;
32
33 string name[64];
34 u32 worker_index;
35 bool bind_enable;
36};
37
Brian Russellb0468302021-02-17 15:51:45 +000038/** \brief policer input: Apply policer as an input feature.
39 @param client_index - opaque cookie to identify the sender
40 @param context - sender context, to match reply w/ request
41 @param name - policer name
42 @param sw_if_index - interface to apply the policer
43 @param apply - Apply/remove
44*/
45autoreply define policer_input
46{
47 u32 client_index;
48 u32 context;
49
50 string name[64];
51 vl_api_interface_index_t sw_if_index;
52 bool apply;
53};
54
Stanislav Zaikine5a3ae02022-04-05 19:23:12 +020055/** \brief policer output: Apply policer as an output feature.
56 @param client_index - opaque cookie to identify the sender
57 @param context - sender context, to match reply w/ request
58 @param name - policer name
59 @param sw_if_index - interface to apply the policer
60 @param apply - Apply/remove
61*/
62autoreply define policer_output
63{
64 u32 client_index;
65 u32 context;
66
67 string name[64];
68 vl_api_interface_index_t sw_if_index;
69 bool apply;
70};
71
Pavel Kotucekd9aad292017-01-25 08:45:38 +010072/** \brief Add/del policer
73 @param client_index - opaque cookie to identify the sender
74 @param context - sender context, to match reply w/ request
75 @param is_add - add policer if non-zero, else delete
76 @param name - policer name
77 @param cir - CIR
78 @param eir - EIR
79 @param cb - Committed Burst
80 @param eb - Excess or Peak Burst
81 @param rate_type - rate type
82 @param round_type - rounding type
83 @param type - policer algorithm
84 @param color_aware - 0=color-blind, 1=color-aware
Jakub Grajciarcd01fb42020-03-02 13:16:53 +010085 @param conform_action - conform action
86 @param exceed_action - exceed action type
87 @param violate_action - violate action type
Pavel Kotucekd9aad292017-01-25 08:45:38 +010088*/
89define policer_add_del
90{
91 u32 client_index;
92 u32 context;
93
Jakub Grajciarcd01fb42020-03-02 13:16:53 +010094 bool is_add;
95 string name[64];
Pavel Kotucekd9aad292017-01-25 08:45:38 +010096 u32 cir;
97 u32 eir;
98 u64 cb;
99 u64 eb;
Jakub Grajciarcd01fb42020-03-02 13:16:53 +0100100 vl_api_sse2_qos_rate_type_t rate_type;
101 vl_api_sse2_qos_round_type_t round_type;
102 vl_api_sse2_qos_policer_type_t type;
103 bool color_aware;
104 vl_api_sse2_qos_action_t conform_action;
105 vl_api_sse2_qos_action_t exceed_action;
106 vl_api_sse2_qos_action_t violate_action;
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100107};
108
109/** \brief Add/del policer response
110 @param context - sender context, to match reply w/ request
111 @param retval - return value for request
112 @param policer_index - for add, returned index of the new policer
113*/
114define policer_add_del_reply
115{
116 u32 context;
117 i32 retval;
118 u32 policer_index;
119};
120
121/** \brief Get list of policers
122 @param client_index - opaque cookie to identify the sender
123 @param context - sender context, to match reply w/ request
124 @param match_name_valid - if 0 request all policers otherwise use match_name
125 @param match_name - policer name
126*/
127define policer_dump
128{
129 u32 client_index;
130 u32 context;
131
Jakub Grajciarcd01fb42020-03-02 13:16:53 +0100132 bool match_name_valid;
133 string match_name[64];
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100134};
135
136/** \brief Policer operational state response.
137 @param context - sender context, to match reply w/ request
138 @param name - policer name
139 @param cir - CIR
140 @param eir - EIR
141 @param cb - Committed Burst
142 @param eb - Excess or Peak Burst
143 @param rate_type - rate type
144 @param round_type - rounding type
145 @param type - policer algorithm
Jakub Grajciarcd01fb42020-03-02 13:16:53 +0100146 @param conform_action - conform action
147 @param exceed_action - exceed action
148 @param violate_action - violate action
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100149 @param single_rate - 1 = single rate policer, 0 = two rate policer
150 @param color_aware - for hierarchical policing
151 @param scale - power-of-2 shift amount for lower rates
152 @param cir_tokens_per_period - number of tokens for each period
153 @param pir_tokens_per_period - number of tokens for each period for 2-rate policer
154 @param current_limit - current limit
155 @param current_bucket - current bucket
156 @param extended_limit - extended limit
157 @param extended_bucket - extended bucket
158 @param last_update_time - last update time
159*/
160define policer_details
161{
162 u32 context;
163
Jakub Grajciarcd01fb42020-03-02 13:16:53 +0100164 string name[64];
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100165 u32 cir;
166 u32 eir;
167 u64 cb;
168 u64 eb;
Jakub Grajciarcd01fb42020-03-02 13:16:53 +0100169 vl_api_sse2_qos_rate_type_t rate_type;
170 vl_api_sse2_qos_round_type_t round_type;
171 vl_api_sse2_qos_policer_type_t type;
172 vl_api_sse2_qos_action_t conform_action;
173 vl_api_sse2_qos_action_t exceed_action;
174 vl_api_sse2_qos_action_t violate_action;
175 bool single_rate;
176 bool color_aware;
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100177 u32 scale;
178 u32 cir_tokens_per_period;
179 u32 pir_tokens_per_period;
180 u32 current_limit;
181 u32 current_bucket;
182 u32 extended_limit;
183 u32 extended_bucket;
184 u64 last_update_time;
185};
186
187/*
188 * Local Variables:
189 * eval: (c-set-style "gnu")
190 * End:
191 */