OpenNSL API Guide and Reference Manual
Macros | Functions | Variables
example_cos.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <opennsl/error.h>
#include <opennsl/init.h>
#include <opennsl/stack.h>
#include <opennsl/port.h>
#include <opennsl/l2.h>
#include <opennsl/vlan.h>
#include <opennsl/cosq.h>
#include <opennsl/multicast.h>
#include <examples/util.h>

Go to the source code of this file.

Macros

#define DEFAULT_UNIT   0
 
#define DEFAULT_VLAN   1
 

Functions

int _opennsl_petra_egress_queue_from_cosq (int unit, int *queue_id, int cosq)
 
int example_egress_transmit_application (int unit, int opennsl_local_port_id, int is_tm)
 
int example_set_mc_queue_mapping (int unit, int local_port_id, int incoming_tc, int incoming_dp, int queue)
 
int example_set_ofp_bandwidth (int unit, int local_port_id, int max_kbits_sec)
 
int example_set_sp (int unit, int local_port_id, int queue, int sp_type)
 
int example_set_uc_queue_mapping (int unit, int local_port_id, int incoming_tc, int incoming_dp, int queue)
 
int example_set_weight (int unit, int local_port_id, int queue, int uc_mc, int weight)
 
int example_setup_mac_forwarding (int unit, opennsl_mac_t mac, opennsl_vlan_t vlan, int dest_type, int dest_id)
 
int main (int argc, char *argv[])
 Main function for policer application.
 
int multicast__add_multicast_entry (int unit, int ipmc_index, int *ports, int *cud, int nof_mc_entries, int is_egress)
 
int multicast__open_egress_mc_group_with_local_ports (int unit, int mc_group_id, int *dest_local_port_id, int *cud, int num_of_ports, int extra_flags)
 
int multicast__open_mc_group (int unit, int *mc_group_id, int extra_flags)
 

Variables

int egress_mc = 0
 
char example_usage []
 

Macro Definition Documentation

#define DEFAULT_UNIT   0

Definition at line 96 of file example_cos.c.

Referenced by main().

#define DEFAULT_VLAN   1

Definition at line 97 of file example_cos.c.

Function Documentation

int _opennsl_petra_egress_queue_from_cosq ( int  unit,
int *  queue_id,
int  cosq 
)
int example_egress_transmit_application ( int  unit,
int  opennsl_local_port_id,
int  is_tm 
)
int example_set_mc_queue_mapping ( int  unit,
int  local_port_id,
int  incoming_tc,
int  incoming_dp,
int  queue 
)
int example_set_ofp_bandwidth ( int  unit,
int  local_port_id,
int  max_kbits_sec 
)
int example_set_sp ( int  unit,
int  local_port_id,
int  queue,
int  sp_type 
)
int example_set_uc_queue_mapping ( int  unit,
int  local_port_id,
int  incoming_tc,
int  incoming_dp,
int  queue 
)
int example_set_weight ( int  unit,
int  local_port_id,
int  queue,
int  uc_mc,
int  weight 
)
int example_setup_mac_forwarding ( int  unit,
opennsl_mac_t  mac,
opennsl_vlan_t  vlan,
int  dest_type,
int  dest_id 
)
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 624 of file example_cos.c.

References DEFAULT_UNIT, example_egress_transmit_application(), example_port_default_config(), example_read_user_choice(), example_switch_default_vlan_config(), example_usage, NULL, opennsl_driver_exit(), opennsl_driver_init(), OPENNSL_E_NONE, OPENNSL_E_PARAM, and opennsl_errmsg.

int multicast__add_multicast_entry ( int  unit,
int  ipmc_index,
int *  ports,
int *  cud,
int  nof_mc_entries,
int  is_egress 
)
int multicast__open_egress_mc_group_with_local_ports ( int  unit,
int  mc_group_id,
int *  dest_local_port_id,
int *  cud,
int  num_of_ports,
int  extra_flags 
)
int multicast__open_mc_group ( int  unit,
int *  mc_group_id,
int  extra_flags 
)

Variable Documentation

int egress_mc = 0
char example_usage[]
Initial value:
=
"Syntax: example_cos \n\r"
" \n\r"
"Paramaters: None. \n\r"
" \n\r"
"Example: The following command is used to test the CoS functionality \n\r"
" \n\r"
" example_cos \n\r"
" \n\r"
"Usage Guidelines: None. \n\r"

Definition at line 84 of file example_cos.c.

Referenced by main().