OpenNSL API Guide and Reference Manual
Macros | Functions | Variables
example_trunk.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sal/driver.h>
#include <opennsl/error.h>
#include <opennsl/vlan.h>
#include <opennsl/port.h>
#include <opennsl/switch.h>
#include <opennsl/trunk.h>
#include <examples/util.h>

Go to the source code of this file.

Macros

#define DEFAULT_UNIT   0
 
#define DEFAULT_VLAN   1
 
#define MAX_DIGITS_IN_CHOICE   5
 
#define MAX_TRUNK_MEMBER   8
 

Functions

int example_trunk_create (int unit, opennsl_trunk_t *tid)
 Create a default trunk.
 
int example_trunk_hash_controls_set (int unit)
 Set hash controls.
 
int main (int argc, char *argv[])
 Main function for Trunk application.
 

Variables

char example_usage []
 

Macro Definition Documentation

#define DEFAULT_UNIT   0

Definition at line 45 of file example_trunk.c.

Referenced by main().

#define DEFAULT_VLAN   1

Definition at line 46 of file example_trunk.c.

#define MAX_DIGITS_IN_CHOICE   5

Definition at line 47 of file example_trunk.c.

#define MAX_TRUNK_MEMBER   8

Definition at line 48 of file example_trunk.c.

Referenced by main().

Function Documentation

int example_trunk_create ( int  unit,
opennsl_trunk_t tid 
)

Create a default trunk.

Parameters
unit[IN] Unit number.
tid[IN,OUT] Pointer to caller-specified trunk ID if OPENNSL_TRUNK_FLAG_WITH_ID is set, else pointer to next available trunk ID.
Returns
OPENNSL_E_XXX OpenNSL API return code

Definition at line 72 of file example_trunk.c.

References opennsl_trunk_create().

Referenced by main().

int example_trunk_hash_controls_set ( int  unit)
int main ( int  argc,
char *  argv[] 
)

Variable Documentation

char example_usage[]
Initial value:
=
"Syntax: example_trunk \n\r"
" \n\r"
"Paramaters: None. \n\r"
" \n\r"
"Example: The following command is used to demonstrate trunk API \n\r"
"calls. The interactive user interface allows the user to get \n\r"
"the trunk information, add, delete ports and destroy a trunk. \n\r"
" example_trunk \n\r"
" \n\r"
"Usage Guidelines: None. \n\r"

Definition at line 50 of file example_trunk.c.