|
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/l2.h>#include <opennsl/multicast.h>#include <examples/util.h>Go to the source code of this file.
Macros | |
| #define | DEFAULT_UNIT 0 |
| #define | DEFAULT_VLAN 1 |
| #define | MCAST_GROUP_ID 10 |
Functions | |
| int | example_l2_entry_add (int unit, opennsl_mac_t mac, opennsl_vlan_t vlan, int is_mc, int dest_gport, int dest_mcg) |
| To add an FDB entry. | |
| int | example_multicast_create (int unit, int mcg, int egress_mc) |
| To create multicast group. | |
| int | main (int argc, char *argv[]) |
| Main function for Layer 2 multicast application. | |
Variables | |
| char | example_usage [] |
| #define DEFAULT_UNIT 0 |
Definition at line 38 of file example_l2_multicast.c.
Referenced by main().
| #define DEFAULT_VLAN 1 |
Definition at line 39 of file example_l2_multicast.c.
Referenced by main().
| #define MCAST_GROUP_ID 10 |
Definition at line 40 of file example_l2_multicast.c.
Referenced by main().
| int example_l2_entry_add | ( | int | unit, |
| opennsl_mac_t | mac, | ||
| opennsl_vlan_t | vlan, | ||
| int | is_mc, | ||
| int | dest_gport, | ||
| int | dest_mcg | ||
| ) |
To add an FDB entry.
| unit | [IN] Unit number |
| mac | [IN] MAC address |
| vlan | [IN] VLAN ID |
| is_mc | [IN] Is MAC address a multicast |
| dest_gport | [IN] destination port |
| dest_mcg | [IN] destination multicast group |
Definition at line 79 of file example_l2_multicast.c.
References opennsl_l2_addr_s::flags, opennsl_l2_addr_s::l2mc_group, OPENNSL_E_NONE, opennsl_l2_addr_add(), opennsl_l2_addr_t_init(), OPENNSL_L2_MCAST, OPENNSL_L2_STATIC, and opennsl_l2_addr_s::port.
Referenced by main().
| int example_multicast_create | ( | int | unit, |
| int | mcg, | ||
| int | egress_mc | ||
| ) |
To create multicast group.
| unit | [IN] Unit number |
| mcg | [IN] Multicast group ID |
| egress_mc | [IN] Egress/Ingress multicast |
Definition at line 109 of file example_l2_multicast.c.
References OPENNSL_E_NONE, opennsl_multicast_create(), OPENNSL_MULTICAST_EGRESS_GROUP, OPENNSL_MULTICAST_INGRESS_GROUP, OPENNSL_MULTICAST_TYPE_L2, and OPENNSL_MULTICAST_WITH_ID.
Referenced by main().
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Main function for Layer 2 multicast application.
| argc,argv | commands line arguments |
Definition at line 136 of file example_l2_multicast.c.
References DEFAULT_UNIT, DEFAULT_VLAN, example_l2_entry_add(), example_multicast_create(), example_port_default_config(), example_read_user_choice(), example_read_user_string(), example_switch_default_vlan_config(), example_usage, MCAST_GROUP_ID, NULL, opennsl_driver_exit(), opennsl_driver_init(), OPENNSL_E_EXISTS, OPENNSL_E_FAIL, OPENNSL_E_NONE, OPENNSL_E_NOT_FOUND, OPENNSL_E_PARAM, opennsl_errmsg, OPENNSL_GPORT_LOCAL_SET, opennsl_mac_parse(), opennsl_multicast_ingress_add(), opennsl_multicast_ingress_delete(), opennsl_multicast_l2_encap_get(), and port().
| char example_usage[] |
Definition at line 42 of file example_l2_multicast.c.