trill.h (15428B)
1 /* 2 * 3 * 4 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 * 6 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 7 * 8 * DO NOT EDIT THIS FILE! 9 * This file is auto-generated. 10 * Edits to this file will be lost when it is regenerated. 11 */ 12 13 #ifndef __BCM_TRILL_H__ 14 #define __BCM_TRILL_H__ 15 16 #if defined(INCLUDE_L3) 17 18 #include <bcm/types.h> 19 #include <bcm/multicast.h> 20 #include <bcm/l3.h> 21 22 #if defined(INCLUDE_L3) 23 /* BCM_TRILL_* flags. */ 24 #define BCM_TRILL_PORT_WITH_ID (1 << 0) /* create trill port with 25 specified ID */ 26 #define BCM_TRILL_PORT_DROP (1 << 1) /* Drop matching packets */ 27 #define BCM_TRILL_PORT_COPYTOCPU (1 << 2) /* Copy matching packets 28 to CPU */ 29 #define BCM_TRILL_PORT_NETWORK (1 << 3) /* Network facing 30 interface */ 31 #define BCM_TRILL_PORT_UNICAST BCM_TRILL_PORT_NETWORK /* Create Unicast Rbridge */ 32 #define BCM_TRILL_PORT_COUNTED (1 << 4) /* Maintain packet/byte 33 counts */ 34 #define BCM_TRILL_PORT_REPLACE (1 << 5) /* Replace existing entry */ 35 #define BCM_TRILL_PORT_MULTICAST (1 << 6) /* Create Root RBridge */ 36 #define BCM_TRILL_PORT_LOCAL (1 << 7) /* Create Local RBridge */ 37 #define BCM_TRILL_MULTICAST_ACCESS_TO_NETWORK (1 << 8) /* Multicast from Access 38 to Network */ 39 #define BCM_TRILL_MULTICAST_ESADI (1 << 9) /* Use ESADI bit as a 40 part of the MC key */ 41 #define BCM_TRILL_MULTICAST_STATIC (1 << 10) /* Trill multicast 42 entries are marked as 43 static, not aged out */ 44 #define BCM_TRILL_PORT_VIRTUAL (1 << 11) /* Virtual/pseudo 45 nicknames for trill 46 multi homing support */ 47 #define BCM_TRILL_PORT_TUNNEL (1 << 12) /* Create unicast Rbridge 48 without transit 49 functionality */ 50 #define BCM_TRILL_PORT_INGRESS (1 << 13) /* Create Ingress Rbridge */ 51 #define BCM_TRILL_PORT_EGRESS (1 << 14) /* Create Egress Rbridge */ 52 #define BCM_TRILL_MULTICAST_TRANSPARENT_SERVICE (1 << 15) /* Trill multicast 53 transparent service */ 54 #define BCM_TRILL_PORT_TERM_ETHERNET (1 << 16) /* Terminate Ethernet 55 header after 56 terminated Trill */ 57 #define BCM_TRILL_PORT_INGRESS_WIDE (1 << 17) /* Create Trill port Wide 58 mode */ 59 #define BCM_TRILL_MULTICAST_REPLACE_DYNAMIC (1 << 18) /* Replace an existing L2 60 entry with TRILL 61 entry, when table is 62 full */ 63 #endif 64 65 #if defined(INCLUDE_L3) 66 /* Trill VPN Flags. */ 67 #define BCM_BCM_TRILL_VPN 0x00000001 /* TRILL Fine Grained VPN */ 68 #define BCM_BCM_TRILL_VPN_WITH_ID 0x00000002 /* Create VPN with 69 specified ID */ 70 #define BCM_BCM_TRILL_VPN_REPLACE 0x00000004 /* Replace attributes of 71 an existing VPN */ 72 #define BCM_BCM_TRILL_VPN_ACCESS 0x00000008 /* For mapping vpn -> 73 high+low vid */ 74 #define BCM_BCM_TRILL_VPN_NETWORK 0x00000010 /* For mapping high+low 75 vid -> vpn */ 76 #define BCM_BCM_TRILL_VPN_INVALID 0x00000020 /* Invalid TRILL VPN */ 77 #define BCM_TRILL_VPN_TRANSPARENT_SERVICE 0x00000040 /* Create VPN with 78 transparent service */ 79 #endif 80 81 #if defined(INCLUDE_L3) 82 /* Trill VPN structure. */ 83 typedef struct bcm_trill_vpn_config_s { 84 uint32 flags; /* Configuration flags */ 85 bcm_vpn_t vpn; /* VPN ID. */ 86 bcm_vlan_t high_vid; /* Outer vlan */ 87 bcm_vlan_t low_vid; /* Inner vlan */ 88 bcm_multicast_t broadcast_group; /* Broadcast group */ 89 bcm_multicast_t unknown_unicast_group; /* Unknown unicast group */ 90 bcm_multicast_t unknown_multicast_group; /* Unknown multicast group */ 91 } bcm_trill_vpn_config_t; 92 #endif 93 94 #if defined(INCLUDE_L3) 95 /* TRILL port type. */ 96 typedef struct bcm_trill_port_s { 97 bcm_gport_t trill_port_id; /* GPORT identifier. */ 98 uint32 flags; /* BCM_TRILL_PORT_xxx. */ 99 int if_class; /* Interface class ID. */ 100 bcm_gport_t port; /* Match port and/or egress port. */ 101 bcm_if_t egress_if; /* TRILL egress object. */ 102 bcm_trill_name_t name; /* Destination RBridge Nickname. */ 103 int mtu; /* TRILL port MTU. */ 104 int hopcount; /* Unicast Hopcount for TRILL. */ 105 int multicast_hopcount; /* Multicast Hopcount for TRILL. */ 106 bcm_if_t encap_id; /* Encap Identifier. */ 107 bcm_trill_name_t virtual_name; /* Virtual RBridge Nickname */ 108 bcm_switch_network_group_t network_group_id; /* Split Horizon network group 109 identifier. */ 110 int inlif_counting_profile; /* In LIF counting profile */ 111 int outlif_counting_profile; /* Out LIF counting profile */ 112 } bcm_trill_port_t; 113 #endif 114 115 #if defined(INCLUDE_L3) 116 /* Initialize the TRILL port structure. */ 117 extern void bcm_trill_port_t_init( 118 bcm_trill_port_t *trill_port); 119 #endif 120 121 /* Initialize the TRILL VPN config structure. */ 122 extern void bcm_trill_vpn_config_t_init( 123 bcm_trill_vpn_config_t *trill_vpn_config); 124 125 #ifndef BCM_HIDE_DISPATCHABLE 126 127 #if defined(INCLUDE_L3) 128 /* Initialize trill module. */ 129 extern int bcm_trill_init( 130 int unit); 131 #endif 132 133 #if defined(INCLUDE_L3) 134 /* Detach trill module. */ 135 extern int bcm_trill_cleanup( 136 int unit); 137 #endif 138 139 #if defined(INCLUDE_L3) 140 /* Add Trill port to TRILL Cloud. */ 141 extern int bcm_trill_port_add( 142 int unit, 143 bcm_trill_port_t *trill_port); 144 #endif 145 146 #if defined(INCLUDE_L3) 147 /* Delete Trill port from TRILL Cloud. */ 148 extern int bcm_trill_port_delete( 149 int unit, 150 bcm_gport_t trill_port_id); 151 #endif 152 153 #if defined(INCLUDE_L3) 154 /* Delete all Trill ports from TRILL Cloud. */ 155 extern int bcm_trill_port_delete_all( 156 int unit); 157 #endif 158 159 #if defined(INCLUDE_L3) 160 /* Get a TRILL port */ 161 extern int bcm_trill_port_get( 162 int unit, 163 bcm_trill_port_t *trill_port); 164 #endif 165 166 #if defined(INCLUDE_L3) 167 /* Get all TRILL ports */ 168 extern int bcm_trill_port_get_all( 169 int unit, 170 int port_max, 171 bcm_trill_port_t *port_array, 172 int *port_count); 173 #endif 174 175 #endif /* BCM_HIDE_DISPATCHABLE */ 176 177 #if defined(INCLUDE_L3) 178 /* RBridge TRILL port. */ 179 typedef struct bcm_trill_rbridge_s { 180 uint32 flags; /* BCM_TRILL_RBRIDGE_xxx. */ 181 bcm_trill_name_t name; /* RBridge Nickname. */ 182 bcm_if_t egress_if; /* TRILL egress object. */ 183 int mtu; /* TRILL port MTU. */ 184 int hopcount; /* Hopcount for TRILL. */ 185 } bcm_trill_rbridge_t; 186 #endif 187 188 #ifndef BCM_HIDE_DISPATCHABLE 189 190 #if defined(INCLUDE_L3) 191 /* Add Trill RBridge entry. */ 192 extern int bcm_trill_rbridge_entry_add( 193 int unit, 194 bcm_trill_rbridge_t *trill_entry); 195 #endif 196 197 #if defined(INCLUDE_L3) 198 /* Add Trill RBridge entry. */ 199 extern int bcm_trill_rbridge_entry_delete( 200 int unit, 201 bcm_trill_rbridge_t *trill_entry); 202 #endif 203 204 #if defined(INCLUDE_L3) 205 /* Get Trill RBridge entry. */ 206 extern int bcm_trill_rbridge_entry_get( 207 int unit, 208 bcm_trill_rbridge_t *trill_entry); 209 #endif 210 211 #endif /* BCM_HIDE_DISPATCHABLE */ 212 213 #if defined(INCLUDE_L3) 214 /* TRILL Multicast Entry. */ 215 typedef struct bcm_trill_multicast_entry_s { 216 uint32 flags; /* BCM_TRILL_MULTICAST_xxx. */ 217 bcm_trill_name_t root_name; /* Trill Root Rbridge. */ 218 bcm_vlan_t c_vlan; /* Customer Vlan */ 219 bcm_mac_t c_dmac; /* Customer Destination MAC Address. */ 220 bcm_multicast_t group; /* TRILL Multicast Group */ 221 bcm_if_t encap_intf; /* RPF interface for Multipath. */ 222 bcm_vlan_t c_vlan_inner; /* low-vlan, when using fine-grained trill, and 223 customer ethernet header is double-tagged */ 224 } bcm_trill_multicast_entry_t; 225 #endif 226 227 #if defined(INCLUDE_L3) 228 /* Initialize the TRILL multicast entry structure. */ 229 extern void bcm_trill_multicast_entry_t_init( 230 bcm_trill_multicast_entry_t *trill_multicast_entry); 231 #endif 232 233 #ifndef BCM_HIDE_DISPATCHABLE 234 235 #if defined(INCLUDE_L3) 236 /* Add TRILL multicast entry */ 237 extern int bcm_trill_multicast_entry_add( 238 int unit, 239 bcm_trill_multicast_entry_t *trill_mc_entry); 240 #endif 241 242 #if defined(INCLUDE_L3) 243 /* Delete TRILL multicast entry */ 244 extern int bcm_trill_multicast_entry_delete( 245 int unit, 246 bcm_trill_multicast_entry_t *trill_mc_entry); 247 #endif 248 249 #if defined(INCLUDE_L3) 250 /* Get TRILL multicast entry */ 251 extern int bcm_trill_multicast_entry_get( 252 int unit, 253 bcm_trill_multicast_entry_t *trill_mc_entry); 254 #endif 255 256 #endif /* BCM_HIDE_DISPATCHABLE */ 257 258 /* TRILL multicast traverse function prototype. */ 259 #if defined(INCLUDE_L3) 260 typedef int (*bcm_trill_multicast_entry_traverse_cb)( 261 int unit, 262 bcm_trill_multicast_entry_t *trill_mc_entry, 263 void *user_data); 264 #endif 265 266 #ifndef BCM_HIDE_DISPATCHABLE 267 268 #if defined(INCLUDE_L3) 269 /* 270 * Traverse all valid TRILL Multicast entries and call the supplied 271 * callback routine. 272 */ 273 extern int bcm_trill_multicast_entry_traverse( 274 int unit, 275 bcm_trill_multicast_entry_traverse_cb cb, 276 void *user_data); 277 #endif 278 279 #if defined(INCLUDE_L3) 280 /* Delete all TRILL multicast entries */ 281 extern int bcm_trill_multicast_delete_all( 282 int unit, 283 bcm_trill_name_t root_name); 284 #endif 285 286 #if defined(INCLUDE_L3) 287 /* Add TRILL multicast RPF entry */ 288 extern int bcm_trill_multicast_source_add( 289 int unit, 290 bcm_trill_name_t root_name, 291 bcm_trill_name_t source_rbridge_name, 292 bcm_gport_t port, 293 bcm_if_t encap_intf); 294 #endif 295 296 #if defined(INCLUDE_L3) 297 /* Delete TRILL multicast RPF entry */ 298 extern int bcm_trill_multicast_source_delete( 299 int unit, 300 bcm_trill_name_t root_name, 301 bcm_trill_name_t source_rbridge_name, 302 bcm_gport_t port, 303 bcm_if_t encap_intf); 304 #endif 305 306 #if defined(INCLUDE_L3) 307 /* Get TRILL Multicast RPF entry */ 308 extern int bcm_trill_multicast_source_get( 309 int unit, 310 bcm_trill_name_t root_name, 311 bcm_trill_name_t source_rbridge_name, 312 bcm_gport_t *port); 313 #endif 314 315 #endif /* BCM_HIDE_DISPATCHABLE */ 316 317 /* TRILL multicast RPF traverse function prototype. */ 318 #if defined(INCLUDE_L3) 319 typedef int (*bcm_trill_multicast_source_traverse_cb)( 320 int unit, 321 bcm_trill_name_t root_name, 322 bcm_trill_name_t source_rbridge_name, 323 bcm_gport_t port, 324 void *user_data); 325 #endif 326 327 #ifndef BCM_HIDE_DISPATCHABLE 328 329 #if defined(INCLUDE_L3) 330 /* 331 * Traverse all valid TRILL Multicast RPF entries and call the supplied 332 * callback routine. 333 */ 334 extern int bcm_trill_multicast_source_traverse( 335 int unit, 336 bcm_trill_multicast_source_traverse_cb cb, 337 void *user_data); 338 #endif 339 340 #endif /* BCM_HIDE_DISPATCHABLE */ 341 342 #if defined(INCLUDE_L3) 343 /* TRILL multicast adjacency entry. */ 344 typedef struct bcm_trill_multicast_adjacency_s { 345 bcm_gport_t port; /* Match Trill network port. */ 346 uint32 flags; /* BCM_TRILL_MULTICAST_ADJACENCY_xxx. */ 347 bcm_if_t encap_intf; /* Neighbor interface. */ 348 } bcm_trill_multicast_adjacency_t; 349 #endif 350 351 #ifndef BCM_HIDE_DISPATCHABLE 352 353 #if defined(INCLUDE_L3) 354 /* Add Trill multicast adjacency. */ 355 extern int bcm_trill_multicast_adjacency_add( 356 int unit, 357 bcm_trill_multicast_adjacency_t *trill_multicast_adjacency); 358 #endif 359 360 #if defined(INCLUDE_L3) 361 /* Delete Trill multicast adjacency. */ 362 extern int bcm_trill_multicast_adjacency_delete( 363 int unit, 364 bcm_trill_multicast_adjacency_t *trill_multicast_adjacency); 365 #endif 366 367 #if defined(INCLUDE_L3) 368 /* Delete All Trill multicast adjacency. */ 369 extern int bcm_trill_multicast_adjacency_delete_all( 370 int unit); 371 #endif 372 373 #endif /* BCM_HIDE_DISPATCHABLE */ 374 375 /* Trill multicast adjacency callback function prototype. */ 376 #if defined(INCLUDE_L3) 377 typedef int (*bcm_trill_multicast_adjacency_traverse_cb)( 378 int unit, 379 bcm_trill_multicast_adjacency_t *info, 380 void *user_data); 381 #endif 382 383 #ifndef BCM_HIDE_DISPATCHABLE 384 385 #if defined(INCLUDE_L3) 386 /* 387 * Traverse all valid TRILL multicast adjacency entries and call supplied 388 * callback routine 389 */ 390 extern int bcm_trill_multicast_adjacency_traverse( 391 int unit, 392 bcm_trill_multicast_adjacency_traverse_cb cb, 393 void *user_data); 394 #endif 395 396 #endif /* BCM_HIDE_DISPATCHABLE */ 397 398 #if defined(INCLUDE_L3) 399 /* TRILL statistics counters. */ 400 typedef enum bcm_trill_stat_e { 401 bcmTrillInPkts = 0, 402 bcmTrillOutPkts = 1, 403 bcmTrillErrorPkts = 2, 404 bcmTrillNameMissPkts = 3, 405 bcmTrillRpfFailPkts = 4, 406 bcmTrillTtlFailPkts = 5 407 } bcm_trill_stat_t; 408 #endif 409 410 #ifndef BCM_HIDE_DISPATCHABLE 411 412 #if defined(INCLUDE_L3) 413 /* bcm_trill_stat_get */ 414 extern int bcm_trill_stat_get( 415 int unit, 416 bcm_port_t port, 417 bcm_trill_stat_t stat, 418 uint64 *val); 419 #endif 420 421 #if defined(INCLUDE_L3) 422 /* bcm_trill_stat_get32 */ 423 extern int bcm_trill_stat_get32( 424 int unit, 425 bcm_port_t port, 426 bcm_trill_stat_t stat, 427 uint32 *val); 428 #endif 429 430 #if defined(INCLUDE_L3) 431 /* bcm_trill_stat_clear */ 432 extern int bcm_trill_stat_clear( 433 int unit, 434 bcm_port_t port, 435 bcm_trill_stat_t stat); 436 #endif 437 438 #if defined(INCLUDE_L3) 439 /* Create a VPN instance. */ 440 extern int bcm_trill_vpn_create( 441 int unit, 442 bcm_trill_vpn_config_t *info); 443 #endif 444 445 #if defined(INCLUDE_L3) 446 /* Delete a VPN instance. */ 447 extern int bcm_trill_vpn_destroy( 448 int unit, 449 bcm_vpn_t vpn); 450 #endif 451 452 #if defined(INCLUDE_L3) 453 /* Delete all VPN instances. */ 454 extern int bcm_trill_vpn_destroy_all( 455 int unit); 456 #endif 457 458 #if defined(INCLUDE_L3) 459 /* Get a VPN instance by ID. */ 460 extern int bcm_trill_vpn_get( 461 int unit, 462 bcm_vpn_t vpn, 463 bcm_trill_vpn_config_t *info); 464 #endif 465 466 #endif /* BCM_HIDE_DISPATCHABLE */ 467 468 /* Trill VPN callback function prototype. */ 469 #if defined(INCLUDE_L3) 470 typedef int (*bcm_trill_vpn_traverse_cb)( 471 int unit, 472 bcm_trill_vpn_config_t *info, 473 void *user_data); 474 #endif 475 476 #ifndef BCM_HIDE_DISPATCHABLE 477 478 #if defined(INCLUDE_L3) 479 /* bcm_trill_vpn_traverse */ 480 extern int bcm_trill_vpn_traverse( 481 int unit, 482 bcm_trill_vpn_traverse_cb cb, 483 void *user_data); 484 #endif 485 486 #endif /* defined(INCLUDE_L3) */ 487 488 #endif /* BCM_HIDE_DISPATCHABLE */ 489 490 #endif /* __BCM_TRILL_H__ */