l3_aacl_int.h (2439B)
1 /*! \file l3_aacl_int.h 2 * 3 * L3 AACL internal header file. 4 * This file contains L3 AACL definitions internal to the L3 module itself. 5 */ 6 /* 7 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 8 * 9 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 10 */ 11 12 #ifndef BCMI_LTSW_L3_AACL_INT_H 13 #define BCMI_LTSW_L3_AACL_INT_H 14 15 #include <bcm_int/ltsw/types.h> 16 #include <sal/sal_types.h> 17 18 /* Field description. */ 19 typedef struct bcmint_ltsw_l3_aacl_fld_s { 20 /* Field name. */ 21 const char *fld_name; 22 23 /* Filed ID. */ 24 uint32_t fld_id; 25 26 /* Key field. */ 27 bool key; 28 29 /* Symbol field. */ 30 bool symbol; 31 32 /* Number of elements needed for field. */ 33 uint32_t elements; 34 35 /* Callback to get scalar value from symbol. */ 36 bcmi_ltsw_symbol_to_scalar_f symbol_to_scalar; 37 38 /* Callback to get symbol from scalar value. */ 39 bcmi_ltsw_scalar_to_symbol_f scalar_to_symbol; 40 41 } bcmint_ltsw_l3_aacl_fld_t; 42 43 /* L3 AACL tables. */ 44 typedef enum bcmint_ltsw_l3_aacl_tbl_id_e { 45 BCMINT_LTSW_L3_AACL_TBL_IPV4_DST, 46 BCMINT_LTSW_L3_AACL_TBL_IPV6_DST, 47 BCMINT_LTSW_L3_AACL_TBL_IPV4_SRC, 48 BCMINT_LTSW_L3_AACL_TBL_IPV6_SRC, 49 BCMINT_LTSW_L3_AACL_TBL_CNT 50 } bcmint_ltsw_l3_aacl_tbl_id_t; 51 52 /* The structure of L3 forwarding table. */ 53 typedef struct bcmint_ltsw_l3_aacl_tbl_s { 54 /* Table name. */ 55 const char *name; 56 57 /* Table ID. */ 58 uint32_t tbl_id; 59 60 /* Field count. */ 61 uint32_t fld_cnt; 62 63 /* Bitmap of valid fields. */ 64 uint64_t fld_bmp; 65 66 /* The fields of table. */ 67 const bcmint_ltsw_l3_aacl_fld_t *flds; 68 69 } bcmint_ltsw_l3_aacl_tbl_t; 70 71 /* L3 forwarding table database. */ 72 typedef struct bcmint_ltsw_l3_aacl_tbl_db_s { 73 /* The table bitmap. */ 74 uint32_t tbl_bmp; 75 76 /* The table array. */ 77 const bcmint_ltsw_l3_aacl_tbl_t *tbls; 78 } bcmint_ltsw_l3_aacl_tbl_db_t; 79 80 /*! 81 * \brief Get L3 AACL logical table info. 82 * 83 * \param [in] unit Unit Number. 84 * \param [in] tbl_id AACL logical table description ID. 85 * \param [out] tbl_info Pointer to table description info. 86 * 87 * \retval SHR_E_UNAVAIL Logical table is not supported. 88 * \retval SHR_E_NONE No errer. 89 */ 90 extern int 91 bcmint_ltsw_l3_aacl_tbl_get(int unit, 92 bcmint_ltsw_l3_aacl_tbl_id_t tbl_id, 93 const bcmint_ltsw_l3_aacl_tbl_t **tbl_info); 94 95 #endif /* BCMI_LTSW_L3_AACL_INT_H */ 96 97