OpenNSL API Guide and Reference Manual
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sal/driver.h>
#include <opennsl/error.h>
#include <opennsl/switch.h>
#include <opennsl/rx.h>
#include <examples/util.h>
Go to the source code of this file.
Functions | |
opennsl_rx_t | example_sflow_handle_rx_event (int unit, opennsl_pkt_t *pkt, void *cookie) |
Callback function to handle CPU bound packets. | |
int | main (int argc, char *argv[]) |
Main function for routing sample application. | |
Variables | |
char | example_usage [] |
int | verbose = 4 |
opennsl_rx_t example_sflow_handle_rx_event | ( | int | unit, |
opennsl_pkt_t * | pkt, | ||
void * | cookie | ||
) |
Callback function to handle CPU bound packets.
unit | [IN] Unit number. |
pkt | [IN] sampled packet description structure |
cookie | [IN] cookie passed to this function |
Definition at line 75 of file example_sflow.c.
References opennsl_pkt_s::cos, opennsl_pkt_blk_s::data, opennsl_pkt_s::flags, OPENNSL_RX_HANDLED, opennslRxReasonSampleSource, opennsl_pkt_s::pkt_data, opennsl_pkt_s::pkt_len, opennsl_pkt_s::rx_port, opennsl_pkt_s::rx_reason, opennsl_pkt_s::src_port, verbose, and opennsl_pkt_s::vlan.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main function for routing sample application.
argc,argv | commands line arguments |
Definition at line 134 of file example_sflow.c.
References example_port_default_config(), example_read_user_choice(), example_sflow_handle_rx_event(), example_switch_default_vlan_config(), example_usage, NULL, OPENNSL_BOOT_F_WARM_BOOT, opennsl_driver_boot_flags_get(), opennsl_driver_exit(), opennsl_driver_init(), OPENNSL_E_NONE, OPENNSL_E_PARAM, OPENNSL_E_UNAVAIL, opennsl_errmsg, OPENNSL_FAILURE, OPENNSL_PORT_CONTROL_SAMPLE_DEST_CPU, opennsl_port_control_set(), opennsl_port_sample_rate_get(), opennsl_port_sample_rate_set(), OPENNSL_RCO_F_ALL_COS, opennsl_rx_active(), opennsl_rx_register(), opennsl_rx_start(), opennsl_switch_control_set(), opennslPortControlSampleIngressDest, opennslSwitchControlSync, and port().
char example_usage[] |
Definition at line 47 of file example_sflow.c.
int verbose = 4 |
Definition at line 63 of file example_sflow.c.