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 | |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 16 | option version = "2.0.0"; |
| 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 | |
Brian Russell | b046830 | 2021-02-17 15:51:45 +0000 | [diff] [blame] | 38 | /** \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 | */ |
| 45 | autoreply 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 | |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 55 | /** \brief Add/del policer |
| 56 | @param client_index - opaque cookie to identify the sender |
| 57 | @param context - sender context, to match reply w/ request |
| 58 | @param is_add - add policer if non-zero, else delete |
| 59 | @param name - policer name |
| 60 | @param cir - CIR |
| 61 | @param eir - EIR |
| 62 | @param cb - Committed Burst |
| 63 | @param eb - Excess or Peak Burst |
| 64 | @param rate_type - rate type |
| 65 | @param round_type - rounding type |
| 66 | @param type - policer algorithm |
| 67 | @param color_aware - 0=color-blind, 1=color-aware |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 68 | @param conform_action - conform action |
| 69 | @param exceed_action - exceed action type |
| 70 | @param violate_action - violate action type |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 71 | */ |
| 72 | define policer_add_del |
| 73 | { |
| 74 | u32 client_index; |
| 75 | u32 context; |
| 76 | |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 77 | bool is_add; |
| 78 | string name[64]; |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 79 | u32 cir; |
| 80 | u32 eir; |
| 81 | u64 cb; |
| 82 | u64 eb; |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 83 | vl_api_sse2_qos_rate_type_t rate_type; |
| 84 | vl_api_sse2_qos_round_type_t round_type; |
| 85 | vl_api_sse2_qos_policer_type_t type; |
| 86 | bool color_aware; |
| 87 | vl_api_sse2_qos_action_t conform_action; |
| 88 | vl_api_sse2_qos_action_t exceed_action; |
| 89 | vl_api_sse2_qos_action_t violate_action; |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 90 | }; |
| 91 | |
| 92 | /** \brief Add/del policer response |
| 93 | @param context - sender context, to match reply w/ request |
| 94 | @param retval - return value for request |
| 95 | @param policer_index - for add, returned index of the new policer |
| 96 | */ |
| 97 | define policer_add_del_reply |
| 98 | { |
| 99 | u32 context; |
| 100 | i32 retval; |
| 101 | u32 policer_index; |
| 102 | }; |
| 103 | |
| 104 | /** \brief Get list of policers |
| 105 | @param client_index - opaque cookie to identify the sender |
| 106 | @param context - sender context, to match reply w/ request |
| 107 | @param match_name_valid - if 0 request all policers otherwise use match_name |
| 108 | @param match_name - policer name |
| 109 | */ |
| 110 | define policer_dump |
| 111 | { |
| 112 | u32 client_index; |
| 113 | u32 context; |
| 114 | |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 115 | bool match_name_valid; |
| 116 | string match_name[64]; |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 117 | }; |
| 118 | |
| 119 | /** \brief Policer operational state response. |
| 120 | @param context - sender context, to match reply w/ request |
| 121 | @param name - policer name |
| 122 | @param cir - CIR |
| 123 | @param eir - EIR |
| 124 | @param cb - Committed Burst |
| 125 | @param eb - Excess or Peak Burst |
| 126 | @param rate_type - rate type |
| 127 | @param round_type - rounding type |
| 128 | @param type - policer algorithm |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 129 | @param conform_action - conform action |
| 130 | @param exceed_action - exceed action |
| 131 | @param violate_action - violate action |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 132 | @param single_rate - 1 = single rate policer, 0 = two rate policer |
| 133 | @param color_aware - for hierarchical policing |
| 134 | @param scale - power-of-2 shift amount for lower rates |
| 135 | @param cir_tokens_per_period - number of tokens for each period |
| 136 | @param pir_tokens_per_period - number of tokens for each period for 2-rate policer |
| 137 | @param current_limit - current limit |
| 138 | @param current_bucket - current bucket |
| 139 | @param extended_limit - extended limit |
| 140 | @param extended_bucket - extended bucket |
| 141 | @param last_update_time - last update time |
| 142 | */ |
| 143 | define policer_details |
| 144 | { |
| 145 | u32 context; |
| 146 | |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 147 | string name[64]; |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 148 | u32 cir; |
| 149 | u32 eir; |
| 150 | u64 cb; |
| 151 | u64 eb; |
Jakub Grajciar | cd01fb4 | 2020-03-02 13:16:53 +0100 | [diff] [blame] | 152 | vl_api_sse2_qos_rate_type_t rate_type; |
| 153 | vl_api_sse2_qos_round_type_t round_type; |
| 154 | vl_api_sse2_qos_policer_type_t type; |
| 155 | vl_api_sse2_qos_action_t conform_action; |
| 156 | vl_api_sse2_qos_action_t exceed_action; |
| 157 | vl_api_sse2_qos_action_t violate_action; |
| 158 | bool single_rate; |
| 159 | bool color_aware; |
Pavel Kotucek | d9aad29 | 2017-01-25 08:45:38 +0100 | [diff] [blame] | 160 | u32 scale; |
| 161 | u32 cir_tokens_per_period; |
| 162 | u32 pir_tokens_per_period; |
| 163 | u32 current_limit; |
| 164 | u32 current_bucket; |
| 165 | u32 extended_limit; |
| 166 | u32 extended_bucket; |
| 167 | u64 last_update_time; |
| 168 | }; |
| 169 | |
| 170 | /* |
| 171 | * Local Variables: |
| 172 | * eval: (c-set-style "gnu") |
| 173 | * End: |
| 174 | */ |