FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
l2.api
Go to the documentation of this file.
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 option version = "2.1.2";
18 
19 import "vnet/ip/ip_types.api";
20 import "vnet/ethernet/ethernet_types.api";
21 
22 /** \brief Reply to l2_xconnect_dump
23  @param context - sender context which was passed in the request
24  @param rx_sw_if_index - Receive interface index
25  @param tx_sw_if_index - Transmit interface index
26  */
27 define l2_xconnect_details
28 {
32 };
33 
34 /** \brief Dump L2 XConnects
35  @param client_index - opaque cookie to identify the sender
36  @param context - sender context, to match reply w/ request
37 */
38 define l2_xconnect_dump
39 {
42 };
43 
44 /** \brief l2 fib table details structure
45  @param bd_id - the l2 fib / bridge domain table id
46  @param mac - the entry's mac address
47  @param sw_if_index - index of the interface
48  @param static_mac - the entry is statically configured.
49  @param filter_mac - the entry is a mac filter entry.
50  @param bvi_mac - the mac address is a bridge virtual interface
51 */
52 define l2_fib_table_details
53 {
56  u8 mac[6];
61 };
62 
63 /** \brief Dump l2 fib (aka bridge domain) table
64  @param client_index - opaque cookie to identify the sender
65  @param bd_id - the l2 fib / bridge domain table identifier
66 */
67 define l2_fib_table_dump
68 {
72 };
73 
74 /** \brief L2 fib clear table request, clear all mac entries in the l2 fib
75  @param client_index - opaque cookie to identify the sender
76  @param context - sender context, to match reply w/ request
77 */
78 autoreply define l2_fib_clear_table
79 {
82 };
83 
84 /** \brief L2 FIB flush all entries
85  @param client_index - opaque cookie to identify the sender
86  @param context - sender context, to match reply w/ request
87 */
88 autoreply define l2fib_flush_all
89 {
92 };
93 
94 /** \brief L2 FIB flush bridge domain entries
95  @param client_index - opaque cookie to identify the sender
96  @param context - sender context, to match reply w/ request
97  @param bd_id - the entry's bridge domain id
98 */
99 autoreply define l2fib_flush_bd
100 {
104 };
105 
106 /** \brief L2 FIB flush interface entries
107  @param client_index - opaque cookie to identify the sender
108  @param context - sender context, to match reply w/ request
109  @param bd_id - the entry's bridge domain id
110 */
111 autoreply define l2fib_flush_int
112 {
116 };
117 
118 /** \brief L2 FIB add entry request
119  @param client_index - opaque cookie to identify the sender
120  @param context - sender context, to match reply w/ request
121  @param mac - the entry's mac address
122  @param bd_id - the entry's bridge domain id
123  @param sw_if_index - the interface
124  @param is_add - If non zero add the entry, else delete it
125  @param static_mac -
126  @param filter_mac -
127 */
128 autoreply define l2fib_add_del
129 {
132  u8 mac[6];
139 };
140 
141 /** \brief Register to receive L2 MAC events for learned and aged MAC
142  @param client_index - opaque cookie to identify the sender
143  @param context - sender context, to match reply w/ request
144  @param learn_limit - MAC learn limit, 0 => default to 1000
145  @param scan_delay - event scan delay in 10 msec unit, 0 => default to 100 msec
146  @param max_macs_in_event - in units of 10 mac entries, 0 => default to 100 entries
147  @param enable_disable - 1 => register for MAC events, 0 => cancel registration
148  @param pid - sender's pid
149 */
150 autoreply define want_l2_macs_events
151 {
159 };
160 
161 /** \brief Entry for learned or aged MAC in L2 MAC Events
162  @param sw_if_index - sw_if_index in the domain
163  @param mac_addr - mac_address
164  @param action - 0 => newly learned MAC, 1 => MAC deleted by ager
165  3 => MAC move (sw_if_index changed)
166  @param flags - flag bits to provide other info, not yet used
167 */
168 typeonly define mac_entry
169 {
171  u8 mac_addr[6];
174 };
175 
176 /** \brief L2 MAC event for a list of learned or aged MACs
177  @param client_index - opaque cookie to identify the sender
178  @param pid - client pid registered to receive notification
179  @param n_macs - number of learned/aged MAC entries
180  @param mac - array of learned/aged MAC entries
181 */
182 define l2_macs_event
183 {
188 };
189 
191  rpc want_l2_macs_events returns want_l2_macs_events_reply
192  events l2_macs_event;
193 };
194 
195 /** \brief Set interface L2 flags (such as L2_LEARN, L2_FWD,
196  L2_FLOOD, L2_UU_FLOOD, or L2_ARP_TERM bits). This can be used
197  to disable one or more of the features represented by the
198  flag bits on an interface to override what is set as default
199  for all interfaces in the bridge domain
200  @param client_index - opaque cookie to identify the sender
201  @param context - sender context, to match reply w/ request
202  @param sw_if_index - interface
203  @param is_set - if non-zero, set the bits, else clear them
204  @param feature_bitmap - non-zero bits (as above) to set or clear
205 */
206 define l2_flags
207 {
213 };
214 
215 /** \brief Set interface L2 flags response
216  @param context - sender context, to match reply w/ request
217  @param retval - return code for the set l2 bits request
218  @param resulting_feature_bitmap - the internal l2 feature bitmap after the request is implemented
219 */
220 define l2_flags_reply
221 {
225 };
226 
227 /** \brief L2 bridge domain set mac age
228  @param client_index - opaque cookie to identify the sender
229  @param context - sender context, to match reply w/ request
230  @param bd_id - the bridge domain to create
231  @param mac_age - mac aging time in min, 0 for disabled
232 */
233 autoreply define bridge_domain_set_mac_age
234 {
239 };
240 
241 /** \brief L2 bridge domain add or delete request
242  @param client_index - opaque cookie to identify the sender
243  @param context - sender context, to match reply w/ request
244  @param bd_id - the bridge domain to create
245  @param flood - enable/disable bcast/mcast flooding in the bd
246  @param uu_flood - enable/disable unknown unicast flood in the bd
247  @param forward - enable/disable forwarding on all interfaces in the bd
248  @param learn - enable/disable learning on all interfaces in the bd
249  @param arp_term - enable/disable arp termination in the bd
250  @param mac_age - mac aging time in min, 0 for disabled
251  @param is_add - add or delete flag
252 */
253 autoreply define bridge_domain_add_del
254 {
264  u8 bd_tag[64];
266 };
267 
268 /** \brief L2 bridge domain request operational state details
269  @param client_index - opaque cookie to identify the sender
270  @param context - sender context, to match reply w/ request
271  @param bd_id - the bridge domain id desired or ~0 to request all bds
272 */
273 define bridge_domain_dump
274 {
278 };
279 
280 /** \brief L2 bridge domain sw interface operational state response
281  @param bd_id - the bridge domain id
282  @param sw_if_index - sw_if_index in the domain
283  @param shg - split horizon group for the interface
284 */
285 typeonly manual_print manual_endian define bridge_domain_sw_if
286 {
290 };
291 
292 /** \brief L2 bridge domain operational state response
293  @param bd_id - the bridge domain id
294  @param flood - bcast/mcast flooding state on all interfaces in the bd
295  @param uu_flood - unknown unicast flooding state on all interfaces in the bd
296  @param forward - forwarding state on all interfaces in the bd
297  @param learn - learning state on all interfaces in the bd
298  @param arp_term - arp termination state on all interfaces in the bd
299  @param mac_age - mac aging time in min, 0 for disabled
300  @param bd_tag - optional textual tag for the bridge domain
301  @param n_sw_ifs - number of sw_if_index's in the domain
302 */
303 manual_print manual_endian define bridge_domain_details
304 {
313  u8 bd_tag[64];
317  vl_api_bridge_domain_sw_if_t sw_if_details[n_sw_ifs];
318 };
319 
320 /** \brief Flags that can be changed on a bridge domain */
322 {
329 };
330 
331 /** \brief Set bridge flags request
332  @param client_index - opaque cookie to identify the sender
333  @param context - sender context, to match reply w/ request
334  @param bd_id - the bridge domain to set the flags for
335  @param is_set - if non-zero, set the flags, else clear them
336  @param flags - flags that are non-zero to set or clear
337 */
338 define bridge_flags
339 {
344  vl_api_bd_flags_t flags;
345 };
346 
347 /** \brief Set bridge flags response
348  @param context - sender context, to match reply w/ request
349  @param retval - return code for the set bridge flags request
350  @param resulting_feature_bitmap - the internal L2 feature bitmap after the request is implemented
351 */
352 define bridge_flags_reply
353 {
357 };
358 
359 /** \brief L2 interface vlan tag rewrite configure request
360  @param client_index - opaque cookie to identify the sender
361  @param context - sender context, to match reply w/ request
362  @param sw_if_index - interface the operation is applied to
363  @param vtr_op - Choose from l2_vtr_op_t enum values
364  @param push_dot1q - first pushed flag dot1q id set, else dot1ad
365  @param tag1 - Needed for any push or translate vtr op
366  @param tag2 - Needed for any push 2 or translate x-2 vtr ops
367 */
368 autoreply define l2_interface_vlan_tag_rewrite
369 {
374  u32 push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
375  u32 tag1; // first pushed tag
376  u32 tag2; // second pushed tag
377 };
378 
379 /** \brief L2 interface pbb tag rewrite configure request
380  @param client_index - opaque cookie to identify the sender
381  @param context - sender context, to match reply w/ request
382  @param sw_if_index - interface the operation is applied to
383  @param vtr_op - Choose from l2_vtr_op_t enum values
384  @param inner_tag - needed for translate_qinq vtr op only
385  @param outer_tag - needed for translate_qinq vtr op only
386  @param b_dmac - B-tag remote mac address, needed for any push or translate_qinq vtr op
387  @param b_smac - B-tag local mac address, needed for any push or translate qinq vtr op
388  @param b_vlanid - B-tag vlanid, needed for any push or translate qinq vtr op
389  @param i_sid - I-tag service id, needed for any push or translate qinq vtr op
390 */
391 autoreply define l2_interface_pbb_tag_rewrite
392 {
398  u8 b_dmac[6];
399  u8 b_smac[6];
402 };
403 
404 /** \brief L2 interface patch add / del request
405  @param client_index - opaque cookie to identify the sender
406  @param context - sender context, to match reply w/ request
407  @param rx_sw_if_index - receive side interface
408  @param tx_sw_if_index - transmit side interface
409  @param is_add - if non-zero set up the interface patch, else remove it
410 */
411 autoreply define l2_patch_add_del
412 {
418 };
419 
420 /** \brief Set L2 XConnect between two interfaces request
421  @param client_index - opaque cookie to identify the sender
422  @param context - sender context, to match reply w/ request
423  @param rx_sw_if_index - Receive interface index
424  @param tx_sw_if_index - Transmit interface index
425  @param enable - enable xconnect if not 0, else set to L3 mode
426 */
427 autoreply define sw_interface_set_l2_xconnect
428 {
434 };
435 
436 /**
437  * @brief An enumeration of the type of ports that can be added
438  * to a bridge domain
439  */
441 {
442  /* a 'normal' interface, i.e. not BVI or UU-Flood */
444  /* a BVI interface in the BD */
446  /* The interface on which to forward unknown unicast packets
447  * If this is not set for a BD then UU is flooded */
449 };
450 
451 /** \brief Interface bridge mode request
452  @param client_index - opaque cookie to identify the sender
453  @param context - sender context, to match reply w/ request
454  @param rx_sw_if_index - the interface
455  @param bd_id - bridge domain id
456  @param port_type - port_mode, see #l2_port_type
457  @param shg - Split horizon group, for bridge mode only
458  @param enable - Enable beige mode if not 0, else set to L3 mode
459 */
460 
461 autoreply define sw_interface_set_l2_bridge
462 {
467  vl_api_l2_port_type_t port_type;
470 };
471 
472 /** \brief Set bridge domain ip to mac entry request
473  @param client_index - opaque cookie to identify the sender
474  @param context - sender context, to match reply w/ request
475  @param bd_id - the bridge domain to set the flags for
476  @param is_add - if non-zero, add the entry, else clear it
477  @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
478  @param mac_address - MAC address
479  @param
480 */
481 autoreply define bd_ip_mac_add_del
482 {
487  vl_api_address_t ip;
488  vl_api_mac_address_t mac;
489 };
490 
491 /** \brief Flush bridge domain IP to MAC entries
492  @param client_index - opaque cookie to identify the sender
493  @param bd_id - bridge domain identifier
494 */
495 autoreply define bd_ip_mac_flush
496 {
500 };
501 
502 /** \brief bridge domain IP to MAC entry details structure
503  @param bd_id - bridge domain table id
504  @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
505  @param ip_address - ipv4 or ipv6 address
506  @param mac_address - MAC address
507 */
508 define bd_ip_mac_details
509 {
514  vl_api_mac_address_t mac_address;
515 };
516 
517 /** \brief Dump bridge domain IP to MAC entries
518  @param client_index - opaque cookie to identify the sender
519  @param bd_id - bridge domain identifier
520 */
521 define bd_ip_mac_dump
522 {
526 };
527 
528 /** \brief L2 interface ethernet flow point filtering enable/disable request
529  @param client_index - opaque cookie to identify the sender
530  @param context - sender context, to match reply w/ request
531  @param sw_if_index - interface to enable/disable filtering on
532  @param enable_disable - if non-zero enable filtering, else disable
533 */
534 autoreply define l2_interface_efp_filter
535 {
540 };
541 
542 /** \brief Interface set vpath request
543  @param client_index - opaque cookie to identify the sender
544  @param context - sender context, to match reply w/ request
545  @param sw_if_index - interface used to reach neighbor
546  @param enable - if non-zero enable, else disable
547 */
548 autoreply define sw_interface_set_vpath
549 {
554 };
555 
556 /** \brief Create BVI interface instance request
557  @param client_index - opaque cookie to identify the sender
558  @param context - sender context, to match reply w/ request
559  @param mac_address - mac addr to assign to the interface if none-zero
560  @param user_instance - requested instance, ~0 => dynamically allocate
561 */
562 define bvi_create
563 {
566  vl_api_mac_address_t mac;
568 };
569 
570 /** \brief Create BVI interface instance response
571  @param context - sender context, to match reply w/ request
572  @param sw_if_index - sw index of the interface that was created
573  @param retval - return code for the request
574 */
575 define bvi_create_reply
576 {
580 };
581 
582 /** \brief Delete BVI interface request
583  @param client_index - opaque cookie to identify the sender
584  @param context - sender context, to match reply w/ request
585  @param sw_if_index - sw index of the interface that was created
586 */
587 autoreply define bvi_delete
588 {
592 };
593 
594 /*
595  * Local Variables:
596  * eval: (c-set-style "gnu")
597  * End:
598  */
vl_api_address_t ip
Definition: l2.api:487
vl_api_l2_port_type_t port_type
Definition: l2.api:467
l2_port_type
An enumeration of the type of ports that can be added to a bridge domain.
Definition: l2.api:440
unsigned char u8
Definition: types.h:56
u8 action
Definition: l2.api:172
Entry for learned or aged MAC in L2 MAC Events.
Definition: l2.api:168
vl_api_mac_address_t mac_address
Definition: l2.api:514
option version
Definition: l2.api:17
vl_api_mac_address_t mac
Definition: l2.api:488
L2 bridge domain sw interface operational state response.
Definition: l2.api:285
u32 feature_bitmap
Definition: l2.api:212
unsigned int u32
Definition: types.h:88
u32 sw_if_index
Definition: l2.api:170
u32 client_index
Definition: l2.api:208
unsigned short u16
Definition: types.h:57
signed int i32
Definition: types.h:77
u8 flags
Definition: l2.api:173
service
Definition: l2.api:190
u32 resulting_feature_bitmap
Definition: l2.api:224
vl_api_bd_flags_t flags
Definition: l2.api:344
vl_api_address_t ip_address
Definition: ip.api:129
u32 sw_if_index
Definition: l2.api:210
bd_flags
Flags that can be changed on a bridge domain.
Definition: l2.api:321
vl_api_mac_address_t mac
Definition: gbp.api:120
vl_api_mac_address_t mac
Definition: l2.api:566