OpenNSL API Guide and Reference Manual
Macros | Functions | Variables
example_mirror.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sal/driver.h>
#include <opennsl/error.h>
#include <opennsl/stack.h>
#include <opennsl/vlan.h>
#include <opennsl/mirror.h>
#include <examples/util.h>

Go to the source code of this file.

Macros

#define DEFAULT_UNIT   0
 
#define DEFAULT_VLAN   1
 

Functions

int main (int argc, char *argv[])
 Main function for mirroring application.
 

Variables

char example_usage []
 

Macro Definition Documentation

#define DEFAULT_UNIT   0

Definition at line 37 of file example_mirror.c.

Referenced by main().

#define DEFAULT_VLAN   1

Definition at line 38 of file example_mirror.c.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Main function for mirroring application.

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

Definition at line 66 of file example_mirror.c.

References DEFAULT_UNIT, 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.

Variable Documentation

char example_usage[]
Initial value:
=
"Syntax: example_mirror mode sport dport \n\r"
" \n\r"
"Paramaters: \n\r"
" mode - 1, to turn on ingress mirroring. \n\r"
" 2, to turn on egress mirroring. \n\r"
" 3, to turn on ingress and egress mirroring. \n\r"
" sport - Port on which mirroring needs to be enabled. \n\r"
" dport - Port on which traffic needs to be probed. \n\r"
" \n\r"
"Example: The following command is used to monitor ingress and egress \n\r"
" traffic from port 5 on port 10. \n\r"
" example_mirror 3 5 10 \n\r"
" \n\r"
"Usage Guidelines: None. \n\r"

Definition at line 40 of file example_mirror.c.