Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 1 | /* |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 2 | * Copyright (c) 2015-2020 Cisco and/or its affiliates. |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 3 | * 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 Peim | 2d1a62b | 2023-01-06 11:57:38 +0000 | [diff] [blame^] | 16 | option version = "3.0.0"; |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 17 | |
Brian Russell | b046830 | 2021-02-17 15:51:45 +0000 | [diff] [blame] | 18 | import "vnet/interface_types.api"; |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 19 | import "vnet/policer/policer_types.api"; |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 20 | |
Brian Russell | 48e2636 | 2021-02-10 13:53:42 +0000 | [diff] [blame] | 21 | /** \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 | */ |
| 28 | autoreply 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 Peim | 2d1a62b | 2023-01-06 11:57:38 +0000 | [diff] [blame^] | 38 | autoreply 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 Russell | b046830 | 2021-02-17 15:51:45 +0000 | [diff] [blame] | 48 | /** \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 | */ |
| 55 | autoreply 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 Peim | 2d1a62b | 2023-01-06 11:57:38 +0000 | [diff] [blame^] | 65 | autoreply 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 Zaikin | e5a3ae0 | 2022-04-05 19:23:12 +0200 | [diff] [blame] | 75 | /** \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 | */ |
| 82 | autoreply 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 Peim | 2d1a62b | 2023-01-06 11:57:38 +0000 | [diff] [blame^] | 92 | autoreply 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 Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 102 | /** \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 Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 115 | @param conform_action - conform action |
| 116 | @param exceed_action - exceed action type |
| 117 | @param violate_action - violate action type |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 118 | */ |
| 119 | define policer_add_del |
| 120 | { |
| 121 | u32 client_index; |
| 122 | u32 context; |
| 123 | |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 124 | bool is_add; |
| 125 | string name[64]; |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 126 | u32 cir; |
| 127 | u32 eir; |
| 128 | u64 cb; |
| 129 | u64 eb; |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 130 | 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 Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 137 | }; |
| 138 | |
Maxime Peim | 2d1a62b | 2023-01-06 11:57:38 +0000 | [diff] [blame^] | 139 | define policer_add |
| 140 | { |
| 141 | u32 client_index; |
| 142 | u32 context; |
| 143 | |
| 144 | string name[64]; |
| 145 | vl_api_policer_config_t infos; |
| 146 | }; |
| 147 | |
| 148 | autoreply define policer_del |
| 149 | { |
| 150 | u32 client_index; |
| 151 | u32 context; |
| 152 | |
| 153 | u32 policer_index; |
| 154 | }; |
| 155 | |
| 156 | autoreply 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 | |
| 165 | autoreply define policer_reset |
| 166 | { |
| 167 | u32 client_index; |
| 168 | u32 context; |
| 169 | |
| 170 | u32 policer_index; |
| 171 | }; |
| 172 | |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 173 | /** \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 | */ |
| 178 | define policer_add_del_reply |
| 179 | { |
| 180 | u32 context; |
| 181 | i32 retval; |
| 182 | u32 policer_index; |
| 183 | }; |
| 184 | |
Maxime Peim | 2d1a62b | 2023-01-06 11:57:38 +0000 | [diff] [blame^] | 185 | define policer_add_reply |
| 186 | { |
| 187 | u32 context; |
| 188 | i32 retval; |
| 189 | u32 policer_index; |
| 190 | }; |
| 191 | |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 192 | /** \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 | */ |
| 198 | define policer_dump |
| 199 | { |
| 200 | u32 client_index; |
| 201 | u32 context; |
| 202 | |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 203 | bool match_name_valid; |
| 204 | string match_name[64]; |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 205 | }; |
| 206 | |
Maxime Peim | 2d1a62b | 2023-01-06 11:57:38 +0000 | [diff] [blame^] | 207 | /** \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 | */ |
| 212 | define policer_dump_v2 |
| 213 | { |
| 214 | u32 client_index; |
| 215 | u32 context; |
| 216 | |
| 217 | u32 policer_index; |
| 218 | }; |
| 219 | |
| 220 | service { |
| 221 | rpc policer_dump_v2 returns stream policer_details; |
| 222 | }; |
| 223 | |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 224 | /** \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 Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 234 | @param conform_action - conform action |
| 235 | @param exceed_action - exceed action |
| 236 | @param violate_action - violate action |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 237 | @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 | */ |
| 248 | define policer_details |
| 249 | { |
| 250 | u32 context; |
| 251 | |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 252 | string name[64]; |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 253 | u32 cir; |
| 254 | u32 eir; |
| 255 | u64 cb; |
| 256 | u64 eb; |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 257 | 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 Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 265 | 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 | */ |