66 "Syntax: example_qos \n\r"
68 "Paramaters: None. \n\r"
70 "Example: The following command is used to map the TC and DP from the \n\r"
71 " VLAN tagged packet, with tag ID 100. \n\r"
75 "Usage Guidelines: None. \n\r";
77 #define DEFAULT_UNIT 0
78 #define DEFAULT_VLAN 1
79 #define MAC_DA {0x00, 0x00, 0x00, 0x00, 0x00, 0x01}
81 #define MAC_MASK {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
130 printf(
"error in opennsl_port_dscp_map_mode_set() $rv\n");
141 printf(
"error in opennsl_switch_control_port_set() $rv\n");
146 for (idx = 0; idx < 8; idx++)
152 printf(
"error in opennsl_port_vlan_priority_map_set() $rv\n");
159 for (idx = 0; idx < 8; idx++)
165 printf(
"error in opennsl_port_vlan_priority_map_set() $rv\n");
173 printf(
"error in opennsl_switch_control_port_set() $rv\n");
181 printf(
"error in opennsl_port_cfi_color_set() $rv\n");
191 for (idx = 0x0; idx < 0x8; idx++)
196 printf(
"error in opennsl_port_priority_color_set() $rv\n");
221 printf(
"error in egress PCP opennsl_qos_map_create() $rv\n");
225 for (idx=0; idx<16; idx++)
237 l2_eg_map.
color = idx&1;
251 printf(
"error in PCP egress opennsl_qos_map_add() $rv\n");
268 switch (service_type)
293 printf(
"error in eve translation opennsl_vlan_translate_egress_action_add() $rv\n");
311 in_vlan_port1.
port = port_in;
318 out_vlan_port1.
port = port_out;
324 in_vlan_port2.
port = port_in;
331 out_vlan_port2.
port = port_out;
337 printf(
"error in opennsl_port_class_set() $rv\n");
344 printf(
"error in opennsl_port_class_set() $rv\n");
376 printf(
"%d\n", in_gport1);
386 printf(
"%d\n", in_gport2);
396 printf(
"%d\n", out_gport1);
406 printf(
"%d\n", out_gport2);
412 gports_untag.
port1 = in_gport1;
413 gports_untag.
port2 = out_gport1;
419 printf(
"error in opennsl_vswitch_cross_connect_add() $rv\n");
427 gports_tag.
port1 = in_gport2;
428 gports_tag.
port2 = out_gport2;
434 printf(
"error in opennsl_vswitch_cross_connect_add() $rv\n");
458 printf(
"Error, opennsl_vswitch_cross_connect_delete() $rv\n");
466 printf(
"Error, opennsl_vswitch_cross_connect_delete() $rv\n");
474 printf(
"Error, opennsl_vlan_port_destroy() $rv\n");
482 printf(
"Error, opennsl_vlan_port_destroy() $rv\n");
490 printf(
"Error, opennsl_vlan_port_destroy() $rv\n");
498 printf(
"Error, opennsl_vlan_port_destroy() $rv\n");
518 int main(
int argc,
char *argv[])
523 int inport, outport, use_de;
525 if((argc != 1) || ((argc > 1) && (strcmp(argv[1],
"--help") == 0)))
535 printf(
"\r\nFailed to initialize the system. Error: %s\r\n",
544 printf(
"\r\nFailed to apply default config on ports, rc = %d (%s).\r\n",
549 printf(
"Adding ports to default vlan.\r\n");
553 printf(
"\r\nFailed to add default ports. Error: %s\r\n",
560 printf(
"\r\nUser menu: Select one of the following options\r\n");
561 printf(
"1. Create QoS mapping\n");
562 #ifdef INCLUDE_DIAG_SHELL
563 printf(
"9. Launch diagnostic shell\n");
565 printf(
"0. Quit the application.\r\n");
569 printf(
"Invalid option entered. Please re-enter.\n");
576 printf(
"Enter the input port number(belonging to core-0):\n");
579 printf(
"Invalid value entered. Please re-enter.\n");
583 printf(
"Enter the output port number(belonging to core-0):\n");
586 printf(
"Invalid value entered. Please re-enter.\n");
590 printf(
"Enter whether to use DEI for QoS mapping(0/1):\n");
592 ((use_de != 0) && (use_de != 1)))
594 printf(
"Invalid value entered. Please re-enter.\n");
601 printf(
"\r\nFailed to initialize the QoS service. Error: %s\r\n",
609 printf(
"\r\nFailed to start the initial QoS service. Error: %s\r\n",
617 printf(
"\r\nFailed to create the QoS PCP mapping. Error: %s\r\n",
624 #ifdef INCLUDE_DIAG_SHELL
627 opennsl_driver_shell();
634 printf(
"Exiting the application.\n");