Matus Fabian | f468e23 | 2016-12-02 06:00:53 -0800 | [diff] [blame] | 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 | |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 17 | vl_api_version 1.0.0 |
| 18 | |
Matus Fabian | f468e23 | 2016-12-02 06:00:53 -0800 | [diff] [blame] | 19 | /** \brief Reply to l2_xconnect_dump |
| 20 | @param context - sender context which was passed in the request |
| 21 | @param rx_sw_if_index - Receive interface index |
| 22 | @param tx_sw_if_index - Transmit interface index |
| 23 | */ |
| 24 | define l2_xconnect_details |
| 25 | { |
| 26 | u32 context; |
| 27 | u32 rx_sw_if_index; |
| 28 | u32 tx_sw_if_index; |
| 29 | }; |
| 30 | |
| 31 | /** \brief Dump L2 XConnects |
| 32 | @param client_index - opaque cookie to identify the sender |
| 33 | @param context - sender context, to match reply w/ request |
| 34 | */ |
| 35 | define l2_xconnect_dump |
| 36 | { |
| 37 | u32 client_index; |
| 38 | u32 context; |
| 39 | }; |
| 40 | |
Ole Troan | 01384fe | 2017-05-12 11:55:35 +0200 | [diff] [blame] | 41 | /** \brief l2 fib table details structure |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 42 | @param bd_id - the l2 fib / bridge domain table id |
| 43 | @param mac - the entry's mac address |
| 44 | @param sw_if_index - index of the interface |
| 45 | @param static_mac - the entry is statically configured. |
| 46 | @param filter_mac - the entry is a mac filter entry. |
| 47 | @param bvi_mac - the mac address is a bridge virtual interface |
| 48 | */ |
Ole Troan | 01384fe | 2017-05-12 11:55:35 +0200 | [diff] [blame] | 49 | define l2_fib_table_details |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 50 | { |
| 51 | u32 context; |
| 52 | u32 bd_id; |
| 53 | u64 mac; |
| 54 | u32 sw_if_index; |
| 55 | u8 static_mac; |
| 56 | u8 filter_mac; |
| 57 | u8 bvi_mac; |
| 58 | }; |
| 59 | |
| 60 | /** \brief Dump l2 fib (aka bridge domain) table |
| 61 | @param client_index - opaque cookie to identify the sender |
| 62 | @param bd_id - the l2 fib / bridge domain table identifier |
| 63 | */ |
| 64 | define l2_fib_table_dump |
| 65 | { |
| 66 | u32 client_index; |
| 67 | u32 context; |
| 68 | u32 bd_id; |
| 69 | }; |
| 70 | |
| 71 | /** \brief L2 fib clear table request, clear all mac entries in the l2 fib |
| 72 | @param client_index - opaque cookie to identify the sender |
| 73 | @param context - sender context, to match reply w/ request |
| 74 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 75 | autoreply define l2_fib_clear_table |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 76 | { |
| 77 | u32 client_index; |
| 78 | u32 context; |
| 79 | }; |
| 80 | |
Eyal Bari | 7537e71 | 2017-04-27 14:07:55 +0300 | [diff] [blame] | 81 | /** \brief L2 FIB flush all entries |
| 82 | @param client_index - opaque cookie to identify the sender |
| 83 | @param context - sender context, to match reply w/ request |
| 84 | */ |
| 85 | autoreply define l2fib_flush_all |
| 86 | { |
| 87 | u32 client_index; |
| 88 | u32 context; |
| 89 | }; |
| 90 | |
Eyal Bari | f24991c | 2017-04-05 05:33:21 +0300 | [diff] [blame] | 91 | /** \brief L2 FIB flush bridge domain entries |
| 92 | @param client_index - opaque cookie to identify the sender |
| 93 | @param context - sender context, to match reply w/ request |
| 94 | @param bd_id - the entry's bridge domain id |
| 95 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 96 | autoreply define l2fib_flush_bd |
Eyal Bari | f24991c | 2017-04-05 05:33:21 +0300 | [diff] [blame] | 97 | { |
| 98 | u32 client_index; |
| 99 | u32 context; |
| 100 | u32 bd_id; |
| 101 | }; |
| 102 | |
Eyal Bari | f24991c | 2017-04-05 05:33:21 +0300 | [diff] [blame] | 103 | /** \brief L2 FIB flush interface entries |
| 104 | @param client_index - opaque cookie to identify the sender |
| 105 | @param context - sender context, to match reply w/ request |
| 106 | @param bd_id - the entry's bridge domain id |
| 107 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 108 | autoreply define l2fib_flush_int |
Eyal Bari | f24991c | 2017-04-05 05:33:21 +0300 | [diff] [blame] | 109 | { |
| 110 | u32 client_index; |
| 111 | u32 context; |
| 112 | u32 sw_if_index; |
| 113 | }; |
| 114 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 115 | /** \brief L2 FIB add entry request |
| 116 | @param client_index - opaque cookie to identify the sender |
| 117 | @param context - sender context, to match reply w/ request |
| 118 | @param mac - the entry's mac address |
| 119 | @param bd_id - the entry's bridge domain id |
| 120 | @param sw_if_index - the interface |
| 121 | @param is_add - If non zero add the entry, else delete it |
| 122 | @param static_mac - |
| 123 | @param filter_mac - |
| 124 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 125 | autoreply define l2fib_add_del |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 126 | { |
| 127 | u32 client_index; |
| 128 | u32 context; |
| 129 | u64 mac; |
| 130 | u32 bd_id; |
| 131 | u32 sw_if_index; |
| 132 | u8 is_add; |
| 133 | u8 static_mac; |
| 134 | u8 filter_mac; |
| 135 | u8 bvi_mac; |
| 136 | }; |
| 137 | |
John Lo | 8d00fff | 2017-08-03 00:35:36 -0400 | [diff] [blame] | 138 | /** \brief Register to recive L2 MAC events for leanred and aged MAC |
John Lo | 8d00fff | 2017-08-03 00:35:36 -0400 | [diff] [blame] | 139 | @param client_index - opaque cookie to identify the sender |
| 140 | @param context - sender context, to match reply w/ request |
| 141 | @param learn_limit - MAC learn limit, 0 => default to 1000 |
| 142 | @param scan_delay - event scan delay in 10 msec unit, 0 => default to 100 msec |
| 143 | @param max_macs_in_event - in units of 10 mac entries, 0 => default to 100 entries |
| 144 | @param enable_disable - 1 => register for MAC events, 0 => cancel registration |
| 145 | @param pid - sender's pid |
| 146 | */ |
| 147 | autoreply define want_l2_macs_events |
| 148 | { |
| 149 | u32 client_index; |
| 150 | u32 context; |
| 151 | u32 learn_limit; |
| 152 | u8 scan_delay; |
| 153 | u8 max_macs_in_event; |
| 154 | u8 enable_disable; |
| 155 | u32 pid; |
| 156 | }; |
| 157 | |
| 158 | /** \brief Entry for learned or aged MAC in L2 MAC Events |
| 159 | @param sw_if_index - sw_if_index in the domain |
| 160 | @param mac_addr - mac_address |
| 161 | @is_del - 0 => newly learned MAC, 1 => aged out MAC |
| 162 | */ |
| 163 | typeonly define mac_entry |
| 164 | { |
| 165 | u32 sw_if_index; |
| 166 | u8 mac_addr[6]; |
| 167 | u8 is_del; |
| 168 | u8 spare; |
| 169 | }; |
| 170 | |
| 171 | /** \brief L2 MAC event for a list of learned or aged MACs |
| 172 | @param client_index - opaque cookie to identify the sender |
| 173 | @param pid - client pid registered to receive notification |
| 174 | @param n_macs - number of learned/aged MAC enntries |
| 175 | @param mac - array of learned/aged MAC entries |
| 176 | */ |
| 177 | define l2_macs_event |
| 178 | { |
| 179 | u32 client_index; |
| 180 | u32 pid; |
| 181 | u32 n_macs; |
| 182 | vl_api_mac_entry_t mac[n_macs]; |
| 183 | }; |
| 184 | |
| 185 | /** \brief Set interface L2 flags (such as L2_LEARN, L2_FWD, |
| 186 | L2_FLOOD, L2_UU_FLOOD, or L2_ARP_TERM bits). This can be used |
| 187 | to disable one or more of the features represented by the |
| 188 | flag bits on an interface to override what is set as default |
| 189 | for all interfaces in the bridge domain |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 190 | @param client_index - opaque cookie to identify the sender |
| 191 | @param context - sender context, to match reply w/ request |
| 192 | @param sw_if_index - interface |
| 193 | @param is_set - if non-zero, set the bits, else clear them |
John Lo | 8d00fff | 2017-08-03 00:35:36 -0400 | [diff] [blame] | 194 | @param feature_bitmap - non-zero bits (as above) to set or clear |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 195 | */ |
| 196 | define l2_flags |
| 197 | { |
| 198 | u32 client_index; |
| 199 | u32 context; |
| 200 | u32 sw_if_index; |
| 201 | u8 is_set; |
| 202 | u32 feature_bitmap; |
| 203 | }; |
| 204 | |
John Lo | 8d00fff | 2017-08-03 00:35:36 -0400 | [diff] [blame] | 205 | /** \brief Set interface L2 flags response |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 206 | @param context - sender context, to match reply w/ request |
| 207 | @param retval - return code for the set l2 bits request |
John Lo | 8d00fff | 2017-08-03 00:35:36 -0400 | [diff] [blame] | 208 | @param resulting_feature_bitmap - the internal l2 feature bitmap after the request is implemented |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 209 | */ |
| 210 | define l2_flags_reply |
| 211 | { |
| 212 | u32 context; |
| 213 | i32 retval; |
| 214 | u32 resulting_feature_bitmap; |
| 215 | }; |
| 216 | |
Eyal Bari | fead670 | 2017-04-04 04:46:32 +0300 | [diff] [blame] | 217 | /** \brief L2 bridge domain set mac age |
| 218 | @param client_index - opaque cookie to identify the sender |
| 219 | @param context - sender context, to match reply w/ request |
| 220 | @param bd_id - the bridge domain to create |
| 221 | @param mac_age - mac aging time in min, 0 for disabled |
| 222 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 223 | autoreply define bridge_domain_set_mac_age |
Eyal Bari | fead670 | 2017-04-04 04:46:32 +0300 | [diff] [blame] | 224 | { |
| 225 | u32 client_index; |
| 226 | u32 context; |
| 227 | u32 bd_id; |
| 228 | u8 mac_age; |
| 229 | }; |
| 230 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 231 | /** \brief L2 bridge domain add or delete request |
| 232 | @param client_index - opaque cookie to identify the sender |
| 233 | @param context - sender context, to match reply w/ request |
| 234 | @param bd_id - the bridge domain to create |
| 235 | @param flood - enable/disable bcast/mcast flooding in the bd |
| 236 | @param uu_flood - enable/disable uknown unicast flood in the bd |
| 237 | @param forward - enable/disable forwarding on all interfaces in the bd |
| 238 | @param learn - enable/disable learning on all interfaces in the bd |
| 239 | @param arp_term - enable/disable arp termination in the bd |
| 240 | @param mac_age - mac aging time in min, 0 for disabled |
| 241 | @param is_add - add or delete flag |
| 242 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 243 | autoreply define bridge_domain_add_del |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 244 | { |
| 245 | u32 client_index; |
| 246 | u32 context; |
| 247 | u32 bd_id; |
| 248 | u8 flood; |
| 249 | u8 uu_flood; |
| 250 | u8 forward; |
| 251 | u8 learn; |
| 252 | u8 arp_term; |
| 253 | u8 mac_age; |
Jerome Tollet | 4830414 | 2017-09-05 12:13:22 +0100 | [diff] [blame] | 254 | u8 bd_tag[64]; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 255 | u8 is_add; |
| 256 | }; |
| 257 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 258 | /** \brief L2 bridge domain request operational state details |
| 259 | @param client_index - opaque cookie to identify the sender |
| 260 | @param context - sender context, to match reply w/ request |
| 261 | @param bd_id - the bridge domain id desired or ~0 to request all bds |
| 262 | */ |
| 263 | define bridge_domain_dump |
| 264 | { |
| 265 | u32 client_index; |
| 266 | u32 context; |
| 267 | u32 bd_id; |
| 268 | }; |
| 269 | |
Ole Troan | 01384fe | 2017-05-12 11:55:35 +0200 | [diff] [blame] | 270 | /** \brief L2 bridge domain sw interface operational state response |
| 271 | @param bd_id - the bridge domain id |
| 272 | @param sw_if_index - sw_if_index in the domain |
| 273 | @param shg - split horizon group for the interface |
| 274 | */ |
| 275 | typeonly manual_print manual_endian define bridge_domain_sw_if |
| 276 | { |
| 277 | u32 context; |
| 278 | u32 sw_if_index; |
| 279 | u8 shg; |
| 280 | }; |
| 281 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 282 | /** \brief L2 bridge domain operational state response |
| 283 | @param bd_id - the bridge domain id |
| 284 | @param flood - bcast/mcast flooding state on all interfaces in the bd |
| 285 | @param uu_flood - uknown unicast flooding state on all interfaces in the bd |
| 286 | @param forward - forwarding state on all interfaces in the bd |
| 287 | @param learn - learning state on all interfaces in the bd |
| 288 | @param arp_term - arp termination state on all interfaces in the bd |
| 289 | @param mac_age - mac aging time in min, 0 for disabled |
Jerome Tollet | 50570ec | 2017-09-14 12:53:56 +0100 | [diff] [blame] | 290 | @param bd_tag - optional textual tag for the bridge domain |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 291 | @param n_sw_ifs - number of sw_if_index's in the domain |
| 292 | */ |
Ole Troan | 01384fe | 2017-05-12 11:55:35 +0200 | [diff] [blame] | 293 | manual_print manual_endian define bridge_domain_details |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 294 | { |
| 295 | u32 context; |
| 296 | u32 bd_id; |
| 297 | u8 flood; |
| 298 | u8 uu_flood; |
| 299 | u8 forward; |
| 300 | u8 learn; |
| 301 | u8 arp_term; |
| 302 | u8 mac_age; |
Jerome Tollet | 4830414 | 2017-09-05 12:13:22 +0100 | [diff] [blame] | 303 | u8 bd_tag[64]; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 304 | u32 bvi_sw_if_index; |
| 305 | u32 n_sw_ifs; |
Ole Troan | 01384fe | 2017-05-12 11:55:35 +0200 | [diff] [blame] | 306 | vl_api_bridge_domain_sw_if_t sw_if_details[n_sw_ifs]; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 307 | }; |
| 308 | |
| 309 | /** \brief Set bridge flags (such as L2_LEARN, L2_FWD, L2_FLOOD, |
John Lo | 8d00fff | 2017-08-03 00:35:36 -0400 | [diff] [blame] | 310 | L2_UU_FLOOD, or L2_ARP_TERM bits) request |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 311 | @param client_index - opaque cookie to identify the sender |
| 312 | @param context - sender context, to match reply w/ request |
| 313 | @param bd_id - the bridge domain to set the flags for |
| 314 | @param is_set - if non-zero, set the flags, else clear them |
John Lo | 8d00fff | 2017-08-03 00:35:36 -0400 | [diff] [blame] | 315 | @param feature_bitmap - bits (as above) that are non-zero to set or clear |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 316 | */ |
| 317 | define bridge_flags |
| 318 | { |
| 319 | u32 client_index; |
| 320 | u32 context; |
| 321 | u32 bd_id; |
| 322 | u8 is_set; |
| 323 | u32 feature_bitmap; |
| 324 | }; |
| 325 | |
| 326 | /** \brief Set bridge flags response |
| 327 | @param context - sender context, to match reply w/ request |
| 328 | @param retval - return code for the set bridge flags request |
John Lo | 8d00fff | 2017-08-03 00:35:36 -0400 | [diff] [blame] | 329 | @param resulting_feature_bitmap - the internal L2 feature bitmap after the request is implemented |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 330 | */ |
| 331 | define bridge_flags_reply |
| 332 | { |
| 333 | u32 context; |
| 334 | i32 retval; |
| 335 | u32 resulting_feature_bitmap; |
| 336 | }; |
| 337 | |
Pavel Kotucek | adec587 | 2017-01-25 08:50:53 +0100 | [diff] [blame] | 338 | /** \brief L2 interface vlan tag rewrite configure request |
| 339 | @param client_index - opaque cookie to identify the sender |
| 340 | @param context - sender context, to match reply w/ request |
| 341 | @param sw_if_index - interface the operation is applied to |
| 342 | @param vtr_op - Choose from l2_vtr_op_t enum values |
| 343 | @param push_dot1q - first pushed flag dot1q id set, else dot1ad |
| 344 | @param tag1 - Needed for any push or translate vtr op |
| 345 | @param tag2 - Needed for any push 2 or translate x-2 vtr ops |
| 346 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 347 | autoreply define l2_interface_vlan_tag_rewrite |
Pavel Kotucek | adec587 | 2017-01-25 08:50:53 +0100 | [diff] [blame] | 348 | { |
| 349 | u32 client_index; |
| 350 | u32 context; |
| 351 | u32 sw_if_index; |
| 352 | u32 vtr_op; |
| 353 | u32 push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad |
| 354 | u32 tag1; // first pushed tag |
| 355 | u32 tag2; // second pushed tag |
| 356 | }; |
| 357 | |
Pavel Kotucek | adec587 | 2017-01-25 08:50:53 +0100 | [diff] [blame] | 358 | /** \brief L2 interface pbb tag rewrite configure request |
| 359 | @param client_index - opaque cookie to identify the sender |
| 360 | @param context - sender context, to match reply w/ request |
| 361 | @param sw_if_index - interface the operation is applied to |
| 362 | @param vtr_op - Choose from l2_vtr_op_t enum values |
| 363 | @param inner_tag - needed for translate_qinq vtr op only |
| 364 | @param outer_tag - needed for translate_qinq vtr op only |
| 365 | @param b_dmac - B-tag remote mac address, needed for any push or translate_qinq vtr op |
| 366 | @param b_smac - B-tag local mac address, needed for any push or translate qinq vtr op |
| 367 | @param b_vlanid - B-tag vlanid, needed for any push or translate qinq vtr op |
| 368 | @param i_sid - I-tag service id, needed for any push or translate qinq vtr op |
| 369 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 370 | autoreply define l2_interface_pbb_tag_rewrite |
Pavel Kotucek | adec587 | 2017-01-25 08:50:53 +0100 | [diff] [blame] | 371 | { |
| 372 | u32 client_index; |
| 373 | u32 context; |
| 374 | u32 sw_if_index; |
| 375 | u32 vtr_op; |
| 376 | u16 outer_tag; |
| 377 | u8 b_dmac[6]; |
| 378 | u8 b_smac[6]; |
| 379 | u16 b_vlanid; |
| 380 | u32 i_sid; |
| 381 | }; |
| 382 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 383 | /* |
| 384 | * Local Variables: |
| 385 | * eval: (c-set-style "gnu") |
| 386 | * End: |
| 387 | */ |