OpenNSL API Guide and Reference Manual
|
#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 [] |
#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.
int _opennsl_petra_egress_queue_from_cosq | ( | int | unit, |
int * | queue_id, | ||
int | cosq | ||
) |
Definition at line 348 of file example_cos.c.
References OPENNSL_COSQ_HIGH_PRIORITY, OPENNSL_COSQ_LOW_PRIORITY, and OPENNSL_E_NONE.
Referenced by example_set_mc_queue_mapping(), and example_set_uc_queue_mapping().
int example_egress_transmit_application | ( | int | unit, |
int | opennsl_local_port_id, | ||
int | is_tm | ||
) |
Definition at line 501 of file example_cos.c.
References example_set_mc_queue_mapping(), example_set_ofp_bandwidth(), example_set_sp(), example_set_uc_queue_mapping(), example_set_weight(), example_setup_mac_forwarding(), multicast__open_egress_mc_group_with_local_ports(), OPENNSL_COSQ_HIGH_PRIORITY, OPENNSL_COSQ_LOW_PRIORITY, OPENNSL_E_NONE, opennsl_multicast_destroy(), and opennsl_stk_modid_get().
Referenced by main().
int example_set_mc_queue_mapping | ( | int | unit, |
int | local_port_id, | ||
int | incoming_tc, | ||
int | incoming_dp, | ||
int | queue | ||
) |
Definition at line 423 of file example_cos.c.
References _opennsl_petra_egress_queue_from_cosq(), opennsl_cosq_gport_info_s::in_gport, opennsl_cosq_gport_egress_multicast_config_set(), opennsl_cosq_gport_handle_get(), OPENNSL_COSQ_MULTICAST_SCHEDULED, OPENNSL_E_NONE, OPENNSL_GPORT_LOCAL_SET, opennslCosqGportTypeLocalPort, and opennsl_cosq_gport_info_s::out_gport.
Referenced by example_egress_transmit_application().
int example_set_ofp_bandwidth | ( | int | unit, |
int | local_port_id, | ||
int | max_kbits_sec | ||
) |
Definition at line 219 of file example_cos.c.
References opennsl_cosq_gport_info_s::in_gport, opennsl_cosq_gport_bandwidth_set(), opennsl_cosq_gport_handle_get(), OPENNSL_E_NONE, OPENNSL_GPORT_LOCAL_SET, opennslCosqGportTypeLocalPort, and opennsl_cosq_gport_info_s::out_gport.
Referenced by example_egress_transmit_application().
int example_set_sp | ( | int | unit, |
int | local_port_id, | ||
int | queue, | ||
int | sp_type | ||
) |
Definition at line 259 of file example_cos.c.
References opennsl_cosq_gport_info_s::in_gport, opennsl_cosq_gport_handle_get(), opennsl_cosq_gport_sched_set(), OPENNSL_COSQ_SP0, OPENNSL_COSQ_SP1, OPENNSL_E_NONE, OPENNSL_GPORT_LOCAL_SET, opennslCosqGportTypeMulticastEgress, and opennsl_cosq_gport_info_s::out_gport.
Referenced by example_egress_transmit_application().
int example_set_uc_queue_mapping | ( | int | unit, |
int | local_port_id, | ||
int | incoming_tc, | ||
int | incoming_dp, | ||
int | queue | ||
) |
Definition at line 384 of file example_cos.c.
References _opennsl_petra_egress_queue_from_cosq(), opennsl_cosq_gport_info_s::in_gport, opennsl_cosq_gport_egress_map_set(), opennsl_cosq_gport_handle_get(), OPENNSL_E_NONE, OPENNSL_GPORT_LOCAL_SET, opennslCosqGportTypeUnicastEgress, and opennsl_cosq_gport_info_s::out_gport.
Referenced by example_egress_transmit_application().
int example_set_weight | ( | int | unit, |
int | local_port_id, | ||
int | queue, | ||
int | uc_mc, | ||
int | weight | ||
) |
Definition at line 306 of file example_cos.c.
References opennsl_cosq_gport_info_s::in_gport, opennsl_cosq_gport_handle_get(), opennsl_cosq_gport_sched_set(), OPENNSL_E_NONE, OPENNSL_GPORT_LOCAL_SET, opennslCosqGportTypeMulticastEgress, opennslCosqGportTypeUnicastEgress, and opennsl_cosq_gport_info_s::out_gport.
Referenced by example_egress_transmit_application().
int example_setup_mac_forwarding | ( | int | unit, |
opennsl_mac_t | mac, | ||
opennsl_vlan_t | vlan, | ||
int | dest_type, | ||
int | dest_id | ||
) |
Definition at line 465 of file example_cos.c.
References opennsl_l2_addr_s::flags, opennsl_l2_addr_s::l2mc_group, OPENNSL_E_NONE, OPENNSL_GPORT_LOCAL_SET, opennsl_l2_addr_add(), opennsl_l2_addr_t_init(), OPENNSL_L2_MCAST, OPENNSL_L2_STATIC, and opennsl_l2_addr_s::port.
Referenced by example_egress_transmit_application().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main function for policer application.
argc,argv | commands line arguments |
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 | ||
) |
Definition at line 145 of file example_cos.c.
References OPENNSL_E_NONE, opennsl_multicast_egress_add(), and opennsl_multicast_ingress_add().
Referenced by multicast__open_egress_mc_group_with_local_ports().
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 | ||
) |
Definition at line 178 of file example_cos.c.
References egress_mc, opennsl_cosq_gport_info_s::in_gport, multicast__add_multicast_entry(), multicast__open_mc_group(), opennsl_cosq_gport_handle_get(), OPENNSL_E_NONE, OPENNSL_GPORT_LOCAL_SET, opennslCosqGportTypeLocalPort, and opennsl_cosq_gport_info_s::out_gport.
Referenced by example_egress_transmit_application().
int multicast__open_mc_group | ( | int | unit, |
int * | mc_group_id, | ||
int | extra_flags | ||
) |
Definition at line 102 of file example_cos.c.
References egress_mc, OPENNSL_E_NONE, opennsl_multicast_create(), opennsl_multicast_destroy(), OPENNSL_MULTICAST_EGRESS_GROUP, OPENNSL_MULTICAST_INGRESS_GROUP, and OPENNSL_MULTICAST_WITH_ID.
Referenced by multicast__open_egress_mc_group_with_local_ports().
int egress_mc = 0 |
Definition at line 100 of file example_cos.c.
Referenced by example_multicast_group_open(), example_vxlan_open_vpn(), example_vxlan_port_add(), multicast__open_egress_mc_group_with_local_ports(), and multicast__open_mc_group().
char example_usage[] |
Definition at line 84 of file example_cos.c.
Referenced by main().