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

mcast.h (4836B)


      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_MCAST_H__
     14 #define __BCM_MCAST_H__
     15 
     16 #include <bcm/types.h>
     17 
     18 /* BCM_MCAST_XXX Flags. */
     19 #define BCM_MCAST_USE_FABRIC_DISTRIBUTION   0x00000001 /* Use specified fabric
     20                                                           distribution class. */
     21 
     22 /* Device-independent L2 multicast address. */
     23 typedef struct bcm_mcast_addr_s {
     24     bcm_mac_t mac;                      /* 802.3 MAC address. */
     25     bcm_vlan_t vid;                     /* VLAN identifier. */
     26     bcm_cos_t cos_dst;                  /* COS based on destination address. */
     27     bcm_pbmp_t pbmp;                    /* Port bitmap. */
     28     bcm_pbmp_t ubmp;                    /* Untagged port bitmap. */
     29     uint32 l2mc_index;                  /* XGS: L2MC index. */
     30     uint32 flags;                       /* See BCM_MCAST_XXX flag definitions. */
     31     bcm_fabric_distribution_t distribution_class; /* Fabric Distribution Class. */
     32 } bcm_mcast_addr_t;
     33 
     34 /* Values returned by bcm_mcast_join and bcm_mcast_leave routines. */
     35 #define BCM_MCAST_JOIN_ADDED        1          
     36 #define BCM_MCAST_JOIN_UPDATED      2          
     37 #define BCM_MCAST_LEAVE_DELETED     3          
     38 #define BCM_MCAST_LEAVE_UPDATED     4          
     39 #define BCM_MCAST_LEAVE_NOTFOUND    5          
     40 
     41 /* Initialize a bcm_mcast_addr_t data type. */
     42 extern void bcm_mcast_addr_t_init(
     43     bcm_mcast_addr_t *mcaddr, 
     44     bcm_mac_t mac, 
     45     bcm_vlan_t vid);
     46 
     47 /* Backward compatibility. */
     48 #define bcm_mcast_addr_init     bcm_mcast_addr_t_init 
     49 
     50 #ifndef BCM_HIDE_DISPATCHABLE
     51 
     52 /* Initialize the L2 multicast module. */
     53 extern int bcm_mcast_init(
     54     int unit);
     55 
     56 /* Add/Remove an entry in the multicast table. */
     57 extern int bcm_mcast_addr_add(
     58     int unit, 
     59     bcm_mcast_addr_t *mcaddr);
     60 
     61 /* Add/Remove an entry in the multicast table. */
     62 extern int bcm_mcast_addr_remove(
     63     int unit, 
     64     bcm_mac_t mac, 
     65     bcm_vlan_t vid);
     66 
     67 /* 
     68  * Get untagged and tagged membership port bit maps for a Multicast
     69  * group.
     70  */
     71 extern int bcm_mcast_port_get(
     72     int unit, 
     73     bcm_mac_t mac, 
     74     bcm_vlan_t vid, 
     75     bcm_mcast_addr_t *mcaddr);
     76 
     77 /* Add a given port to the membership of a given multicast group. */
     78 extern int bcm_mcast_join(
     79     int unit, 
     80     bcm_mac_t mcMacAddr, 
     81     bcm_vlan_t vlanId, 
     82     int srcPort, 
     83     bcm_mcast_addr_t *mcaddr, 
     84     bcm_pbmp_t *allRouterBmp);
     85 
     86 /* Remove a given port from the membership of a given multicast group. */
     87 extern int bcm_mcast_leave(
     88     int unit, 
     89     bcm_mac_t mcMacAddr, 
     90     bcm_vlan_t vlanId, 
     91     int srcPort);
     92 
     93 /* 
     94  * Add/Update/Remove an entry in the multicast table with l2mc index
     95  * provided.
     96  */
     97 extern int bcm_mcast_addr_remove_w_l2mcindex(
     98     int unit, 
     99     bcm_mcast_addr_t *mcaddr);
    100 
    101 /* 
    102  * Add/Update/Remove an entry in the multicast table with l2mc index
    103  * provided.
    104  */
    105 extern int bcm_mcast_addr_add_w_l2mcindex(
    106     int unit, 
    107     bcm_mcast_addr_t *mcaddr);
    108 
    109 /* Add/Remove ports to/from an existing entry in the multicast table. */
    110 extern int bcm_mcast_port_remove(
    111     int unit, 
    112     bcm_mcast_addr_t *mcaddr);
    113 
    114 /* Add/Remove ports to/from an existing entry in the multicast table. */
    115 extern int bcm_mcast_port_add(
    116     int unit, 
    117     bcm_mcast_addr_t *mcaddr);
    118 
    119 /* 
    120  * Provides the maximum multicast index that this fabric can handle (XGS
    121  * fabrics).
    122  */
    123 extern int bcm_mcast_bitmap_max_get(
    124     int unit, 
    125     int *max_index);
    126 
    127 /* Set/Get/Delete the L2 multicast forwarding port bitmap (XGS fabrics). */
    128 extern int bcm_mcast_bitmap_set(
    129     int unit, 
    130     int mc_idx, 
    131     bcm_port_t in_port, 
    132     bcm_pbmp_t pbmp);
    133 
    134 /* Set/Get/Delete the L2 multicast forwarding port bitmap (XGS fabrics). */
    135 extern int bcm_mcast_bitmap_get(
    136     int unit, 
    137     int mc_idx, 
    138     bcm_port_t in_port, 
    139     bcm_pbmp_t *pbmp);
    140 
    141 /* Set/Get/Delete the L2 multicast forwarding port bitmap (XGS fabrics). */
    142 extern int bcm_mcast_bitmap_del(
    143     int unit, 
    144     int mc_idx, 
    145     bcm_port_t in_port, 
    146     bcm_pbmp_t pbmp);
    147 
    148 #endif /* BCM_HIDE_DISPATCHABLE */
    149 
    150 #define BCM_MCAST_GPORT_IS_BITMAP_ID(gport)  _SHR_MCAST_GPORT_IS_BITMAP_ID(gport) 
    151 #define BCM_MCAST_GPORT_IS_GROUP_ID(gport)  _SHR_MCAST_GPORT_IS_GROUP_ID(gport) 
    152 #define BCM_MCAST_GPORT_GROUP_ID_SET(gport, mcast_id)  _SHR_MCAST_GPORT_GROUP_ID_SET(gport, mcast_id) 
    153 #define BCM_MCAST_GPORT_BITMAP_ID_SET(gport, bmp_id)  _SHR_MCAST_GPORT_BITMAP_ID_SET(gport, bmp_id) 
    154 #define BCM_MCAST_GPORT_GROUP_ID_GET(gport)  _SHR_MCAST_GPORT_GROUP_ID_GET(gport) 
    155 #define BCM_MCAST_GPORT_BITMAP_ID_GET(gport)  _SHR_MCAST_GPORT_BITMAP_ID_GET(gport) 
    156 
    157 #endif /* __BCM_MCAST_H__ */