policer: API cleanup
[vpp.git] / src / vnet / policer / policer.api
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/policer/policer_types.api";
19
20 /** \brief Add/del policer
21     @param client_index - opaque cookie to identify the sender
22     @param context - sender context, to match reply w/ request
23     @param is_add - add policer if non-zero, else delete
24     @param name - policer name
25     @param cir - CIR
26     @param eir - EIR
27     @param cb - Committed Burst
28     @param eb - Excess or Peak Burst
29     @param rate_type - rate type
30     @param round_type - rounding type
31     @param type - policer algorithm
32     @param color_aware - 0=color-blind, 1=color-aware
33     @param conform_action - conform action
34     @param exceed_action - exceed action type
35     @param violate_action - violate action type
36 */
37 define policer_add_del
38 {
39   u32 client_index;
40   u32 context;
41
42   bool is_add;
43   string name[64];
44   u32 cir;
45   u32 eir;
46   u64 cb;
47   u64 eb;
48   vl_api_sse2_qos_rate_type_t rate_type;
49   vl_api_sse2_qos_round_type_t round_type;
50   vl_api_sse2_qos_policer_type_t type;
51   bool color_aware;
52   vl_api_sse2_qos_action_t conform_action;
53   vl_api_sse2_qos_action_t exceed_action;
54   vl_api_sse2_qos_action_t violate_action;
55 };
56
57 /** \brief Add/del policer response
58     @param context - sender context, to match reply w/ request
59     @param retval - return value for request
60     @param policer_index - for add, returned index of the new policer
61 */
62 define policer_add_del_reply
63 {
64   u32 context;
65   i32 retval;
66   u32 policer_index;
67 };
68
69 /** \brief Get list of policers
70     @param client_index - opaque cookie to identify the sender
71     @param context - sender context, to match reply w/ request
72     @param match_name_valid - if 0 request all policers otherwise use match_name
73     @param match_name - policer name
74 */
75 define policer_dump
76 {
77   u32 client_index;
78   u32 context;
79
80   bool match_name_valid;
81   string match_name[64];
82 };
83
84 /** \brief Policer operational state response.
85     @param context - sender context, to match reply w/ request
86     @param name - policer name
87     @param cir - CIR
88     @param eir - EIR
89     @param cb - Committed Burst
90     @param eb - Excess or Peak Burst
91     @param rate_type - rate type
92     @param round_type - rounding type
93     @param type - policer algorithm
94     @param conform_action - conform action
95     @param exceed_action - exceed action
96     @param violate_action - violate action
97     @param single_rate - 1 = single rate policer, 0 = two rate policer
98     @param color_aware - for hierarchical policing
99     @param scale - power-of-2 shift amount for lower rates
100     @param cir_tokens_per_period - number of tokens for each period
101     @param pir_tokens_per_period - number of tokens for each period for 2-rate policer
102     @param current_limit - current limit
103     @param current_bucket - current bucket
104     @param extended_limit - extended limit
105     @param extended_bucket - extended bucket
106     @param last_update_time - last update time
107 */
108 define policer_details
109 {
110   u32 context;
111
112   string name[64];
113   u32 cir;
114   u32 eir;
115   u64 cb;
116   u64 eb;
117   vl_api_sse2_qos_rate_type_t rate_type;
118   vl_api_sse2_qos_round_type_t round_type;
119   vl_api_sse2_qos_policer_type_t type;
120   vl_api_sse2_qos_action_t conform_action;
121   vl_api_sse2_qos_action_t exceed_action;
122   vl_api_sse2_qos_action_t violate_action;
123   bool single_rate;
124   bool color_aware;
125   u32 scale;
126   u32 cir_tokens_per_period;
127   u32 pir_tokens_per_period;
128   u32 current_limit;
129   u32 current_bucket;
130   u32 extended_limit;
131   u32 extended_bucket;
132   u64 last_update_time;
133 };
134
135 /*
136  * Local Variables:
137  * eval: (c-set-style "gnu")
138  * End:
139  */