openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

multicast.h (23580B)


      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_MULTICAST_H__
     14 #define __BCM_MULTICAST_H__
     15 
     16 #include <bcm/types.h>
     17 #include <shared/multicast.h>
     18 
     19 #define BCM_MULTICAST_INVALID   0          
     20 
     21 /* Mulicast flags. */
     22 #define BCM_MULTICAST_WITH_ID               0x00000001 
     23 #define BCM_MULTICAST_TYPE_L2               0x00010000 
     24 #define BCM_MULTICAST_TYPE_L3               0x00020000 
     25 #define BCM_MULTICAST_TYPE_VPLS             0x00040000 
     26 #define BCM_MULTICAST_TYPE_SUBPORT          0x00080000 
     27 #define BCM_MULTICAST_TYPE_MIM              0x00100000 
     28 #define BCM_MULTICAST_TYPE_WLAN             0x00200000 
     29 #define BCM_MULTICAST_TYPE_VLAN             0x00400000 
     30 #define BCM_MULTICAST_TYPE_TRILL            0x00800000 
     31 #define BCM_MULTICAST_TYPE_NIV              0x01000000 
     32 #define BCM_MULTICAST_TYPE_EGRESS_OBJECT    0x02000000 
     33 #define BCM_MULTICAST_TYPE_L2GRE            0x04000000 
     34 #define BCM_MULTICAST_TYPE_VXLAN            0x08000000 
     35 #define BCM_MULTICAST_TYPE_EXTENDER         0x10000000 
     36 #define BCM_MULTICAST_TYPE_MAC              0x20000000 
     37 #define BCM_MULTICAST_TYPE_PORTS_GROUP      0x40000000 
     38 #define BCM_MULTICAST_TYPE_FLOW             0x80000000 
     39 #define BCM_MULTICAST_TYPE_MASK             0xffff0000 
     40 #define BCM_MULTICAST_DISABLE_SRC_KNOCKOUT  0x00000002 
     41 #define BCM_MULTICAST_INGRESS_GROUP         0x00000004 
     42 #define BCM_MULTICAST_EGRESS_GROUP          0x00000008 
     43 #define BCM_MULTICAST_INGRESS_MMC_BUFFERS   0x00000010 
     44 
     45 /* Multicast Type (for bcm_multicast_type). */
     46 typedef enum bcm_multicast_type_e {
     47     bcmMulticastTypeL2 = 1,             /* Multicast type L2 */
     48     bcmMulticastTypeL3 = 2,             /* Multicast type L3 */
     49     bcmMulticastTypeVpls = 3,           /* Multicast type VPLS */
     50     bcmMulticastTypeSubPort = 4,        /* Multicast type Sub Port */
     51     bcmMulticastTypeMim = 5,            /* Multicast type MIM */
     52     bcmMulticastTypeWlan = 6,           /* Multicast type Wlan */
     53     bcmMulticastTypeVlan = 7,           /* Multicast type Vlan */
     54     bcmMulticastTypeTrill = 8,          /* Multicast type TRILL */
     55     bcmMulticastTypeNiv = 9,            /* Multicast type NIV */
     56     bcmMulticastTypeEgressObject = 10,  /* Multicast type Egress Object */
     57     bcmMulticastTypeL2Gre = 11,         /* Multicast type L2 GRE */
     58     bcmMulticastTypeVxlan = 12,         /* Multicast type Vxlan */
     59     bcmMulticastTypePortsGroup = 13,    /* Multicast type Ports Group */
     60     bcmMulticastTypeExtender = 14,      /* Multicast type Extender */
     61     bcmMulticastTypeMac = 15,           /* Multicast type MAC */
     62     bcmMulticastTypeFlow = 16,          /* Multicast type Flow */
     63     bcmMulticastTypeCount = 17          /* Multicast type Count */
     64 } bcm_multicast_type_t;
     65 
     66 #define BCM_MULTICASTTYPE_STRINGS \
     67 { \
     68     "L2", \
     69     "L3", \
     70     "Vpls", \
     71     "SubPort", \
     72     "Mim", \
     73     "Wlan", \
     74     "Vlan", \
     75     "Trill", \
     76     "Niv", \
     77     "EgressObject", \
     78     "L2Gre", \
     79     "Vxlan", \
     80     "PortsGroup", \
     81     "Extender", \
     82     "Mac", \
     83     "Flow", \
     84     "Count"  \
     85 }
     86 
     87 #define BCM_MULTICAST_IS_SET(group)  _SHR_MULTICAST_IS_SET(group) 
     88 
     89 #define BCM_MULTICAST_IS_L2(group)      _SHR_MULTICAST_IS_L2(group) 
     90 #define BCM_MULTICAST_IS_L3(group)      _SHR_MULTICAST_IS_L3(group) 
     91 #define BCM_MULTICAST_IS_VPLS(group)    _SHR_MULTICAST_IS_VPLS(group) 
     92 #define BCM_MULTICAST_IS_SUBPORT(group)  _SHR_MULTICAST_IS_SUBPORT(group) 
     93 #define BCM_MULTICAST_IS_MIM(group)     _SHR_MULTICAST_IS_MIM(group) 
     94 #define BCM_MULTICAST_IS_WLAN(group)    _SHR_MULTICAST_IS_WLAN(group) 
     95 #define BCM_MULTICAST_IS_VLAN(group)    _SHR_MULTICAST_IS_VLAN(group) 
     96 #define BCM_MULTICAST_IS_TRILL(group)   _SHR_MULTICAST_IS_TRILL(group) 
     97 #define BCM_MULTICAST_IS_NIV(group)     _SHR_MULTICAST_IS_NIV(group) 
     98 #define BCM_MULTICAST_IS_EGRESS_OBJECT(group)  _SHR_MULTICAST_IS_EGRESS_OBJECT(group) 
     99 #define BCM_MULTICAST_IS_L2GRE(group)   _SHR_MULTICAST_IS_L2GRE(group) 
    100 #define BCM_MULTICAST_IS_VXLAN(group)   _SHR_MULTICAST_IS_VXLAN(group) 
    101 #define BCM_MULTICAST_IS_FLOW(group)    _SHR_MULTICAST_IS_FLOW(group) 
    102 #define BCM_MULTICAST_IS_PORTS_GROUP(group)  _SHR_MULTICAST_IS_PORTS_GROUP(group) 
    103 #define BCM_MULTICAST_IS_EXTENDER(group)  _SHR_MULTICAST_IS_EXTENDER(group) 
    104 
    105 #define BCM_MULTICAST_L2_SET(group, mc_index)  _SHR_MULTICAST_L2_SET(group, mc_index) 
    106 #define BCM_MULTICAST_L3_SET(group, mc_index)  _SHR_MULTICAST_L3_SET(group, mc_index) 
    107 #define BCM_MULTICAST_VPLS_SET(group, mc_index)  _SHR_MULTICAST_VPLS_SET(group, mc_index) 
    108 #define BCM_MULTICAST_SUBPORT_SET(group, mc_index)  _SHR_MULTICAST_SUBPORT_SET(group, mc_index) 
    109 #define BCM_MULTICAST_MIM_SET(group, mc_index)  _SHR_MULTICAST_MIM_SET(group, mc_index) 
    110 #define BCM_MULTICAST_WLAN_SET(group, mc_index)  _SHR_MULTICAST_WLAN_SET(group, mc_index) 
    111 #define BCM_MULTICAST_VLAN_SET(group, mc_index)  _SHR_MULTICAST_VLAN_SET(group, mc_index) 
    112 #define BCM_MULTICAST_TRILL_SET(group, mc_index)  _SHR_MULTICAST_TRILL_SET(group, mc_index) 
    113 #define BCM_MULTICAST_NIV_SET(group, mc_index)  _SHR_MULTICAST_NIV_SET(group, mc_index) 
    114 #define BCM_MULTICAST_EGRESS_OBJECT_SET(group, mc_index)  _SHR_MULTICAST_EGRESS_OBJECT_SET(group, mc_index) 
    115 #define BCM_MULTICAST_L2GRE_SET(group, mc_index)  _SHR_MULTICAST_L2GRE_SET(group, mc_index) 
    116 #define BCM_MULTICAST_VXLAN_SET(group, mc_index)  _SHR_MULTICAST_VXLAN_SET(group, mc_index) 
    117 #define BCM_MULTICAST_FLOW_SET(group, mc_index)  _SHR_MULTICAST_FLOW_SET(group, mc_index) 
    118 #define BCM_MULTICAST_PORTS_GROUP_SET(group, mc_index)  _SHR_MULTICAST_PORTS_GROUP_SET(group, mc_index) 
    119 #define BCM_MULTICAST_EXTENDER_SET(group, mc_index)  _SHR_MULTICAST_EXTENDER_SET(group, mc_index) 
    120 
    121 #define BCM_MULTICAST_L2_GET(group)     _SHR_MULTICAST_L2_GET(group) 
    122 #define BCM_MULTICAST_L3_GET(group)     _SHR_MULTICAST_L3_GET(group) 
    123 #define BCM_MULTICAST_VPLS_GET(group)   _SHR_MULTICAST_VPLS_GET(group) 
    124 #define BCM_MULTICAST_SUBPORT_GET(group)  _SHR_MULTICAST_SUBPORT_GET(group) 
    125 #define BCM_MULTICAST_MIM_GET(group)    _SHR_MULTICAST_MIM_GET(group) 
    126 #define BCM_MULTICAST_WLAN_GET(group)   _SHR_MULTICAST_WLAN_GET(group) 
    127 #define BCM_MULTICAST_VLAN_GET(group)   _SHR_MULTICAST_VLAN_GET(group) 
    128 #define BCM_MULTICAST_TRILL_GET(group)  _SHR_MULTICAST_TRILL_GET(group) 
    129 #define BCM_MULTICAST_NIV_GET(group)    _SHR_MULTICAST_NIV_GET(group) 
    130 #define BCM_MULTICAST_EGRESS_OBJECT_GET(group)  _SHR_MULTICAST_EGRESS_OBJECT_GET(group) 
    131 #define BCM_MULTICAST_L2GRE_GET(group)  _SHR_MULTICAST_L2GRE_GET(group) 
    132 #define BCM_MULTICAST_VXLAN_GET(group)  _SHR_MULTICAST_VXLAN_GET(group) 
    133 #define BCM_MULTICAST_FLOW_GET(group)   _SHR_MULTICAST_FLOW_GET(group) 
    134 #define BCM_MULTICAST_PORTS_GROUP_GET(group)  _SHR_MULTICAST_PORTS_GROUP_GET(group) 
    135 #define BCM_MULTICAST_EXTENDER_GET(group)  _SHR_MULTICAST_EXTENDER_GET(group) 
    136 
    137 #define BCM_MULTICAST_L2(mc_index)  _SHR_MULTICAST_L2(mc_index) 
    138 #define BCM_MULTICAST_L3(mc_index)  _SHR_MULTICAST_L3(mc_index) 
    139 #define BCM_MULTICAST_VPLS(mc_index)  _SHR_MULTICAST_VPLS(mc_index) 
    140 #define BCM_MULTICAST_SUBPORT(mc_index)  _SHR_MULTICAST_SUBPORT(mc_index) 
    141 #define BCM_MULTICAST_MIM(mc_index)  _SHR_MULTICAST_MIM(mc_index) 
    142 #define BCM_MULTICAST_WLAN(mc_index)  _SHR_MULTICAST_WLAN(mc_index) 
    143 #define BCM_MULTICAST_VLAN(mc_index)  _SHR_MULTICAST_VLAN(mc_index) 
    144 #define BCM_MULTICAST_TRILL(mc_index)  _SHR_MULTICAST_TRILL(mc_index) 
    145 #define BCM_MULTICAST_NIV(mc_index)  _SHR_MULTICAST_NIV(mc_index) 
    146 #define BCM_MULTICAST_EGRESS_OBJECT(mc_index)  _SHR_MULTICAST_EGRESS_OBJECT(mc_index) 
    147 #define BCM_MULTICAST_L2GRE(mc_index)  _SHR_MULTICAST_L2GRE(mc_index) 
    148 #define BCM_MULTICAST_VXLAN(mc_index)  _SHR_MULTICAST_VXLAN(mc_index) 
    149 #define BCM_MULTICAST_FLOW(mc_index)  _SHR_MULTICAST_FLOW(mc_index) 
    150 #define BCM_MULTICAST_PORTS_GROUP(mc_index)  _SHR_MULTICAST_PORTS_GROUP(mc_index) 
    151 #define BCM_MULTICAST_EXTENDER(mc_index)  _SHR_MULTICAST_EXTENDER(mc_index) 
    152 
    153 #define BCM_MULTICAST_TYPE(group)  _SHR_MULTICAST_TYPE(group) 
    154 
    155 #ifndef BCM_HIDE_DISPATCHABLE
    156 
    157 /* Initialize the multicast module. */
    158 extern int bcm_multicast_init(
    159     int unit);
    160 
    161 /* Shut down (uninitialize) the multicast module. */
    162 extern int bcm_multicast_detach(
    163     int unit);
    164 
    165 /* bcm_multicast_create */
    166 extern int bcm_multicast_create(
    167     int unit, 
    168     uint32 flags, 
    169     bcm_multicast_t *group);
    170 
    171 /* bcm_multicast_destroy */
    172 extern int bcm_multicast_destroy(
    173     int unit, 
    174     bcm_multicast_t group);
    175 
    176 /* bcm_multicast_fabric_distribution_set */
    177 extern int bcm_multicast_fabric_distribution_set(
    178     int unit, 
    179     bcm_multicast_t group, 
    180     bcm_fabric_distribution_t ds_id);
    181 
    182 /* bcm_multicast_fabric_distribution_get */
    183 extern int bcm_multicast_fabric_distribution_get(
    184     int unit, 
    185     bcm_multicast_t group, 
    186     bcm_fabric_distribution_t *ds_id);
    187 
    188 /* bcm_multicast_l3_encap_get */
    189 extern int bcm_multicast_l3_encap_get(
    190     int unit, 
    191     bcm_multicast_t group, 
    192     bcm_gport_t port, 
    193     bcm_if_t intf, 
    194     bcm_if_t *encap_id);
    195 
    196 /* bcm_multicast_l2_encap_get */
    197 extern int bcm_multicast_l2_encap_get(
    198     int unit, 
    199     bcm_multicast_t group, 
    200     bcm_gport_t port, 
    201     bcm_vlan_t vlan, 
    202     bcm_if_t *encap_id);
    203 
    204 /* bcm_multicast_vpls_encap_get */
    205 extern int bcm_multicast_vpls_encap_get(
    206     int unit, 
    207     bcm_multicast_t group, 
    208     bcm_gport_t port, 
    209     bcm_gport_t mpls_port_id, 
    210     bcm_if_t *encap_id);
    211 
    212 /* bcm_multicast_trill_encap_get */
    213 extern int bcm_multicast_trill_encap_get(
    214     int unit, 
    215     bcm_multicast_t group, 
    216     bcm_gport_t port, 
    217     bcm_if_t intf, 
    218     bcm_if_t *encap_id);
    219 
    220 /* bcm_multicast_subport_encap_get */
    221 extern int bcm_multicast_subport_encap_get(
    222     int unit, 
    223     bcm_multicast_t group, 
    224     bcm_gport_t port, 
    225     bcm_gport_t subport, 
    226     bcm_if_t *encap_id);
    227 
    228 /* bcm_multicast_mim_encap_get */
    229 extern int bcm_multicast_mim_encap_get(
    230     int unit, 
    231     bcm_multicast_t group, 
    232     bcm_gport_t port, 
    233     bcm_gport_t mim_port_id, 
    234     bcm_if_t *encap_id);
    235 
    236 /* bcm_multicast_wlan_encap_get */
    237 extern int bcm_multicast_wlan_encap_get(
    238     int unit, 
    239     bcm_multicast_t group, 
    240     bcm_gport_t port, 
    241     bcm_gport_t wlan_port_id, 
    242     bcm_if_t *encap_id);
    243 
    244 /* bcm_multicast_vlan_encap_get */
    245 extern int bcm_multicast_vlan_encap_get(
    246     int unit, 
    247     bcm_multicast_t group, 
    248     bcm_gport_t port, 
    249     bcm_gport_t vlan_port_id, 
    250     bcm_if_t *encap_id);
    251 
    252 /* bcm_multicast_niv_encap_get */
    253 extern int bcm_multicast_niv_encap_get(
    254     int unit, 
    255     bcm_multicast_t group, 
    256     bcm_gport_t port, 
    257     bcm_gport_t niv_port_id, 
    258     bcm_if_t *encap_id);
    259 
    260 /* bcm_multicast_egress_object_encap_get */
    261 extern int bcm_multicast_egress_object_encap_get(
    262     int unit, 
    263     bcm_multicast_t group, 
    264     bcm_if_t intf, 
    265     bcm_if_t *encap_id);
    266 
    267 /* bcm_multicast_l2gre_encap_get */
    268 extern int bcm_multicast_l2gre_encap_get(
    269     int unit, 
    270     bcm_multicast_t group, 
    271     bcm_gport_t port, 
    272     bcm_gport_t l2gre_port_id, 
    273     bcm_if_t *encap_id);
    274 
    275 /* bcm_multicast_vxlan_encap_get */
    276 extern int bcm_multicast_vxlan_encap_get(
    277     int unit, 
    278     bcm_multicast_t group, 
    279     bcm_gport_t port, 
    280     bcm_gport_t vxlan_port_id, 
    281     bcm_if_t *encap_id);
    282 
    283 /* bcm_multicast_extender_encap_get */
    284 extern int bcm_multicast_extender_encap_get(
    285     int unit, 
    286     bcm_multicast_t group, 
    287     bcm_gport_t port, 
    288     bcm_gport_t extender_port_id, 
    289     bcm_if_t *encap_id);
    290 
    291 /* bcm_multicast_mac_encap_get */
    292 extern int bcm_multicast_mac_encap_get(
    293     int unit, 
    294     bcm_multicast_t group, 
    295     bcm_gport_t port, 
    296     bcm_gport_t mac_port_id, 
    297     bcm_if_t *encap_id);
    298 
    299 /* bcm_multicast_egress_add */
    300 extern int bcm_multicast_egress_add(
    301     int unit, 
    302     bcm_multicast_t group, 
    303     bcm_gport_t port, 
    304     bcm_if_t encap_id);
    305 
    306 /* bcm_multicast_egress_subscriber_add */
    307 extern int bcm_multicast_egress_subscriber_add(
    308     int unit, 
    309     bcm_multicast_t group, 
    310     bcm_gport_t port, 
    311     bcm_if_t encap_id, 
    312     bcm_gport_t subscriber_queue);
    313 
    314 /* bcm_multicast_egress_delete */
    315 extern int bcm_multicast_egress_delete(
    316     int unit, 
    317     bcm_multicast_t group, 
    318     bcm_gport_t port, 
    319     bcm_if_t encap_id);
    320 
    321 /* bcm_multicast_egress_subscriber_delete */
    322 extern int bcm_multicast_egress_subscriber_delete(
    323     int unit, 
    324     bcm_multicast_t group, 
    325     bcm_gport_t port, 
    326     bcm_if_t encap_id, 
    327     bcm_gport_t subscriber_queue);
    328 
    329 /* bcm_multicast_egress_delete_all */
    330 extern int bcm_multicast_egress_delete_all(
    331     int unit, 
    332     bcm_multicast_t group);
    333 
    334 /* bcm_multicast_egress_set */
    335 extern int bcm_multicast_egress_set(
    336     int unit, 
    337     bcm_multicast_t group, 
    338     int port_count, 
    339     bcm_gport_t *port_array, 
    340     bcm_if_t *encap_id_array);
    341 
    342 /* bcm_multicast_egress_subscriber_set */
    343 extern int bcm_multicast_egress_subscriber_set(
    344     int unit, 
    345     bcm_multicast_t group, 
    346     int port_count, 
    347     bcm_gport_t *port_array, 
    348     bcm_if_t *encap_id_array, 
    349     bcm_gport_t *subscriber_queue_array);
    350 
    351 /* bcm_multicast_egress_get */
    352 extern int bcm_multicast_egress_get(
    353     int unit, 
    354     bcm_multicast_t group, 
    355     int port_max, 
    356     bcm_gport_t *port_array, 
    357     bcm_if_t *encap_id_array, 
    358     int *port_count);
    359 
    360 /* bcm_multicast_egress_subscriber_get */
    361 extern int bcm_multicast_egress_subscriber_get(
    362     int unit, 
    363     bcm_multicast_t group, 
    364     int port_max, 
    365     bcm_gport_t *port_array, 
    366     bcm_if_t *encap_id_array, 
    367     bcm_gport_t *subscriber_queue_array, 
    368     int *port_count);
    369 
    370 /* bcm_multicast_egress_subscriber_qos_map_set */
    371 extern int bcm_multicast_egress_subscriber_qos_map_set(
    372     int unit, 
    373     bcm_multicast_t group, 
    374     bcm_gport_t port, 
    375     bcm_gport_t subscriber_queue, 
    376     int qos_map_id);
    377 
    378 /* bcm_multicast_egress_subscriber_qos_map_get */
    379 extern int bcm_multicast_egress_subscriber_qos_map_get(
    380     int unit, 
    381     bcm_multicast_t group, 
    382     bcm_gport_t port, 
    383     bcm_gport_t subscriber_queue, 
    384     int *qos_map_id);
    385 
    386 /* bcm_multicast_ingress_add */
    387 extern int bcm_multicast_ingress_add(
    388     int unit, 
    389     bcm_multicast_t group, 
    390     bcm_gport_t port, 
    391     bcm_if_t encap_id);
    392 
    393 /* bcm_multicast_egress_delete */
    394 extern int bcm_multicast_ingress_delete(
    395     int unit, 
    396     bcm_multicast_t group, 
    397     bcm_gport_t port, 
    398     bcm_if_t encap_id);
    399 
    400 /* bcm_multicast_egress_delete_all */
    401 extern int bcm_multicast_ingress_delete_all(
    402     int unit, 
    403     bcm_multicast_t group);
    404 
    405 /* bcm_multicast_ingress_set */
    406 extern int bcm_multicast_ingress_set(
    407     int unit, 
    408     bcm_multicast_t group, 
    409     int port_count, 
    410     bcm_gport_t *port_array, 
    411     bcm_if_t *encap_id_array);
    412 
    413 /* bcm_multicast_ingress_get */
    414 extern int bcm_multicast_ingress_get(
    415     int unit, 
    416     bcm_multicast_t group, 
    417     int port_max, 
    418     bcm_gport_t *port_array, 
    419     bcm_if_t *encap_id_array, 
    420     int *port_count);
    421 
    422 /* Assign a set of VLANs as the selected port's replication list. */
    423 extern int bcm_multicast_repl_set(
    424     int unit, 
    425     int mc_index, 
    426     bcm_port_t port, 
    427     bcm_vlan_vector_t vlan_vec);
    428 
    429 /* Return set of VLANs selected for port's replication list. */
    430 extern int bcm_multicast_repl_get(
    431     int unit, 
    432     int index, 
    433     bcm_port_t port, 
    434     bcm_vlan_vector_t vlan_vec);
    435 
    436 /* Retrieve the flags associated with a mulitcast group. */
    437 extern int bcm_multicast_group_get(
    438     int unit, 
    439     bcm_multicast_t group, 
    440     uint32 *flags);
    441 
    442 /* Request if the given multicast group is available on the device */
    443 extern int bcm_multicast_group_is_free(
    444     int unit, 
    445     bcm_multicast_t group);
    446 
    447 /* 
    448  * Retrieve the minimum and maximum unallocated multicast groups for a
    449  * given multicast type.
    450  */
    451 extern int bcm_multicast_group_free_range_get(
    452     int unit, 
    453     uint32 type_flag, 
    454     bcm_multicast_t *group_min, 
    455     bcm_multicast_t *group_max);
    456 
    457 #endif /* BCM_HIDE_DISPATCHABLE */
    458 
    459 /* Callback function for bcm_multicast_group_traverse. */
    460 typedef int (*bcm_multicast_group_traverse_cb_t)(
    461     int unit, 
    462     bcm_multicast_t group, 
    463     uint32 flags, 
    464     void *user_data);
    465 
    466 #ifndef BCM_HIDE_DISPATCHABLE
    467 
    468 /* 
    469  * Iterate over the defined multicast groups of the type specified in
    470  * 'flags'.  If all types are desired, use MULTICAST_TYPE_MASK.
    471  */
    472 extern int bcm_multicast_group_traverse(
    473     int unit, 
    474     bcm_multicast_group_traverse_cb_t trav_fn, 
    475     uint32 flags, 
    476     void *user_data);
    477 
    478 #endif /* BCM_HIDE_DISPATCHABLE */
    479 
    480 /* Multicast group controls. */
    481 typedef enum bcm_multicast_control_e {
    482     bcmMulticastControlMtu = 0,     /* Maximum transmission unit. */
    483     bcmMulticastVpTrunkResolve = 1, /* Enable virtual port trunk group
    484                                        resolution. */
    485     bcmMulticastRemapGroup = 2,     /* Remap multicast groups. */
    486     bcmMulticastControlCount = 3    /* Must be last */
    487 } bcm_multicast_control_t;
    488 
    489 #ifndef BCM_HIDE_DISPATCHABLE
    490 
    491 /* Set multicast group control. */
    492 extern int bcm_multicast_control_set(
    493     int unit, 
    494     bcm_multicast_t group, 
    495     bcm_multicast_control_t type, 
    496     int arg);
    497 
    498 /* Get multicast group control. */
    499 extern int bcm_multicast_control_get(
    500     int unit, 
    501     bcm_multicast_t group, 
    502     bcm_multicast_control_t type, 
    503     int *arg);
    504 
    505 #endif /* BCM_HIDE_DISPATCHABLE */
    506 
    507 /* describes a multicast replication */
    508 typedef struct bcm_multicast_replication_s {
    509     uint32 flags;       /* information on the replication */
    510     bcm_gport_t port;   /* destination */
    511     bcm_if_t encap1;    /* first encapsulation. */
    512     bcm_if_t encap2;    /* second encapsulation. */
    513 } bcm_multicast_replication_t;
    514 
    515 #define BCM_MUTICAST_REPLICATION_ENCAP2_VALID 1          /* determines if encap2
    516                                                           is used . */
    517 #define BCM_MUTICAST_REPLICATION_ENCAP1_L3_INTF 2          /* when encap2 is used,
    518                                                           determines if encap1
    519                                                           is a routing interface
    520                                                           or not. */
    521 
    522 #ifndef BCM_HIDE_DISPATCHABLE
    523 
    524 /* get multicast destinations */
    525 extern int bcm_multicast_get(
    526     int unit, 
    527     bcm_multicast_t group, 
    528     uint32 flags, 
    529     int replication_max, 
    530     bcm_multicast_replication_t *out_rep_array, 
    531     int *rep_count);
    532 
    533 /* set multicast destinations */
    534 extern int bcm_multicast_set(
    535     int unit, 
    536     bcm_multicast_t group, 
    537     uint32 flags, 
    538     int nof_replications, 
    539     bcm_multicast_replication_t *rep_array);
    540 
    541 /* remove multicast destinations */
    542 extern int bcm_multicast_delete(
    543     int unit, 
    544     bcm_multicast_t group, 
    545     uint32 flags, 
    546     int nof_replications, 
    547     bcm_multicast_replication_t *rep_array);
    548 
    549 /* Add multicast destinations */
    550 extern int bcm_multicast_add(
    551     int unit, 
    552     bcm_multicast_t group, 
    553     uint32 flags, 
    554     int nof_replications, 
    555     bcm_multicast_replication_t *rep_array);
    556 
    557 #endif /* BCM_HIDE_DISPATCHABLE */
    558 
    559 /* init multicast replication struct */
    560 extern void bcm_multicast_replication_t_init(
    561     bcm_multicast_replication_t *replication_structure);
    562 
    563 /* 
    564  * Can be use for  setting flags parameter  to 
    565  * (bcm_multicast_get,bcm_multicast_set,bcm_multicast_add,bcm_multicast_delete)
    566  */
    567 #define BCM_MULTICAST_INGRESS   0x00000001 
    568 
    569 /* L3 Multiple multicast group related flags. */
    570 #define BCM_MULTICAST_MULTI_WITH_ID     (1 << 0)   /* Create multiple multicast
    571                                                       groups with id. */
    572 #define BCM_MULTICAST_MULTI_TYPE_L3     (1 << 1)   /* Create multiple group of
    573                                                       L3 type. */
    574 #define BCM_MULTICAST_MULTI_TYPE_VPLS   (1 << 2)   /* Create multiple group of
    575                                                       VPLS type. */
    576 
    577 /* Information to create multiple multicast groups. */
    578 typedef struct bcm_multicast_multi_info_s {
    579     uint32 flags;           /* See BCM_MULTICAST_MULTI_XXX flag definitions. */
    580     int number_of_elements; /* number of multicast groups to allocate. */
    581 } bcm_multicast_multi_info_t;
    582 
    583 /* Initialize a multicast multi structure. */
    584 extern void bcm_multicast_multi_info_t_init(
    585     bcm_multicast_multi_info_t *mc_multi_info);
    586 
    587 #ifndef BCM_HIDE_DISPATCHABLE
    588 
    589 /* Allocate multiple multicast groups. */
    590 extern int bcm_multicast_multi_alloc(
    591     int unit, 
    592     bcm_multicast_multi_info_t mc_multi_info, 
    593     bcm_multicast_t *base_mc_group);
    594 
    595 /* Free multiple multicast groups. */
    596 extern int bcm_multicast_multi_free(
    597     int unit, 
    598     bcm_multicast_t base_mc_group);
    599 
    600 #endif /* BCM_HIDE_DISPATCHABLE */
    601 
    602 #define BCM_MULTICAST_REMOVE_ALL    0x00000010 
    603 
    604 #define BCM_MULTICAST_BIER_64_GROUP     0x00000010 
    605 #define BCM_MULTICAST_BIER_128_GROUP    0x00000020 
    606 #define BCM_MULTICAST_BIER_256_GROUP    0x00000040 
    607 
    608 #define BCM_MULICAST_STAT_EXTERNAL  0x00000001 /* Used to indicate of updating
    609                                                   multicast external statistics
    610                                                   parameters. */
    611 
    612 /* Multicast statistics control types. */
    613 typedef enum bcm_multicast_stat_control_type_e {
    614     bcmMulticastStatControlCountAllCopiesAsOne = 0 
    615 } bcm_multicast_stat_control_type_t;
    616 
    617 #ifndef BCM_HIDE_DISPATCHABLE
    618 
    619 /* Multicast statistics control set API. */
    620 extern int bcm_multicast_stat_control_set(
    621     int unit, 
    622     bcm_core_t core_id, 
    623     uint32 flags, 
    624     int command_id, 
    625     bcm_multicast_stat_control_type_t type, 
    626     int arg);
    627 
    628 /* Multicast statistics control get API. */
    629 extern int bcm_multicast_stat_control_get(
    630     int unit, 
    631     bcm_core_t core_id, 
    632     uint32 flags, 
    633     int command_id, 
    634     bcm_multicast_stat_control_type_t type, 
    635     int *arg);
    636 
    637 #endif /* BCM_HIDE_DISPATCHABLE */
    638 
    639 /* Multicast Encap extension flags */
    640 #define BCM_MULTICAST_ENCAP_EXTENSION_REPLACE 0x00000001 /* Replace an existing
    641                                                           entry in encapsulation
    642                                                           extension table */
    643 #define BCM_MULTICAST_ENCAP_EXTENSION_WITH_ID 0x00000002 /* Indicate creation with
    644                                                           a given ID. */
    645 
    646 #ifndef BCM_HIDE_DISPATCHABLE
    647 
    648 /* Allows the MC replication to use more than a single encapsulation. */
    649 extern int bcm_multicast_encap_extension_create(
    650     int unit, 
    651     uint32 flags, 
    652     bcm_if_t *multicast_replication_index, 
    653     int encap_extension_count, 
    654     bcm_if_t *encap_extension_array);
    655 
    656 /* 
    657  * Return the encapsulation IDs that are placed in the encapsulation
    658  * extension table under the encap_id entry.
    659  */
    660 extern int bcm_multicast_encap_extension_get(
    661     int unit, 
    662     uint32 flags, 
    663     bcm_if_t multicast_replication_index, 
    664     int encap_max, 
    665     bcm_if_t *encap_extension_array, 
    666     int *encap_extension_count);
    667 
    668 /* Delete an entry from the encapsulation table. */
    669 extern int bcm_multicast_encap_extension_destroy(
    670     int unit, 
    671     uint32 flags, 
    672     bcm_if_t multicast_replication_index);
    673 
    674 /* Delete all the members from the encapsulation extension table. */
    675 extern int bcm_multicast_encap_extension_delete_all(
    676     int unit);
    677 
    678 #endif /* BCM_HIDE_DISPATCHABLE */
    679 
    680 /* Callback function for bcm_multicast_encap_extension_traverse. */
    681 typedef int (*bcm_multicast_encap_extension_traverse_cb)(
    682     int unit, 
    683     bcm_if_t multicast_replication_index, 
    684     uint32 flags, 
    685     void *user_data);
    686 
    687 #ifndef BCM_HIDE_DISPATCHABLE
    688 
    689 /* Traverse over all the entries in the encapsulation extension table */
    690 extern int bcm_multicast_encap_extension_traverse(
    691     int unit, 
    692     bcm_multicast_encap_extension_traverse_cb trav_fn, 
    693     void *user_data);
    694 
    695 #endif /* BCM_HIDE_DISPATCHABLE */
    696 
    697 #endif /* __BCM_MULTICAST_H__ */