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/port.h>
#include <opennsl/l2.h>
#include <opennsl/vlan.h>
#include <opennsl/switch.h>
#include <opennsl/vswitch.h>
#include <opennsl/qos.h>
#include <examples/util.h>
Go to the source code of this file.
Macros | |
#define | DEFAULT_UNIT 0 |
#define | DEFAULT_VLAN 1 |
#define | MAC_DA {0x00, 0x00, 0x00, 0x00, 0x00, 0x01} |
#define | MAC_MASK {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} |
Enumerations | |
enum | service_type_e { match_untag, match_otag } |
enum | use_de_type_e { with_no_use_de, with_use_de } |
Functions | |
int | initial_qos_service (int unit) |
int | initial_qos_service_cleanup (int unit) |
int | initial_qos_service_init (int unit, opennsl_port_t port_in, opennsl_port_t port_out) |
int | initial_qos_service_vlan_action_set (int unit, int service_type) |
int | main (int argc, char *argv[]) |
Main function for QoS application. | |
int | qos_map_l2_eg_dft_profile (int unit, int service_type) |
int | qos_pcp_map_create (int unit, int port, int is_use_de) |
Variables | |
opennsl_vlan_t | down_ovlan1 = 200 |
opennsl_vlan_t | down_ovlan2 = 300 |
char | example_usage [] |
opennsl_vswitch_cross_connect_t | gports_tag |
opennsl_vswitch_cross_connect_t | gports_untag |
opennsl_vlan_port_t | in_vlan_port1 |
opennsl_vlan_port_t | in_vlan_port2 |
int | internal_color_ctag [8] = {0,0,0,0,1,1,1,1} |
int | internal_color_stag_with_no_use_de [8] = {1,0,1,0,1,0,1,0} |
int | internal_color_stag_with_use_de [8] = {0,1,0,1,0,1,0,1} |
int | internal_pri [8] = {1,2,3,4,5,6,7,7} |
opennsl_vlan_port_t | out_vlan_port1 |
opennsl_vlan_port_t | out_vlan_port2 |
int | pkt_cfi [8] = {0,1,0,1,0,1,0,1} |
int | pkt_pri [8] = {0,1,2,3,4,5,6,7} |
int | qos_eg_map_id_dft [2] |
opennsl_vlan_t | up_ovlan = 100 |
#define DEFAULT_UNIT 0 |
Definition at line 77 of file example_qos.c.
Referenced by main().
#define DEFAULT_VLAN 1 |
Definition at line 78 of file example_qos.c.
#define MAC_DA {0x00, 0x00, 0x00, 0x00, 0x00, 0x01} |
Definition at line 79 of file example_qos.c.
#define MAC_MASK {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} |
Definition at line 81 of file example_qos.c.
enum service_type_e |
Definition at line 104 of file example_qos.c.
enum use_de_type_e |
Definition at line 110 of file example_qos.c.
int initial_qos_service | ( | int | unit | ) |
Definition at line 359 of file example_qos.c.
References initial_qos_service_vlan_action_set(), match_otag, match_untag, OPENNSL_E_NONE, opennsl_errmsg, opennsl_vlan_port_create(), opennsl_vswitch_cross_connect_add(), opennsl_vswitch_cross_connect_t_init(), opennsl_vswitch_cross_connect_s::port1, opennsl_vswitch_cross_connect_s::port2, and opennsl_vlan_port_s::vlan_port_id.
Referenced by main().
int initial_qos_service_cleanup | ( | int | unit | ) |
Definition at line 444 of file example_qos.c.
References match_otag, match_untag, OPENNSL_E_NONE, opennsl_qos_map_destroy(), opennsl_vlan_port_destroy(), opennsl_vswitch_cross_connect_delete(), opennsl_vswitch_cross_connect_s::port1, opennsl_vswitch_cross_connect_s::port2, qos_eg_map_id_dft, and opennsl_vlan_port_s::vlan_port_id.
int initial_qos_service_init | ( | int | unit, |
opennsl_port_t | port_in, | ||
opennsl_port_t | port_out | ||
) |
Definition at line 305 of file example_qos.c.
References opennsl_vlan_port_s::criteria, down_ovlan1, down_ovlan2, opennsl_vlan_port_s::egress_vlan, opennsl_vlan_port_s::flags, match_otag, match_untag, opennsl_vlan_port_s::match_vlan, OPENNSL_E_NONE, opennsl_port_class_set(), OPENNSL_VLAN_PORT_INNER_VLAN_PRESERVE, OPENNSL_VLAN_PORT_MATCH_PORT, OPENNSL_VLAN_PORT_MATCH_PORT_VLAN, OPENNSL_VLAN_PORT_OUTER_VLAN_PRESERVE, opennsl_vlan_port_t_init(), opennslPortClassId, opennsl_vlan_port_s::port, qos_map_l2_eg_dft_profile(), and up_ovlan.
Referenced by main().
int initial_qos_service_vlan_action_set | ( | int | unit, |
int | service_type | ||
) |
Definition at line 261 of file example_qos.c.
References down_ovlan1, down_ovlan2, match_otag, match_untag, opennsl_vlan_action_set_s::new_outer_vlan, NULL, OPENNSL_E_NONE, OPENNSL_E_PARAM, opennsl_vlan_action_set_t_init(), OPENNSL_VLAN_NONE, opennsl_vlan_translate_egress_action_add(), opennslVlanActionAdd, opennslVlanActionReplace, opennsl_vlan_action_set_s::ot_outer, opennsl_vlan_action_set_s::ot_outer_pkt_prio, out_vlan_port1, out_vlan_port2, opennsl_vlan_action_set_s::priority, qos_eg_map_id_dft, opennsl_vlan_action_set_s::ut_outer, opennsl_vlan_action_set_s::ut_outer_pkt_prio, and opennsl_vlan_port_s::vlan_port_id.
Referenced by initial_qos_service().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main function for QoS application.
argc,argv | commands line arguments |
Definition at line 518 of file example_qos.c.
References DEFAULT_UNIT, example_port_default_config(), example_read_user_choice(), example_switch_default_vlan_config(), example_usage, initial_qos_service(), initial_qos_service_init(), NULL, opennsl_driver_exit(), opennsl_driver_init(), OPENNSL_E_NONE, OPENNSL_E_PARAM, opennsl_errmsg, and qos_pcp_map_create().
int qos_map_l2_eg_dft_profile | ( | int | unit, |
int | service_type | ||
) |
Definition at line 209 of file example_qos.c.
References opennsl_qos_map_s::color, opennsl_qos_map_s::int_pri, match_otag, match_untag, OPENNSL_E_NONE, opennsl_qos_map_add(), opennsl_qos_map_create(), OPENNSL_QOS_MAP_EGRESS, OPENNSL_QOS_MAP_L2, OPENNSL_QOS_MAP_L2_OUTER_TAG, OPENNSL_QOS_MAP_L2_UNTAGGED, OPENNSL_QOS_MAP_L2_VLAN_PCP, opennsl_qos_map_t_init(), opennsl_qos_map_s::pkt_cfi, opennsl_qos_map_s::pkt_pri, and qos_eg_map_id_dft.
Referenced by initial_qos_service_init().
int qos_pcp_map_create | ( | int | unit, |
int | port, | ||
int | is_use_de | ||
) |
Definition at line 118 of file example_qos.c.
References internal_color_ctag, internal_color_stag_with_no_use_de, internal_color_stag_with_use_de, internal_pri, OPENNSL_COLOR_OUTER_CFI, OPENNSL_COLOR_PRIORITY, OPENNSL_E_NONE, OPENNSL_E_PARAM, opennsl_port_cfi_color_set(), opennsl_port_dscp_map_mode_set(), OPENNSL_PORT_DSCP_MAP_NONE, opennsl_port_priority_color_set(), opennsl_port_vlan_priority_map_set(), opennsl_switch_control_port_set(), opennslSwitchColorSelect, pkt_cfi, pkt_pri, with_no_use_de, and with_use_de.
Referenced by main().
opennsl_vlan_t down_ovlan1 = 200 |
Definition at line 85 of file example_qos.c.
Referenced by initial_qos_service_init(), and initial_qos_service_vlan_action_set().
opennsl_vlan_t down_ovlan2 = 300 |
Definition at line 86 of file example_qos.c.
Referenced by initial_qos_service_init(), and initial_qos_service_vlan_action_set().
char example_usage[] |
Definition at line 65 of file example_qos.c.
opennsl_vswitch_cross_connect_t gports_tag |
Definition at line 88 of file example_qos.c.
opennsl_vswitch_cross_connect_t gports_untag |
Definition at line 88 of file example_qos.c.
opennsl_vlan_port_t in_vlan_port1 |
Definition at line 87 of file example_qos.c.
opennsl_vlan_port_t in_vlan_port2 |
Definition at line 87 of file example_qos.c.
int internal_color_ctag[8] = {0,0,0,0,1,1,1,1} |
Definition at line 101 of file example_qos.c.
Referenced by qos_pcp_map_create().
int internal_color_stag_with_no_use_de[8] = {1,0,1,0,1,0,1,0} |
Definition at line 99 of file example_qos.c.
Referenced by qos_pcp_map_create().
int internal_color_stag_with_use_de[8] = {0,1,0,1,0,1,0,1} |
Definition at line 97 of file example_qos.c.
Referenced by qos_pcp_map_create().
int internal_pri[8] = {1,2,3,4,5,6,7,7} |
Definition at line 95 of file example_qos.c.
Referenced by qos_pcp_map_create().
opennsl_vlan_port_t out_vlan_port1 |
Definition at line 87 of file example_qos.c.
Referenced by initial_qos_service_vlan_action_set().
opennsl_vlan_port_t out_vlan_port2 |
Definition at line 87 of file example_qos.c.
Referenced by initial_qos_service_vlan_action_set().
int pkt_cfi[8] = {0,1,0,1,0,1,0,1} |
Definition at line 93 of file example_qos.c.
Referenced by qos_pcp_map_create().
int pkt_pri[8] = {0,1,2,3,4,5,6,7} |
Definition at line 91 of file example_qos.c.
Referenced by qos_pcp_map_create().
int qos_eg_map_id_dft[2] |
Definition at line 89 of file example_qos.c.
Referenced by initial_qos_service_cleanup(), initial_qos_service_vlan_action_set(), and qos_map_l2_eg_dft_profile().
opennsl_vlan_t up_ovlan = 100 |
Definition at line 84 of file example_qos.c.
Referenced by initial_qos_service_init().