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_intf_int.h (4448B)


      1 /*! \file l3_intf_int.h
      2  *
      3  * L3 intf internal header file.
      4  * This file contains L3 interface definitions internal to the L3 intf module
      5  * itself.
      6  */
      7 /*
      8  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      9  * 
     10  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
     11  */
     12 
     13 
     14 #ifndef BCMI_LTSW_L3_INTF_INT_H
     15 #define BCMI_LTSW_L3_INTF_INT_H
     16 
     17 #include <bcm/l3.h>
     18 #include <sal/sal_types.h>
     19 
     20 #include <bcm_int/ltsw/types.h>
     21 
     22 /* HA Sub component id for add_to_arl bitmap. */
     23 #define BCMINT_LTSW_L3_INTF_HA_ADD2ARL (0)
     24 #define BCMINT_LTSW_L3_INTF_HA_UL_OIF_INFO (1)
     25 
     26 
     27 /* Do not modify DSCP. */
     28 #define BCMINT_LTSW_L3_INTF_DSCP_ACTION_NONE (0)
     29 
     30 /* Use DSCP value from L3_EIF table. */
     31 #define BCMINT_LTSW_L3_INTF_DSCP_ACTION_FIXED (1)
     32 
     33 /*
     34  * Use PHB_EGR_IP_INT_PRI_TO_DSCP_ID to get DSCP
     35  * value from PHB_EGR_IP_INT_PRI_TO_DSCP table.
     36  */
     37 #define BCMINT_LTSW_L3_INTF_DSCP_ACTION_MAP (2)
     38 
     39 
     40 
     41 /* Do not modify PRI and CFI. */
     42 #define BCMINT_LTSW_L3_INTF_L2_TAG_ACTION_NONE (0)
     43 
     44 /*! Use PRI, CFI values from L3_EIF table. */
     45 #define BCMINT_LTSW_L3_INTF_L2_TAG_ACTION_FIXED (1)
     46 
     47 /*
     48  * Use PHB_EGR_L2_INT_PRI_TO_OTAG_ID to get PRI, CFI
     49  * values from PHB_EGR_L2_INT_PRI_TO_OTAG table.
     50  */
     51 #define BCMINT_LTSW_L3_INTF_L2_TAG_ACTION_MAP (2)
     52 
     53 
     54 /* No tunnel. */
     55 #define BCMINT_LTSW_L3_INTF_TNL_TYPE_NONE (0)
     56 
     57 /* IPV4 tunnel. */
     58 #define BCMINT_LTSW_L3_INTF_TNL_TYPE_IPV4 (1)
     59 
     60 /* IPV6 tunnel. */
     61 #define BCMINT_LTSW_L3_INTF_TNL_TYPE_IPV6 (2)
     62 
     63 /* MPLS tunnel. */
     64 #define BCMINT_LTSW_L3_INTF_TNL_TYPE_MPLS (3)
     65 
     66 
     67 
     68 /*
     69  * \brief Defines L3 egress interface information.
     70  *
     71  * This data structure defines the information in L3 egress interface.
     72  */
     73 typedef struct bcmint_ltsw_l3_egr_intf_s {
     74     /* Create or replace. */
     75     uint32_t flags;
     76 
     77     /* Interface flags. */
     78     uint32_t intf_flags;
     79 
     80     /* Interface index. */
     81     int intf_id;
     82 
     83     /* MAC address for this interface. */
     84     bcm_mac_t mac_addr;
     85 
     86     /* VLAN ID for this interface. */
     87     bcm_vlan_t vid;
     88 
     89     /* Tunnel index. */
     90     int tunnel_idx;
     91 
     92     /* TTL threshold. */
     93     int ttl;
     94 
     95     /* MTU threshold. */
     96     int mtu;
     97 
     98     /* TTL decrement value. */
     99     int ttl_dec;
    100 
    101     /* Classification class ID. */
    102     int class_id;
    103 
    104     /* DSCP QoS setting. */
    105     bcm_l3_intf_qos_t  dscp_qos;
    106 
    107     /* VLAN QoS setting. */
    108     bcm_l3_intf_qos_t vlan_qos;
    109 
    110     /* Opaque ctrl ID. */
    111     int opaque_ctrl_id;
    112 
    113     /* MPLS flags. */
    114     uint32_t mpls_flags;
    115 
    116     /* MPLS VC Label. */
    117     bcm_mpls_label_t mpls_label;
    118 
    119     /* MPLS TTL threshold. */
    120     uint8 mpls_ttl;
    121 
    122     /* MPLS Exp. */
    123     uint8 mpls_exp;
    124 
    125     /* CPU interface. */
    126     bool cpu;
    127 } bcmint_ltsw_l3_egr_intf_t;
    128 
    129 /* Field description. */
    130 typedef struct bcmint_ltsw_l3_intf_fld_s {
    131     /* Field name. */
    132     const char *fld_name;
    133 
    134     /* Field ID. */
    135     uint32_t fld_id;
    136 
    137     /* Key field. */
    138     bool key;
    139 
    140     /* Symbol field. */
    141     bool symbol;
    142 
    143     /* View type field. */
    144     bool view_t;
    145 
    146     /* Bitmap of valid views for field. Only used for multi-view LT. */
    147     uint32_t vt_bmp;
    148 
    149     /* Callback to get scalar value from symbol. */
    150     bcmi_ltsw_symbol_to_scalar_f symbol_to_scalar;
    151 
    152     /* Callback to get symbol from scalar value. */
    153     bcmi_ltsw_scalar_to_symbol_f scalar_to_symbol;
    154 
    155 } bcmint_ltsw_l3_intf_fld_t;
    156 
    157 /* The structure of L3 interface table. */
    158 typedef struct bcmint_ltsw_l3_intf_tbl_s {
    159     /* Table name. */
    160     const char *name;
    161 
    162     /* Table ID. */
    163     uint32_t tbl_id;
    164 
    165     /* Table attributes. */
    166     uint32_t attr;
    167 
    168     /* Field count. */
    169     uint32_t fld_cnt;
    170 
    171     /* Bitmap of valid fields. */
    172     uint64_t fld_bmp;
    173 
    174     /* The fields of table. */
    175     const bcmint_ltsw_l3_intf_fld_t *flds;
    176 
    177 } bcmint_ltsw_l3_intf_tbl_t;
    178 
    179 /* L3 interface table database. */
    180 typedef struct bcmint_ltsw_l3_intf_tbl_db_s {
    181     /* The table bitmap. */
    182     uint32_t tbl_bmp;
    183 
    184     /* The table array. */
    185     const bcmint_ltsw_l3_intf_tbl_t *tbls;
    186 } bcmint_ltsw_l3_intf_tbl_db_t;
    187 
    188 /*!
    189  * \brief Get L3 interface logical table info.
    190  *
    191  * \param [in] unit Unit Number.
    192  * \param [in] tbl_id L3 intf logical table description ID.
    193  * \param [out] tbl_info Pointer to table description info.
    194  *
    195  * \retval SHR_E_UNAVAIL Logical table is not supported.
    196  * \retval SHR_E_NONE No errer.
    197  */
    198 extern int
    199 bcmint_ltsw_l3_intf_tbl_get(int unit, int tbl_id,
    200                             const bcmint_ltsw_l3_intf_tbl_t **tbl_info);
    201 
    202 #endif /* BCMI_LTSW_L3_INTF_INT_H */
    203