|
OpenNSL API Guide and Reference Manual
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sal/driver.h>#include <sal/version.h>#include <opennsl/error.h>#include <opennsl/vlan.h>#include <opennsl/port.h>#include <opennsl/switch.h>#include <opennsl/pkt.h>#include <opennsl/rx.h>#include <examples/util.h>Go to the source code of this file.
Macros | |
| #define | DEFAULT_UNIT 0 |
| #define | DEFAULT_VLAN 1 |
| #define | MAX_DIGITS_IN_CHOICE 5 |
Functions | |
| int | example_pkt_start_get (unsigned int unit, unsigned char *pkt, int len, unsigned char *user_header, unsigned int *offset) |
| Strip FTMH and User Header etc and get the start ethernet packet. | |
| opennsl_rx_t | example_rx_packet_receive (int unit, opennsl_pkt_t *pkt, void *cookie) |
| Packet receive callback function. | |
| int | example_rx_setup (int unit) |
| Setup up the system for packet reception. | |
| int | main (int argc, char *argv[]) |
| Main function for packet reception. | |
Variables | |
| char | example_usage [] |
| #define DEFAULT_UNIT 0 |
Definition at line 39 of file example_rx_packet_cpu.c.
Referenced by main().
| #define DEFAULT_VLAN 1 |
Definition at line 40 of file example_rx_packet_cpu.c.
Referenced by main().
| #define MAX_DIGITS_IN_CHOICE 5 |
Definition at line 41 of file example_rx_packet_cpu.c.
| int example_pkt_start_get | ( | unsigned int | unit, |
| unsigned char * | pkt, | ||
| int | len, | ||
| unsigned char * | user_header, | ||
| unsigned int * | offset | ||
| ) |
Strip FTMH and User Header etc and get the start ethernet packet.
| [IN] | unit unit number |
| [IN] | pkt Pointer to packet data |
| [IN] | len Length of the packet |
| [OUT] | user_header Pointer to User Header start |
| [OUT] | offset Offset to ethernet header length of FTMH+ User Header etc |
Definition at line 68 of file example_rx_packet_cpu.c.
Referenced by example_rx_packet_receive().
| opennsl_rx_t example_rx_packet_receive | ( | int | unit, |
| opennsl_pkt_t * | pkt, | ||
| void * | cookie | ||
| ) |
Packet receive callback function.
| unit | [IN] Unit number |
| pkt | [IN] Pointer to packet data |
| cookie | [IN] Cookie |
Definition at line 169 of file example_rx_packet_cpu.c.
References opennsl_pkt_s::cos, opennsl_pkt_blk_s::data, example_pkt_start_get(), opennsl_pkt_blk_s::len, OPENNSL_RX_HANDLED, opennsl_pkt_s::pkt_data, opennsl_pkt_s::pkt_len, opennsl_pkt_s::rx_port, opennsl_pkt_s::src_port, and opennsl_pkt_s::tot_len.
Referenced by example_rx_setup().
| int example_rx_setup | ( | int | unit | ) |
Setup up the system for packet reception.
| unit | [IN] Unit number |
Definition at line 237 of file example_rx_packet_cpu.c.
References opennsl_rx_chan_cfg_s::chains, opennsl_rx_cfg_s::chan_cfg, opennsl_rx_chan_cfg_s::cos_bmp, example_rx_packet_receive(), opennsl_rx_cfg_s::global_pps, opennsl_rx_cfg_s::max_burst, NULL, OPENNSL_E_NONE, opennsl_errmsg, OPENNSL_FAILURE, OPENNSL_RCO_F_ALL_COS, opennsl_rx_active(), opennsl_rx_cfg_t_init(), opennsl_rx_register(), opennsl_rx_start(), opennsl_rx_cfg_s::pkt_size, and opennsl_rx_cfg_s::pkts_per_chain.
Referenced by main().
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Main function for packet reception.
| argc,argv | commands line arguments |
Definition at line 284 of file example_rx_packet_cpu.c.
References opennsl_port_config_s::cpu, DEFAULT_UNIT, DEFAULT_VLAN, example_port_default_config(), example_read_user_choice(), example_rx_setup(), example_switch_default_vlan_config(), example_usage, NULL, opennsl_driver_exit(), opennsl_driver_init(), OPENNSL_E_NONE, OPENNSL_E_PARAM, opennsl_errmsg, opennsl_port_config_get(), opennsl_version_get(), and opennsl_vlan_port_add().
| char example_usage[] |
Definition at line 43 of file example_rx_packet_cpu.c.