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

l3.h (20145B)


      1 /*! \file l3.h
      2  *
      3  * BCM L3 module APIs and Structures used only internally.
      4  */
      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_L3_H
     12 #define BCMINT_LTSW_MBCM_L3_H
     13 
     14 #include <bcm/l3.h>
     15 #include <bcm_int/ltsw/l3.h>
     16 #include <bcm_int/ltsw/l3_int.h>
     17 
     18 /*!
     19  * \brief Initialize L3 module.
     20  *
     21  * \param [in] unit Unit Number.
     22  *
     23  * \retval SHR_E_NONE No errors.
     24  * \retval !SHR_E_NONE Failure.
     25  */
     26 typedef int (*l3_init_f)(int unit);
     27 
     28 /*!
     29  * \brief De-initialize L3 module.
     30  *
     31  * \param [in] unit Unit Number.
     32  *
     33  * \retval SHR_E_NONE No errors.
     34  * \retval !SHR_E_NONE Failure.
     35  */
     36 typedef int (*l3_deinit_f)(int unit);
     37 
     38 /*!
     39  * \brief Set mtu value.
     40  *
     41  * \param [in] unit Unit Number.
     42  * \param [in] cfg MTU Information.
     43  *
     44  * \retval SHR_E_NONE No errors.
     45  * \retval !SHR_E_NONE Failure.
     46  */
     47 typedef int (*l3_mtu_set_f)(
     48     int unit,
     49     bcmi_ltsw_l3_mtu_cfg_t *cfg);
     50 
     51 /*!
     52  * \brief Get mtu value.
     53  *
     54  * \param [in] unit Unit Number.
     55  * \param [out] cfg MTU Information.
     56  *
     57  * \retval SHR_E_NONE No errors.
     58  * \retval !SHR_E_NONE Failure.
     59  */
     60 typedef int (*l3_mtu_get_f)(
     61     int unit,
     62     bcmi_ltsw_l3_mtu_cfg_t *cfg);
     63 
     64 /*!
     65  * \brief Delete mtu value.
     66  *
     67  * \param [in] unit Unit Number.
     68  * \param [in] mtu_idx MTU entry index.
     69  *
     70  * \retval SHR_E_NONE No errors.
     71  * \retval !SHR_E_NONE Failure.
     72  */
     73 typedef int (*l3_mtu_delete_f)(
     74     int unit,
     75     bcmi_ltsw_l3_mtu_cfg_t *cfg);
     76 
     77 /*!
     78  * \brief Recover mtu database from LT.
     79  *
     80  * \param [in] unit Unit Number.
     81  * \param [in] mtu_idx MTU entry index.
     82  *
     83  * \retval SHR_E_NONE No errors.
     84  * \retval !SHR_E_NONE Failure.
     85  */
     86 typedef int (*l3_mtu_recover_f)(int unit, int mtu_idx);
     87 
     88 /*!
     89  * \brief Get the available L3 information.
     90  *
     91  * \param [in] unit Unit Number.
     92  * \param [in] l3info L3 information.
     93  *
     94  * \retval SHR_E_NONE No errors.
     95  * \retval !SHR_E_NONE Failure.
     96  */
     97 typedef int (*l3_info_get_f)(int unit, bcm_l3_info_t *l3info);
     98 
     99 /*!
    100  * \brief Enable/disable L3 function for a unit without clearing any L3 tables.
    101  *
    102  * \param [in] unit Unit number.
    103  * \param [in] 1 for enable, 0 for disable.
    104  *
    105  * \retval SHR_E_NONE Success.
    106  * \retval !SHR_E_NONE Failure.
    107  */
    108 typedef int (*l3_enable_set_f)(int unit, int enable);
    109 
    110 /*!
    111  * \brief Set L3 controlling information.
    112  *
    113  * \param [in] unit Unit Number.
    114  * \param [in] l3_type L3 switch control type.
    115  * \param [in] control Switch control.
    116  * \param [in] value Type-based controlling value for L3.
    117  *
    118  * \retval SHR_E_NONE No errors.
    119  * \retval !SHR_E_NONE Failure.
    120  */
    121 typedef int (*l3_control_set_f)(
    122     int unit,
    123     bcmi_ltsw_l3_control_t control,
    124     uint32_t value);
    125 
    126 
    127 /*!
    128  * \brief Get L3 controlling information.
    129  *
    130  * \param [in] unit Unit Number.
    131  * \param [in] l3_type L3 switch control type.
    132  * \param [in] control Switch control.
    133  * \param [out] value Type-based controlling value for L3.
    134  *
    135  * \retval SHR_E_NONE No errors.
    136  * \retval !SHR_E_NONE Failure.
    137  */
    138 typedef int (*l3_control_get_f)(
    139     int unit,
    140     bcmi_ltsw_l3_control_t control,
    141     uint32_t *value);
    142 
    143 /*!
    144  * \brief Set L3 port controlling information.
    145  *
    146  * \param [in] unit Unit Number.
    147  * \param [in] port Port Number.
    148  * \param [in] control Control type.
    149  * \param [in] info Control infomation.
    150  *
    151  * \retval SHR_E_NONE No errors.
    152  * \retval !SHR_E_NONE Failure.
    153  */
    154 typedef int (*l3_port_control_set_f)(
    155     int unit,
    156     int port,
    157     int control,
    158     bcmi_ltsw_l3_port_control_t *info);
    159 
    160 /*!
    161  * \brief Get L3 port controlling information.
    162  *
    163  * \param [in] unit Unit Number.
    164  * \param [in] port Port Number.
    165  * \param [in] control Control type.
    166  * \param [out] info Control infomation.
    167  *
    168  * \retval SHR_E_NONE No errors.
    169  * \retval !SHR_E_NONE Failure.
    170  */
    171 typedef int (*l3_port_control_get_f)(
    172     int unit,
    173     int port,
    174     int control,
    175     bcmi_ltsw_l3_port_control_t *info);
    176 
    177 /*!
    178  * \brief Set ipv6 reserved multicast address and mask.
    179  *
    180  * \param [in] unit Unit number.
    181  * \param [in] num Number of ipv6 address/mask pairs
    182  * \param [in] ip6_addr  Ipv6 address.
    183  * \param [in] ip6_mask Ipv6 address mask.
    184  *
    185  * \retval SHR_E_NONE No errors.
    186  * \retval !SHR_E_NONE Failure.
    187  */
    188 typedef int (*l3_ipv6_reserved_multicast_addr_multi_set_f)(
    189     int unit,
    190     int num,
    191     bcm_ip6_t *ip6_addr,
    192     bcm_ip6_t *ip6_mask);
    193 
    194 /*!
    195  * \brief Get ipv6 reserved multicast address and mask.
    196  *
    197  * \param [in] unit Unit number.
    198  * \param [in] num Number of ipv6 address/mask pairs
    199  * \param [out] ip6_addr  Ipv6 address.
    200  * \param [out] ip6_mask Ipv6 address mask.
    201  *
    202  * \retval SHR_E_NONE No errors.
    203  * \retval !SHR_E_NONE Failure.
    204  */
    205 typedef int (*l3_ipv6_reserved_multicast_addr_multi_get_f)(
    206     int unit,
    207     int num,
    208     bcm_ip6_t *ip6_addr,
    209     bcm_ip6_t *ip6_mask);
    210 
    211 /*!
    212  * \brief Create an IP option handling profile.
    213  *
    214  * \param [in] unit Unit number.
    215  * \param [in] flags BCM_L3_WITH_ID: ip4_options_profile_id argument given.
    216  * \param [in] default_action Default action for options in the profile.
    217  * \param [out] ip4_options_profile_id L3 IP options profile ID.
    218  *
    219  * \retval SHR_E_NONE Success.
    220  * \retval !SHR_E_NONE Failure.
    221  */
    222 typedef int (*l3_ip4_options_profile_create_f)(
    223     int unit, uint32 flags,
    224     bcm_l3_ip4_options_action_t default_action,
    225     int *ip4_options_profile_id);
    226 
    227 /*!
    228  * \brief Delete a IP option handling profile.
    229  *
    230  * \param [in] unit Unit number.
    231  * \param [in] ip4_options_profile_id L3 IP options profile ID.
    232  *
    233  * \retval SHR_E_NONE Success.
    234  * \retval !SHR_E_NONE Failure.
    235  */
    236 typedef int (*l3_ip4_options_profile_destroy_f)(
    237     int unit,
    238     int ip4_options_profile_id);
    239 
    240 /*!
    241  * \brief Update action for given IP action and Profile ID.
    242  *
    243  * \param [in] unit Unit number.
    244  * \param [in] ip4_options_profile_id L3 IP options profile ID.
    245  * \param [in] ip4_option New Action for IP Options.
    246  * \param [in] action L3 IP options handing actions.
    247  *
    248  * \retval SHR_E_NONE Success.
    249  * \retval !SHR_E_NONE Failure.
    250  */
    251 typedef int (*l3_ip4_options_action_set_f)(
    252     int unit,
    253     int ip4_options_profile_id,
    254     int ip4_option,
    255     bcm_l3_ip4_options_action_t action);
    256 
    257 /*!
    258  * \brief Retrive action for given IP action and Profile ID.
    259  *
    260  * \param [in] unit Unit number.
    261  * \param [in] ip4_options_profile_id L3 IP options profile ID.
    262  * \param [in] ip4_option New Action for IP Options.
    263  * \param [out] action L3 IP options handing actions.
    264  *
    265  * \retval SHR_E_NONE Success.
    266  * \retval !SHR_E_NONE Failure.
    267  */
    268 typedef int (*l3_ip4_options_action_get_f)(
    269     int unit,
    270     int ip4_options_profile_id,
    271     int ip4_option,
    272     bcm_l3_ip4_options_action_t *action);
    273 
    274 /*!
    275  * \brief Create an IPv6 prefix map into IPv4 entry.
    276  *
    277  * \param [in] unit Unit number.
    278  * \param [in] ip6_addr New IPv6 translation address.
    279  *
    280  * \retval SHR_E_NONE Success.
    281  * \retval !SHR_E_NONE Failure.
    282  */
    283 typedef int (*l3_ip6_prefix_map_add_f)(int unit, bcm_ip6_t ip6_addr);
    284 
    285 /*!
    286  * \brief Get a list of IPv6 96 bit prefixes which are mapped to ipv4 lookup.
    287  *
    288  * \param [in] unit Unit number.
    289  * \param [in] map_size Size of allocated entries in ip6_array.
    290  * \param [out] ip6_array Array of mapped prefixes.
    291  * \param [out] ip6_count Number of entries of ip6_array actually filled in.
    292  *
    293  * \retval SHR_E_NONE Success.
    294  * \retval !SHR_E_NONE Failure.
    295  */
    296 typedef int (*l3_ip6_prefix_map_get_f)(
    297     int unit, int map_size,
    298     bcm_ip6_t *ip6_array, int *ip6_count);
    299 
    300 /*!
    301  * \brief Destroy an IPv6 prefix map entry.
    302  *
    303  * \param [in] unit Unit number.
    304  * \param [in] ip6_addr IPv6 translation address.
    305  *
    306  * \retval SHR_E_NONE Success.
    307  * \retval !SHR_E_NONE Failure.
    308  */
    309 typedef int (*l3_ip6_prefix_map_del_f)(int unit, bcm_ip6_t ip6_addr);
    310 
    311 /*!
    312  * \brief Flush all IPv6 prefix maps.
    313  *
    314  * \param [in] unit Unit number.
    315  *
    316  * \retval SHR_E_NONE Success.
    317  * \retval !SHR_E_NONE Failure.
    318  */
    319 typedef int (*l3_ip6_prefix_map_del_all_f)(int unit);
    320 
    321 /*!
    322  * \brief Translate Profile ID into hardware table index used by API.
    323  *
    324  * \param [in] unit Unit Number.
    325  * \param [in] profile_id Profile ID.
    326  * \param [out] hw_idx Hardware index.
    327  *
    328  * \retval SHR_E_NONE No errors.
    329  * \retval !SHR_E_NONE Failure.
    330  */
    331 typedef int (*l3_ip4_options_profile_id2idx_f)(
    332     int unit,
    333     int profile_id,
    334     int *hw_idx);
    335 
    336 /*!
    337  * \brief Translate hardware table index into Profile ID used by API.
    338  *
    339  * \param [in] unit Unit Number.
    340  * \param [in] hw_idx Hardware index.
    341  * \param [out] profile_id Profile ID.
    342  *
    343  * \retval SHR_E_NONE No errors.
    344  * \retval !SHR_E_NONE Failure.
    345  */
    346 typedef int (*l3_ip4_options_profile_idx2id_f)(
    347     int unit,
    348     int hw_idx,
    349     int *profile_id);
    350 
    351 /*!
    352  * \brief Get L3 switch control logical table info.
    353  *
    354  * \param [in] unit Unit Number.
    355  * \param [out] tbl_info Pointer to table description info.
    356  *
    357  * \retval SHR_E_UNAVAIL Logical table is not supported.
    358  * \retval SHR_E_NONE No errer.
    359  */
    360 typedef int (*l3_switch_control_tbl_get_f)(
    361     int unit,
    362     const bcmint_ltsw_l3_switch_control_tbl_t **tbl_info);
    363 
    364 /*!
    365  * \brief L3 driver structure.
    366  */
    367 typedef struct mbcm_ltsw_l3_drv_s {
    368 
    369     /*! Init L3 module. */
    370     l3_init_f l3_init;
    371 
    372     /*! De-init L3 module. */
    373     l3_deinit_f l3_deinit;
    374 
    375     /*! Set mtu value. */
    376     l3_mtu_set_f l3_mtu_set;
    377 
    378     /*! Get mtu value. */
    379     l3_mtu_get_f l3_mtu_get;
    380 
    381     /*! Delete mtu value. */
    382     l3_mtu_delete_f l3_mtu_delete;
    383 
    384     /*! Recover mtu database from LT. */
    385     l3_mtu_recover_f l3_mtu_recover;
    386 
    387     /*! Get L3 information. */
    388     l3_info_get_f l3_info_get;
    389 
    390     /*! Enable L3. */
    391     l3_enable_set_f l3_enable_set;
    392 
    393     /*! Set L3 control. */
    394     l3_control_set_f l3_control_set;
    395 
    396     /*! Get L3 control. */
    397     l3_control_get_f l3_control_get;
    398 
    399     /*! Set L3 port control. */
    400     l3_port_control_set_f l3_port_control_set;
    401 
    402     /*! Get L3 port control. */
    403     l3_port_control_get_f l3_port_control_get;
    404 
    405     /*! Set L3 port control. */
    406     l3_ipv6_reserved_multicast_addr_multi_set_f l3_ipv6_reserved_multicast_addr_multi_set;
    407 
    408     /*! Get L3 port control. */
    409     l3_ipv6_reserved_multicast_addr_multi_get_f l3_ipv6_reserved_multicast_addr_multi_get;
    410 
    411     /*! Create IPV4 Option profile. */
    412     l3_ip4_options_profile_create_f l3_ip4_options_profile_create;
    413 
    414     /*! Destroy IPV4 Option profile. */
    415     l3_ip4_options_profile_destroy_f l3_ip4_options_profile_destroy;
    416 
    417     /*! Set IPV4 Option profile action. */
    418     l3_ip4_options_action_set_f l3_ip4_options_action_set;
    419 
    420     /*! Get IPV4 Option profile action. */
    421     l3_ip4_options_action_get_f l3_ip4_options_action_get;
    422 
    423     /*! Add IPV6 Prefix map. */
    424     l3_ip6_prefix_map_add_f l3_ip6_prefix_map_add;
    425 
    426     /*! Get IPV6 Prefix map. */
    427     l3_ip6_prefix_map_get_f l3_ip6_prefix_map_get;
    428 
    429     /*! Delete IPV6 Prefix map. */
    430     l3_ip6_prefix_map_del_f l3_ip6_prefix_map_del;
    431 
    432     /*! Delete all  IPV6 Prefix maps. */
    433     l3_ip6_prefix_map_del_all_f l3_ip6_prefix_map_del_all;
    434 
    435     /*! L3 IPV4 option idx to ID. */
    436     l3_ip4_options_profile_id2idx_f l3_ip4_options_profile_id2idx;
    437 
    438     /*! L3 IPV4 option ID to idx. */
    439     l3_ip4_options_profile_idx2id_f l3_ip4_options_profile_idx2id;
    440 
    441     /*! Get L3 switch control table information. */
    442     l3_switch_control_tbl_get_f l3_switch_control_tbl_get;
    443 
    444 } mbcm_ltsw_l3_drv_t;
    445 
    446 /*!
    447  * \brief Set the L3 driver of the device.
    448  *
    449  * \param [in] unit Unit Number.
    450  * \param [in] drv L3 driver to set.
    451  *
    452  * \retval SHR_E_NONE No errors.
    453  * \retval !SHR_E_NONE Failure.
    454  */
    455 extern int
    456 mbcm_ltsw_l3_drv_set(
    457     int unit,
    458     mbcm_ltsw_l3_drv_t *drv);
    459 
    460 /*!
    461  * \brief Initialize L3 module.
    462  *
    463  * \param [in] unit Unit Number.
    464  *
    465  * \retval SHR_E_NONE No errors.
    466  * \retval !SHR_E_NONE Failure.
    467  */
    468 extern int
    469 mbcm_ltsw_l3_init(int unit);
    470 
    471 /*!
    472  * \brief De-initialize L3 module.
    473  *
    474  * \param [in] unit Unit Number.
    475  *
    476  * \retval SHR_E_NONE No errors.
    477  * \retval !SHR_E_NONE Failure.
    478  */
    479 extern int
    480 mbcm_ltsw_l3_deinit(int unit);
    481 
    482 /*!
    483  * \brief Set mtu value.
    484  *
    485  * \param [in] unit Unit Number.
    486  * \param [in] cfg MTU Information.
    487  *
    488  * \retval SHR_E_NONE No errors.
    489  * \retval !SHR_E_NONE Failure.
    490  */
    491 extern int
    492 mbcm_ltsw_l3_mtu_set(
    493     int unit,
    494     bcmi_ltsw_l3_mtu_cfg_t *cfg);
    495 
    496 /*!
    497  * \brief Get mtu value.
    498  *
    499  * \param [in] unit Unit Number.
    500  * \param [out] cfg MTU Information.
    501  *
    502  * \retval SHR_E_NONE No errors.
    503  * \retval !SHR_E_NONE Failure.
    504  */
    505 extern int
    506 mbcm_ltsw_l3_mtu_get(
    507     int unit,
    508     bcmi_ltsw_l3_mtu_cfg_t *cfg);
    509 
    510 /*!
    511  * \brief Delete mtu value.
    512  *
    513  * \param [in] unit Unit Number.
    514  * \param [in] mtu_idx MTU entry index.
    515  *
    516  * \retval SHR_E_NONE No errors.
    517  * \retval !SHR_E_NONE Failure.
    518  */
    519 extern int
    520 mbcm_ltsw_l3_mtu_delete(
    521     int unit,
    522     bcmi_ltsw_l3_mtu_cfg_t *cfg);
    523 
    524 /*!
    525  * \brief Recover mtu database from LT.
    526  *
    527  * \param [in] unit Unit Number.
    528  * \param [in] mtu_idx MTU entry index.
    529  *
    530  * \retval SHR_E_NONE No errors.
    531  * \retval !SHR_E_NONE Failure.
    532  */
    533 extern int
    534 mbcm_ltsw_l3_mtu_recover(int unit, int mtu_idx);
    535 
    536 /*!
    537  * \brief Get the available L3 information.
    538  *
    539  * \param [in] unit Unit Number.
    540  * \param [in] l3info L3 information.
    541  *
    542  * \retval SHR_E_NONE No errors.
    543  * \retval !SHR_E_NONE Failure.
    544  */
    545 extern int
    546 mbcm_ltsw_l3_info_get(int unit, bcm_l3_info_t *l3info);
    547 
    548 /*!
    549  * \brief Enable/disable L3 function for a unit without clearing any L3 tables
    550  *
    551  * \param [in] unit Unit number.
    552  * \param [in] 1 for enable, 0 for disable.
    553  *
    554  * \retval SHR_E_NONE Success.
    555  * \retval !SHR_E_NONE Failure.
    556  */
    557 extern int
    558 mbcm_ltsw_l3_enable_set(int unit, int enable);
    559 
    560 /*!
    561  * \brief Set L3 controlling information.
    562  *
    563  * \param [in] unit Unit Number.
    564  * \param [in] control Switch control.
    565  * \param [in] value Type-based controlling value for L3.
    566  *
    567  * \retval SHR_E_NONE No errors.
    568  * \retval !SHR_E_NONE Failure.
    569  */
    570 extern int
    571 mbcm_ltsw_l3_control_set(
    572     int unit,
    573     bcmi_ltsw_l3_control_t control,
    574     uint32_t value);
    575 
    576 /*!
    577  * \brief Get L3 controlling information.
    578  *
    579  * \param [in] unit Unit Number.
    580  * \param [in] control Switch control.
    581  * \param [out] value Type-based controlling value for L3.
    582  *
    583  * \retval SHR_E_NONE No errors.
    584  * \retval !SHR_E_NONE Failure.
    585  */
    586 extern int
    587 mbcm_ltsw_l3_control_get(
    588     int unit,
    589     bcmi_ltsw_l3_control_t control,
    590     uint32_t *value);
    591 
    592 /*!
    593  * \brief Set ipv6 reserved multicast address and mask.
    594  *
    595  * \param [in] unit Unit number.
    596  * \param [in] num Number of ipv6 address/mask pairs
    597  * \param [in] ip6_addr  Ipv6 address.
    598  * \param [in] ip6_mask Ipv6 address mask.
    599  *
    600  * \retval SHR_E_NONE No errors.
    601  * \retval !SHR_E_NONE Failure.
    602  */
    603 extern int
    604 mbcm_ltsw_l3_ipv6_reserved_multicast_addr_multi_set(
    605     int unit,
    606     int num,
    607     bcm_ip6_t *ip6_addr,
    608     bcm_ip6_t *ip6_mask);
    609 
    610 /*!
    611  * \brief Get ipv6 reserved multicast address and mask.
    612  *
    613  * \param [in] unit Unit number.
    614  * \param [in] num Number of ipv6 address/mask pairs
    615  * \param [out] ip6_addr  Ipv6 address.
    616  * \param [out]] ip6_mask Ipv6 address mask.
    617  *
    618  * \retval SHR_E_NONE No errors.
    619  * \retval !SHR_E_NONE Failure.
    620  */
    621 extern int
    622 mbcm_ltsw_l3_ipv6_reserved_multicast_addr_multi_get(
    623     int unit,
    624     int num,
    625     bcm_ip6_t *ip6_addr,
    626     bcm_ip6_t *ip6_mask);
    627 
    628 /*!
    629  * \brief Set L3 port controlling information.
    630  *
    631  * \param [in] unit Unit Number.
    632  * \param [in] port Port Number.
    633  * \param [in] control Control type.
    634  * \param [in] info Control infomation.
    635  *
    636  * \retval SHR_E_NONE No errors.
    637  * \retval !SHR_E_NONE Failure.
    638  */
    639 extern int
    640 mbcm_ltsw_l3_port_control_set(
    641     int unit,
    642     int port,
    643     int control,
    644     bcmi_ltsw_l3_port_control_t *info);
    645 
    646 /*!
    647  * \brief Get L3 port controlling information.
    648  *
    649  * \param [in] unit Unit Number.
    650  * \param [in] port Port Number.
    651  * \param [in] control Control type.
    652  * \param [out] info Control infomation.
    653  *
    654  * \retval SHR_E_NONE No errors.
    655  * \retval !SHR_E_NONE Failure.
    656  */
    657 
    658 extern int
    659 mbcm_ltsw_l3_port_control_get(
    660     int unit,
    661     int port,
    662     int control,
    663     bcmi_ltsw_l3_port_control_t *info);
    664 
    665 /*!
    666  * \brief Create an IP option handling profile.
    667  *
    668  * \param [in] unit Unit number.
    669  * \param [in] flags BCM_L3_WITH_ID: ip4_options_profile_id argument given.
    670  * \param [in] default_action Default action for options in the profile.
    671  * \param [out] ip4_options_profile_id L3 IP options profile ID.
    672  *
    673  * \retval SHR_E_NONE Success.
    674  * \retval !SHR_E_NONE Failure.
    675  */
    676 extern int
    677 mbcm_ltsw_l3_ip4_options_profile_create(
    678     int unit, uint32 flags,
    679     bcm_l3_ip4_options_action_t default_action,
    680     int *ip4_options_profile_id);
    681 
    682 /*!
    683  * \brief Delete a IP option handling profile.
    684  *
    685  * \param [in] unit Unit number.
    686  * \param [in] ip4_options_profile_id L3 IP options profile ID.
    687  *
    688  * \retval SHR_E_NONE Success.
    689  * \retval !SHR_E_NONE Failure.
    690  */
    691 extern int
    692 mbcm_ltsw_l3_ip4_options_profile_destroy(
    693     int unit,
    694     int ip4_options_profile_id);
    695 
    696 /*!
    697  * \brief Update action for given IP action and Profile ID.
    698  *
    699  * \param [in] unit Unit number.
    700  * \param [in] ip4_options_profile_id L3 IP options profile ID.
    701  * \param [in] ip4_option New Action for IP Options.
    702  * \param [in] action L3 IP options handing actions.
    703  *
    704  * \retval SHR_E_NONE Success.
    705  * \retval !SHR_E_NONE Failure.
    706  */
    707 extern int
    708 mbcm_ltsw_l3_ip4_options_action_set(
    709     int unit,
    710     int ip4_options_profile_id,
    711     int ip4_option,
    712     bcm_l3_ip4_options_action_t action);
    713 
    714 /*!
    715  * \brief Retrive action for given IP action and Profile ID.
    716  *
    717  * \param [in] unit Unit number.
    718  * \param [in] ip4_options_profile_id L3 IP options profile ID.
    719  * \param [in] ip4_option New Action for IP Options.
    720  * \param [out] action L3 IP options handing actions.
    721  *
    722  * \retval SHR_E_NONE Success.
    723  * \retval !SHR_E_NONE Failure.
    724  */
    725 extern int
    726 mbcm_ltsw_l3_ip4_options_action_get(
    727     int unit,
    728     int ip4_options_profile_id,
    729     int ip4_option,
    730     bcm_l3_ip4_options_action_t *action);
    731 
    732 /*!
    733  * \brief Create an IPv6 prefix map into IPv4 entry.
    734  *
    735  * \param [in] unit Unit number.
    736  * \param [in] ip6_addr New IPv6 translation address.
    737  *
    738  * \retval SHR_E_NONE Success.
    739  * \retval !SHR_E_NONE Failure.
    740  */
    741 extern int
    742 mbcm_ltsw_l3_ip6_prefix_map_add(int unit, bcm_ip6_t ip6_addr);
    743 
    744 /*!
    745  * \brief Get a list of IPv6 96 bit prefixes which are mapped to ipv4 lookup.
    746  *
    747  * \param [in] unit Unit number.
    748  * \param [in] map_size Size of allocated entries in ip6_array.
    749  * \param [out] ip6_array Array of mapped prefixes.
    750  * \param [out] ip6_count Number of entries of ip6_array actually filled in.
    751  *
    752  * \retval SHR_E_NONE Success.
    753  * \retval !SHR_E_NONE Failure.
    754  */
    755 extern int
    756 mbcm_ltsw_l3_ip6_prefix_map_get(
    757     int unit, int map_size,
    758     bcm_ip6_t *ip6_array, int *ip6_count);
    759 
    760 /*!
    761  * \brief Destroy an IPv6 prefix map entry.
    762  *
    763  * \param [in] unit Unit number.
    764  * \param [in] ip6_addr IPv6 translation address.
    765  *
    766  * \retval SHR_E_NONE Success.
    767  * \retval !SHR_E_NONE Failure.
    768  */
    769 extern int
    770 mbcm_ltsw_l3_ip6_prefix_map_del(int unit, bcm_ip6_t ip6_addr);
    771 
    772 /*!
    773  * \brief Flush all IPv6 prefix maps.
    774  *
    775  * \param [in] unit Unit number.
    776  *
    777  * \retval SHR_E_NONE Success.
    778  * \retval !SHR_E_NONE Failure.
    779  */
    780 extern int
    781 mbcm_ltsw_l3_ip6_prefix_map_del_all(int unit);
    782 
    783 /*!
    784  * \brief Translate Profile ID into hardware table index used by API.
    785  *
    786  * \param [in] unit Unit Number.
    787  * \param [in] profile_id Profile ID.
    788  * \param [out] hw_idx Hardware index.
    789  *
    790  * \retval SHR_E_NONE No errors.
    791  * \retval !SHR_E_NONE Failure.
    792  */
    793 extern int
    794 mbcm_ltsw_l3_ip4_options_profile_id2idx(
    795     int unit,
    796     int profile_id,
    797     int *hw_idx);
    798 
    799 /*!
    800  * \brief Translate hardware table index into Profile ID used by API.
    801  *
    802  * \param [in] unit Unit Number.
    803  * \param [in] hw_idx Hardware index.
    804  * \param [out] profile_id Profile ID.
    805  *
    806  * \retval SHR_E_NONE No errors.
    807  * \retval !SHR_E_NONE Failure.
    808  */
    809 extern int
    810 mbcm_ltsw_l3_ip4_options_profile_idx2id(
    811     int unit,
    812     int hw_idx,
    813     int *profile_id);
    814 
    815 /*!
    816  * \brief Get L3 switch control logical table info.
    817  *
    818  * \param [in] unit Unit Number.
    819  * \param [out] tbl_info Pointer to table description info.
    820  *
    821  * \retval SHR_E_UNAVAIL Logical table is not supported.
    822  * \retval SHR_E_NONE No errer.
    823  */
    824 extern int
    825 mbcm_ltsw_l3_switch_control_tbl_get(
    826     int unit,
    827     const bcmint_ltsw_l3_switch_control_tbl_t **tbl_info);
    828 
    829 #endif /* BCMINT_LTSW_MBCM_L3_H */