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

nat.h (9615B)


      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_NAT_H
     12 #define BCMINT_LTSW_MBCM_NAT_H
     13 
     14 #include <bcm/nat.h>
     15 
     16 #include <bcm_int/ltsw/nat_int.h>
     17 
     18 #include <sal/sal_types.h>
     19 
     20 /*!
     21  * \brief Initialize NAT module.
     22  *
     23  * \param [in] unit Unit Number.
     24  *
     25  * \retval SHR_E_NONE No errors.
     26  * \retval !SHR_E_NONE Failure.
     27  */
     28 typedef int (*nat_init_f)(int unit);
     29 
     30 /*!
     31  * \brief De-initialize NAT module.
     32  *
     33  * \param [in] unit Unit Number.
     34  *
     35  * \retval SHR_E_NONE No errors.
     36  * \retval !SHR_E_NONE Failure.
     37  */
     38 typedef int (*nat_detach_f)(int unit);
     39 
     40 /*!
     41  * \brief Get the public info of NAT module.
     42  *
     43  * \param [in] unit Unit Number.
     44  * \param [out] nat_pub Returned nat public info.
     45  *
     46  * \retval SHR_E_NONE No errors.
     47  * \retval !SHR_E_NONE Failure.
     48  */
     49 typedef int (*nat_pub_info_get_f)(
     50     int unit,
     51     bcmint_nat_pub_info_t *nat_pub);
     52 
     53 /*!
     54  * \brief Add an egress NAT translation entry.
     55  *
     56  * \param [in] unit Unit Number.
     57  * \param [in] nat_info Egress NAT object pointer.
     58  *
     59  * \retval SHR_E_NONE No errors.
     60  * \retval !SHR_E_NONE Failure.
     61  */
     62 typedef int (*nat_egress_add_f)(
     63     int unit,
     64     bcm_l3_nat_egress_t *nat_info);
     65 
     66 /*!
     67  * \brief Destroy the egress NAT translation entry.
     68  *
     69  * \param [in] unit Unit Number.
     70  * \param [in] nat_info Egress NAT object pointer.
     71  *
     72  * \retval SHR_E_NONE No errors.
     73  * \retval !SHR_E_NONE Failure.
     74  */
     75 typedef int (*nat_egress_destroy_f)(
     76     int unit,
     77     bcm_l3_nat_egress_t *nat_info);
     78 
     79 /*!
     80  * \brief Get the egress NAT translation entry.
     81  *
     82  * \param [in] unit Unit Number.
     83  * \param [in] nat_info Egress NAT object pointer.
     84  *
     85  * \retval SHR_E_NONE No errors.
     86  * \retval !SHR_E_NONE Failure.
     87  */
     88 typedef int (*nat_egress_get_f)(
     89     int unit,
     90     bcm_l3_nat_egress_t *nat_info);
     91 
     92 /*!
     93  * \brief Traverse valid egress NAT translations and call the callback.
     94  *
     95  * \param [in] unit Unit Number.
     96  * \param [in] flags BCM_L3_NAT_EGRESS_XXX flags.
     97  * \param [in] cb User callback function, called once per egress NAT transltion entry.
     98  * \param [in] user_data Cookie.
     99  *
    100  * \retval SHR_E_NONE No errors.
    101  * \retval !SHR_E_NONE Failure.
    102  */
    103 typedef int (*nat_egress_traverse_f)(
    104     int unit,
    105     uint32_t flags,
    106     bcm_l3_nat_egress_traverse_cb cb,
    107     void *user_data);
    108 
    109 /*!
    110  * \brief Add an ingress NAT table entry.
    111  *
    112  * \param [in] unit Unit Number.
    113  * \param [in] nat_info Ingress NAT object pointer.
    114  *
    115  * \retval SHR_E_NONE No errors.
    116  * \retval !SHR_E_NONE Failure.
    117  */
    118 typedef int (*nat_ingress_add_f)(
    119     int unit,
    120     bcm_l3_nat_ingress_t *nat_info);
    121 
    122 /*!
    123  * \brief Delete the ingress NAT table entry.
    124  *
    125  * \param [in] unit Unit Number.
    126  * \param [in] nat_info Ingress NAT object pointer.
    127  *
    128  * \retval SHR_E_NONE No errors.
    129  * \retval !SHR_E_NONE Failure.
    130  */
    131 typedef int (*nat_ingress_delete_f)(
    132     int unit,
    133     bcm_l3_nat_ingress_t *nat_info);
    134 
    135 /*!
    136  * \brief Get the ingress NAT table entry.
    137  *
    138  * \param [in] unit Unit Number.
    139  * \param [in] nat_info Ingress NAT object pointer.
    140  *
    141  * \retval SHR_E_NONE No errors.
    142  * \retval !SHR_E_NONE Failure.
    143  */
    144 typedef int (*nat_ingress_find_f)(
    145     int unit,
    146     bcm_l3_nat_ingress_t *nat_info);
    147 
    148 /*!
    149  * \brief Delete the ingress NAT table entries specified by flags.
    150  *
    151  * \param [in] unit Unit Number.
    152  * \param [in] nat_info Only flags field is valid.These are used to figure out which table to clear.
    153  *
    154  * \retval SHR_E_NONE No errors.
    155  * \retval !SHR_E_NONE Failure.
    156  */
    157 typedef int (*nat_ingress_delete_all_f)(
    158     int unit,
    159     bcm_l3_nat_ingress_t *nat_info);
    160 
    161 /*!
    162  * \brief Traverse valid ingress NAT entriess and call the callback.
    163  *
    164  * \param [in] unit Unit Number.
    165  * \param [in] flags BCM_L3_NAT_INGRESS_XXX flags.
    166  * \param [in] cb User callback function, called once per ingress NAT table entry.
    167  * \param [in] user_data Cookie.
    168  *
    169  * \retval SHR_E_NONE No errors.
    170  * \retval !SHR_E_NONE Failure.
    171  */
    172 typedef int (*nat_ingress_traverse_f)(
    173     int unit,
    174     uint32_t flags,
    175     bcm_l3_nat_ingress_traverse_cb cb,
    176     void *user_data);
    177 
    178 /*!
    179  * \brief Nat driver structure.
    180  */
    181 typedef struct mbcm_ltsw_nat_drv_s {
    182 
    183     /*! Initialize NAT module. */
    184     nat_init_f nat_init;
    185 
    186     /*! De-initialize NAT module. */
    187     nat_detach_f nat_detach;
    188 
    189     /*! Get the public info of NAT module. */
    190     nat_pub_info_get_f nat_pub_info_get;
    191 
    192     /*! Add an egress NAT translation entry. */
    193     nat_egress_add_f nat_egress_add;
    194 
    195     /*! Destroy the egress NAT translation entry. */
    196     nat_egress_destroy_f nat_egress_destroy;
    197 
    198     /*! Get the egress NAT translation entry. */
    199     nat_egress_get_f nat_egress_get;
    200 
    201     /*! Traverse valid egress NAT translations and call the callback. */
    202     nat_egress_traverse_f nat_egress_traverse;
    203 
    204     /*! Add an ingress NAT table entry. */
    205     nat_ingress_add_f nat_ingress_add;
    206 
    207     /*! Delete the ingress NAT table entry. */
    208     nat_ingress_delete_f nat_ingress_delete;
    209 
    210     /*! Get the ingress NAT table entry. */
    211     nat_ingress_find_f nat_ingress_find;
    212 
    213     /*! Delete the ingress NAT table entries specified by flags. */
    214     nat_ingress_delete_all_f nat_ingress_delete_all;
    215 
    216     /*! Traverse valid ingress NAT entriess and call the callback. */
    217     nat_ingress_traverse_f nat_ingress_traverse;
    218 
    219 } mbcm_ltsw_nat_drv_t;
    220 
    221 /*!
    222  * \brief Set the NAT driver of the device.
    223  *
    224  * \param [in] unit Unit Number.
    225  * \param [in] drv Nat driver to set.
    226  *
    227  * \retval SHR_E_NONE No errors.
    228  * \retval !SHR_E_NONE Failure.
    229  */
    230 extern int
    231 mbcm_ltsw_nat_drv_set(
    232     int unit,
    233     mbcm_ltsw_nat_drv_t *drv);
    234 
    235 /*!
    236  * \brief Initialize NAT module.
    237  *
    238  * \param [in] unit Unit Number.
    239  *
    240  * \retval SHR_E_NONE No errors.
    241  * \retval !SHR_E_NONE Failure.
    242  */
    243 extern int
    244 mbcm_ltsw_nat_init(int unit);
    245 
    246 /*!
    247  * \brief De-initialize NAT module.
    248  *
    249  * \param [in] unit Unit Number.
    250  *
    251  * \retval SHR_E_NONE No errors.
    252  * \retval !SHR_E_NONE Failure.
    253  */
    254 extern int
    255 mbcm_ltsw_nat_detach(int unit);
    256 
    257 /*!
    258  * \brief Get the public info of NAT module.
    259  *
    260  * \param [in] unit Unit Number.
    261  * \param [out] nat_pub Returned nat public info.
    262  *
    263  * \retval SHR_E_NONE No errors.
    264  * \retval !SHR_E_NONE Failure.
    265  */
    266 extern int
    267 mbcm_ltsw_nat_pub_info_get(
    268     int unit,
    269     bcmint_nat_pub_info_t *nat_pub);
    270 
    271 /*!
    272  * \brief Add an egress NAT translation entry.
    273  *
    274  * \param [in] unit Unit Number.
    275  * \param [in] nat_info Egress NAT object pointer.
    276  *
    277  * \retval SHR_E_NONE No errors.
    278  * \retval !SHR_E_NONE Failure.
    279  */
    280 extern int
    281 mbcm_ltsw_nat_egress_add(
    282     int unit,
    283     bcm_l3_nat_egress_t *nat_info);
    284 
    285 /*!
    286  * \brief Destroy the egress NAT translation entry.
    287  *
    288  * \param [in] unit Unit Number.
    289  * \param [in] nat_info Egress NAT object pointer.
    290  *
    291  * \retval SHR_E_NONE No errors.
    292  * \retval !SHR_E_NONE Failure.
    293  */
    294 extern int
    295 mbcm_ltsw_nat_egress_destroy(
    296     int unit,
    297     bcm_l3_nat_egress_t *nat_info);
    298 
    299 /*!
    300  * \brief Get the egress NAT translation entry.
    301  *
    302  * \param [in] unit Unit Number.
    303  * \param [in] nat_info Egress NAT object pointer.
    304  *
    305  * \retval SHR_E_NONE No errors.
    306  * \retval !SHR_E_NONE Failure.
    307  */
    308 extern int
    309 mbcm_ltsw_nat_egress_get(
    310     int unit,
    311     bcm_l3_nat_egress_t *nat_info);
    312 
    313 /*!
    314  * \brief Traverse valid egress NAT translations and call the callback.
    315  *
    316  * \param [in] unit Unit Number.
    317  * \param [in] flags BCM_L3_NAT_EGRESS_XXX flags.
    318  * \param [in] cb User callback function, called once per egress NAT transltion entry.
    319  * \param [in] user_data Cookie.
    320  *
    321  * \retval SHR_E_NONE No errors.
    322  * \retval !SHR_E_NONE Failure.
    323  */
    324 extern int
    325 mbcm_ltsw_nat_egress_traverse(
    326     int unit,
    327     uint32_t flags,
    328     bcm_l3_nat_egress_traverse_cb cb,
    329     void *user_data);
    330 
    331 /*!
    332  * \brief Add an ingress NAT table entry.
    333  *
    334  * \param [in] unit Unit Number.
    335  * \param [in] nat_info Ingress NAT object pointer.
    336  *
    337  * \retval SHR_E_NONE No errors.
    338  * \retval !SHR_E_NONE Failure.
    339  */
    340 extern int
    341 mbcm_ltsw_nat_ingress_add(
    342     int unit,
    343     bcm_l3_nat_ingress_t *nat_info);
    344 
    345 /*!
    346  * \brief Delete the ingress NAT table entry.
    347  *
    348  * \param [in] unit Unit Number.
    349  * \param [in] nat_info Ingress NAT object pointer.
    350  *
    351  * \retval SHR_E_NONE No errors.
    352  * \retval !SHR_E_NONE Failure.
    353  */
    354 extern int
    355 mbcm_ltsw_nat_ingress_delete(
    356     int unit,
    357     bcm_l3_nat_ingress_t *nat_info);
    358 
    359 /*!
    360  * \brief Get the ingress NAT table entry.
    361  *
    362  * \param [in] unit Unit Number.
    363  * \param [in] nat_info Ingress NAT object pointer.
    364  *
    365  * \retval SHR_E_NONE No errors.
    366  * \retval !SHR_E_NONE Failure.
    367  */
    368 extern int
    369 mbcm_ltsw_nat_ingress_find(
    370     int unit,
    371     bcm_l3_nat_ingress_t *nat_info);
    372 
    373 /*!
    374  * \brief Delete the ingress NAT table entries specified by flags.
    375  *
    376  * \param [in] unit Unit Number.
    377  * \param [in] nat_info Only flags field is valid.These are used to figure out which table to clear.
    378  *
    379  * \retval SHR_E_NONE No errors.
    380  * \retval !SHR_E_NONE Failure.
    381  */
    382 extern int
    383 mbcm_ltsw_nat_ingress_delete_all(
    384     int unit,
    385     bcm_l3_nat_ingress_t *nat_info);
    386 
    387 /*!
    388  * \brief Traverse valid ingress NAT entriess and call the callback.
    389  *
    390  * \param [in] unit Unit Number.
    391  * \param [in] flags BCM_L3_NAT_INGRESS_XXX flags.
    392  * \param [in] cb User callback function, called once per ingress NAT table entry.
    393  * \param [in] user_data Cookie.
    394  *
    395  * \retval SHR_E_NONE No errors.
    396  * \retval !SHR_E_NONE Failure.
    397  */
    398 extern int
    399 mbcm_ltsw_nat_ingress_traverse(
    400     int unit,
    401     uint32_t flags,
    402     bcm_l3_nat_ingress_traverse_cb cb,
    403     void *user_data);
    404 
    405 #endif /* BCMINT_LTSW_MBCM_NAT_H */