OpenNSL API Guide and Reference Manual
|
Data Structures | |
struct | opennsl_trunk_chip_info_s |
Initialize a trunk chip information structure. More... | |
struct | opennsl_trunk_info_s |
Trunk group attributes structure. More... | |
struct | opennsl_trunk_member_s |
Structure describing a trunk member. More... | |
Files | |
file | trunk.h |
file | trunkX.h |
Macros | |
#define | OPENNSL_TRUNK_FLAG_FAILOVER OPENNSL_TRUNK_FLAG_FAILOVER_NEXT_LOCAL |
Enable trunk failover support (deprecated). | |
#define | OPENNSL_TRUNK_FLAG_FAILOVER_NEXT 0x0001 |
Failover port defaults to the next port in the trunk port list. | |
#define | OPENNSL_TRUNK_FLAG_FAILOVER_NEXT_LOCAL 0x0002 |
Failover port defaults to the next local port in the trunk port list, if any. | |
#define | OPENNSL_TRUNK_FLAG_IPMC_CLEAVE 0x0020 |
Disable trunk resolution for IPMC packets in hardware. | |
#define | OPENNSL_TRUNK_FLAG_WITH_ID 0x0010 |
Use the trunk ID supplied by user. | |
#define | OPENNSL_TRUNK_MAX_PORTCNT 256 |
Maximum number of ports in a trunk group. | |
#define | OPENNSL_TRUNK_MEMBER_EGRESS_DISABLE 0x0002 |
Member will not be a part of the distributor members to be hashed. | |
#define | OPENNSL_TRUNK_PSC_DSTIP 5 |
Destination IP address. | |
#define | OPENNSL_TRUNK_PSC_PORTFLOW 9 |
Enhanced hashing. | |
#define | OPENNSL_TRUNK_PSC_SRCDSTIP 6 |
Source+dest IP address. | |
#define | OPENNSL_TRUNK_PSC_SRCDSTMAC 3 |
Source+dest MAC address. | |
#define | OPENNSL_TRUNK_UNSPEC_INDEX -1 |
Let software set DLF/MC/IPMC. | |
Typedefs | |
typedef struct opennsl_trunk_chip_info_s | opennsl_trunk_chip_info_t |
Initialize a trunk chip information structure. | |
typedef struct opennsl_trunk_info_s | opennsl_trunk_info_t |
Trunk group attributes structure. | |
typedef struct opennsl_trunk_member_s | opennsl_trunk_member_t |
Structure describing a trunk member. | |
Functions | |
int | opennsl_trunk_chip_info_get (int unit, opennsl_trunk_chip_info_t *ta_info) LIB_DLL_EXPORTED |
Gets the underlying SoC device's trunk support limits. | |
int | opennsl_trunk_create (int unit, uint32 flags, opennsl_trunk_t *tid) LIB_DLL_EXPORTED |
Create the software data structure for a new trunk, using caller-specified or next available trunk ID. | |
int | opennsl_trunk_destroy (int unit, opennsl_trunk_t tid) LIB_DLL_EXPORTED |
Removes a trunk group. | |
int | opennsl_trunk_detach (int unit) LIB_DLL_EXPORTED |
Shut down (uninitialize) the trunk module. | |
int | opennsl_trunk_failover_get (int unit, opennsl_trunk_t tid, opennsl_gport_t failport, int *psc, uint32 *flags, int array_size, opennsl_gport_t *fail_to_array, int *array_count) LIB_DLL_EXPORTED |
Retrieve the failover port list for a specific trunk port. | |
int | opennsl_trunk_failover_set (int unit, opennsl_trunk_t tid, opennsl_gport_t failport, int psc, uint32 flags, int count, opennsl_gport_t *fail_to_array) LIB_DLL_EXPORTED |
Assign the failover port list for a specific trunk port. | |
int | opennsl_trunk_find (int unit, opennsl_module_t modid, opennsl_gport_t gport, opennsl_trunk_t *tid) LIB_DLL_EXPORTED |
Get the trunk group ID for a given system port, specified by Module ID and Port number. | |
int | opennsl_trunk_get (int unit, opennsl_trunk_t tid, opennsl_trunk_info_t *t_data, int member_max, opennsl_trunk_member_t *member_array, int *member_count) LIB_DLL_EXPORTED |
Get the current attributes and member ports for the specified trunk group. | |
void | opennsl_trunk_info_t_init (opennsl_trunk_info_t *trunk_info) LIB_DLL_EXPORTED |
Initializes the opennsl_trunk_info_t structure. | |
int | opennsl_trunk_init (int unit) LIB_DLL_EXPORTED |
Initialize the trunk module and SoC trunk hardware. | |
int | opennsl_trunk_member_add (int unit, opennsl_trunk_t tid, opennsl_trunk_member_t *member) LIB_DLL_EXPORTED |
Add a member to a trunk group. | |
int | opennsl_trunk_member_delete (int unit, opennsl_trunk_t tid, opennsl_trunk_member_t *member) LIB_DLL_EXPORTED |
Delete a member from a trunk group. | |
void | opennsl_trunk_member_t_init (opennsl_trunk_member_t *trunk_member) LIB_DLL_EXPORTED |
Initializes the opennsl_trunk_member_t structure. | |
int | opennsl_trunk_psc_set (int unit, opennsl_trunk_t tid, int psc) LIB_DLL_EXPORTED |
Set a trunk's Port Selection Criteria (PSC). | |
int | opennsl_trunk_set (int unit, opennsl_trunk_t tid, opennsl_trunk_info_t *trunk_info, int member_count, opennsl_trunk_member_t *member_array) LIB_DLL_EXPORTED |
Specify the ports in a trunk group. | |
#define OPENNSL_TRUNK_FLAG_FAILOVER OPENNSL_TRUNK_FLAG_FAILOVER_NEXT_LOCAL |
#define OPENNSL_TRUNK_FLAG_FAILOVER_NEXT 0x0001 |
#define OPENNSL_TRUNK_FLAG_FAILOVER_NEXT_LOCAL 0x0002 |
#define OPENNSL_TRUNK_FLAG_IPMC_CLEAVE 0x0020 |
#define OPENNSL_TRUNK_FLAG_WITH_ID 0x0010 |
#define OPENNSL_TRUNK_MAX_PORTCNT 256 |
#define OPENNSL_TRUNK_MEMBER_EGRESS_DISABLE 0x0002 |
#define OPENNSL_TRUNK_PSC_SRCDSTMAC 3 |
#define OPENNSL_TRUNK_UNSPEC_INDEX -1 |
typedef struct opennsl_trunk_chip_info_s opennsl_trunk_chip_info_t |
Initialize a trunk chip information structure.
typedef struct opennsl_trunk_info_s opennsl_trunk_info_t |
Trunk group attributes structure.
typedef struct opennsl_trunk_member_s opennsl_trunk_member_t |
Structure describing a trunk member.
int opennsl_trunk_chip_info_get | ( | int | unit, |
opennsl_trunk_chip_info_t * | ta_info | ||
) |
Gets the underlying SoC device's trunk support limits.
unit | [IN] Unit number. |
ta_info | [OUT] Pointer to returned chip info structure (see =opennsl_trunk_chip_info_t). |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | Trunk module has not been initialized |
int opennsl_trunk_create | ( | int | unit, |
uint32 | flags, | ||
opennsl_trunk_t * | tid | ||
) |
Create the software data structure for a new trunk, using caller-specified or next available trunk ID.
unit | [IN] Unit number. |
flags | [IN] OPENNSL_TRUNK_FLAG_* |
tid | [IN,OUT] Pointer to caller-specified trunk ID if OPENNSL_TRUNK_FLAG_WITH_ID is set, else pointer to next available trunk ID. |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | Trunk module has not been initialized |
OPENNSL_E_BADID | Invalid or unsupported trunk ID |
OPENNSL_E_EXISTS | Specified trunk ID is already in use |
OPENNSL_E_FULL | No available trunk IDs |
OPENNSL_E_XXX | Other possible errors; for details, see |
Referenced by example_trunk_create().
int opennsl_trunk_destroy | ( | int | unit, |
opennsl_trunk_t | tid | ||
) |
Removes a trunk group.
unit | [IN] Unit number. |
tid | [IN] Trunk ID. |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | Trunk module has not been initialized |
OPENNSL_E_BADID | Invalid or unsupported trunk ID |
OPENNSL_E_NOT_FOUND | Specified trunk ID is not currently defined |
OPENNSL_E_XXX | Other possible errors; for details, see |
Referenced by main().
int opennsl_trunk_detach | ( | int | unit | ) |
Shut down (uninitialize) the trunk module.
unit | [IN] Unit number. |
OPENNSL_E_NONE | Success |
int opennsl_trunk_failover_get | ( | int | unit, |
opennsl_trunk_t | tid, | ||
opennsl_gport_t | failport, | ||
int * | psc, | ||
uint32 * | flags, | ||
int | array_size, | ||
opennsl_gport_t * | fail_to_array, | ||
int * | array_count | ||
) |
Retrieve the failover port list for a specific trunk port.
unit | [IN] Unit number. |
tid | [IN] Trunk ID. |
failport | [IN] Port in trunk for which to retrieve failover port list. |
psc | [OUT] Port selection criteria for failover port list. |
flags | [OUT] OPENNSL_TRUNK_FLAG_FAILOVER_xxx. |
array_size | [IN] Maximum number of ports in provided failover port list. |
fail_to_array | [OUT] Failover port list. |
array_count | [OUT] Number of ports in returned failover port list. |
OPENNSL_E_XXX |
int opennsl_trunk_failover_set | ( | int | unit, |
opennsl_trunk_t | tid, | ||
opennsl_gport_t | failport, | ||
int | psc, | ||
uint32 | flags, | ||
int | count, | ||
opennsl_gport_t * | fail_to_array | ||
) |
Assign the failover port list for a specific trunk port.
unit | [IN] Unit number. |
tid | [IN] Trunk ID. |
failport | [IN] Port in trunk for which to specify failover port list. |
psc | [IN] Port selection criteria for failover port list. |
flags | [IN] OPENNSL_TRUNK_FLAG_FAILOVER_xxx. |
count | [IN] Number of ports in failover port list. |
fail_to_array | [IN] Failover port list. |
OPENNSL_E_XXX |
int opennsl_trunk_find | ( | int | unit, |
opennsl_module_t | modid, | ||
opennsl_gport_t | gport, | ||
opennsl_trunk_t * | tid | ||
) |
Get the trunk group ID for a given system port, specified by Module ID and Port number.
unit | [IN] Unit number. |
modid | [IN] Module ID |
gport | [IN] |
tid | [OUT] Trunk ID |
OPENNSL_E_NONE | Success |
OPENNSL_E_UNAVAIL | Feature not supported by the SoC hardware |
OPENNSL_E_INIT | Trunk module has not been initialized |
OPENNSL_E_BADID | Invalid or unsupported Module ID or Port number |
OPENNSL_E_NOT_FOUND | Trunk ID not found |
OPENNSL_E_XXX | Other possible errors; for details, see |
int opennsl_trunk_get | ( | int | unit, |
opennsl_trunk_t | tid, | ||
opennsl_trunk_info_t * | t_data, | ||
int | member_max, | ||
opennsl_trunk_member_t * | member_array, | ||
int * | member_count | ||
) |
Get the current attributes and member ports for the specified trunk group.
unit | [IN] Unit number. |
tid | [IN] Trunk ID. |
t_data | [OUT] |
member_max | [IN] Maximum number of members in provided member_array. |
member_array | [OUT] Member list. |
member_count | [OUT] Number of members returned in member_array. |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | Trunk module has not been initialized |
OPENNSL_E_BADID | Invalid or unsupported trunk ID |
OPENNSL_E_NOT_FOUND | Specified trunk ID is not currently defined |
OPENNSL_E_XXX | Other possible errors; for details, see |
Referenced by main().
void opennsl_trunk_info_t_init | ( | opennsl_trunk_info_t * | trunk_info | ) |
Initializes the opennsl_trunk_info_t structure.
trunk_info | [IN,OUT] Pointer to trunk info structure (see =opennsl_trunk_info_t). |
Referenced by main().
int opennsl_trunk_init | ( | int | unit | ) |
Initialize the trunk module and SoC trunk hardware.
unit | [IN] Unit number. |
OPENNSL_E_NONE | Success |
OPENNSL_E_XXX | Other possible errors; for details, see |
int opennsl_trunk_member_add | ( | int | unit, |
opennsl_trunk_t | tid, | ||
opennsl_trunk_member_t * | member | ||
) |
Add a member to a trunk group.
unit | [IN] Unit number. |
tid | [IN] Trunk ID. |
member | [IN] Trunk member to add. |
OPENNSL_E_XXX |
Referenced by main().
int opennsl_trunk_member_delete | ( | int | unit, |
opennsl_trunk_t | tid, | ||
opennsl_trunk_member_t * | member | ||
) |
Delete a member from a trunk group.
unit | [IN] Unit number. |
tid | [IN] Trunk ID. |
member | [IN] Trunk member to delete. |
OPENNSL_E_XXX |
Referenced by main().
void opennsl_trunk_member_t_init | ( | opennsl_trunk_member_t * | trunk_member | ) |
Initializes the opennsl_trunk_member_t structure.
trunk_member | [IN,OUT] Pointer to trunk member structure (see =opennsl_trunk_member_t). |
Referenced by main().
int opennsl_trunk_psc_set | ( | int | unit, |
opennsl_trunk_t | tid, | ||
int | psc | ||
) |
Set a trunk's Port Selection Criteria (PSC).
unit | [IN] Unit number. |
tid | [IN] Trunk ID. |
psc | [IN] PSC to apply to specified trunk (see =PSC_macros). |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | Trunk module has not been initialized |
OPENNSL_E_BADID | Invalid or unsupported trunk ID |
OPENNSL_E_NOT_FOUND | Specified trunk ID is not currently defined |
OPENNSL_E_XXX | Other possible errors; for details, see |
Referenced by main().
int opennsl_trunk_set | ( | int | unit, |
opennsl_trunk_t | tid, | ||
opennsl_trunk_info_t * | trunk_info, | ||
int | member_count, | ||
opennsl_trunk_member_t * | member_array | ||
) |
Specify the ports in a trunk group.
unit | [IN] Unit number. |
tid | [IN] Trunk ID |
trunk_info | [IN] Pointer to trunk info structure (see =opennsl_trunk_info_t) |
member_count | [IN] Number of members in member_array. |
member_array | [IN] Member list. |
OPENNSL_E_NONE | Success |
OPENNSL_E_INIT | Trunk module has not been initialized |
OPENNSL_E_BADID | Invalid or unsupported trunk ID, port or PSC |
OPENNSL_E_NOT_FOUND | Specified trunk ID is not currently defined |
OPENNSL_E_PARAM | Invalid number of member ports specified |
OPENNSL_E_XXX | Other possible errors; for details, see |