FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
policer.api
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2020 Cisco and/or its affiliates.
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 
16 option version = "2.0.0";
17 
18 import "vnet/interface_types.api";
19 import "vnet/policer/policer_types.api";
20 
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 {
32 
33  string name[64];
36 };
37 
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 {
49 
50  string name[64];
51  vl_api_interface_index_t sw_if_index;
52  bool apply;
53 };
54 
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
68  @param conform_action - conform action
69  @param exceed_action - exceed action type
70  @param violate_action - violate action type
71 */
73 {
76 
77  bool is_add;
78  string name[64];
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;
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;
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 {
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 {
114 
116  string match_name[64];
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
129  @param conform_action - conform action
130  @param exceed_action - exceed action
131  @param violate_action - violate action
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 {
146 
147  string name[64];
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;
168 };
169 
170 /*
171  * Local Variables:
172  * eval: (c-set-style "gnu")
173  * End:
174  */
vl_api_policer_add_del_reply_t
Add/del policer response.
Definition: policer.api:97
vl_api_policer_details_t::rate_type
vl_api_sse2_qos_rate_type_t rate_type
Definition: policer.api:152
vl_api_policer_add_del_t::client_index
u32 client_index
Definition: policer.api:74
vl_api_policer_add_del_reply_t::policer_index
u32 policer_index
Definition: policer.api:101
policer_input
int policer_input(u8 *name, u32 sw_if_index, bool apply)
Definition: policer.c:169
vl_api_policer_details_t::conform_action
vl_api_sse2_qos_action_t conform_action
Definition: policer.api:155
vl_api_policer_bind_t::context
u32 context
Definition: policer.api:31
vl_api_policer_details_t::violate_action
vl_api_sse2_qos_action_t violate_action
Definition: policer.api:157
version
option version
Definition: policer.api:16
vl_api_policer_details_t::eir
u32 eir
Definition: policer.api:149
vl_api_policer_dump_t::match_name
string match_name[64]
Definition: policer.api:116
vl_api_policer_details_t::round_type
vl_api_sse2_qos_round_type_t round_type
Definition: policer.api:153
name
string name[64]
Definition: fib.api:25
vl_api_policer_add_del_reply_t::context
u32 context
Definition: policer.api:99
vl_api_policer_details_t::exceed_action
vl_api_sse2_qos_action_t exceed_action
Definition: policer.api:156
vl_api_policer_details_t::current_bucket
u32 current_bucket
Definition: policer.api:164
vl_api_policer_dump_t::match_name_valid
bool match_name_valid
Definition: policer.api:115
vl_api_policer_add_del_t::violate_action
vl_api_sse2_qos_action_t violate_action
Definition: policer.api:89
vl_api_policer_dump_t
Get list of policers.
Definition: policer.api:110
vl_api_policer_add_del_t::type
vl_api_sse2_qos_policer_type_t type
Definition: policer.api:85
vl_api_policer_add_del_t::cb
u64 cb
Definition: policer.api:81
vl_api_policer_add_del_t::eir
u32 eir
Definition: policer.api:80
vl_api_policer_details_t::type
vl_api_sse2_qos_policer_type_t type
Definition: policer.api:154
vl_api_policer_add_del_t::is_add
bool is_add
Definition: policer.api:77
vl_api_policer_input_t::apply
bool apply
Definition: policer.api:52
i32
signed int i32
Definition: types.h:77
vl_api_policer_input_t::client_index
u32 client_index
Definition: policer.api:47
vl_api_policer_add_del_t::name
string name[64]
Definition: policer.api:78
vl_api_policer_bind_t::bind_enable
bool bind_enable
Definition: policer.api:35
vl_api_policer_add_del_t::conform_action
vl_api_sse2_qos_action_t conform_action
Definition: policer.api:87
vl_api_policer_details_t::pir_tokens_per_period
u32 pir_tokens_per_period
Definition: policer.api:162
policer_add_del
clib_error_t * policer_add_del(vlib_main_t *vm, u8 *name, qos_pol_cfg_params_st *cfg, u32 *policer_index, u8 is_add)
Definition: policer.c:53
vl_api_policer_details_t::scale
u32 scale
Definition: policer.api:160
vl_api_policer_dump_t::client_index
u32 client_index
Definition: policer.api:112
vl_api_policer_details_t::single_rate
bool single_rate
Definition: policer.api:158
vl_api_policer_details_t::cir
u32 cir
Definition: policer.api:148
vl_api_policer_add_del_t::rate_type
vl_api_sse2_qos_rate_type_t rate_type
Definition: policer.api:83
vl_api_policer_bind_t
policer bind: Associate/disassociate a policer with a worker thread.
Definition: policer.api:28
vl_api_policer_details_t::color_aware
bool color_aware
Definition: policer.api:159
vl_api_policer_bind_t::client_index
u32 client_index
Definition: policer.api:30
vl_api_policer_input_t
policer input: Apply policer as an input feature.
Definition: policer.api:45
vl_api_policer_details_t::context
u32 context
Definition: policer.api:145
vl_api_policer_details_t::extended_limit
u32 extended_limit
Definition: policer.api:165
vl_api_policer_bind_t::worker_index
u32 worker_index
Definition: policer.api:34
vl_api_policer_add_del_t::context
u32 context
Definition: policer.api:75
vl_api_policer_details_t
Policer operational state response.
Definition: policer.api:143
vl_api_policer_bind_t::name
string name[64]
Definition: policer.api:33
vl_api_policer_add_del_t::round_type
vl_api_sse2_qos_round_type_t round_type
Definition: policer.api:84
u64
unsigned long u64
Definition: types.h:89
vl_api_policer_dump_t::context
u32 context
Definition: policer.api:113
u32
unsigned int u32
Definition: types.h:88
vl_api_policer_add_del_t::exceed_action
vl_api_sse2_qos_action_t exceed_action
Definition: policer.api:88
vl_api_policer_add_del_t::cir
u32 cir
Definition: policer.api:79
vl_api_policer_add_del_t::eb
u64 eb
Definition: policer.api:82
vl_api_policer_details_t::current_limit
u32 current_limit
Definition: policer.api:163
vl_api_policer_add_del_t
Add/del policer.
Definition: policer.api:72
vl_api_policer_details_t::eb
u64 eb
Definition: policer.api:151
vl_api_policer_details_t::name
string name[64]
Definition: policer.api:147
vl_api_policer_details_t::last_update_time
u64 last_update_time
Definition: policer.api:167
vl_api_policer_details_t::cb
u64 cb
Definition: policer.api:150
vl_api_policer_input_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: policer.api:51
vl_api_policer_input_t::context
u32 context
Definition: policer.api:48
vl_api_policer_add_del_reply_t::retval
i32 retval
Definition: policer.api:100
vl_api_policer_details_t::extended_bucket
u32 extended_bucket
Definition: policer.api:166
vl_api_policer_add_del_t::color_aware
bool color_aware
Definition: policer.api:86
vl_api_policer_details_t::cir_tokens_per_period
u32 cir_tokens_per_period
Definition: policer.api:161
vl_api_policer_input_t::name
string name[64]
Definition: policer.api:50