BD/API:add bridge_domain_set_mac_age api
[vpp.git] / src / vnet / l2 / l2.api
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Copyright (c) 2016 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /** \brief Reply to l2_xconnect_dump 
18     @param context - sender context which was passed in the request
19     @param rx_sw_if_index - Receive interface index
20     @param tx_sw_if_index - Transmit interface index
21  */
22 define l2_xconnect_details
23 {
24   u32 context;
25   u32 rx_sw_if_index;
26   u32 tx_sw_if_index;
27 };
28
29 /** \brief Dump L2 XConnects
30     @param client_index - opaque cookie to identify the sender
31     @param context - sender context, to match reply w/ request
32 */
33 define l2_xconnect_dump
34 {
35   u32 client_index;
36   u32 context;
37 };
38
39 /** \brief l2 fib table entry structure
40     @param bd_id - the l2 fib / bridge domain table id
41     @param mac - the entry's mac address
42     @param sw_if_index - index of the interface
43     @param static_mac - the entry is statically configured.
44     @param filter_mac - the entry is a mac filter entry.
45     @param bvi_mac - the mac address is a bridge virtual interface
46 */
47 define l2_fib_table_entry
48 {
49   u32 context;
50   u32 bd_id;
51   u64 mac;
52   u32 sw_if_index;
53   u8 static_mac;
54   u8 filter_mac;
55   u8 bvi_mac;
56 };
57
58 /** \brief Dump l2 fib (aka bridge domain) table
59     @param client_index - opaque cookie to identify the sender
60     @param bd_id - the l2 fib / bridge domain table identifier
61 */
62 define l2_fib_table_dump
63 {
64   u32 client_index;
65   u32 context;
66   u32 bd_id;
67 };
68
69 /** \brief L2 fib clear table request, clear all mac entries in the l2 fib
70     @param client_index - opaque cookie to identify the sender
71     @param context - sender context, to match reply w/ request
72 */
73 define l2_fib_clear_table
74 {
75   u32 client_index;
76   u32 context;
77 };
78
79 /** \brief L2 fib clear table response
80     @param context - sender context, to match reply w/ request
81     @param retval - return code for the request
82 */
83 define l2_fib_clear_table_reply
84 {
85   u32 context;
86   i32 retval;
87 };
88
89 /** \brief L2 FIB add entry request
90     @param client_index - opaque cookie to identify the sender
91     @param context - sender context, to match reply w/ request
92     @param mac - the entry's mac address
93     @param bd_id - the entry's bridge domain id
94     @param sw_if_index - the interface
95     @param is_add - If non zero add the entry, else delete it
96     @param static_mac - 
97     @param filter_mac -
98 */
99 define l2fib_add_del
100 {
101   u32 client_index;
102   u32 context;
103   u64 mac;
104   u32 bd_id;
105   u32 sw_if_index;
106   u8 is_add;
107   u8 static_mac;
108   u8 filter_mac;
109   u8 bvi_mac;
110 };
111
112 /** \brief L2 FIB add entry response
113     @param context - sender context, to match reply w/ request
114     @param retval - return code for the add l2fib entry request
115 */
116 define l2fib_add_del_reply
117 {
118   u32 context;
119   i32 retval;
120 };
121
122 /** \brief Set L2 flags request !!! TODO - need more info, feature bits in l2_input.h
123     @param client_index - opaque cookie to identify the sender
124     @param context - sender context, to match reply w/ request
125     @param sw_if_index - interface 
126     @param is_set - if non-zero, set the bits, else clear them
127     @param feature_bitmap - non-zero bits to set or clear
128 */
129 define l2_flags
130 {
131   u32 client_index;
132   u32 context;
133   u32 sw_if_index;
134   u8 is_set;
135   u32 feature_bitmap;
136 };
137
138 /** \brief Set L2 bits response
139     @param context - sender context, to match reply w/ request
140     @param retval - return code for the set l2 bits request
141 */
142 define l2_flags_reply
143 {
144   u32 context;
145   i32 retval;
146   u32 resulting_feature_bitmap;
147 };
148
149 /** \brief L2 bridge domain set mac age
150     @param client_index - opaque cookie to identify the sender
151     @param context - sender context, to match reply w/ request
152     @param bd_id - the bridge domain to create
153     @param mac_age - mac aging time in min, 0 for disabled
154 */
155 define bridge_domain_set_mac_age
156 {
157   u32 client_index;
158   u32 context;
159   u32 bd_id;
160   u8 mac_age;
161 };
162
163 /** \brief Set bridge domain response
164     @param context - sender context, to match reply w/ request
165     @param retval - return code for the set l2 bits request
166 */
167 define bridge_domain_set_mac_age_reply
168 {
169   u32 context;
170   i32 retval;
171 };
172
173 /** \brief L2 bridge domain add or delete request
174     @param client_index - opaque cookie to identify the sender
175     @param context - sender context, to match reply w/ request
176     @param bd_id - the bridge domain to create
177     @param flood - enable/disable bcast/mcast flooding in the bd
178     @param uu_flood - enable/disable uknown unicast flood in the bd
179     @param forward - enable/disable forwarding on all interfaces in the bd
180     @param learn - enable/disable learning on all interfaces in the bd
181     @param arp_term - enable/disable arp termination in the bd
182     @param mac_age - mac aging time in min, 0 for disabled
183     @param is_add - add or delete flag
184 */
185 define bridge_domain_add_del
186 {
187   u32 client_index;
188   u32 context;
189   u32 bd_id;
190   u8 flood;
191   u8 uu_flood;
192   u8 forward;
193   u8 learn;
194   u8 arp_term;
195   u8 mac_age;
196   u8 is_add;
197 };
198
199 /** \brief L2 bridge domain add or delete response
200     @param context - sender context, to match reply w/ request
201     @param retval - return code for the set bridge flags request
202 */
203 define bridge_domain_add_del_reply
204 {
205   u32 context;
206   i32 retval;
207 };
208
209 /** \brief L2 bridge domain request operational state details
210     @param client_index - opaque cookie to identify the sender
211     @param context - sender context, to match reply w/ request
212     @param bd_id - the bridge domain id desired or ~0 to request all bds
213 */
214 define bridge_domain_dump
215 {
216   u32 client_index;
217   u32 context;
218   u32 bd_id;
219 };
220
221 /** \brief L2 bridge domain operational state response
222     @param bd_id - the bridge domain id
223     @param flood - bcast/mcast flooding state on all interfaces in the bd
224     @param uu_flood - uknown unicast flooding state on all interfaces in the bd
225     @param forward - forwarding state on all interfaces in the bd
226     @param learn - learning state on all interfaces in the bd
227     @param arp_term - arp termination state on all interfaces in the bd
228     @param mac_age - mac aging time in min, 0 for disabled
229     @param n_sw_ifs - number of sw_if_index's in the domain
230 */
231 define bridge_domain_details
232 {
233   u32 context;
234   u32 bd_id;
235   u8 flood;
236   u8 uu_flood;
237   u8 forward;
238   u8 learn;
239   u8 arp_term;
240   u8 mac_age;
241   u32 bvi_sw_if_index;
242   u32 n_sw_ifs;
243 };
244
245 /** \brief L2 bridge domain sw interface operational state response
246     @param bd_id - the bridge domain id
247     @param sw_if_index - sw_if_index in the domain
248     @param shg - split horizon group for the interface
249 */
250 define bridge_domain_sw_if_details
251 {
252   u32 context;
253   u32 bd_id;
254   u32 sw_if_index;
255   u8 shg;
256 };
257
258 /** \brief Set bridge flags (such as L2_LEARN, L2_FWD, L2_FLOOD, 
259     L2_UU_FLOOD, or L2_ARP_TERM) request
260     @param client_index - opaque cookie to identify the sender
261     @param context - sender context, to match reply w/ request
262     @param bd_id - the bridge domain to set the flags for
263     @param is_set - if non-zero, set the flags, else clear them
264     @param feature_bitmap - bits that are non-zero to set or clear
265 */
266 define bridge_flags
267 {
268   u32 client_index;
269   u32 context;
270   u32 bd_id;
271   u8 is_set;
272   u32 feature_bitmap;
273 };
274
275 /** \brief Set bridge flags response
276     @param context - sender context, to match reply w/ request
277     @param retval - return code for the set bridge flags request
278     @param resulting_feature_bitmap - the feature bitmap value after the request is implemented
279 */
280 define bridge_flags_reply
281 {
282   u32 context;
283   i32 retval;
284   u32 resulting_feature_bitmap;
285 };
286
287 /** \brief L2 interface vlan tag rewrite configure request
288     @param client_index - opaque cookie to identify the sender
289     @param context - sender context, to match reply w/ request
290     @param sw_if_index - interface the operation is applied to
291     @param vtr_op - Choose from l2_vtr_op_t enum values
292     @param push_dot1q - first pushed flag dot1q id set, else dot1ad
293     @param tag1 - Needed for any push or translate vtr op
294     @param tag2 - Needed for any push 2 or translate x-2 vtr ops
295 */
296 define l2_interface_vlan_tag_rewrite
297 {
298   u32 client_index;
299   u32 context;
300   u32 sw_if_index;
301   u32 vtr_op;
302   u32 push_dot1q;               // ethertype of first pushed tag is dot1q/dot1ad
303   u32 tag1;                     // first pushed tag
304   u32 tag2;                     // second pushed tag
305 };
306
307 /** \brief L2 interface vlan tag rewrite response
308     @param context - sender context, to match reply w/ request
309     @param retval - return code for the request
310 */
311 define l2_interface_vlan_tag_rewrite_reply
312 {
313   u32 context;
314   i32 retval;
315 };
316
317 /** \brief L2 interface pbb tag rewrite configure request
318     @param client_index - opaque cookie to identify the sender
319     @param context - sender context, to match reply w/ request
320     @param sw_if_index - interface the operation is applied to
321     @param vtr_op - Choose from l2_vtr_op_t enum values
322     @param inner_tag - needed for translate_qinq vtr op only
323     @param outer_tag - needed for translate_qinq vtr op only 
324     @param b_dmac - B-tag remote mac address, needed for any push or translate_qinq vtr op
325     @param b_smac - B-tag local mac address, needed for any push or translate qinq vtr op
326     @param b_vlanid - B-tag vlanid, needed for any push or translate qinq vtr op
327     @param i_sid - I-tag service id, needed for any push or translate qinq vtr op
328 */
329 define l2_interface_pbb_tag_rewrite
330 {
331   u32 client_index;
332   u32 context;
333   u32 sw_if_index;
334   u32 vtr_op;
335   u16 outer_tag;
336   u8  b_dmac[6];
337   u8  b_smac[6];
338   u16 b_vlanid;
339   u32 i_sid;
340 };
341
342 /** \brief L2 interface pbb tag rewrite response
343     @param context - sender context, to match reply w/ request
344     @param retval - return code for the request
345 */
346 define l2_interface_pbb_tag_rewrite_reply
347 {
348   u32 context;
349   i32 retval;
350 };
351
352 /*
353  * Local Variables:
354  * eval: (c-set-style "gnu")
355  * End:
356  */