OpenNSL API Guide and Reference Manual
Macros | Functions
example_policer.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <opennsl/error.h>
#include <opennsl/port.h>
#include <opennsl/vlan.h>
#include <opennsl/field.h>
#include <opennsl/policer.h>
#include <examples/util.h>

Go to the source code of this file.

Macros

#define DEFAULT_UNIT   0
 
#define DEFAULT_VLAN   1
 

Functions

opennsl_error_t example_check_rates (int unit, int *stat_list, int stat_count)
 
opennsl_error_t example_create_policer (int unit, opennsl_field_group_t *group, opennsl_port_t port, opennsl_vlan_t vlan, int index, int *statId)
 
int example_policer_test (int unit)
 
int main (int argc, char *argv[])
 Main function for policer application.
 

Macro Definition Documentation

#define DEFAULT_UNIT   0

Definition at line 40 of file example_policer.c.

Referenced by main().

#define DEFAULT_VLAN   1

Definition at line 41 of file example_policer.c.

Function Documentation

opennsl_error_t example_check_rates ( int  unit,
int *  stat_list,
int  stat_count 
)
opennsl_error_t example_create_policer ( int  unit,
opennsl_field_group_t group,
opennsl_port_t  port,
opennsl_vlan_t  vlan,
int  index,
int *  statId 
)
int example_policer_test ( int  unit)
int main ( int  argc,
char *  argv[] 
)

Main function for policer application.

Parameters
argc,argvcommands line arguments
Returns
OPENNSL_E_XXX OpenNSL API return code

Definition at line 320 of file example_policer.c.

References DEFAULT_UNIT, example_policer_test(), example_port_default_config(), example_switch_default_vlan_config(), NULL, opennsl_driver_init(), OPENNSL_E_NONE, and opennsl_errmsg.