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

ipmc.h (9438B)


      1 /*
      2  * DO NOT EDIT THIS FILE!
      3  * This file is auto-generated.
      4  * Edits to this file will be lost when it is regenerated.
      5  *
      6  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      7  * 
      8  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      9  */
     10 
     11 #ifndef BCMINT_LTSW_MBCM_IPMC_H
     12 #define BCMINT_LTSW_MBCM_IPMC_H
     13 
     14 #include <bcm/ipmc.h>
     15 #include <bcm/types.h>
     16 
     17 #include <bcm_int/ltsw/ipmc_int.h>
     18 
     19 #include <sal/sal_types.h>
     20 
     21 /*!
     22  * \brief Initialize IPMC module.
     23  *
     24  * \param [in] unit Unit Number.
     25  *
     26  * \retval SHR_E_NONE No errors.
     27  * \retval !SHR_E_NONE Failure.
     28  */
     29 typedef int (*ipmc_init_f)(int unit);
     30 
     31 /*!
     32  * \brief De-initialize IPMC module.
     33  *
     34  * \param [in] unit Unit Number.
     35  *
     36  * \retval SHR_E_NONE No errors.
     37  * \retval !SHR_E_NONE Failure.
     38  */
     39 typedef int (*ipmc_detach_f)(int unit);
     40 
     41 /*!
     42  * \brief Get the public info of IPMC module.
     43  *
     44  * \param [in] unit Unit Number.
     45  * \param [out] mc_pub Returned mc public info.
     46  *
     47  * \retval SHR_E_NONE No errors.
     48  * \retval !SHR_E_NONE Failure.
     49  */
     50 typedef int (*ipmc_pub_info_get_f)(
     51     int unit,
     52     bcmint_ipmc_pub_info_t *mc_pub);
     53 
     54 /*!
     55  * \brief Add an IPMC entry for L2 domain.
     56  *
     57  * \param [in] unit Unit Number.
     58  * \param [in] data IPMC entry information.
     59  *
     60  * \retval SHR_E_NONE No errors.
     61  * \retval !SHR_E_NONE Failure.
     62  */
     63 typedef int (*ipmc_add_l2_f)(
     64     int unit,
     65     bcm_ipmc_addr_t *data);
     66 
     67 /*!
     68  * \brief Remove an IPMC entry for L2 domain.
     69  *
     70  * \param [in] unit Unit Number.
     71  * \param [in] data IPMC entry information.
     72  *
     73  * \retval SHR_E_NONE No errors.
     74  * \retval !SHR_E_NONE Failure.
     75  */
     76 typedef int (*ipmc_remove_l2_f)(
     77     int unit,
     78     bcm_ipmc_addr_t *data);
     79 
     80 /*!
     81  * \brief Get an IPMC entry for L2 domain.
     82  *
     83  * \param [in] unit Unit Number.
     84  * \param [in] data IPMC entry information.
     85  *
     86  * \retval SHR_E_NONE No errors.
     87  * \retval !SHR_E_NONE Failure.
     88  */
     89 typedef int (*ipmc_find_l2_f)(
     90     int unit,
     91     bcm_ipmc_addr_t *data);
     92 
     93 /*!
     94  * \brief Traverse valid IPMC entry for L2 domain.
     95  *
     96  * \param [in] unit Unit Number.
     97  * \param [in] flags BCM_IPMC_XXX flags.
     98  * \param [in] cb User callback function, called once per IPMC entry for L2 domain.
     99  * \param [in] user_data Cookie.
    100  *
    101  * \retval SHR_E_NONE No errors.
    102  * \retval !SHR_E_NONE Failure.
    103  */
    104 typedef int (*ipmc_traverse_l2_f)(
    105     int unit,
    106     uint32_t flags,
    107     bcm_ipmc_traverse_cb cb,
    108     void *user_data);
    109 
    110 /*!
    111  * \brief Delete all IPMC entry for L2 domain.
    112  *
    113  * \param [in] unit Unit Number.
    114  *
    115  * \retval SHR_E_NONE No errors.
    116  * \retval !SHR_E_NONE Failure.
    117  */
    118 typedef int (*ipmc_delete_all_l2_f)(int unit);
    119 
    120 /*!
    121  * \brief Enable/disable IPMC support.
    122  *
    123  * \param [in] unit Unit Number.
    124  * \param [in] enable 1: enable IPMC support. 0: disable IPMC support.
    125  *
    126  * \retval SHR_E_NONE No errors.
    127  * \retval !SHR_E_NONE Failure.
    128  */
    129 typedef int (*ipmc_enable_f)(
    130     int unit,
    131     int enable);
    132 
    133 /*!
    134  * \brief Config the egress IP multicast Configuration Register.
    135  *
    136  * \param [in] unit Unit Number.
    137  * \param [in] port port to config.
    138  * \param [in] mac MAC address.
    139  * \param [in] untag 1: The IP multicast packet is transmitted as untagged packet. 0: The IP multicast packet is transmitted as tagged packet with VLAN tag vid.
    140  * \param [in] vid VLAN ID.
    141  * \param [in] ttl_thresh Drop IPMC packets if TTL of IP packet <= ttl_thresh.
    142  *
    143  * \retval SHR_E_NONE No errors.
    144  * \retval !SHR_E_NONE Failure.
    145  */
    146 typedef int (*ipmc_egress_port_set_f)(
    147     int unit,
    148     bcm_port_t port,
    149     const bcm_mac_t mac,
    150     int untag,
    151     bcm_vlan_t vid,
    152     int ttl_thresh);
    153 
    154 /*!
    155  * \brief Get the egress IP multicast Configuration Register.
    156  *
    157  * \param [in] unit Unit Number.
    158  * \param [in] port port to config.
    159  * \param [out] mac MAC address.
    160  * \param [out] untag 1: The IP multicast packet is transmitted as untagged packet. 0: The IP multicast packet is transmitted as tagged packet with VLAN tag vid.
    161  * \param [out] vid VLAN ID.
    162  * \param [out] ttl_thresh Drop IPMC packets if TTL of IP packet <= ttl_thresh.
    163  *
    164  * \retval SHR_E_NONE No errors.
    165  * \retval !SHR_E_NONE Failure.
    166  */
    167 typedef int (*ipmc_egress_port_get_f)(
    168     int unit,
    169     bcm_port_t port,
    170     bcm_mac_t mac,
    171     int *untag,
    172     bcm_vlan_t *vid,
    173     int *ttl_thresh);
    174 
    175 /*!
    176  * \brief Ipmc driver structure.
    177  */
    178 typedef struct mbcm_ltsw_ipmc_drv_s {
    179 
    180     /*! Initialize IPMC module. */
    181     ipmc_init_f ipmc_init;
    182 
    183     /*! De-initialize IPMC module. */
    184     ipmc_detach_f ipmc_detach;
    185 
    186     /*! Get the public info of IPMC module. */
    187     ipmc_pub_info_get_f ipmc_pub_info_get;
    188 
    189     /*! Add an IPMC entry for L2 domain. */
    190     ipmc_add_l2_f ipmc_add_l2;
    191 
    192     /*! Remove an IPMC entry for L2 domain. */
    193     ipmc_remove_l2_f ipmc_remove_l2;
    194 
    195     /*! Get an IPMC entry for L2 domain. */
    196     ipmc_find_l2_f ipmc_find_l2;
    197 
    198     /*! Traverse valid IPMC entry for L2 domain. */
    199     ipmc_traverse_l2_f ipmc_traverse_l2;
    200 
    201     /*! Delete all IPMC entry for L2 domain. */
    202     ipmc_delete_all_l2_f ipmc_delete_all_l2;
    203 
    204     /*! Enable/disable IPMC support. */
    205     ipmc_enable_f ipmc_enable;
    206 
    207     /*! Config the egress IP multicast Configuration Register. */
    208     ipmc_egress_port_set_f ipmc_egress_port_set;
    209 
    210     /*! Get the egress IP multicast Configuration Register. */
    211     ipmc_egress_port_get_f ipmc_egress_port_get;
    212 
    213 } mbcm_ltsw_ipmc_drv_t;
    214 
    215 /*!
    216  * \brief Set the IPMC driver of the device.
    217  *
    218  * \param [in] unit Unit Number.
    219  * \param [in] drv Ipmc driver to set.
    220  *
    221  * \retval SHR_E_NONE No errors.
    222  * \retval !SHR_E_NONE Failure.
    223  */
    224 extern int
    225 mbcm_ltsw_ipmc_drv_set(
    226     int unit,
    227     mbcm_ltsw_ipmc_drv_t *drv);
    228 
    229 /*!
    230  * \brief Initialize IPMC module.
    231  *
    232  * \param [in] unit Unit Number.
    233  *
    234  * \retval SHR_E_NONE No errors.
    235  * \retval !SHR_E_NONE Failure.
    236  */
    237 extern int
    238 mbcm_ltsw_ipmc_init(int unit);
    239 
    240 /*!
    241  * \brief De-initialize IPMC module.
    242  *
    243  * \param [in] unit Unit Number.
    244  *
    245  * \retval SHR_E_NONE No errors.
    246  * \retval !SHR_E_NONE Failure.
    247  */
    248 extern int
    249 mbcm_ltsw_ipmc_detach(int unit);
    250 
    251 /*!
    252  * \brief Get the public info of IPMC module.
    253  *
    254  * \param [in] unit Unit Number.
    255  * \param [out] mc_pub Returned mc public info.
    256  *
    257  * \retval SHR_E_NONE No errors.
    258  * \retval !SHR_E_NONE Failure.
    259  */
    260 extern int
    261 mbcm_ltsw_ipmc_pub_info_get(
    262     int unit,
    263     bcmint_ipmc_pub_info_t *mc_pub);
    264 
    265 /*!
    266  * \brief Add an IPMC entry for L2 domain.
    267  *
    268  * \param [in] unit Unit Number.
    269  * \param [in] data IPMC entry information.
    270  *
    271  * \retval SHR_E_NONE No errors.
    272  * \retval !SHR_E_NONE Failure.
    273  */
    274 extern int
    275 mbcm_ltsw_ipmc_add_l2(
    276     int unit,
    277     bcm_ipmc_addr_t *data);
    278 
    279 /*!
    280  * \brief Remove an IPMC entry for L2 domain.
    281  *
    282  * \param [in] unit Unit Number.
    283  * \param [in] data IPMC entry information.
    284  *
    285  * \retval SHR_E_NONE No errors.
    286  * \retval !SHR_E_NONE Failure.
    287  */
    288 extern int
    289 mbcm_ltsw_ipmc_remove_l2(
    290     int unit,
    291     bcm_ipmc_addr_t *data);
    292 
    293 /*!
    294  * \brief Get an IPMC entry for L2 domain.
    295  *
    296  * \param [in] unit Unit Number.
    297  * \param [in] data IPMC entry information.
    298  *
    299  * \retval SHR_E_NONE No errors.
    300  * \retval !SHR_E_NONE Failure.
    301  */
    302 extern int
    303 mbcm_ltsw_ipmc_find_l2(
    304     int unit,
    305     bcm_ipmc_addr_t *data);
    306 
    307 /*!
    308  * \brief Traverse valid IPMC entry for L2 domain.
    309  *
    310  * \param [in] unit Unit Number.
    311  * \param [in] flags BCM_IPMC_XXX flags.
    312  * \param [in] cb User callback function, called once per IPMC entry for L2 domain.
    313  * \param [in] user_data Cookie.
    314  *
    315  * \retval SHR_E_NONE No errors.
    316  * \retval !SHR_E_NONE Failure.
    317  */
    318 extern int
    319 mbcm_ltsw_ipmc_traverse_l2(
    320     int unit,
    321     uint32_t flags,
    322     bcm_ipmc_traverse_cb cb,
    323     void *user_data);
    324 
    325 /*!
    326  * \brief Delete all IPMC entry for L2 domain.
    327  *
    328  * \param [in] unit Unit Number.
    329  *
    330  * \retval SHR_E_NONE No errors.
    331  * \retval !SHR_E_NONE Failure.
    332  */
    333 extern int
    334 mbcm_ltsw_ipmc_delete_all_l2(int unit);
    335 
    336 /*!
    337  * \brief Enable/disable IPMC support.
    338  *
    339  * \param [in] unit Unit Number.
    340  * \param [in] enable 1: enable IPMC support. 0: disable IPMC support.
    341  *
    342  * \retval SHR_E_NONE No errors.
    343  * \retval !SHR_E_NONE Failure.
    344  */
    345 extern int
    346 mbcm_ltsw_ipmc_enable(
    347     int unit,
    348     int enable);
    349 
    350 /*!
    351  * \brief Config the egress IP multicast Configuration Register.
    352  *
    353  * \param [in] unit Unit Number.
    354  * \param [in] port port to config.
    355  * \param [in] mac MAC address.
    356  * \param [in] untag 1: The IP multicast packet is transmitted as untagged packet. 0: The IP multicast packet is transmitted as tagged packet with VLAN tag vid.
    357  * \param [in] vid VLAN ID.
    358  * \param [in] ttl_thresh Drop IPMC packets if TTL of IP packet <= ttl_thresh.
    359  *
    360  * \retval SHR_E_NONE No errors.
    361  * \retval !SHR_E_NONE Failure.
    362  */
    363 extern int
    364 mbcm_ltsw_ipmc_egress_port_set(
    365     int unit,
    366     bcm_port_t port,
    367     const bcm_mac_t mac,
    368     int untag,
    369     bcm_vlan_t vid,
    370     int ttl_thresh);
    371 
    372 /*!
    373  * \brief Get the egress IP multicast Configuration Register.
    374  *
    375  * \param [in] unit Unit Number.
    376  * \param [in] port port to config.
    377  * \param [out] mac MAC address.
    378  * \param [out] untag 1: The IP multicast packet is transmitted as untagged packet. 0: The IP multicast packet is transmitted as tagged packet with VLAN tag vid.
    379  * \param [out] vid VLAN ID.
    380  * \param [out] ttl_thresh Drop IPMC packets if TTL of IP packet <= ttl_thresh.
    381  *
    382  * \retval SHR_E_NONE No errors.
    383  * \retval !SHR_E_NONE Failure.
    384  */
    385 extern int
    386 mbcm_ltsw_ipmc_egress_port_get(
    387     int unit,
    388     bcm_port_t port,
    389     bcm_mac_t mac,
    390     int *untag,
    391     bcm_vlan_t *vid,
    392     int *ttl_thresh);
    393 
    394 #endif /* BCMINT_LTSW_MBCM_IPMC_H */