blob: 00ff66c901907b3e4ce4d52d02db30d5b7d5bae8 [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.
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
Jakub Grajciar145e3302019-10-24 13:52:42 +020017option version = "3.0.0";
Neale Ranns4d5b9172018-10-24 02:57:49 -070018
19import "vnet/ip/ip_types.api";
20import "vnet/ethernet/ethernet_types.api";
Neale Rannscbe25aa2019-09-30 10:53:31 +000021import "vnet/interface_types.api";
Dave Barach0d056e52017-09-28 15:11:16 -040022
Jakub Grajciar145e3302019-10-24 13:52:42 +020023/** \brief Reply to l2_xconnect_dump
Matus Fabianf468e232016-12-02 06:00:53 -080024 @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 */
28define l2_xconnect_details
29{
30 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +020031 vl_api_interface_index_t rx_sw_if_index;
32 vl_api_interface_index_t tx_sw_if_index;
Matus Fabianf468e232016-12-02 06:00:53 -080033};
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*/
39define l2_xconnect_dump
40{
41 u32 client_index;
42 u32 context;
43};
44
Ole Troan01384fe2017-05-12 11:55:35 +020045/** \brief l2 fib table details structure
Pavel Kotucek0f971d82017-01-03 10:48:54 +010046 @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*/
Ole Troan01384fe2017-05-12 11:55:35 +020053define l2_fib_table_details
Pavel Kotucek0f971d82017-01-03 10:48:54 +010054{
55 u32 context;
56 u32 bd_id;
Jakub Grajciar145e3302019-10-24 13:52:42 +020057 vl_api_mac_address_t mac;
58 vl_api_interface_index_t sw_if_index;
59 bool static_mac;
60 bool filter_mac;
61 bool bvi_mac;
Pavel Kotucek0f971d82017-01-03 10:48:54 +010062};
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*/
68define l2_fib_table_dump
69{
70 u32 client_index;
71 u32 context;
72 u32 bd_id;
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*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040079autoreply define l2_fib_clear_table
Pavel Kotucek0f971d82017-01-03 10:48:54 +010080{
81 u32 client_index;
82 u32 context;
83};
84
Eyal Bari7537e712017-04-27 14:07:55 +030085/** \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*/
89autoreply define l2fib_flush_all
90{
91 u32 client_index;
92 u32 context;
93};
94
Eyal Barif24991c2017-04-05 05:33:21 +030095/** \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*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400100autoreply define l2fib_flush_bd
Eyal Barif24991c2017-04-05 05:33:21 +0300101{
102 u32 client_index;
103 u32 context;
104 u32 bd_id;
105};
106
Eyal Barif24991c2017-04-05 05:33:21 +0300107/** \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*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400112autoreply define l2fib_flush_int
Eyal Barif24991c2017-04-05 05:33:21 +0300113{
114 u32 client_index;
115 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200116 vl_api_interface_index_t sw_if_index;
Eyal Barif24991c2017-04-05 05:33:21 +0300117};
118
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100119/** \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
Jakub Grajciar145e3302019-10-24 13:52:42 +0200126 @param static_mac -
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100127 @param filter_mac -
Jakub Grajciar145e3302019-10-24 13:52:42 +0200128 @param bvi_mac -
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100129*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400130autoreply define l2fib_add_del
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100131{
132 u32 client_index;
133 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200134 vl_api_mac_address_t mac;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100135 u32 bd_id;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200136 vl_api_interface_index_t sw_if_index;
137 bool is_add [default=true];
138 bool static_mac;
139 bool filter_mac;
140 bool bvi_mac;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100141};
142
Paul Vinciguerrabdc0e6b2018-09-22 05:32:50 -0700143/** \brief Register to receive L2 MAC events for learned and aged MAC
John Lo8d00fff2017-08-03 00:35:36 -0400144 @param client_index - opaque cookie to identify the sender
145 @param context - sender context, to match reply w/ request
Jakub Grajciar145e3302019-10-24 13:52:42 +0200146 @param learn_limit - MAC learn limit
147 @param scan_delay - event scan delay in 10 msec unit
148 @param max_macs_in_event - in units of 10 mac entries
John Lo8d00fff2017-08-03 00:35:36 -0400149 @param enable_disable - 1 => register for MAC events, 0 => cancel registration
150 @param pid - sender's pid
151*/
152autoreply define want_l2_macs_events
153{
154 u32 client_index;
155 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200156 u32 learn_limit [default=1000];
157 u8 scan_delay [default=10];
158 u8 max_macs_in_event [default=10];
159 bool enable_disable [default=true];
John Lo8d00fff2017-08-03 00:35:36 -0400160 u32 pid;
161};
162
Jakub Grajciar145e3302019-10-24 13:52:42 +0200163enum mac_event_action
164{
165 MAC_EVENT_ACTION_API_ADD = 0,
166 MAC_EVENT_ACTION_API_DELETE = 1,
167 MAC_EVENT_ACTION_API_MOVE = 2,
168};
169
John Lo8d00fff2017-08-03 00:35:36 -0400170/** \brief Entry for learned or aged MAC in L2 MAC Events
171 @param sw_if_index - sw_if_index in the domain
172 @param mac_addr - mac_address
John Loe23c99e2018-03-13 21:53:18 -0400173 @param action - 0 => newly learned MAC, 1 => MAC deleted by ager
Jakub Grajciar145e3302019-10-24 13:52:42 +0200174 2 => MAC move (sw_if_index changed)
John Loe23c99e2018-03-13 21:53:18 -0400175 @param flags - flag bits to provide other info, not yet used
John Lo8d00fff2017-08-03 00:35:36 -0400176*/
Paul Vinciguerrae7174822019-08-07 00:05:59 -0400177typedef mac_entry
John Lo8d00fff2017-08-03 00:35:36 -0400178{
Jakub Grajciar145e3302019-10-24 13:52:42 +0200179 vl_api_interface_index_t sw_if_index;
180 vl_api_mac_address_t mac_addr;
181 vl_api_mac_event_action_t action;
182 u8 flags;
John Lo8d00fff2017-08-03 00:35:36 -0400183};
184
185/** \brief L2 MAC event for a list of learned or aged MACs
186 @param client_index - opaque cookie to identify the sender
187 @param pid - client pid registered to receive notification
Paul Vinciguerrabdc0e6b2018-09-22 05:32:50 -0700188 @param n_macs - number of learned/aged MAC entries
John Lo8d00fff2017-08-03 00:35:36 -0400189 @param mac - array of learned/aged MAC entries
190*/
191define l2_macs_event
192{
193 u32 client_index;
194 u32 pid;
195 u32 n_macs;
196 vl_api_mac_entry_t mac[n_macs];
197};
198
Marek Gradzki51e59682018-03-06 10:05:44 +0100199service {
200 rpc want_l2_macs_events returns want_l2_macs_events_reply
201 events l2_macs_event;
202};
203
Jakub Grajciar145e3302019-10-24 13:52:42 +0200204/** \brief Set interface L2 flags (such as L2_LEARN, L2_FWD,
John Lo8d00fff2017-08-03 00:35:36 -0400205 L2_FLOOD, L2_UU_FLOOD, or L2_ARP_TERM bits). This can be used
206 to disable one or more of the features represented by the
207 flag bits on an interface to override what is set as default
208 for all interfaces in the bridge domain
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100209 @param client_index - opaque cookie to identify the sender
210 @param context - sender context, to match reply w/ request
Jakub Grajciar145e3302019-10-24 13:52:42 +0200211 @param sw_if_index - interface
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100212 @param is_set - if non-zero, set the bits, else clear them
John Lo8d00fff2017-08-03 00:35:36 -0400213 @param feature_bitmap - non-zero bits (as above) to set or clear
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100214*/
215define l2_flags
216{
217 u32 client_index;
218 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200219 vl_api_interface_index_t sw_if_index;
220 bool is_set;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100221 u32 feature_bitmap;
222};
223
John Lo8d00fff2017-08-03 00:35:36 -0400224/** \brief Set interface L2 flags response
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100225 @param context - sender context, to match reply w/ request
226 @param retval - return code for the set l2 bits request
John Lo8d00fff2017-08-03 00:35:36 -0400227 @param resulting_feature_bitmap - the internal l2 feature bitmap after the request is implemented
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100228*/
229define l2_flags_reply
230{
231 u32 context;
232 i32 retval;
233 u32 resulting_feature_bitmap;
234};
235
Eyal Barifead6702017-04-04 04:46:32 +0300236/** \brief L2 bridge domain set mac age
237 @param client_index - opaque cookie to identify the sender
238 @param context - sender context, to match reply w/ request
239 @param bd_id - the bridge domain to create
240 @param mac_age - mac aging time in min, 0 for disabled
241*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400242autoreply define bridge_domain_set_mac_age
Eyal Barifead6702017-04-04 04:46:32 +0300243{
244 u32 client_index;
245 u32 context;
246 u32 bd_id;
247 u8 mac_age;
248};
249
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100250/** \brief L2 bridge domain add or delete request
251 @param client_index - opaque cookie to identify the sender
252 @param context - sender context, to match reply w/ request
253 @param bd_id - the bridge domain to create
254 @param flood - enable/disable bcast/mcast flooding in the bd
Paul Vinciguerrabdc0e6b2018-09-22 05:32:50 -0700255 @param uu_flood - enable/disable unknown unicast flood in the bd
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100256 @param forward - enable/disable forwarding on all interfaces in the bd
257 @param learn - enable/disable learning on all interfaces in the bd
258 @param arp_term - enable/disable arp termination in the bd
Mohsin Kazmi5e6f7342019-04-05 17:40:20 +0200259 @param arp_ufwd - enable/disable arp unicast forwarding in the bd
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100260 @param mac_age - mac aging time in min, 0 for disabled
261 @param is_add - add or delete flag
262*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400263autoreply define bridge_domain_add_del
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100264{
265 u32 client_index;
266 u32 context;
267 u32 bd_id;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200268 bool flood;
269 bool uu_flood;
270 bool forward;
271 bool learn;
272 bool arp_term;
273 bool arp_ufwd;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100274 u8 mac_age;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200275 string bd_tag[64];
276 bool is_add [default=true];
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100277};
278
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100279/** \brief L2 bridge domain request operational state details
280 @param client_index - opaque cookie to identify the sender
281 @param context - sender context, to match reply w/ request
282 @param bd_id - the bridge domain id desired or ~0 to request all bds
Jakub Grajciar145e3302019-10-24 13:52:42 +0200283 @param sw_if_index - filter by sw_if_index UNIMPLEMENTED
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100284*/
285define bridge_domain_dump
286{
287 u32 client_index;
288 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200289 u32 bd_id [default=0xffffffff];
290 vl_api_interface_index_t sw_if_index [default=0xffffffff];
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100291};
292
Ole Troan01384fe2017-05-12 11:55:35 +0200293/** \brief L2 bridge domain sw interface operational state response
294 @param bd_id - the bridge domain id
295 @param sw_if_index - sw_if_index in the domain
296 @param shg - split horizon group for the interface
297*/
Paul Vinciguerrae7174822019-08-07 00:05:59 -0400298typedef bridge_domain_sw_if
Ole Troan01384fe2017-05-12 11:55:35 +0200299{
300 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200301 vl_api_interface_index_t sw_if_index;
302 /* FIXME: set_int_l2_mode() u32/ api u8 */
Ole Troan01384fe2017-05-12 11:55:35 +0200303 u8 shg;
304};
305
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100306/** \brief L2 bridge domain operational state response
307 @param bd_id - the bridge domain id
308 @param flood - bcast/mcast flooding state on all interfaces in the bd
Paul Vinciguerrabdc0e6b2018-09-22 05:32:50 -0700309 @param uu_flood - unknown unicast flooding state on all interfaces in the bd
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100310 @param forward - forwarding state on all interfaces in the bd
311 @param learn - learning state on all interfaces in the bd
312 @param arp_term - arp termination state on all interfaces in the bd
Mohsin Kazmi5e6f7342019-04-05 17:40:20 +0200313 @param arp_ufwd - arp unicast forwarding state on all interfaces in the bd
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100314 @param mac_age - mac aging time in min, 0 for disabled
Jerome Tollet50570ec2017-09-14 12:53:56 +0100315 @param bd_tag - optional textual tag for the bridge domain
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100316 @param n_sw_ifs - number of sw_if_index's in the domain
317*/
Ole Troan01384fe2017-05-12 11:55:35 +0200318manual_print manual_endian define bridge_domain_details
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100319{
320 u32 context;
321 u32 bd_id;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200322 bool flood;
323 bool uu_flood;
324 bool forward;
325 bool learn;
326 bool arp_term;
327 bool arp_ufwd;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100328 u8 mac_age;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200329 string bd_tag[64];
330 vl_api_interface_index_t bvi_sw_if_index;
331 vl_api_interface_index_t uu_fwd_sw_if_index;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100332 u32 n_sw_ifs;
Ole Troan01384fe2017-05-12 11:55:35 +0200333 vl_api_bridge_domain_sw_if_t sw_if_details[n_sw_ifs];
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100334};
335
Neale Rannsb4743802018-09-05 09:13:57 -0700336/** \brief Flags that can be changed on a bridge domain */
337enum bd_flags
338{
Michal Cmarada5daf0c52019-03-15 10:46:07 +0100339 BRIDGE_API_FLAG_NONE = 0x0,
Neale Rannsb4743802018-09-05 09:13:57 -0700340 BRIDGE_API_FLAG_LEARN = 0x1,
341 BRIDGE_API_FLAG_FWD = 0x2,
342 BRIDGE_API_FLAG_FLOOD = 0x4,
343 BRIDGE_API_FLAG_UU_FLOOD = 0x8,
344 BRIDGE_API_FLAG_ARP_TERM = 0x10,
Mohsin Kazmi5e6f7342019-04-05 17:40:20 +0200345 BRIDGE_API_FLAG_ARP_UFWD = 0x20,
Neale Rannsb4743802018-09-05 09:13:57 -0700346};
347
348/** \brief Set bridge flags request
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100349 @param client_index - opaque cookie to identify the sender
350 @param context - sender context, to match reply w/ request
351 @param bd_id - the bridge domain to set the flags for
352 @param is_set - if non-zero, set the flags, else clear them
Neale Rannsb4743802018-09-05 09:13:57 -0700353 @param flags - flags that are non-zero to set or clear
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100354*/
355define bridge_flags
356{
357 u32 client_index;
358 u32 context;
359 u32 bd_id;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200360 bool is_set;
Neale Rannsb4743802018-09-05 09:13:57 -0700361 vl_api_bd_flags_t flags;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100362};
363
364/** \brief Set bridge flags response
365 @param context - sender context, to match reply w/ request
366 @param retval - return code for the set bridge flags request
John Lo8d00fff2017-08-03 00:35:36 -0400367 @param resulting_feature_bitmap - the internal L2 feature bitmap after the request is implemented
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100368*/
369define bridge_flags_reply
370{
371 u32 context;
372 i32 retval;
373 u32 resulting_feature_bitmap;
374};
375
Pavel Kotucekadec5872017-01-25 08:50:53 +0100376/** \brief L2 interface vlan tag rewrite configure request
377 @param client_index - opaque cookie to identify the sender
378 @param context - sender context, to match reply w/ request
379 @param sw_if_index - interface the operation is applied to
380 @param vtr_op - Choose from l2_vtr_op_t enum values
381 @param push_dot1q - first pushed flag dot1q id set, else dot1ad
382 @param tag1 - Needed for any push or translate vtr op
383 @param tag2 - Needed for any push 2 or translate x-2 vtr ops
384*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400385autoreply define l2_interface_vlan_tag_rewrite
Pavel Kotucekadec5872017-01-25 08:50:53 +0100386{
387 u32 client_index;
388 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200389 vl_api_interface_index_t sw_if_index;
Pavel Kotucekadec5872017-01-25 08:50:53 +0100390 u32 vtr_op;
391 u32 push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
392 u32 tag1; // first pushed tag
393 u32 tag2; // second pushed tag
394};
395
Pavel Kotucekadec5872017-01-25 08:50:53 +0100396/** \brief L2 interface pbb tag rewrite configure request
397 @param client_index - opaque cookie to identify the sender
398 @param context - sender context, to match reply w/ request
399 @param sw_if_index - interface the operation is applied to
400 @param vtr_op - Choose from l2_vtr_op_t enum values
401 @param inner_tag - needed for translate_qinq vtr op only
Jakub Grajciar145e3302019-10-24 13:52:42 +0200402 @param outer_tag - needed for translate_qinq vtr op only
Pavel Kotucekadec5872017-01-25 08:50:53 +0100403 @param b_dmac - B-tag remote mac address, needed for any push or translate_qinq vtr op
404 @param b_smac - B-tag local mac address, needed for any push or translate qinq vtr op
405 @param b_vlanid - B-tag vlanid, needed for any push or translate qinq vtr op
406 @param i_sid - I-tag service id, needed for any push or translate qinq vtr op
407*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400408autoreply define l2_interface_pbb_tag_rewrite
Pavel Kotucekadec5872017-01-25 08:50:53 +0100409{
410 u32 client_index;
411 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200412 vl_api_interface_index_t sw_if_index;
Pavel Kotucekadec5872017-01-25 08:50:53 +0100413 u32 vtr_op;
414 u16 outer_tag;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200415 vl_api_mac_address_t b_dmac;
416 vl_api_mac_address_t b_smac;
Pavel Kotucekadec5872017-01-25 08:50:53 +0100417 u16 b_vlanid;
418 u32 i_sid;
419};
420
Neale Rannsb8d44812017-11-10 06:53:54 -0800421/** \brief L2 interface patch add / del request
422 @param client_index - opaque cookie to identify the sender
423 @param context - sender context, to match reply w/ request
Jakub Grajciar145e3302019-10-24 13:52:42 +0200424 @param rx_sw_if_index - receive side interface
Neale Rannsb8d44812017-11-10 06:53:54 -0800425 @param tx_sw_if_index - transmit side interface
426 @param is_add - if non-zero set up the interface patch, else remove it
427*/
428autoreply define l2_patch_add_del
429{
430 u32 client_index;
431 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200432 vl_api_interface_index_t rx_sw_if_index;
433 vl_api_interface_index_t tx_sw_if_index;
434 bool is_add [default=true];
Neale Rannsb8d44812017-11-10 06:53:54 -0800435};
436
437/** \brief Set L2 XConnect between two interfaces request
438 @param client_index - opaque cookie to identify the sender
439 @param context - sender context, to match reply w/ request
440 @param rx_sw_if_index - Receive interface index
441 @param tx_sw_if_index - Transmit interface index
442 @param enable - enable xconnect if not 0, else set to L3 mode
443*/
444autoreply define sw_interface_set_l2_xconnect
445{
446 u32 client_index;
447 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200448 vl_api_interface_index_t rx_sw_if_index;
449 vl_api_interface_index_t tx_sw_if_index;
450 bool enable [default=true];
Neale Rannsb8d44812017-11-10 06:53:54 -0800451};
452
Neale Rannsb4743802018-09-05 09:13:57 -0700453/**
454 * @brief An enumeration of the type of ports that can be added
455 * to a bridge domain
456 */
457enum l2_port_type
458{
459 /* a 'normal' interface, i.e. not BVI or UU-Flood */
460 L2_API_PORT_TYPE_NORMAL = 0,
461 /* a BVI interface in the BD */
462 L2_API_PORT_TYPE_BVI = 1,
463 /* The interface on which to forward unknown unicast packets
464 * If this is not set for a BD then UU is flooded */
465 L2_API_PORT_TYPE_UU_FWD = 2,
466};
467
Neale Rannsb8d44812017-11-10 06:53:54 -0800468/** \brief Interface bridge mode request
469 @param client_index - opaque cookie to identify the sender
470 @param context - sender context, to match reply w/ request
471 @param rx_sw_if_index - the interface
472 @param bd_id - bridge domain id
Yichen Wang0a4e0062018-10-01 11:15:25 -0700473 @param port_type - port_mode, see #l2_port_type
Yichen Wang5c7c49d2018-09-18 17:32:29 -0700474 @param shg - Split horizon group, for bridge mode only
Neale Rannsb8d44812017-11-10 06:53:54 -0800475 @param enable - Enable beige mode if not 0, else set to L3 mode
476*/
Neale Rannsb4743802018-09-05 09:13:57 -0700477
Neale Rannsb8d44812017-11-10 06:53:54 -0800478autoreply define sw_interface_set_l2_bridge
479{
480 u32 client_index;
481 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200482 vl_api_interface_index_t rx_sw_if_index;
Neale Rannsb8d44812017-11-10 06:53:54 -0800483 u32 bd_id;
Neale Rannsb4743802018-09-05 09:13:57 -0700484 vl_api_l2_port_type_t port_type;
Neale Rannsb8d44812017-11-10 06:53:54 -0800485 u8 shg;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200486 bool enable [default=true];
Neale Rannsb8d44812017-11-10 06:53:54 -0800487};
488
489/** \brief Set bridge domain ip to mac entry request
490 @param client_index - opaque cookie to identify the sender
491 @param context - sender context, to match reply w/ request
492 @param bd_id - the bridge domain to set the flags for
493 @param is_add - if non-zero, add the entry, else clear it
Igor Mikhailov (imichail)54bc5e42019-05-08 16:01:01 -0700494 @param ip - ipv4 or ipv6 address
495 @param mac - MAC address
Neale Rannsb8d44812017-11-10 06:53:54 -0800496*/
Neale Rannsbc764c82019-06-19 07:07:13 -0700497
498typedef bd_ip_mac
499{
500 u32 bd_id;
501 vl_api_address_t ip;
502 vl_api_mac_address_t mac;
503};
504
Neale Rannsb8d44812017-11-10 06:53:54 -0800505autoreply define bd_ip_mac_add_del
506{
507 u32 client_index;
508 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200509 bool is_add [default=true];
Neale Rannsbc764c82019-06-19 07:07:13 -0700510 vl_api_bd_ip_mac_t entry;
Neale Rannsb8d44812017-11-10 06:53:54 -0800511};
512
John Loe26c81f2019-01-07 15:16:33 -0500513/** \brief Flush bridge domain IP to MAC entries
514 @param client_index - opaque cookie to identify the sender
515 @param bd_id - bridge domain identifier
516*/
517autoreply define bd_ip_mac_flush
518{
519 u32 client_index;
520 u32 context;
521 u32 bd_id;
522};
523
Mohsin Kazmi5d82d2f2018-08-13 19:17:54 +0200524/** \brief bridge domain IP to MAC entry details structure
525 @param bd_id - bridge domain table id
526 @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
527 @param ip_address - ipv4 or ipv6 address
528 @param mac_address - MAC address
529*/
530define bd_ip_mac_details
531{
532 u32 context;
Neale Rannsbc764c82019-06-19 07:07:13 -0700533 vl_api_bd_ip_mac_t entry;
Mohsin Kazmi5d82d2f2018-08-13 19:17:54 +0200534};
535
536/** \brief Dump bridge domain IP to MAC entries
537 @param client_index - opaque cookie to identify the sender
538 @param bd_id - bridge domain identifier
539*/
540define bd_ip_mac_dump
541{
542 u32 client_index;
543 u32 context;
544 u32 bd_id;
545};
546
Neale Rannsb8d44812017-11-10 06:53:54 -0800547/** \brief L2 interface ethernet flow point filtering enable/disable request
548 @param client_index - opaque cookie to identify the sender
549 @param context - sender context, to match reply w/ request
550 @param sw_if_index - interface to enable/disable filtering on
551 @param enable_disable - if non-zero enable filtering, else disable
552*/
553autoreply define l2_interface_efp_filter
554{
555 u32 client_index;
556 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200557 vl_api_interface_index_t sw_if_index;
558 bool enable_disable [default=true];
Neale Rannsb8d44812017-11-10 06:53:54 -0800559};
560
561/** \brief Interface set vpath request
562 @param client_index - opaque cookie to identify the sender
563 @param context - sender context, to match reply w/ request
564 @param sw_if_index - interface used to reach neighbor
565 @param enable - if non-zero enable, else disable
566*/
567autoreply define sw_interface_set_vpath
568{
569 u32 client_index;
570 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200571 vl_api_interface_index_t sw_if_index;
572 bool enable [default=0xffffffff];
Neale Rannsb8d44812017-11-10 06:53:54 -0800573};
574
Neale Ranns192b13f2019-03-15 02:16:20 -0700575/** \brief Create BVI interface instance request
576 @param client_index - opaque cookie to identify the sender
577 @param context - sender context, to match reply w/ request
578 @param mac_address - mac addr to assign to the interface if none-zero
579 @param user_instance - requested instance, ~0 => dynamically allocate
580*/
581define bvi_create
582{
583 u32 client_index;
584 u32 context;
585 vl_api_mac_address_t mac;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200586 u32 user_instance [default=0xffffffff];
Neale Ranns192b13f2019-03-15 02:16:20 -0700587};
588
589/** \brief Create BVI interface instance response
590 @param context - sender context, to match reply w/ request
591 @param sw_if_index - sw index of the interface that was created
592 @param retval - return code for the request
593*/
594define bvi_create_reply
595{
596 u32 context;
597 i32 retval;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200598 vl_api_interface_index_t sw_if_index;
Neale Ranns192b13f2019-03-15 02:16:20 -0700599};
600
601/** \brief Delete BVI interface request
602 @param client_index - opaque cookie to identify the sender
603 @param context - sender context, to match reply w/ request
604 @param sw_if_index - sw index of the interface that was created
605*/
606autoreply define bvi_delete
607{
608 u32 client_index;
609 u32 context;
Jakub Grajciar145e3302019-10-24 13:52:42 +0200610 vl_api_interface_index_t sw_if_index;
Neale Ranns192b13f2019-03-15 02:16:20 -0700611};
612
Neale Rannscbe25aa2019-09-30 10:53:31 +0000613/** \brief Register for IP4 ARP resolution event on receing ARP reply or
614 MAC/IP info from ARP requests in L2 BDs
615 @param client_index - opaque cookie to identify the sender
616 @param context - sender context, to match reply w/ request
617 @param enable - 1 => register for events, 0 => cancel registration
618 @param pid - sender's pid
619*/
620autoreply define want_l2_arp_term_events
621{
622 u32 client_index;
623 u32 context;
624 bool enable;
625 u32 pid;
626};
627
628/** \brief Tell client about an IP4 ARP resolution event or
629 MAC/IP info from ARP requests in L2 BDs
630 @param client_index - opaque cookie to identify the sender
631 @param pid - client pid registered to receive notification
632 @param ip - IP address of new ARP term entry
633 @param sw_if_index - interface of new ARP term entry
634 @param mac - MAC address of new ARP term entry
635*/
636define l2_arp_term_event
637{
638 u32 client_index;
639 u32 pid;
640 vl_api_address_t ip;
641 vl_api_interface_index_t sw_if_index;
642 vl_api_mac_address_t mac;
643};
644
645service {
646 rpc want_l2_arp_term_events returns want_l2_arp_term_events_reply
647 events l2_arp_term_event;
648};
649
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100650/*
651 * Local Variables:
652 * eval: (c-set-style "gnu")
653 * End:
654 */