blob: a5a60b35c6b619a038e998fbf9d77ab7aaec1a22 [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
Maxime Peim2d1a62b2023-01-06 11:57:38 +000016option version = "3.0.0";
Jakub Grajciarcd01fb42020-03-02 13:16:53 +010017
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
Maxime Peim2d1a62b2023-01-06 11:57:38 +000038autoreply define policer_bind_v2
39{
40 u32 client_index;
41 u32 context;
42
43 u32 policer_index;
44 u32 worker_index;
45 bool bind_enable;
46};
47
Brian Russellb0468302021-02-17 15:51:45 +000048/** \brief policer input: Apply policer as an input feature.
49 @param client_index - opaque cookie to identify the sender
50 @param context - sender context, to match reply w/ request
51 @param name - policer name
52 @param sw_if_index - interface to apply the policer
53 @param apply - Apply/remove
54*/
55autoreply define policer_input
56{
57 u32 client_index;
58 u32 context;
59
60 string name[64];
61 vl_api_interface_index_t sw_if_index;
62 bool apply;
63};
64
Maxime Peim2d1a62b2023-01-06 11:57:38 +000065autoreply define policer_input_v2
66{
67 u32 client_index;
68 u32 context;
69
70 u32 policer_index;
71 vl_api_interface_index_t sw_if_index;
72 bool apply;
73};
74
Stanislav Zaikine5a3ae02022-04-05 19:23:12 +020075/** \brief policer output: Apply policer as an output feature.
76 @param client_index - opaque cookie to identify the sender
77 @param context - sender context, to match reply w/ request
78 @param name - policer name
79 @param sw_if_index - interface to apply the policer
80 @param apply - Apply/remove
81*/
82autoreply define policer_output
83{
84 u32 client_index;
85 u32 context;
86
87 string name[64];
88 vl_api_interface_index_t sw_if_index;
89 bool apply;
90};
91
Maxime Peim2d1a62b2023-01-06 11:57:38 +000092autoreply define policer_output_v2
93{
94 u32 client_index;
95 u32 context;
96
97 u32 policer_index;
98 vl_api_interface_index_t sw_if_index;
99 bool apply;
100};
101
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100102/** \brief Add/del policer
103 @param client_index - opaque cookie to identify the sender
104 @param context - sender context, to match reply w/ request
105 @param is_add - add policer if non-zero, else delete
106 @param name - policer name
107 @param cir - CIR
108 @param eir - EIR
109 @param cb - Committed Burst
110 @param eb - Excess or Peak Burst
111 @param rate_type - rate type
112 @param round_type - rounding type
113 @param type - policer algorithm
114 @param color_aware - 0=color-blind, 1=color-aware
Jakub Grajciarcd01fb42020-03-02 13:16:53 +0100115 @param conform_action - conform action
116 @param exceed_action - exceed action type
117 @param violate_action - violate action type
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100118*/
119define policer_add_del
120{
121 u32 client_index;
122 u32 context;
123
Jakub Grajciarcd01fb42020-03-02 13:16:53 +0100124 bool is_add;
125 string name[64];
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100126 u32 cir;
127 u32 eir;
128 u64 cb;
129 u64 eb;
Jakub Grajciarcd01fb42020-03-02 13:16:53 +0100130 vl_api_sse2_qos_rate_type_t rate_type;
131 vl_api_sse2_qos_round_type_t round_type;
132 vl_api_sse2_qos_policer_type_t type;
133 bool color_aware;
134 vl_api_sse2_qos_action_t conform_action;
135 vl_api_sse2_qos_action_t exceed_action;
136 vl_api_sse2_qos_action_t violate_action;
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100137};
138
Maxime Peim2d1a62b2023-01-06 11:57:38 +0000139define policer_add
140{
141 u32 client_index;
142 u32 context;
143
144 string name[64];
145 vl_api_policer_config_t infos;
146};
147
148autoreply define policer_del
149{
150 u32 client_index;
151 u32 context;
152
153 u32 policer_index;
154};
155
156autoreply define policer_update
157{
158 u32 client_index;
159 u32 context;
160
161 u32 policer_index;
162 vl_api_policer_config_t infos;
163};
164
165autoreply define policer_reset
166{
167 u32 client_index;
168 u32 context;
169
170 u32 policer_index;
171};
172
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100173/** \brief Add/del policer response
174 @param context - sender context, to match reply w/ request
175 @param retval - return value for request
176 @param policer_index - for add, returned index of the new policer
177*/
178define policer_add_del_reply
179{
180 u32 context;
181 i32 retval;
182 u32 policer_index;
183};
184
Maxime Peim2d1a62b2023-01-06 11:57:38 +0000185define policer_add_reply
186{
187 u32 context;
188 i32 retval;
189 u32 policer_index;
190};
191
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100192/** \brief Get list of policers
193 @param client_index - opaque cookie to identify the sender
194 @param context - sender context, to match reply w/ request
195 @param match_name_valid - if 0 request all policers otherwise use match_name
196 @param match_name - policer name
197*/
198define policer_dump
199{
200 u32 client_index;
201 u32 context;
202
Jakub Grajciarcd01fb42020-03-02 13:16:53 +0100203 bool match_name_valid;
204 string match_name[64];
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100205};
206
Maxime Peim2d1a62b2023-01-06 11:57:38 +0000207/** \brief Get list of policers
208 @param client_index - opaque cookie to identify the sender
209 @param context - sender context, to match reply w/ request
210 @param policer_index - index of policer in the pool, ~0 to request all
211*/
212define policer_dump_v2
213{
214 u32 client_index;
215 u32 context;
216
217 u32 policer_index;
218};
219
220service {
221 rpc policer_dump_v2 returns stream policer_details;
222};
223
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100224/** \brief Policer operational state response.
225 @param context - sender context, to match reply w/ request
226 @param name - policer name
227 @param cir - CIR
228 @param eir - EIR
229 @param cb - Committed Burst
230 @param eb - Excess or Peak Burst
231 @param rate_type - rate type
232 @param round_type - rounding type
233 @param type - policer algorithm
Jakub Grajciarcd01fb42020-03-02 13:16:53 +0100234 @param conform_action - conform action
235 @param exceed_action - exceed action
236 @param violate_action - violate action
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100237 @param single_rate - 1 = single rate policer, 0 = two rate policer
238 @param color_aware - for hierarchical policing
239 @param scale - power-of-2 shift amount for lower rates
240 @param cir_tokens_per_period - number of tokens for each period
241 @param pir_tokens_per_period - number of tokens for each period for 2-rate policer
242 @param current_limit - current limit
243 @param current_bucket - current bucket
244 @param extended_limit - extended limit
245 @param extended_bucket - extended bucket
246 @param last_update_time - last update time
247*/
248define policer_details
249{
250 u32 context;
251
Jakub Grajciarcd01fb42020-03-02 13:16:53 +0100252 string name[64];
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100253 u32 cir;
254 u32 eir;
255 u64 cb;
256 u64 eb;
Jakub Grajciarcd01fb42020-03-02 13:16:53 +0100257 vl_api_sse2_qos_rate_type_t rate_type;
258 vl_api_sse2_qos_round_type_t round_type;
259 vl_api_sse2_qos_policer_type_t type;
260 vl_api_sse2_qos_action_t conform_action;
261 vl_api_sse2_qos_action_t exceed_action;
262 vl_api_sse2_qos_action_t violate_action;
263 bool single_rate;
264 bool color_aware;
Pavel Kotucekd9aad292017-01-25 08:45:38 +0100265 u32 scale;
266 u32 cir_tokens_per_period;
267 u32 pir_tokens_per_period;
268 u32 current_limit;
269 u32 current_bucket;
270 u32 extended_limit;
271 u32 extended_bucket;
272 u64 last_update_time;
273};
274
275/*
276 * Local Variables:
277 * eval: (c-set-style "gnu")
278 * End:
279 */