OpenNSL API Guide and Reference Manual
|
Files | |
file | stg.h |
file | stgX.h |
Typedefs | |
typedef enum opennsl_stg_stp_e | opennsl_stg_stp_t |
opennsl_stg_stp_e | |
Enumerations | |
enum | opennsl_stg_stp_e { OPENNSL_STG_STP_DISABLE = _SHR_PORT_STP_DISABLE, OPENNSL_STG_STP_BLOCK = _SHR_PORT_STP_BLOCK, OPENNSL_STG_STP_LISTEN = _SHR_PORT_STP_LISTEN, OPENNSL_STG_STP_LEARN = _SHR_PORT_STP_LEARN, OPENNSL_STG_STP_FORWARD = _SHR_PORT_STP_FORWARD, OPENNSL_STG_STP_COUNT = _SHR_PORT_STP_COUNT } |
opennsl_stg_stp_e More... | |
Functions | |
int | opennsl_stg_clear (int unit) LIB_DLL_EXPORTED |
Destroy all STGs and initialize the Spanning Tree Group (STG) module to its initial configuration. | |
int | opennsl_stg_count_get (int unit, int *max_stg) LIB_DLL_EXPORTED |
Return the maximum number of STGs that the underlying hardware can support. | |
int | opennsl_stg_create (int unit, opennsl_stg_t *stg_ptr) LIB_DLL_EXPORTED |
Create a new STG, using a new STG ID. | |
int | opennsl_stg_default_get (int unit, opennsl_stg_t *stg_ptr) LIB_DLL_EXPORTED |
Return the current default STG ID for the chip. | |
int | opennsl_stg_default_set (int unit, opennsl_stg_t stg) LIB_DLL_EXPORTED |
Designate the default STG ID for the chip. | |
int | opennsl_stg_destroy (int unit, opennsl_stg_t stg) LIB_DLL_EXPORTED |
Destroys the specified STG. | |
int | opennsl_stg_init (int unit) LIB_DLL_EXPORTED |
Initialize the Spanning Tree Group (STG) module to its initial configuration. | |
int | opennsl_stg_list (int unit, opennsl_stg_t **list, int *count) LIB_DLL_EXPORTED |
Generates a list of IDs for currently defined STGs. | |
int | opennsl_stg_list_destroy (int unit, opennsl_stg_t *list, int count) LIB_DLL_EXPORTED |
Destroys a previously returned list of STG IDs; the STGs themselves are not affected. | |
int | opennsl_stg_stp_get (int unit, opennsl_stg_t stg, opennsl_port_t port, int *stp_state) LIB_DLL_EXPORTED |
Return the Spanning Tree Protocol state of a port in the specified STG. | |
int | opennsl_stg_stp_set (int unit, opennsl_stg_t stg, opennsl_port_t port, int stp_state) LIB_DLL_EXPORTED |
Set the Spanning Tree Protocol state of a port/VP in the specified STG. | |
int | opennsl_stg_vlan_add (int unit, opennsl_stg_t stg, opennsl_vlan_t vid) LIB_DLL_EXPORTED |
Add a VLAN to a specified STG. | |
int | opennsl_stg_vlan_list (int unit, opennsl_stg_t stg, opennsl_vlan_t **list, int *count) LIB_DLL_EXPORTED |
Generates a list of VLANs in a specified STG. | |
int | opennsl_stg_vlan_list_destroy (int unit, opennsl_vlan_t *list, int count) LIB_DLL_EXPORTED |
Destroy a list returned by =opennsl_stg_vlan_list . | |
int | opennsl_stg_vlan_remove (int unit, opennsl_stg_t stg, opennsl_vlan_t vid) LIB_DLL_EXPORTED |
Remove a VLAN from a Spanning Tree Group. | |
int | opennsl_stg_vlan_remove_all (int unit, opennsl_stg_t stg) LIB_DLL_EXPORTED |
Remove all VLANs from a Spanning Tree Group. | |
typedef enum opennsl_stg_stp_e opennsl_stg_stp_t |
opennsl_stg_stp_e
enum opennsl_stg_stp_e |
int opennsl_stg_clear | ( | int | unit | ) |
Destroy all STGs and initialize the Spanning Tree Group (STG) module to its initial configuration.
unit | [IN] Unit number. |
OPENNSL_E_NONE | Success |
OPENNSL_E_UNIT | Invalid device ID |
OPENNSL_E_INIT | STG module is not currently initialized. |
OPENNSL_E_XXX | Other possible errors; for details, see |
int opennsl_stg_count_get | ( | int | unit, |
int * | max_stg | ||
) |
Return the maximum number of STGs that the underlying hardware can support.
unit | [IN] Unit number. |
max_stg | [OUT] Pointer to the returned max allowable STGs |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | STG module is not currently initialized. |
int opennsl_stg_create | ( | int | unit, |
opennsl_stg_t * | stg_ptr | ||
) |
Create a new STG, using a new STG ID.
unit | [IN] Unit number. |
stg_ptr | [OUT] Pointer to returned STG ID |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | STG module is not currently initialized. |
OPENNSL_E_FULL | if all available STG IDs are already being used |
OPENNSL_E_XXX | Other possible errors; for details, see |
Referenced by example_stg_init().
int opennsl_stg_default_get | ( | int | unit, |
opennsl_stg_t * | stg_ptr | ||
) |
Return the current default STG ID for the chip.
unit | [IN] Unit number. |
stg_ptr | [OUT] Pointer to returned default STG ID. |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | STG module is not currently initialized. |
int opennsl_stg_default_set | ( | int | unit, |
opennsl_stg_t | stg | ||
) |
Designate the default STG ID for the chip.
unit | [IN] Unit number. |
stg | [IN] Default STG ID for the chip. |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | STG module is not currently initialized. |
OPENNSL_E_BADID | Invalid STG ID |
OPENNSL_E_NOT_FOUND | STG ID is not currently defined |
int opennsl_stg_destroy | ( | int | unit, |
opennsl_stg_t | stg | ||
) |
Destroys the specified STG.
unit | [IN] Unit number. |
stg | [IN] STG ID |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | STG module is not currently initialized. |
OPENNSL_E_BADID | Invalid STG ID |
OPENNSL_E_NOT_FOUND | STG ID is not currently defined |
OPENNSL_E_XXX | Other possible errors; for details, see |
Referenced by revert_stg().
int opennsl_stg_init | ( | int | unit | ) |
Initialize the Spanning Tree Group (STG) module to its initial configuration.
unit | [IN] Unit number. |
OPENNSL_E_NONE | Success |
OPENNSL_E_UNIT | Invalid device ID |
OPENNSL_E_XXX | Other possible errors; for details, see |
int opennsl_stg_list | ( | int | unit, |
opennsl_stg_t ** | list, | ||
int * | count | ||
) |
Generates a list of IDs for currently defined STGs.
unit | [IN] Unit number. |
list | [OUT] Pointer to returned pointer-to-array of STG IDs |
count | [OUT] Pointer to returned count of STG IDs |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | STG module is not currently initialized. |
OPENNSL_E_XXX | Other possible errors; for details, see |
int opennsl_stg_list_destroy | ( | int | unit, |
opennsl_stg_t * | list, | ||
int | count | ||
) |
Destroys a previously returned list of STG IDs; the STGs themselves are not affected.
unit | [IN] Unit number. |
list | [IN] Pointer to array of STG IDs |
count | [IN] Count of STG IDs in the array |
OPENNSL_E_NONE | Success |
int opennsl_stg_stp_get | ( | int | unit, |
opennsl_stg_t | stg, | ||
opennsl_port_t | port, | ||
int * | stp_state | ||
) |
Return the Spanning Tree Protocol state of a port in the specified STG.
unit | [IN] Unit number. |
stg | [IN] STG ID |
port | [IN] Local port number |
stp_state | [OUT] Pointer to the returned Spanning Tree Protocol state |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | STG module is not currently initialized. |
OPENNSL_E_BADID | Invalid STG ID |
OPENNSL_E_PORT | if invalid port specified |
OPENNSL_E_NOT_FOUND | STG ID is not currently defined |
OPENNSL_E_XXX | Other possible errors; for details, see |
Referenced by main().
int opennsl_stg_stp_set | ( | int | unit, |
opennsl_stg_t | stg, | ||
opennsl_port_t | port, | ||
int | stp_state | ||
) |
Set the Spanning Tree Protocol state of a port/VP in the specified STG.
VP GROUP STP state need to be setted per direction, Please use =opennsl_vlan_gport_add for this.
unit | [IN] Unit number. |
stg | [IN] STG ID |
port | [IN] Local port number |
stp_state | [IN] Spanning Tree Protocol state |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | STG module is not currently initialized. |
OPENNSL_E_BADID | Invalid STG ID |
OPENNSL_E_PORT | if invalid port specified |
OPENNSL_E_NOT_FOUND | STG ID is not currently defined |
OPENNSL_E_XXX | Other possible errors; for details, see |
Referenced by example_port_default_config(), example_stg_create(), and main().
int opennsl_stg_vlan_add | ( | int | unit, |
opennsl_stg_t | stg, | ||
opennsl_vlan_t | vid | ||
) |
Add a VLAN to a specified STG.
unit | [IN] Unit number. |
stg | [IN] STG ID |
vid | [IN] VLAN ID |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | STG module is not currently initialized. |
OPENNSL_E_BADID | Invalid STG ID or VLAN ID |
OPENNSL_E_NOT_FOUND | STG ID is not currently defined |
OPENNSL_E_XXX | Other possible errors; for details, see |
Referenced by example_stg_create().
int opennsl_stg_vlan_list | ( | int | unit, |
opennsl_stg_t | stg, | ||
opennsl_vlan_t ** | list, | ||
int * | count | ||
) |
Generates a list of VLANs in a specified STG.
unit | [IN] Unit number. |
stg | [IN] STG ID |
list | [OUT] Pointer to returned pointer-to-array of VLAN IDs |
count | [OUT] Pointer to returned count of VLAN IDs |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | STG module is not currently initialized. |
OPENNSL_E_BADID | Invalid STG ID or VLAN ID |
OPENNSL_E_NOT_FOUND | STG ID is not currently defined |
OPENNSL_E_XXX | Other possible errors; for details, see |
int opennsl_stg_vlan_list_destroy | ( | int | unit, |
opennsl_vlan_t * | list, | ||
int | count | ||
) |
Destroy a list returned by =opennsl_stg_vlan_list .
unit | [IN] Unit number. |
list | [IN] Pointer to array of VLAN IDs |
count | [IN] Count of VLAN IDs in the array |
OPENNSL_E_NONE | Success |
int opennsl_stg_vlan_remove | ( | int | unit, |
opennsl_stg_t | stg, | ||
opennsl_vlan_t | vid | ||
) |
Remove a VLAN from a Spanning Tree Group.
unit | [IN] Unit number. |
stg | [IN] STG ID |
vid | [IN] VLAN ID |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | STG module is not currently initialized. |
OPENNSL_E_BADID | Invalid STG ID or VLAN ID |
OPENNSL_E_NOT_FOUND | STG ID is not currently defined |
OPENNSL_E_XXX | Other possible errors; for details, see |
int opennsl_stg_vlan_remove_all | ( | int | unit, |
opennsl_stg_t | stg | ||
) |
Remove all VLANs from a Spanning Tree Group.
unit | [IN] Unit number. |
stg | [IN] STG ID |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | STG module is not currently initialized. |
OPENNSL_E_BADID | Invalid STG ID or VLAN ID |
OPENNSL_E_NOT_FOUND | STG ID is not currently defined |
OPENNSL_E_XXX | Other possible errors; for details, see |