flow.h (6476B)
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 BCMI_LTSW_FLOW_H 12 #define BCMI_LTSW_FLOW_H 13 14 #include <bcm/flow.h> 15 #include <bcm/types.h> 16 #include <bcm/trunk.h> 17 #include <bcm/switch.h> 18 19 #include <sal/sal_types.h> 20 21 /*! 22 * \brief Get the field name for logical field ID. 23 * 24 * \param [in] unit Unit Number. 25 * \param [in] flow_handle Flow handle. 26 * \param [in] field_id Logical field ID. 27 * \param [out] field_name Logical field name. 28 * 29 * \retval SHR_E_NONE No errors. 30 * \retval !SHR_E_NONE Failure. 31 */ 32 extern int 33 bcmi_ltsw_flow_logical_field_name_get( 34 int unit, 35 bcm_flow_handle_t flow_handle, 36 uint32_t field_id, 37 char *field_name); 38 39 /*! 40 * \brief Get the table name for internal flow option ID. 41 * 42 * \param [in] unit Unit Number. 43 * \param [in] flow_handle Flow handle. 44 * \param [in] option_id Flow option ID. 45 * \param [out] table_name Logical table name. 46 * 47 * \retval SHR_E_NONE No errors. 48 * \retval !SHR_E_NONE Failure. 49 */ 50 extern int 51 bcmi_ltsw_flow_option_logical_table_name_get( 52 int unit, 53 bcm_flow_handle_t flow_handle, 54 bcm_flow_option_id_t option_id, 55 char *table_name); 56 57 /*! 58 * \brief Get flow port type. 59 * 60 * \param [in] unit Unit Number. 61 * \param [in] port Port Number. 62 * \param [out] type Flow port type, TRUE for access, FALSE for network. 63 * 64 * \retval SHR_E_NONE No errors. 65 * \retval !SHR_E_NONE Failure. 66 */ 67 extern int 68 bcmi_ltsw_flow_port_type( 69 int unit, 70 bcm_port_t port, 71 uint8_t *type); 72 73 /*! 74 * \brief Check whehter flow port is network port. 75 * 76 * \param [in] unit Unit Number. 77 * \param [in] port Port Number. 78 * 79 * \retval TRUE Flow port exist and is network port. 80 * \retval FALSE Flow port not exist or is access port. 81 */ 82 extern int 83 bcmi_ltsw_flow_port_is_network( 84 int unit, 85 bcm_port_t port); 86 87 /*! 88 * \brief Get flow port from L2 interface. 89 * 90 * \param [in] unit Unit Number. 91 * \param [in] l2_if L2 interface. 92 * \param [out] port Port Number. 93 * 94 * \retval SHR_E_NONE No errors. 95 * \retval !SHR_E_NONE Failure. 96 */ 97 extern int 98 bcmi_ltsw_flow_l2_if_to_port( 99 int unit, 100 int l2_if, 101 bcm_port_t *port); 102 103 /*! 104 * \brief Get L2 interface from flow port. 105 * 106 * \param [in] unit Unit Number. 107 * \param [in] port Port Number. 108 * \param [out] l2_if L2 interface. 109 * 110 * \retval SHR_E_NONE No errors. 111 * \retval !SHR_E_NONE Failure. 112 */ 113 extern int 114 bcmi_ltsw_flow_port_to_l2_if( 115 int unit, 116 bcm_port_t port, 117 int *l2_if); 118 119 /*! 120 * \brief Dump flow handle info. 121 * 122 * \param [in] unit Unit Number. 123 * 124 * \retval SHR_E_NONE No errors. 125 * \retval !SHR_E_NONE Failure. 126 */ 127 extern int 128 bcmi_ltsw_flow_handle_dump(int unit); 129 130 /*! 131 * \brief Dump flow option info. 132 * 133 * \param [in] unit Unit Number. 134 * 135 * \retval SHR_E_NONE No errors. 136 * \retval !SHR_E_NONE Failure. 137 */ 138 extern int 139 bcmi_ltsw_flow_option_dump(int unit); 140 141 /*! 142 * \brief Helper funtion to get modid, port, and trunk_id from a flow port. 143 * 144 * \param [in] unit Unit Number. 145 * \param [in] flow_port Flow port. 146 * \param [out] modid Module ID. 147 * \param [out] port Port Number. 148 * \param [out] trunk_id Trunk ID. 149 * \param [out] id HW ID. 150 * 151 * \retval SHR_E_NONE No errors. 152 * \retval !SHR_E_NONE Failure. 153 */ 154 extern int 155 bcmi_ltsw_flow_gport_resolve( 156 int unit, 157 bcm_gport_t flow_port, 158 bcm_module_t *modid, 159 bcm_port_t *port, 160 bcm_trunk_t *trunk_id, 161 int *id); 162 163 /*! 164 * \brief Display FLOW software structure information. 165 * 166 * \param [in] unit Unit Number. 167 */ 168 extern void 169 bcmi_ltsw_flow_sw_dump(int unit); 170 171 /*! 172 * \brief Resolve the tunnel ID into the tunnel logical table index. 173 * 174 * \param [in] unit Unit Number. 175 * \param [in] tunnel_id Tunnel gport ID. 176 * \param [out] tnl_idx Tunnel logical table index. 177 * 178 * \retval SHR_E_NONE No errors. 179 * \retval !SHR_E_NONE Failure. 180 */ 181 extern int 182 bcmi_ltsw_flow_tunnel_id_resolve( 183 int unit, 184 bcm_gport_t tunnel_id, 185 uint32_t *tnl_idx); 186 187 /*! 188 * \brief Enable/disable EVPN functionality. 189 * 190 * \param [in] unit Unit Number. 191 * \param [in] enable EVPN enable indicator. 0 : Disable EVPN, 1 : Enable EVPN. 192 */ 193 extern int 194 bcmi_ltsw_flow_evpn_enable_set( 195 int unit, 196 int enable); 197 198 /*! 199 * \brief Get the enable status of EVPN functionality. 200 * 201 * \param [in] unit Unit Number. 202 * \param [in] enable EVPN enable indicator. 0 : EVPN disabled , 1 : EVPN enabled. 203 */ 204 extern int 205 bcmi_ltsw_flow_evpn_enable_get( 206 int unit, 207 int *enable); 208 209 /*! 210 * \brief Specify general switch behaviors. 211 * 212 * \param [in] unit Unit Number. 213 * \param [in] type The desired configuration parameter to retrieve. 214 * \param [in] arg The value with which to set the parameter. 215 */ 216 extern int 217 bcmi_ltsw_flow_switch_control_set( 218 int unit, 219 bcm_switch_control_t type, 220 int arg); 221 222 /*! 223 * \brief Retrieve general switch behaviors. 224 * 225 * \param [in] unit Unit Number. 226 * \param [in] type The desired configuration parameter to retrieve. 227 * \param [in] arg Pointer to where the retrieved value will be written. 228 */ 229 extern int 230 bcmi_ltsw_flow_switch_control_get( 231 int unit, 232 bcm_switch_control_t type, 233 int *arg); 234 235 /*! 236 * \brief Set the matching criteria of flow gport to the vp_lag vp. 237 * 238 * \param [in] unit Unit Number. 239 * \param [in] flow_port_id Flow gport ID. 240 * \param [in] vp_lag_vp VPLAG vp ID. 241 * 242 * \retval SHR_E_NONE No errors. 243 * \retval !SHR_E_NONE Failure. 244 */ 245 extern int 246 bcmi_ltsw_flow_port_source_vp_lag_set( 247 int unit, 248 bcm_gport_t flow_port_id, 249 int vp_lag_vp); 250 251 /*! 252 * \brief Get the vp_lag vp matched by the criteria of the flow gport. 253 * 254 * \param [in] unit Unit Number. 255 * \param [in] flow_port_id Flow gport ID. 256 * \param [out] vp_lag_vp VPLAG vp ID. 257 * 258 * \retval SHR_E_NONE No errors. 259 * \retval !SHR_E_NONE Failure. 260 */ 261 extern int 262 bcmi_ltsw_flow_port_source_vp_lag_get( 263 int unit, 264 bcm_gport_t flow_port_id, 265 int *vp_lag_vp); 266 267 /*! 268 * \brief clear the vp_lag vp matched by the criteria of the flow gport. 269 * 270 * \param [in] unit Unit Number. 271 * \param [in] flow_port_id Flow gport ID. 272 * \param [in] vp_lag_vp VPLAG vp ID. 273 * 274 * \retval SHR_E_NONE No errors. 275 * \retval !SHR_E_NONE Failure. 276 */ 277 extern int 278 bcmi_ltsw_flow_port_source_vp_lag_clr( 279 int unit, 280 bcm_gport_t flow_port_id, 281 int vp_lag_vp); 282 283 #endif /* BCMI_LTSW_FLOW_H */