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