FD.io VPP  v20.01-48-g3e0dafb74
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.2.2";
18 
19 import "vnet/ip/ip_types.api";
20 import "vnet/ethernet/ethernet_types.api";
21 import "vnet/interface_types.api";
22 
23 /** \brief Reply to l2_xconnect_dump
24  @param context - sender context which was passed in the request
25  @param rx_sw_if_index - Receive interface index
26  @param tx_sw_if_index - Transmit interface index
27  */
28 define l2_xconnect_details
29 {
33 };
34 
35 /** \brief Dump L2 XConnects
36  @param client_index - opaque cookie to identify the sender
37  @param context - sender context, to match reply w/ request
38 */
39 define l2_xconnect_dump
40 {
43 };
44 
45 /** \brief l2 fib table details structure
46  @param bd_id - the l2 fib / bridge domain table id
47  @param mac - the entry's mac address
48  @param sw_if_index - index of the interface
49  @param static_mac - the entry is statically configured.
50  @param filter_mac - the entry is a mac filter entry.
51  @param bvi_mac - the mac address is a bridge virtual interface
52 */
53 define l2_fib_table_details
54 {
57  u8 mac[6];
62 };
63 
64 /** \brief Dump l2 fib (aka bridge domain) table
65  @param client_index - opaque cookie to identify the sender
66  @param bd_id - the l2 fib / bridge domain table identifier
67 */
68 define l2_fib_table_dump
69 {
73 };
74 
75 /** \brief L2 fib clear table request, clear all mac entries in the l2 fib
76  @param client_index - opaque cookie to identify the sender
77  @param context - sender context, to match reply w/ request
78 */
79 autoreply define l2_fib_clear_table
80 {
83 };
84 
85 /** \brief L2 FIB flush all entries
86  @param client_index - opaque cookie to identify the sender
87  @param context - sender context, to match reply w/ request
88 */
89 autoreply define l2fib_flush_all
90 {
93 };
94 
95 /** \brief L2 FIB flush bridge domain entries
96  @param client_index - opaque cookie to identify the sender
97  @param context - sender context, to match reply w/ request
98  @param bd_id - the entry's bridge domain id
99 */
100 autoreply define l2fib_flush_bd
101 {
105 };
106 
107 /** \brief L2 FIB flush interface entries
108  @param client_index - opaque cookie to identify the sender
109  @param context - sender context, to match reply w/ request
110  @param bd_id - the entry's bridge domain id
111 */
112 autoreply define l2fib_flush_int
113 {
117 };
118 
119 /** \brief L2 FIB add entry request
120  @param client_index - opaque cookie to identify the sender
121  @param context - sender context, to match reply w/ request
122  @param mac - the entry's mac address
123  @param bd_id - the entry's bridge domain id
124  @param sw_if_index - the interface
125  @param is_add - If non zero add the entry, else delete it
126  @param static_mac -
127  @param filter_mac -
128 */
129 autoreply define l2fib_add_del
130 {
133  u8 mac[6];
140 };
141 
142 /** \brief Register to receive L2 MAC events for learned and aged MAC
143  @param client_index - opaque cookie to identify the sender
144  @param context - sender context, to match reply w/ request
145  @param learn_limit - MAC learn limit, 0 => default to 1000
146  @param scan_delay - event scan delay in 10 msec unit, 0 => default to 100 msec
147  @param max_macs_in_event - in units of 10 mac entries, 0 => default to 100 entries
148  @param enable_disable - 1 => register for MAC events, 0 => cancel registration
149  @param pid - sender's pid
150 */
151 autoreply define want_l2_macs_events
152 {
160 };
161 
162 /** \brief Entry for learned or aged MAC in L2 MAC Events
163  @param sw_if_index - sw_if_index in the domain
164  @param mac_addr - mac_address
165  @param action - 0 => newly learned MAC, 1 => MAC deleted by ager
166  3 => MAC move (sw_if_index changed)
167  @param flags - flag bits to provide other info, not yet used
168 */
169 typedef mac_entry
170 {
175 };
176 
177 /** \brief L2 MAC event for a list of learned or aged MACs
178  @param client_index - opaque cookie to identify the sender
179  @param pid - client pid registered to receive notification
180  @param n_macs - number of learned/aged MAC entries
181  @param mac - array of learned/aged MAC entries
182 */
183 define l2_macs_event
184 {
188  vl_api_mac_entry_t mac[n_macs];
189 };
190 
192  rpc want_l2_macs_events returns want_l2_macs_events_reply
193  events l2_macs_event;
194 };
195 
196 /** \brief Set interface L2 flags (such as L2_LEARN, L2_FWD,
197  L2_FLOOD, L2_UU_FLOOD, or L2_ARP_TERM bits). This can be used
198  to disable one or more of the features represented by the
199  flag bits on an interface to override what is set as default
200  for all interfaces in the bridge domain
201  @param client_index - opaque cookie to identify the sender
202  @param context - sender context, to match reply w/ request
203  @param sw_if_index - interface
204  @param is_set - if non-zero, set the bits, else clear them
205  @param feature_bitmap - non-zero bits (as above) to set or clear
206 */
207 define l2_flags
208 {
214 };
215 
216 /** \brief Set interface L2 flags response
217  @param context - sender context, to match reply w/ request
218  @param retval - return code for the set l2 bits request
219  @param resulting_feature_bitmap - the internal l2 feature bitmap after the request is implemented
220 */
221 define l2_flags_reply
222 {
226 };
227 
228 /** \brief L2 bridge domain set mac age
229  @param client_index - opaque cookie to identify the sender
230  @param context - sender context, to match reply w/ request
231  @param bd_id - the bridge domain to create
232  @param mac_age - mac aging time in min, 0 for disabled
233 */
234 autoreply define bridge_domain_set_mac_age
235 {
240 };
241 
242 /** \brief L2 bridge domain add or delete request
243  @param client_index - opaque cookie to identify the sender
244  @param context - sender context, to match reply w/ request
245  @param bd_id - the bridge domain to create
246  @param flood - enable/disable bcast/mcast flooding in the bd
247  @param uu_flood - enable/disable unknown unicast flood in the bd
248  @param forward - enable/disable forwarding on all interfaces in the bd
249  @param learn - enable/disable learning on all interfaces in the bd
250  @param arp_term - enable/disable arp termination in the bd
251  @param arp_ufwd - enable/disable arp unicast forwarding in the bd
252  @param mac_age - mac aging time in min, 0 for disabled
253  @param is_add - add or delete flag
254 */
255 autoreply define bridge_domain_add_del
256 {
267  u8 bd_tag[64];
269 };
270 
271 /** \brief L2 bridge domain request operational state details
272  @param client_index - opaque cookie to identify the sender
273  @param context - sender context, to match reply w/ request
274  @param bd_id - the bridge domain id desired or ~0 to request all bds
275 */
276 define bridge_domain_dump
277 {
281 };
282 
283 /** \brief L2 bridge domain sw interface operational state response
284  @param bd_id - the bridge domain id
285  @param sw_if_index - sw_if_index in the domain
286  @param shg - split horizon group for the interface
287 */
288 typedef bridge_domain_sw_if
289 {
290  u32 context;
293 };
294 
295 /** \brief L2 bridge domain operational state response
296  @param bd_id - the bridge domain id
297  @param flood - bcast/mcast flooding state on all interfaces in the bd
298  @param uu_flood - unknown unicast flooding state on all interfaces in the bd
299  @param forward - forwarding state on all interfaces in the bd
300  @param learn - learning state on all interfaces in the bd
301  @param arp_term - arp termination state on all interfaces in the bd
302  @param arp_ufwd - arp unicast forwarding state on all interfaces in the bd
303  @param mac_age - mac aging time in min, 0 for disabled
304  @param bd_tag - optional textual tag for the bridge domain
305  @param n_sw_ifs - number of sw_if_index's in the domain
306 */
307 manual_print manual_endian define bridge_domain_details
308 {
318  u8 bd_tag[64];
322  vl_api_bridge_domain_sw_if_t sw_if_details[n_sw_ifs];
323 };
324 
325 /** \brief Flags that can be changed on a bridge domain */
327 {
335 };
336 
337 /** \brief Set bridge flags request
338  @param client_index - opaque cookie to identify the sender
339  @param context - sender context, to match reply w/ request
340  @param bd_id - the bridge domain to set the flags for
341  @param is_set - if non-zero, set the flags, else clear them
342  @param flags - flags that are non-zero to set or clear
343 */
344 define bridge_flags
345 {
350  vl_api_bd_flags_t flags;
351 };
352 
353 /** \brief Set bridge flags response
354  @param context - sender context, to match reply w/ request
355  @param retval - return code for the set bridge flags request
356  @param resulting_feature_bitmap - the internal L2 feature bitmap after the request is implemented
357 */
358 define bridge_flags_reply
359 {
363 };
364 
365 /** \brief L2 interface vlan tag rewrite configure request
366  @param client_index - opaque cookie to identify the sender
367  @param context - sender context, to match reply w/ request
368  @param sw_if_index - interface the operation is applied to
369  @param vtr_op - Choose from l2_vtr_op_t enum values
370  @param push_dot1q - first pushed flag dot1q id set, else dot1ad
371  @param tag1 - Needed for any push or translate vtr op
372  @param tag2 - Needed for any push 2 or translate x-2 vtr ops
373 */
374 autoreply define l2_interface_vlan_tag_rewrite
375 {
380  u32 push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
381  u32 tag1; // first pushed tag
382  u32 tag2; // second pushed tag
383 };
384 
385 /** \brief L2 interface pbb tag rewrite configure request
386  @param client_index - opaque cookie to identify the sender
387  @param context - sender context, to match reply w/ request
388  @param sw_if_index - interface the operation is applied to
389  @param vtr_op - Choose from l2_vtr_op_t enum values
390  @param inner_tag - needed for translate_qinq vtr op only
391  @param outer_tag - needed for translate_qinq vtr op only
392  @param b_dmac - B-tag remote mac address, needed for any push or translate_qinq vtr op
393  @param b_smac - B-tag local mac address, needed for any push or translate qinq vtr op
394  @param b_vlanid - B-tag vlanid, needed for any push or translate qinq vtr op
395  @param i_sid - I-tag service id, needed for any push or translate qinq vtr op
396 */
397 autoreply define l2_interface_pbb_tag_rewrite
398 {
404  u8 b_dmac[6];
405  u8 b_smac[6];
408 };
409 
410 /** \brief L2 interface patch add / del request
411  @param client_index - opaque cookie to identify the sender
412  @param context - sender context, to match reply w/ request
413  @param rx_sw_if_index - receive side interface
414  @param tx_sw_if_index - transmit side interface
415  @param is_add - if non-zero set up the interface patch, else remove it
416 */
417 autoreply define l2_patch_add_del
418 {
424 };
425 
426 /** \brief Set L2 XConnect between two interfaces request
427  @param client_index - opaque cookie to identify the sender
428  @param context - sender context, to match reply w/ request
429  @param rx_sw_if_index - Receive interface index
430  @param tx_sw_if_index - Transmit interface index
431  @param enable - enable xconnect if not 0, else set to L3 mode
432 */
433 autoreply define sw_interface_set_l2_xconnect
434 {
440 };
441 
442 /**
443  * @brief An enumeration of the type of ports that can be added
444  * to a bridge domain
445  */
447 {
448  /* a 'normal' interface, i.e. not BVI or UU-Flood */
450  /* a BVI interface in the BD */
452  /* The interface on which to forward unknown unicast packets
453  * If this is not set for a BD then UU is flooded */
455 };
456 
457 /** \brief Interface bridge mode request
458  @param client_index - opaque cookie to identify the sender
459  @param context - sender context, to match reply w/ request
460  @param rx_sw_if_index - the interface
461  @param bd_id - bridge domain id
462  @param port_type - port_mode, see #l2_port_type
463  @param shg - Split horizon group, for bridge mode only
464  @param enable - Enable beige mode if not 0, else set to L3 mode
465 */
466 
467 autoreply define sw_interface_set_l2_bridge
468 {
473  vl_api_l2_port_type_t port_type;
476 };
477 
478 /** \brief Set bridge domain ip to mac entry request
479  @param client_index - opaque cookie to identify the sender
480  @param context - sender context, to match reply w/ request
481  @param bd_id - the bridge domain to set the flags for
482  @param is_add - if non-zero, add the entry, else clear it
483  @param ip - ipv4 or ipv6 address
484  @param mac - MAC address
485 */
486 
487 typedef bd_ip_mac
488 {
489  u32 bd_id;
490  vl_api_address_t ip;
491  vl_api_mac_address_t mac;
492 };
493 
494 autoreply define bd_ip_mac_add_del
495 {
499  vl_api_bd_ip_mac_t entry;
500 };
501 
502 /** \brief Flush bridge domain IP to MAC entries
503  @param client_index - opaque cookie to identify the sender
504  @param bd_id - bridge domain identifier
505 */
506 autoreply define bd_ip_mac_flush
507 {
511 };
512 
513 /** \brief bridge domain IP to MAC entry details structure
514  @param bd_id - bridge domain table id
515  @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
516  @param ip_address - ipv4 or ipv6 address
517  @param mac_address - MAC address
518 */
519 define bd_ip_mac_details
520 {
522  vl_api_bd_ip_mac_t entry;
523 };
524 
525 /** \brief Dump bridge domain IP to MAC entries
526  @param client_index - opaque cookie to identify the sender
527  @param bd_id - bridge domain identifier
528 */
529 define bd_ip_mac_dump
530 {
534 };
535 
536 /** \brief L2 interface ethernet flow point filtering enable/disable request
537  @param client_index - opaque cookie to identify the sender
538  @param context - sender context, to match reply w/ request
539  @param sw_if_index - interface to enable/disable filtering on
540  @param enable_disable - if non-zero enable filtering, else disable
541 */
542 autoreply define l2_interface_efp_filter
543 {
548 };
549 
550 /** \brief Interface set vpath request
551  @param client_index - opaque cookie to identify the sender
552  @param context - sender context, to match reply w/ request
553  @param sw_if_index - interface used to reach neighbor
554  @param enable - if non-zero enable, else disable
555 */
556 autoreply define sw_interface_set_vpath
557 {
562 };
563 
564 /** \brief Create BVI interface instance request
565  @param client_index - opaque cookie to identify the sender
566  @param context - sender context, to match reply w/ request
567  @param mac_address - mac addr to assign to the interface if none-zero
568  @param user_instance - requested instance, ~0 => dynamically allocate
569 */
570 define bvi_create
571 {
574  vl_api_mac_address_t mac;
576 };
577 
578 /** \brief Create BVI interface instance response
579  @param context - sender context, to match reply w/ request
580  @param sw_if_index - sw index of the interface that was created
581  @param retval - return code for the request
582 */
583 define bvi_create_reply
584 {
588 };
589 
590 /** \brief Delete BVI interface request
591  @param client_index - opaque cookie to identify the sender
592  @param context - sender context, to match reply w/ request
593  @param sw_if_index - sw index of the interface that was created
594 */
595 autoreply define bvi_delete
596 {
600 };
601 
602 /** \brief Register for IP4 ARP resolution event on receing ARP reply or
603  MAC/IP info from ARP requests in L2 BDs
604  @param client_index - opaque cookie to identify the sender
605  @param context - sender context, to match reply w/ request
606  @param enable - 1 => register for events, 0 => cancel registration
607  @param pid - sender's pid
608 */
609 autoreply define want_l2_arp_term_events
610 {
613  bool enable;
615 };
616 
617 /** \brief Tell client about an IP4 ARP resolution event or
618  MAC/IP info from ARP requests in L2 BDs
619  @param client_index - opaque cookie to identify the sender
620  @param pid - client pid registered to receive notification
621  @param ip - IP address of new ARP term entry
622  @param sw_if_index - interface of new ARP term entry
623  @param mac - MAC address of new ARP term entry
624 */
625 define l2_arp_term_event
626 {
629  vl_api_address_t ip;
630  vl_api_interface_index_t sw_if_index;
631  vl_api_mac_address_t mac;
632 };
633 
634 service {
635  rpc want_l2_arp_term_events returns want_l2_arp_term_events_reply
636  events l2_arp_term_event;
637 };
638 
639 /*
640  * Local Variables:
641  * eval: (c-set-style "gnu")
642  * End:
643  */
vl_api_address_t ip
Definition: l2.api:629
vl_api_bd_ip_mac_t entry
Definition: l2.api:522
vl_api_mac_address_t mac
Definition: l2.api:491
vl_api_l2_port_type_t port_type
Definition: l2.api:473
vl_api_mac_address_t mac
Definition: l2.api:631
typedef bd_ip_mac
Set bridge domain ip to mac entry request.
Definition: l2.api:488
l2_port_type
An enumeration of the type of ports that can be added to a bridge domain.
Definition: l2.api:446
unsigned char u8
Definition: types.h:56
option version
Definition: l2.api:17
u8 shg
Definition: l2.api:292
u32 feature_bitmap
Definition: l2.api:213
u8 flags
Definition: l2.api:174
vl_api_interface_index_t sw_if_index
Definition: l2.api:630
unsigned int u32
Definition: types.h:88
u32 client_index
Definition: l2.api:209
u32 bd_id
Definition: gbp.api:175
unsigned short u16
Definition: types.h:57
typedef mac_entry
Entry for learned or aged MAC in L2 MAC Events.
Definition: l2.api:170
typedef bridge_domain_sw_if
L2 bridge domain sw interface operational state response.
Definition: l2.api:289
u8 mac_addr[6]
Definition: l2.api:172
signed int i32
Definition: types.h:77
u32 sw_if_index
Definition: l2.api:291
service
Definition: l2.api:191
u32 resulting_feature_bitmap
Definition: l2.api:225
u8 action
Definition: l2.api:173
vl_api_address_t ip
Definition: l2.api:490
vl_api_bd_flags_t flags
Definition: l2.api:350
u32 sw_if_index
Definition: l2.api:211
vl_api_bd_ip_mac_t entry
Definition: l2.api:499
bd_flags
Flags that can be changed on a bridge domain.
Definition: l2.api:326
vl_api_mac_address_t mac
Definition: l2.api:574