l3_aacl.h (8638B)
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_L3_AACL_H 12 #define BCMINT_LTSW_MBCM_L3_AACL_H 13 14 #include <bcm/l3.h> 15 #include <bcm_int/ltsw/l3_aacl.h> 16 #include <bcm_int/ltsw/l3_aacl_int.h> 17 18 19 /*! 20 * \brief Initialize L3 AACL feature. 21 * 22 * \param [in] unit Unit Number. 23 * 24 * \retval SHR_E_NONE No errors. 25 * \retval !SHR_E_NONE Failure. 26 */ 27 typedef int (*l3_aacl_init_f)(int unit); 28 29 /*! 30 * \brief De-initialize the L3 AACL feature. 31 * 32 * \param [in] unit Unit Number. 33 * 34 * \retval SHR_E_NONE No errors. 35 * \retval !SHR_E_NONE Failure. 36 */ 37 typedef int (*l3_aacl_deinit_f)(int unit); 38 39 /*! 40 * \brief Validation for L3 AACL feature. 41 * 42 * \param [in] unit Unit Number. 43 * \param [in] aacl Pointer to bcm_l3_aacl_t struct which contains fields related to compression table. 44 * \param [in] strict Stict validation. 45 * 46 * \retval SHR_E_NONE No errors. 47 * \retval !SHR_E_NONE Failure. 48 */ 49 typedef int (*l3_aacl_validate_f)( 50 int unit, 51 bcm_l3_aacl_t *aacl, 52 bool strict); 53 54 /*! 55 * \brief Adds a L3 AACL to the compression table. 56 * 57 * \param [in] unit Unit Number. 58 * \param [in] options L3 AACL options. See BCM_L3_AACL_OPTIONS_xxx. 59 * \param [in] aacl Pointer to bcm_l3_aacl_t struct which contains fields related to compression table. 60 * 61 * \retval SHR_E_NONE No errors. 62 * \retval !SHR_E_NONE Failure. 63 */ 64 typedef int (*l3_aacl_add_f)( 65 int unit, 66 uint32_t options, 67 bcm_l3_aacl_t *aacl); 68 69 /*! 70 * \brief Deletes a L3 AACL from the compression table. 71 * 72 * \param [in] unit Unit Number. 73 * \param [in] aacl Pointer to bcm_l3_aacl_t struct which contains fields related to compression table. 74 * 75 * \retval SHR_E_NONE No errors. 76 * \retval !SHR_E_NONE Failure. 77 */ 78 typedef int (*l3_aacl_delete_f)( 79 int unit, 80 bcm_l3_aacl_t *aacl); 81 82 /*! 83 * \brief Deletes all AACLs. 84 * 85 * \param [in] unit Unit Number. 86 * \param [in] aacl Pointer to bcm_l3_aacl_t struct which contains fields related to compression table. 87 * 88 * \retval SHR_E_NONE No errors. 89 * \retval !SHR_E_NONE Failure. 90 */ 91 typedef int (*l3_aacl_delete_all_f)( 92 int unit, 93 bcm_l3_aacl_t *aacl); 94 95 /*! 96 * \brief Finds information from the AACL table. 97 * 98 * \param [in] unit Unit Number. 99 * \param [inout] aacl Pointer to bcm_l3_aacl_t struct which contains fields related to compression table. 100 * 101 * \retval SHR_E_NONE No errors. 102 * \retval !SHR_E_NONE Failure. 103 */ 104 typedef int (*l3_aacl_find_f)( 105 int unit, 106 bcm_l3_aacl_t *aacl); 107 108 /*! 109 * \brief Traverse through the AACL table and run callback at each entry. 110 * 111 * \param [in] unit Unit Number. 112 * \param [in] trav_fn Traverse call back function. 113 * \param [in] user_data User data. 114 * 115 * \retval SHR_E_NONE No errors. 116 * \retval !SHR_E_NONE Failure. 117 */ 118 typedef int (*l3_aacl_traverse_f)( 119 int unit, 120 bcm_l3_aacl_traverse_cb trav_fn, 121 void *user_data); 122 123 /*! 124 * \brief Traverse through the AACL table and run callback at each entry. 125 * 126 * \param [in] unit Unit Number. 127 * \param [in] flags L3 AACL flags. See BCM_L3_AACL_FLAGS_xxx. 128 * \param [in] trav_fn Traverse call back function. 129 * \param [in] user_data User data. 130 * 131 * \retval SHR_E_NONE No errors. 132 * \retval !SHR_E_NONE Failure. 133 */ 134 typedef int (*l3_aacl_matched_traverse_f)( 135 int unit, 136 uint32_t flags, 137 bcm_l3_aacl_traverse_cb trav_fn, 138 void *user_data); 139 140 /*! 141 * \brief Get the AACL table database. 142 * 143 * \param [in] unit Unit number. 144 * \param [out] tbl_db AACL table databse. 145 * 146 * \retval SHR_E_NONE No errors. 147 */ 148 typedef int (*l3_aacl_tbl_db_get_f)( 149 int unit, 150 bcmint_ltsw_l3_aacl_tbl_db_t *tbl_db); 151 152 /*! 153 * \brief L3_aacl driver structure. 154 */ 155 typedef struct mbcm_ltsw_l3_aacl_drv_s { 156 157 /*! Initialize L3 AACL feature. */ 158 l3_aacl_init_f l3_aacl_init; 159 160 /*! De-initialize the L3 AACL feature. */ 161 l3_aacl_deinit_f l3_aacl_deinit; 162 163 /*! Validation for L3 AACL feature. */ 164 l3_aacl_validate_f l3_aacl_validate; 165 166 /*! Adds a L3 AACL to the compression table. */ 167 l3_aacl_add_f l3_aacl_add; 168 169 /*! Deletes a L3 AACL from the compression table. */ 170 l3_aacl_delete_f l3_aacl_delete; 171 172 /*! Deletes all AACLs. */ 173 l3_aacl_delete_all_f l3_aacl_delete_all; 174 175 /*! Finds information from the AACL table. */ 176 l3_aacl_find_f l3_aacl_find; 177 178 /*! Traverse through the AACL table and run callback at each entry. */ 179 l3_aacl_traverse_f l3_aacl_traverse; 180 181 /*! Traverse through the AACL table and run callback at each entry. */ 182 l3_aacl_matched_traverse_f l3_aacl_matched_traverse; 183 184 /*! Get the AACL table database. */ 185 l3_aacl_tbl_db_get_f l3_aacl_tbl_db_get; 186 187 } mbcm_ltsw_l3_aacl_drv_t; 188 189 /*! 190 * \brief Set the L3_AACL driver of the device. 191 * 192 * \param [in] unit Unit Number. 193 * \param [in] drv L3_aacl driver to set. 194 * 195 * \retval SHR_E_NONE No errors. 196 * \retval !SHR_E_NONE Failure. 197 */ 198 extern int 199 mbcm_ltsw_l3_aacl_drv_set( 200 int unit, 201 mbcm_ltsw_l3_aacl_drv_t *drv); 202 203 /*! 204 * \brief Initialize L3 AACL feature. 205 * 206 * \param [in] unit Unit Number. 207 * 208 * \retval SHR_E_NONE No errors. 209 * \retval !SHR_E_NONE Failure. 210 */ 211 extern int 212 mbcm_ltsw_l3_aacl_init(int unit); 213 214 /*! 215 * \brief De-initialize the L3 AACL feature. 216 * 217 * \param [in] unit Unit Number. 218 * 219 * \retval SHR_E_NONE No errors. 220 * \retval !SHR_E_NONE Failure. 221 */ 222 extern int 223 mbcm_ltsw_l3_aacl_deinit(int unit); 224 225 /*! 226 * \brief Validation for L3 AACL feature. 227 * 228 * \param [in] unit Unit Number. 229 * \param [in] aacl Pointer to bcm_l3_aacl_t struct which contains fields related to compression table. 230 * \param [in] strict Stict validation. 231 * 232 * \retval SHR_E_NONE No errors. 233 * \retval !SHR_E_NONE Failure. 234 */ 235 extern int 236 mbcm_ltsw_l3_aacl_validate( 237 int unit, 238 bcm_l3_aacl_t *aacl, 239 bool strict); 240 241 /*! 242 * \brief Adds a L3 AACL to the compression table. 243 * 244 * \param [in] unit Unit Number. 245 * \param [in] options L3 AACL options. See BCM_L3_AACL_OPTIONS_xxx. 246 * \param [in] aacl Pointer to bcm_l3_aacl_t struct which contains fields related to compression table. 247 * 248 * \retval SHR_E_NONE No errors. 249 * \retval !SHR_E_NONE Failure. 250 */ 251 extern int 252 mbcm_ltsw_l3_aacl_add( 253 int unit, 254 uint32_t options, 255 bcm_l3_aacl_t *aacl); 256 257 /*! 258 * \brief Deletes a L3 AACL from the compression table. 259 * 260 * \param [in] unit Unit Number. 261 * \param [in] aacl Pointer to bcm_l3_aacl_t struct which contains fields related to compression table. 262 * 263 * \retval SHR_E_NONE No errors. 264 * \retval !SHR_E_NONE Failure. 265 */ 266 extern int 267 mbcm_ltsw_l3_aacl_delete( 268 int unit, 269 bcm_l3_aacl_t *aacl); 270 271 /*! 272 * \brief Deletes all AACLs. 273 * 274 * \param [in] unit Unit Number. 275 * \param [in] aacl Pointer to bcm_l3_aacl_t struct which contains fields related to compression table. 276 * 277 * \retval SHR_E_NONE No errors. 278 * \retval !SHR_E_NONE Failure. 279 */ 280 extern int 281 mbcm_ltsw_l3_aacl_delete_all( 282 int unit, 283 bcm_l3_aacl_t *aacl); 284 285 /*! 286 * \brief Finds information from the AACL table. 287 * 288 * \param [in] unit Unit Number. 289 * \param [inout] aacl Pointer to bcm_l3_aacl_t struct which contains fields related to compression table. 290 * 291 * \retval SHR_E_NONE No errors. 292 * \retval !SHR_E_NONE Failure. 293 */ 294 extern int 295 mbcm_ltsw_l3_aacl_find( 296 int unit, 297 bcm_l3_aacl_t *aacl); 298 299 /*! 300 * \brief Traverse through the AACL table and run callback at each entry. 301 * 302 * \param [in] unit Unit Number. 303 * \param [in] trav_fn Traverse call back function. 304 * \param [in] user_data User data. 305 * 306 * \retval SHR_E_NONE No errors. 307 * \retval !SHR_E_NONE Failure. 308 */ 309 extern int 310 mbcm_ltsw_l3_aacl_traverse( 311 int unit, 312 bcm_l3_aacl_traverse_cb trav_fn, 313 void *user_data); 314 315 /*! 316 * \brief Traverse through the AACL table and run callback at each entry. 317 * 318 * \param [in] unit Unit Number. 319 * \param [in] flags L3 AACL flags. See BCM_L3_AACL_FLAGS_xxx. 320 * \param [in] trav_fn Traverse call back function. 321 * \param [in] user_data User data. 322 * 323 * \retval SHR_E_NONE No errors. 324 * \retval !SHR_E_NONE Failure. 325 */ 326 extern int 327 mbcm_ltsw_l3_aacl_matched_traverse( 328 int unit, 329 uint32_t flags, 330 bcm_l3_aacl_traverse_cb trav_fn, 331 void *user_data); 332 333 /*! 334 * \brief Get L3 AACL logical table info. 335 * 336 * \param [in] unit Unit Number. 337 * \param [out] tbl_db Pointer to table description info. 338 * 339 * \retval SHR_E_UNAVAIL Logical table is not supported. 340 * \retval SHR_E_NONE No errer. 341 */ 342 extern int 343 mbcm_ltsw_l3_aacl_tbl_db_get( 344 int unit, 345 bcmint_ltsw_l3_aacl_tbl_db_t *tbl_db); 346 347 #endif /* BCMINT_LTSW_MBCM_L3_AACL_H */