blob: ccba9aa3df1d66afe1507b4496bec5d2bee6253d [file] [log] [blame]
Matus Fabianf468e232016-12-02 06:00:53 -08001/* Hey Emacs use -*- mode: C -*- */
2/*
3 * Copyright (c) 2016 Cisco and/or its affiliates.
Laszlo Kiraly0f8f4352022-09-16 13:20:07 +02004 * Copyright (c) 2022 Nordix Foundation.
Matus Fabianf468e232016-12-02 06:00:53 -08005 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
Laszlo Kiraly0f8f4352022-09-16 13:20:07 +020018option version = "3.2.0";
Neale Ranns4d5b9172018-10-24 02:57:49 -070019
20import "vnet/ip/ip_types.api";
21import "vnet/ethernet/ethernet_types.api";
Neale Rannscbe25aa2019-09-30 10:53:31 +000022import "vnet/interface_types.api";
Dave Barach0d056e52017-09-28 15:11:16 -040023
Jakub Grajciar145e3302019-10-24 13:52:42 +020024/** \brief Reply to l2_xconnect_dump
Matus Fabianf468e232016-12-02 06:00:53 -080025 @param context - sender context which was passed in the request
26 @param rx_sw_if_index - Receive interface index
27 @param tx_sw_if_index - Transmit interface index
28 */
29define l2_xconnect_details
30{
31 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +020032 vl_api_interface_index_t rx_sw_if_index;
33 vl_api_interface_index_t tx_sw_if_index;
Matus Fabianf468e232016-12-02 06:00:53 -080034};
35
36/** \brief Dump L2 XConnects
37 @param client_index - opaque cookie to identify the sender
38 @param context - sender context, to match reply w/ request
39*/
40define l2_xconnect_dump
41{
42 u32 client_index;
43 u32 context;
44};
45
Ole Troan01384fe2017-05-12 11:55:35 +020046/** \brief l2 fib table details structure
Pavel Kotucek0f971d82017-01-03 10:48:54 +010047 @param bd_id - the l2 fib / bridge domain table id
48 @param mac - the entry's mac address
49 @param sw_if_index - index of the interface
50 @param static_mac - the entry is statically configured.
51 @param filter_mac - the entry is a mac filter entry.
52 @param bvi_mac - the mac address is a bridge virtual interface
53*/
Ole Troan01384fe2017-05-12 11:55:35 +020054define l2_fib_table_details
Pavel Kotucek0f971d82017-01-03 10:48:54 +010055{
56 u32 context;
57 u32 bd_id;
Jakub Grajciar145e3302019-10-24 13:52:42 +020058 vl_api_mac_address_t mac;
59 vl_api_interface_index_t sw_if_index;
60 bool static_mac;
61 bool filter_mac;
62 bool bvi_mac;
Pavel Kotucek0f971d82017-01-03 10:48:54 +010063};
64
65/** \brief Dump l2 fib (aka bridge domain) table
66 @param client_index - opaque cookie to identify the sender
67 @param bd_id - the l2 fib / bridge domain table identifier
68*/
69define l2_fib_table_dump
70{
71 u32 client_index;
72 u32 context;
73 u32 bd_id;
74};
75
76/** \brief L2 fib clear table request, clear all mac entries in the l2 fib
77 @param client_index - opaque cookie to identify the sender
78 @param context - sender context, to match reply w/ request
79*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040080autoreply define l2_fib_clear_table
Pavel Kotucek0f971d82017-01-03 10:48:54 +010081{
82 u32 client_index;
83 u32 context;
84};
85
Eyal Bari7537e712017-04-27 14:07:55 +030086/** \brief L2 FIB flush all entries
87 @param client_index - opaque cookie to identify the sender
88 @param context - sender context, to match reply w/ request
89*/
90autoreply define l2fib_flush_all
91{
92 u32 client_index;
93 u32 context;
94};
95
Eyal Barif24991c2017-04-05 05:33:21 +030096/** \brief L2 FIB flush bridge domain entries
97 @param client_index - opaque cookie to identify the sender
98 @param context - sender context, to match reply w/ request
99 @param bd_id - the entry's bridge domain id
100*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400101autoreply define l2fib_flush_bd
Eyal Barif24991c2017-04-05 05:33:21 +0300102{
103 u32 client_index;
104 u32 context;
105 u32 bd_id;
106};
107
Eyal Barif24991c2017-04-05 05:33:21 +0300108/** \brief L2 FIB flush interface entries
109 @param client_index - opaque cookie to identify the sender
110 @param context - sender context, to match reply w/ request
111 @param bd_id - the entry's bridge domain id
112*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400113autoreply define l2fib_flush_int
Eyal Barif24991c2017-04-05 05:33:21 +0300114{
115 u32 client_index;
116 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200117 vl_api_interface_index_t sw_if_index;
Eyal Barif24991c2017-04-05 05:33:21 +0300118};
119
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100120/** \brief L2 FIB add entry request
121 @param client_index - opaque cookie to identify the sender
122 @param context - sender context, to match reply w/ request
123 @param mac - the entry's mac address
124 @param bd_id - the entry's bridge domain id
125 @param sw_if_index - the interface
126 @param is_add - If non zero add the entry, else delete it
Jakub Grajciar145e3302019-10-24 13:52:42 +0200127 @param static_mac -
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100128 @param filter_mac -
Jakub Grajciar145e3302019-10-24 13:52:42 +0200129 @param bvi_mac -
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100130*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400131autoreply define l2fib_add_del
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100132{
133 u32 client_index;
134 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200135 vl_api_mac_address_t mac;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100136 u32 bd_id;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200137 vl_api_interface_index_t sw_if_index;
138 bool is_add [default=true];
139 bool static_mac;
140 bool filter_mac;
141 bool bvi_mac;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100142};
143
Paul Vinciguerrabdc0e6b2018-09-22 05:32:50 -0700144/** \brief Register to receive L2 MAC events for learned and aged MAC
John Lo8d00fff2017-08-03 00:35:36 -0400145 @param client_index - opaque cookie to identify the sender
146 @param context - sender context, to match reply w/ request
Jakub Grajciar145e3302019-10-24 13:52:42 +0200147 @param learn_limit - MAC learn limit
148 @param scan_delay - event scan delay in 10 msec unit
149 @param max_macs_in_event - in units of 10 mac entries
John Lo8d00fff2017-08-03 00:35:36 -0400150 @param enable_disable - 1 => register for MAC events, 0 => cancel registration
151 @param pid - sender's pid
152*/
153autoreply define want_l2_macs_events
154{
Jerome Tollet0f8d1002021-01-07 12:44:17 +0100155 option deprecated;
John Lo8d00fff2017-08-03 00:35:36 -0400156 u32 client_index;
157 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200158 u32 learn_limit [default=1000];
159 u8 scan_delay [default=10];
160 u8 max_macs_in_event [default=10];
161 bool enable_disable [default=true];
John Lo8d00fff2017-08-03 00:35:36 -0400162 u32 pid;
163};
164
Jerome Tollet0f8d1002021-01-07 12:44:17 +0100165/** \brief Register to receive L2 MAC events for learned and aged MAC
166 @param client_index - opaque cookie to identify the sender
167 @param context - sender context, to match reply w/ request
168 @param max_macs_in_event - in units of 10 mac entries
169 @param enable_disable - 1 => register for MAC events, 0 => cancel registration
170 @param pid - sender's pid
171*/
172autoreply define want_l2_macs_events2
173{
174 u32 client_index;
175 u32 context;
176 u8 max_macs_in_event [default=10];
177 bool enable_disable [default=true];
178 u32 pid;
179};
180
181/** \brief set l2 table scan delay
182 @param client_index - opaque cookie to identify the sender
183 @param context - sender context, to match reply w/ request
184 @param scan_delay - event scan delay in 10 msec unit
185*/
186autoreply define l2fib_set_scan_delay
187{
188 u32 client_index;
189 u32 context;
190 u16 scan_delay [default=10];
191};
192
193
Jakub Grajciar145e3302019-10-24 13:52:42 +0200194enum mac_event_action
195{
196 MAC_EVENT_ACTION_API_ADD = 0,
197 MAC_EVENT_ACTION_API_DELETE = 1,
198 MAC_EVENT_ACTION_API_MOVE = 2,
199};
200
John Lo8d00fff2017-08-03 00:35:36 -0400201/** \brief Entry for learned or aged MAC in L2 MAC Events
202 @param sw_if_index - sw_if_index in the domain
203 @param mac_addr - mac_address
John Loe23c99e2018-03-13 21:53:18 -0400204 @param action - 0 => newly learned MAC, 1 => MAC deleted by ager
Jakub Grajciar145e3302019-10-24 13:52:42 +0200205 2 => MAC move (sw_if_index changed)
John Loe23c99e2018-03-13 21:53:18 -0400206 @param flags - flag bits to provide other info, not yet used
John Lo8d00fff2017-08-03 00:35:36 -0400207*/
Paul Vinciguerrae7174822019-08-07 00:05:59 -0400208typedef mac_entry
John Lo8d00fff2017-08-03 00:35:36 -0400209{
Jakub Grajciar145e3302019-10-24 13:52:42 +0200210 vl_api_interface_index_t sw_if_index;
211 vl_api_mac_address_t mac_addr;
212 vl_api_mac_event_action_t action;
213 u8 flags;
John Lo8d00fff2017-08-03 00:35:36 -0400214};
215
216/** \brief L2 MAC event for a list of learned or aged MACs
217 @param client_index - opaque cookie to identify the sender
218 @param pid - client pid registered to receive notification
Paul Vinciguerrabdc0e6b2018-09-22 05:32:50 -0700219 @param n_macs - number of learned/aged MAC entries
John Lo8d00fff2017-08-03 00:35:36 -0400220 @param mac - array of learned/aged MAC entries
221*/
222define l2_macs_event
223{
224 u32 client_index;
225 u32 pid;
226 u32 n_macs;
227 vl_api_mac_entry_t mac[n_macs];
228};
229
Marek Gradzki51e59682018-03-06 10:05:44 +0100230service {
231 rpc want_l2_macs_events returns want_l2_macs_events_reply
232 events l2_macs_event;
233};
234
Jakub Grajciar145e3302019-10-24 13:52:42 +0200235/** \brief Set interface L2 flags (such as L2_LEARN, L2_FWD,
John Lo8d00fff2017-08-03 00:35:36 -0400236 L2_FLOOD, L2_UU_FLOOD, or L2_ARP_TERM bits). This can be used
237 to disable one or more of the features represented by the
238 flag bits on an interface to override what is set as default
239 for all interfaces in the bridge domain
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100240 @param client_index - opaque cookie to identify the sender
241 @param context - sender context, to match reply w/ request
Jakub Grajciar145e3302019-10-24 13:52:42 +0200242 @param sw_if_index - interface
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100243 @param is_set - if non-zero, set the bits, else clear them
John Lo8d00fff2017-08-03 00:35:36 -0400244 @param feature_bitmap - non-zero bits (as above) to set or clear
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100245*/
246define l2_flags
247{
248 u32 client_index;
249 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200250 vl_api_interface_index_t sw_if_index;
251 bool is_set;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100252 u32 feature_bitmap;
253};
254
John Lo8d00fff2017-08-03 00:35:36 -0400255/** \brief Set interface L2 flags response
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100256 @param context - sender context, to match reply w/ request
257 @param retval - return code for the set l2 bits request
John Lo8d00fff2017-08-03 00:35:36 -0400258 @param resulting_feature_bitmap - the internal l2 feature bitmap after the request is implemented
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100259*/
260define l2_flags_reply
261{
262 u32 context;
263 i32 retval;
264 u32 resulting_feature_bitmap;
265};
266
Eyal Barifead6702017-04-04 04:46:32 +0300267/** \brief L2 bridge domain set mac age
268 @param client_index - opaque cookie to identify the sender
269 @param context - sender context, to match reply w/ request
270 @param bd_id - the bridge domain to create
271 @param mac_age - mac aging time in min, 0 for disabled
272*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400273autoreply define bridge_domain_set_mac_age
Eyal Barifead6702017-04-04 04:46:32 +0300274{
275 u32 client_index;
276 u32 context;
277 u32 bd_id;
278 u8 mac_age;
279};
280
Jerome Tollet5f93e3b2020-12-18 09:44:24 +0100281/** \brief L2 bridge domain set default learn limit
282 @param client_index - opaque cookie to identify the sender
283 @param context - sender context, to match reply w/ request
284 @param learn limit - maximum number of entries by default for bridge domains
285*/
286autoreply define bridge_domain_set_default_learn_limit
287{
288 u32 client_index;
289 u32 context;
290 u32 learn_limit;
291};
292
293
294/** \brief L2 bridge domain set learn limit
295 @param client_index - opaque cookie to identify the sender
296 @param context - sender context, to match reply w/ request
297 @param bd_id - the bridge domain idenntifier
298 @param learn limit - maximum number of entries for this bd
299*/
300autoreply define bridge_domain_set_learn_limit
301{
302 u32 client_index;
303 u32 context;
304 u32 bd_id;
305 u32 learn_limit;
306};
307
Laszlo Kiraly0f8f4352022-09-16 13:20:07 +0200308/** \brief L2 bridge domain add or delete request - will be deprecated
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100309 @param client_index - opaque cookie to identify the sender
310 @param context - sender context, to match reply w/ request
311 @param bd_id - the bridge domain to create
312 @param flood - enable/disable bcast/mcast flooding in the bd
Paul Vinciguerrabdc0e6b2018-09-22 05:32:50 -0700313 @param uu_flood - enable/disable unknown unicast flood in the bd
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100314 @param forward - enable/disable forwarding on all interfaces in the bd
315 @param learn - enable/disable learning on all interfaces in the bd
316 @param arp_term - enable/disable arp termination in the bd
Mohsin Kazmi5e6f7342019-04-05 17:40:20 +0200317 @param arp_ufwd - enable/disable arp unicast forwarding in the bd
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100318 @param mac_age - mac aging time in min, 0 for disabled
319 @param is_add - add or delete flag
320*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400321autoreply define bridge_domain_add_del
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100322{
Laszlo Kiraly0f8f4352022-09-16 13:20:07 +0200323 option deprecated;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100324 u32 client_index;
325 u32 context;
326 u32 bd_id;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200327 bool flood;
328 bool uu_flood;
329 bool forward;
330 bool learn;
331 bool arp_term;
332 bool arp_ufwd;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100333 u8 mac_age;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200334 string bd_tag[64];
335 bool is_add [default=true];
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100336};
337
Laszlo Kiraly0f8f4352022-09-16 13:20:07 +0200338/** \brief L2 bridge domain add delete request version 2
339 @param client_index - opaque cookie to identify the sender
340 @param context - sender context, to match reply w/ request
341 @param bd_id - if the id == ~0 creates a bridge domain with an unused id
342 if the id != ~0 the id of the bridge domain to create/delete
343 @param flood - enable/disable bcast/mcast flooding in the bd
344 @param uu_flood - enable/disable unknown unicast flood in the bd
345 @param forward - enable/disable forwarding on all interfaces in the bd
346 @param learn - enable/disable learning on all interfaces in the bd
347 @param arp_term - enable/disable arp termination in the bd
348 @param arp_ufwd - enable/disable arp unicast forwarding in the bd
349 @param mac_age - mac aging time in min, 0 for disabled
350 @param is_add - add or delete flag
351*/
352define bridge_domain_add_del_v2
353{
354 u32 client_index;
355 u32 context;
356 u32 bd_id;
357 bool flood;
358 bool uu_flood;
359 bool forward;
360 bool learn;
361 bool arp_term;
362 bool arp_ufwd;
363 u8 mac_age;
364 string bd_tag[64];
365 bool is_add [default=true];
366};
367
368/** \brief L2 bridge domain add delete version 2 response
369 @param context - sender context, to match reply w/ request
370 @param retval - return code for the set bridge flags request
371 @param resulting_id - the id for the new bridge domain
372*/
373define bridge_domain_add_del_v2_reply
374{
375 u32 context;
376 i32 retval;
377 u32 bd_id;
378};
379
380
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100381/** \brief L2 bridge domain request operational state details
382 @param client_index - opaque cookie to identify the sender
383 @param context - sender context, to match reply w/ request
384 @param bd_id - the bridge domain id desired or ~0 to request all bds
Jakub Grajciar145e3302019-10-24 13:52:42 +0200385 @param sw_if_index - filter by sw_if_index UNIMPLEMENTED
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100386*/
387define bridge_domain_dump
388{
389 u32 client_index;
390 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200391 u32 bd_id [default=0xffffffff];
392 vl_api_interface_index_t sw_if_index [default=0xffffffff];
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100393};
394
Ole Troan01384fe2017-05-12 11:55:35 +0200395/** \brief L2 bridge domain sw interface operational state response
396 @param bd_id - the bridge domain id
397 @param sw_if_index - sw_if_index in the domain
398 @param shg - split horizon group for the interface
399*/
Paul Vinciguerrae7174822019-08-07 00:05:59 -0400400typedef bridge_domain_sw_if
Ole Troan01384fe2017-05-12 11:55:35 +0200401{
402 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200403 vl_api_interface_index_t sw_if_index;
404 /* FIXME: set_int_l2_mode() u32/ api u8 */
Ole Troan01384fe2017-05-12 11:55:35 +0200405 u8 shg;
406};
407
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100408/** \brief L2 bridge domain operational state response
409 @param bd_id - the bridge domain id
410 @param flood - bcast/mcast flooding state on all interfaces in the bd
Paul Vinciguerrabdc0e6b2018-09-22 05:32:50 -0700411 @param uu_flood - unknown unicast flooding state on all interfaces in the bd
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100412 @param forward - forwarding state on all interfaces in the bd
413 @param learn - learning state on all interfaces in the bd
414 @param arp_term - arp termination state on all interfaces in the bd
Mohsin Kazmi5e6f7342019-04-05 17:40:20 +0200415 @param arp_ufwd - arp unicast forwarding state on all interfaces in the bd
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100416 @param mac_age - mac aging time in min, 0 for disabled
Jerome Tollet50570ec2017-09-14 12:53:56 +0100417 @param bd_tag - optional textual tag for the bridge domain
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100418 @param n_sw_ifs - number of sw_if_index's in the domain
419*/
Ole Troandf87f802020-11-18 19:17:48 +0100420define bridge_domain_details
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100421{
422 u32 context;
423 u32 bd_id;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200424 bool flood;
425 bool uu_flood;
426 bool forward;
427 bool learn;
428 bool arp_term;
429 bool arp_ufwd;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100430 u8 mac_age;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200431 string bd_tag[64];
432 vl_api_interface_index_t bvi_sw_if_index;
433 vl_api_interface_index_t uu_fwd_sw_if_index;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100434 u32 n_sw_ifs;
Ole Troan01384fe2017-05-12 11:55:35 +0200435 vl_api_bridge_domain_sw_if_t sw_if_details[n_sw_ifs];
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100436};
437
Neale Rannsb4743802018-09-05 09:13:57 -0700438/** \brief Flags that can be changed on a bridge domain */
439enum bd_flags
440{
Michal Cmarada5daf0c52019-03-15 10:46:07 +0100441 BRIDGE_API_FLAG_NONE = 0x0,
Neale Rannsb4743802018-09-05 09:13:57 -0700442 BRIDGE_API_FLAG_LEARN = 0x1,
443 BRIDGE_API_FLAG_FWD = 0x2,
444 BRIDGE_API_FLAG_FLOOD = 0x4,
445 BRIDGE_API_FLAG_UU_FLOOD = 0x8,
446 BRIDGE_API_FLAG_ARP_TERM = 0x10,
Mohsin Kazmi5e6f7342019-04-05 17:40:20 +0200447 BRIDGE_API_FLAG_ARP_UFWD = 0x20,
Neale Rannsb4743802018-09-05 09:13:57 -0700448};
449
450/** \brief Set bridge flags request
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100451 @param client_index - opaque cookie to identify the sender
452 @param context - sender context, to match reply w/ request
453 @param bd_id - the bridge domain to set the flags for
454 @param is_set - if non-zero, set the flags, else clear them
Neale Rannsb4743802018-09-05 09:13:57 -0700455 @param flags - flags that are non-zero to set or clear
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100456*/
457define bridge_flags
458{
459 u32 client_index;
460 u32 context;
461 u32 bd_id;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200462 bool is_set;
Neale Rannsb4743802018-09-05 09:13:57 -0700463 vl_api_bd_flags_t flags;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100464};
465
466/** \brief Set bridge flags response
467 @param context - sender context, to match reply w/ request
468 @param retval - return code for the set bridge flags request
John Lo8d00fff2017-08-03 00:35:36 -0400469 @param resulting_feature_bitmap - the internal L2 feature bitmap after the request is implemented
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100470*/
471define bridge_flags_reply
472{
473 u32 context;
474 i32 retval;
475 u32 resulting_feature_bitmap;
476};
477
Pavel Kotucekadec5872017-01-25 08:50:53 +0100478/** \brief L2 interface vlan tag rewrite configure request
479 @param client_index - opaque cookie to identify the sender
480 @param context - sender context, to match reply w/ request
481 @param sw_if_index - interface the operation is applied to
482 @param vtr_op - Choose from l2_vtr_op_t enum values
483 @param push_dot1q - first pushed flag dot1q id set, else dot1ad
484 @param tag1 - Needed for any push or translate vtr op
485 @param tag2 - Needed for any push 2 or translate x-2 vtr ops
486*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400487autoreply define l2_interface_vlan_tag_rewrite
Pavel Kotucekadec5872017-01-25 08:50:53 +0100488{
489 u32 client_index;
490 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200491 vl_api_interface_index_t sw_if_index;
Pavel Kotucekadec5872017-01-25 08:50:53 +0100492 u32 vtr_op;
493 u32 push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
494 u32 tag1; // first pushed tag
495 u32 tag2; // second pushed tag
496};
497
Pavel Kotucekadec5872017-01-25 08:50:53 +0100498/** \brief L2 interface pbb tag rewrite configure request
499 @param client_index - opaque cookie to identify the sender
500 @param context - sender context, to match reply w/ request
501 @param sw_if_index - interface the operation is applied to
502 @param vtr_op - Choose from l2_vtr_op_t enum values
503 @param inner_tag - needed for translate_qinq vtr op only
Jakub Grajciar145e3302019-10-24 13:52:42 +0200504 @param outer_tag - needed for translate_qinq vtr op only
Pavel Kotucekadec5872017-01-25 08:50:53 +0100505 @param b_dmac - B-tag remote mac address, needed for any push or translate_qinq vtr op
506 @param b_smac - B-tag local mac address, needed for any push or translate qinq vtr op
507 @param b_vlanid - B-tag vlanid, needed for any push or translate qinq vtr op
508 @param i_sid - I-tag service id, needed for any push or translate qinq vtr op
509*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400510autoreply define l2_interface_pbb_tag_rewrite
Pavel Kotucekadec5872017-01-25 08:50:53 +0100511{
512 u32 client_index;
513 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200514 vl_api_interface_index_t sw_if_index;
Pavel Kotucekadec5872017-01-25 08:50:53 +0100515 u32 vtr_op;
516 u16 outer_tag;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200517 vl_api_mac_address_t b_dmac;
518 vl_api_mac_address_t b_smac;
Pavel Kotucekadec5872017-01-25 08:50:53 +0100519 u16 b_vlanid;
520 u32 i_sid;
521};
522
Neale Rannsb8d44812017-11-10 06:53:54 -0800523/** \brief L2 interface patch add / del request
524 @param client_index - opaque cookie to identify the sender
525 @param context - sender context, to match reply w/ request
Jakub Grajciar145e3302019-10-24 13:52:42 +0200526 @param rx_sw_if_index - receive side interface
Neale Rannsb8d44812017-11-10 06:53:54 -0800527 @param tx_sw_if_index - transmit side interface
528 @param is_add - if non-zero set up the interface patch, else remove it
529*/
530autoreply define l2_patch_add_del
531{
532 u32 client_index;
533 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200534 vl_api_interface_index_t rx_sw_if_index;
535 vl_api_interface_index_t tx_sw_if_index;
536 bool is_add [default=true];
Neale Rannsb8d44812017-11-10 06:53:54 -0800537};
538
539/** \brief Set L2 XConnect between two interfaces request
540 @param client_index - opaque cookie to identify the sender
541 @param context - sender context, to match reply w/ request
542 @param rx_sw_if_index - Receive interface index
543 @param tx_sw_if_index - Transmit interface index
544 @param enable - enable xconnect if not 0, else set to L3 mode
545*/
546autoreply define sw_interface_set_l2_xconnect
547{
548 u32 client_index;
549 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200550 vl_api_interface_index_t rx_sw_if_index;
551 vl_api_interface_index_t tx_sw_if_index;
552 bool enable [default=true];
Neale Rannsb8d44812017-11-10 06:53:54 -0800553};
554
Neale Rannsb4743802018-09-05 09:13:57 -0700555/**
556 * @brief An enumeration of the type of ports that can be added
557 * to a bridge domain
558 */
559enum l2_port_type
560{
561 /* a 'normal' interface, i.e. not BVI or UU-Flood */
562 L2_API_PORT_TYPE_NORMAL = 0,
563 /* a BVI interface in the BD */
564 L2_API_PORT_TYPE_BVI = 1,
565 /* The interface on which to forward unknown unicast packets
566 * If this is not set for a BD then UU is flooded */
567 L2_API_PORT_TYPE_UU_FWD = 2,
568};
569
Neale Rannsb8d44812017-11-10 06:53:54 -0800570/** \brief Interface bridge mode request
571 @param client_index - opaque cookie to identify the sender
572 @param context - sender context, to match reply w/ request
573 @param rx_sw_if_index - the interface
574 @param bd_id - bridge domain id
Yichen Wang0a4e0062018-10-01 11:15:25 -0700575 @param port_type - port_mode, see #l2_port_type
Yichen Wang5c7c49d2018-09-18 17:32:29 -0700576 @param shg - Split horizon group, for bridge mode only
Neale Rannsb8d44812017-11-10 06:53:54 -0800577 @param enable - Enable beige mode if not 0, else set to L3 mode
578*/
Neale Rannsb4743802018-09-05 09:13:57 -0700579
Neale Rannsb8d44812017-11-10 06:53:54 -0800580autoreply define sw_interface_set_l2_bridge
581{
582 u32 client_index;
583 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200584 vl_api_interface_index_t rx_sw_if_index;
Neale Rannsb8d44812017-11-10 06:53:54 -0800585 u32 bd_id;
Neale Rannsb4743802018-09-05 09:13:57 -0700586 vl_api_l2_port_type_t port_type;
Neale Rannsb8d44812017-11-10 06:53:54 -0800587 u8 shg;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200588 bool enable [default=true];
Neale Rannsb8d44812017-11-10 06:53:54 -0800589};
590
591/** \brief Set bridge domain ip to mac entry request
592 @param client_index - opaque cookie to identify the sender
593 @param context - sender context, to match reply w/ request
594 @param bd_id - the bridge domain to set the flags for
595 @param is_add - if non-zero, add the entry, else clear it
Igor Mikhailov (imichail)54bc5e42019-05-08 16:01:01 -0700596 @param ip - ipv4 or ipv6 address
597 @param mac - MAC address
Neale Rannsb8d44812017-11-10 06:53:54 -0800598*/
Neale Rannsbc764c82019-06-19 07:07:13 -0700599
600typedef bd_ip_mac
601{
602 u32 bd_id;
603 vl_api_address_t ip;
604 vl_api_mac_address_t mac;
605};
606
Neale Rannsb8d44812017-11-10 06:53:54 -0800607autoreply define bd_ip_mac_add_del
608{
609 u32 client_index;
610 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200611 bool is_add [default=true];
Neale Rannsbc764c82019-06-19 07:07:13 -0700612 vl_api_bd_ip_mac_t entry;
Neale Rannsb8d44812017-11-10 06:53:54 -0800613};
614
John Loe26c81f2019-01-07 15:16:33 -0500615/** \brief Flush bridge domain IP to MAC entries
616 @param client_index - opaque cookie to identify the sender
617 @param bd_id - bridge domain identifier
618*/
619autoreply define bd_ip_mac_flush
620{
621 u32 client_index;
622 u32 context;
623 u32 bd_id;
624};
625
Mohsin Kazmi5d82d2f2018-08-13 19:17:54 +0200626/** \brief bridge domain IP to MAC entry details structure
627 @param bd_id - bridge domain table id
628 @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
629 @param ip_address - ipv4 or ipv6 address
630 @param mac_address - MAC address
631*/
632define bd_ip_mac_details
633{
634 u32 context;
Neale Rannsbc764c82019-06-19 07:07:13 -0700635 vl_api_bd_ip_mac_t entry;
Mohsin Kazmi5d82d2f2018-08-13 19:17:54 +0200636};
637
638/** \brief Dump bridge domain IP to MAC entries
639 @param client_index - opaque cookie to identify the sender
640 @param bd_id - bridge domain identifier
641*/
642define bd_ip_mac_dump
643{
644 u32 client_index;
645 u32 context;
646 u32 bd_id;
647};
648
Neale Rannsb8d44812017-11-10 06:53:54 -0800649/** \brief L2 interface ethernet flow point filtering enable/disable request
650 @param client_index - opaque cookie to identify the sender
651 @param context - sender context, to match reply w/ request
652 @param sw_if_index - interface to enable/disable filtering on
653 @param enable_disable - if non-zero enable filtering, else disable
654*/
655autoreply define l2_interface_efp_filter
656{
657 u32 client_index;
658 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200659 vl_api_interface_index_t sw_if_index;
660 bool enable_disable [default=true];
Neale Rannsb8d44812017-11-10 06:53:54 -0800661};
662
663/** \brief Interface set vpath request
664 @param client_index - opaque cookie to identify the sender
665 @param context - sender context, to match reply w/ request
666 @param sw_if_index - interface used to reach neighbor
667 @param enable - if non-zero enable, else disable
668*/
669autoreply define sw_interface_set_vpath
670{
671 u32 client_index;
672 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200673 vl_api_interface_index_t sw_if_index;
674 bool enable [default=0xffffffff];
Neale Rannsb8d44812017-11-10 06:53:54 -0800675};
676
Neale Ranns192b13f2019-03-15 02:16:20 -0700677/** \brief Create BVI interface instance request
678 @param client_index - opaque cookie to identify the sender
679 @param context - sender context, to match reply w/ request
680 @param mac_address - mac addr to assign to the interface if none-zero
681 @param user_instance - requested instance, ~0 => dynamically allocate
682*/
683define bvi_create
684{
685 u32 client_index;
686 u32 context;
687 vl_api_mac_address_t mac;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200688 u32 user_instance [default=0xffffffff];
Neale Ranns192b13f2019-03-15 02:16:20 -0700689};
690
691/** \brief Create BVI interface instance response
692 @param context - sender context, to match reply w/ request
693 @param sw_if_index - sw index of the interface that was created
694 @param retval - return code for the request
695*/
696define bvi_create_reply
697{
698 u32 context;
699 i32 retval;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200700 vl_api_interface_index_t sw_if_index;
Neale Ranns192b13f2019-03-15 02:16:20 -0700701};
702
703/** \brief Delete BVI interface request
704 @param client_index - opaque cookie to identify the sender
705 @param context - sender context, to match reply w/ request
706 @param sw_if_index - sw index of the interface that was created
707*/
708autoreply define bvi_delete
709{
710 u32 client_index;
711 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200712 vl_api_interface_index_t sw_if_index;
Neale Ranns192b13f2019-03-15 02:16:20 -0700713};
714
Paul Vinciguerrac0e94412020-04-28 01:12:04 -0400715/** \brief Register for IP4 ARP resolution event on receiving ARP reply or
Neale Rannscbe25aa2019-09-30 10:53:31 +0000716 MAC/IP info from ARP requests in L2 BDs
717 @param client_index - opaque cookie to identify the sender
718 @param context - sender context, to match reply w/ request
719 @param enable - 1 => register for events, 0 => cancel registration
720 @param pid - sender's pid
721*/
722autoreply define want_l2_arp_term_events
723{
724 u32 client_index;
725 u32 context;
726 bool enable;
727 u32 pid;
728};
729
730/** \brief Tell client about an IP4 ARP resolution event or
731 MAC/IP info from ARP requests in L2 BDs
732 @param client_index - opaque cookie to identify the sender
733 @param pid - client pid registered to receive notification
734 @param ip - IP address of new ARP term entry
735 @param sw_if_index - interface of new ARP term entry
736 @param mac - MAC address of new ARP term entry
737*/
738define l2_arp_term_event
739{
740 u32 client_index;
741 u32 pid;
742 vl_api_address_t ip;
743 vl_api_interface_index_t sw_if_index;
744 vl_api_mac_address_t mac;
745};
746
747service {
748 rpc want_l2_arp_term_events returns want_l2_arp_term_events_reply
749 events l2_arp_term_event;
750};
751
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100752/*
753 * Local Variables:
754 * eval: (c-set-style "gnu")
755 * End:
756 */