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/init.h>
#include <opennsl/l2.h>
#include <opennsl/switch.h>
#include <opennsl/vlan.h>
#include <opennsl/vswitch.h>
#include <opennsl/tunnel.h>
#include <opennsl/multicast.h>
#include <opennsl/vxlan.h>
#include <examples/util.h>
Go to the source code of this file.
Data Structures | |
struct | create_l3_egress_s |
struct | create_l3_intf_s |
struct | ip_tunnel_glbl_info_s |
struct | ip_tunnel_s |
struct | vxlan_port_add_s |
struct | vxlan_s |
Macros | |
#define | DEFAULT_UNIT 0 |
#define | MY_MAC {0x00, 0x0c, 0x00, 0x02, 0x00, 0x00} |
Functions | |
int | example_add_inLif_to_vswitch (int unit, opennsl_vlan_t vsi, opennsl_port_t phy_port, opennsl_gport_t gport) |
Add gport of type vlan-port to the multicast. | |
int | example_add_multicast_entry (int unit, int ipmc_index, int *ports, int *cud, int nof_mc_entries, int is_egress) |
Adding entries to MC group. | |
void | example_add_ports_to_vlans (int unit, int network_port, int access_port) |
Utility function to add ports to relevant VLAN's. | |
void | example_add_vlan_on_port (int unit, int vlan, int port) |
Open new vsi and attach it to the give mc_group. | |
int | example_ip_tunnel_add (int unit, opennsl_if_t *itf, opennsl_tunnel_initiator_t *tunnel) |
Create ipv4 tunnel. | |
int | example_ip_tunnel_term_create_l3_intf (int unit, int provider_vlan) |
Create L3 interface on provider_vlan. | |
void | example_ip_tunnel_term_print_key (char *type, opennsl_tunnel_terminator_t *tunnel_term) |
Utility function to print IP tunnel parameters. | |
int | example_l2_addr_add (int unit, opennsl_mac_t mac, uint16 vid, opennsl_gport_t port) |
To update MAC table. | |
int | example_l3_egress_create (int unit, struct create_l3_egress_s *l3_egress) |
Create L3 egress object for FEC and ARP entry. | |
int | example_l3_intf_rif_create (int unit, struct create_l3_intf_s *l3_intf) |
Create Router interface. | |
int | example_multicast_group_open (int unit, int *mc_group_id, int extra_flags) |
Utility function to create multicast group. | |
int | example_multicast_vxlan_port_add (int unit, int mc_group_id, int sys_port, int gport, uint8 is_egress) |
Add gport of type vlan-port to the multicast. | |
int | example_open_vlan_per_mc (int unit, int vlan, opennsl_multicast_t mc_group) |
Create new VSI. | |
int | example_vlan_inLif_create (int unit, opennsl_gport_t in_port, opennsl_gport_t *port_id) |
To create inLif for a port. | |
int | example_vlan_port_add (int unit, int mc_group_id, int sys_port, int gport, uint8 is_egress) |
Add gport of type vlan-port to the multicast. | |
int | example_vxlan (int unit, int network_port, int access_port, int vpn_id) |
Main function to build VxLAN IP tunnel. | |
int | example_vxlan_egress_tunnel_create (int unit, int tunnel_vlan, opennsl_gport_t *tunnel_gportp) |
Build IP tunnel. | |
int | example_vxlan_egress_tunnel_fec_create (int unit, int tunnel_vlan, int tunnel_port, opennsl_if_t *tunnel_fec_p) |
Create Egress FEC object. | |
int | example_vxlan_open_vpn (int unit, int vpn, int vni) |
To build L2 VPN. | |
int | example_vxlan_port_add (int unit, struct vxlan_port_add_s *vxlan_port_add) |
To create VxLAN port. | |
int | example_vxlan_port_s_clear (struct vxlan_port_add_s *vxlan_port_add) |
To initialize vxlan_port_add_s. | |
int | example_vxlan_tunnel_terminator_create (int unit, opennsl_gport_t *in_tunnel_gport_p) |
Create IP tunnel termination interface. | |
void | init_portmap (int unit) |
OTP portmap for DNX device. | |
int | main (int argc, char *argv[]) |
Main function for VxLAN application. | |
int | remove_inLif_from_vswitch (int unit, opennsl_vlan_t vsi, opennsl_port_t phy_port, opennsl_gport_t vlan_port) |
Remove gport of type vlan-port from the multicast group. | |
void | vxlan_init (int unit, struct vxlan_s *vx_info) |
To initialize the global VxLAN structure. | |
void | vxlan_struct_get (struct vxlan_s *vx_info) |
To copy the global VxLAN structure. | |
Variables | |
int | egress_mc = 0 |
char | example_usage [] |
struct vxlan_s | g_vxlan |
struct ip_tunnel_glbl_info_s | ip_tunnel_glbl_info |
int | outlif_counting_profile = OPENNSL_STAT_LIF_COUNTING_PROFILE_NONE |
int | outlif_to_count2 |
int | portmap [100] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} |
uint32 | vdc_port_class = 10 |
int | verbose = 0 |
#define DEFAULT_UNIT 0 |
Definition at line 93 of file example_vxlan.c.
Referenced by main().
#define MY_MAC {0x00, 0x0c, 0x00, 0x02, 0x00, 0x00} |
Definition at line 227 of file example_vxlan.c.
Referenced by example_ip_tunnel_term_create_l3_intf().
int example_add_inLif_to_vswitch | ( | int | unit, |
opennsl_vlan_t | vsi, | ||
opennsl_port_t | phy_port, | ||
opennsl_gport_t | gport | ||
) |
Add gport of type vlan-port to the multicast.
unit | [IN] Unit number |
vsi | [IN] Virtual Switch ID |
phy_port | [IN] Physical port |
gport | [IN] gport |
Definition at line 480 of file example_vxlan.c.
References example_vlan_port_add(), vxlan_s::mc_group_id, OPENNSL_E_NONE, opennsl_errmsg, opennsl_vswitch_port_add(), and verbose.
Referenced by example_vxlan().
int example_add_multicast_entry | ( | int | unit, |
int | ipmc_index, | ||
int * | ports, | ||
int * | cud, | ||
int | nof_mc_entries, | ||
int | is_egress | ||
) |
Adding entries to MC group.
unit | [IN] Unit number |
ipmc_index | [IN] Multicast group |
port | [IN] List of ports to add to the group |
cud | [IN] CUD |
nof_mc_entries | [IN] Number of multicast entries |
is_egress | [IN] If true, add ingress multicast entry |
Definition at line 401 of file example_vxlan.c.
References OPENNSL_E_NONE, opennsl_errmsg, opennsl_multicast_egress_add(), and opennsl_multicast_ingress_add().
Referenced by example_vlan_port_add().
void example_add_ports_to_vlans | ( | int | unit, |
int | network_port, | ||
int | access_port | ||
) |
Utility function to add ports to relevant VLAN's.
unit | [IN] Unit number |
network_port | [IN] Network port number |
access_port | [IN] Access port number |
Definition at line 631 of file example_vxlan.c.
References ip_tunnel_glbl_info_s::access_vlan, example_add_vlan_on_port(), ip_tunnel_glbl_info_s::provider_vlan, and ip_tunnel_glbl_info_s::tunnel_vlan.
Referenced by example_vxlan().
void example_add_vlan_on_port | ( | int | unit, |
int | vlan, | ||
int | port | ||
) |
Open new vsi and attach it to the give mc_group.
unit | [IN] Unit number |
vlan | [IN] VLAN ID |
port | [IN] Port number |
Definition at line 601 of file example_vxlan.c.
References example_open_vlan_per_mc(), OPENNSL_E_EXISTS, OPENNSL_E_NONE, opennsl_errmsg, and opennsl_vlan_gport_add().
Referenced by example_add_ports_to_vlans().
int example_ip_tunnel_add | ( | int | unit, |
opennsl_if_t * | itf, | ||
opennsl_tunnel_initiator_t * | tunnel | ||
) |
Create ipv4 tunnel.
unit | [IN] Unit number |
itf | [IN/OUT] Placement of the tunnel as encap-id |
tunnel | [IN] Update to include the placement of the created tunnel as gport |
Definition at line 1087 of file example_vxlan.c.
References opennsl_tunnel_initiator_s::flags, opennsl_l3_intf_s::l3a_intf_id, OPENNSL_E_NONE, opennsl_errmsg, OPENNSL_GPORT_TUNNEL_ID_SET, opennsl_l3_intf_t_init(), opennsl_tunnel_initiator_create(), OPENNSL_TUNNEL_WITH_ID, and opennsl_tunnel_initiator_s::tunnel_id.
Referenced by example_vxlan_egress_tunnel_create().
int example_ip_tunnel_term_create_l3_intf | ( | int | unit, |
int | provider_vlan | ||
) |
Create L3 interface on provider_vlan.
unit | [IN] Unit number |
provider_vlan | [IN] Provider VLAN |
Definition at line 906 of file example_vxlan.c.
References example_l3_intf_rif_create(), create_l3_intf_s::ingress_flags, create_l3_intf_s::my_global_mac, create_l3_intf_s::my_lsb_mac, MY_MAC, OPENNSL_E_NONE, opennsl_errmsg, OPENNSL_L3_INGRESS_GLOBAL_ROUTE, vxlan_s::prov_vlan_l3_intf_id, create_l3_intf_s::rif, and create_l3_intf_s::vsi.
Referenced by example_vxlan().
void example_ip_tunnel_term_print_key | ( | char * | type, |
opennsl_tunnel_terminator_t * | tunnel_term | ||
) |
Utility function to print IP tunnel parameters.
type | [IN] String token |
tunnel_term | [IN] Tunnel terminator information |
Definition at line 320 of file example_vxlan.c.
References opennsl_tunnel_terminator_s::dip, opennsl_tunnel_terminator_s::dip_mask, print_ip_addr(), opennsl_tunnel_terminator_s::sip, opennsl_tunnel_terminator_s::sip_mask, and opennsl_tunnel_terminator_s::tunnel_if.
Referenced by example_vxlan_tunnel_terminator_create().
int example_l2_addr_add | ( | int | unit, |
opennsl_mac_t | mac, | ||
uint16 | vid, | ||
opennsl_gport_t | port | ||
) |
To update MAC table.
unit | [IN] Unit number |
mac | [IN] MAC address |
vid | [IN] VLAN identifier |
port | [IN] Port number |
Definition at line 359 of file example_vxlan.c.
References opennsl_l2_addr_s::flags, l2_print_mac(), OPENNSL_E_NONE, opennsl_errmsg, opennsl_l2_addr_add(), opennsl_l2_addr_t_init(), OPENNSL_L2_STATIC, opennsl_l2_addr_s::port, port(), verbose, and opennsl_l2_addr_s::vid.
Referenced by example_vxlan(), and main().
int example_l3_egress_create | ( | int | unit, |
struct create_l3_egress_s * | l3_egress | ||
) |
Create L3 egress object for FEC and ARP entry.
unit | [IN] Unit number |
l3_egress | [IN/OUT] L3 egress object holding next hop information |
Definition at line 698 of file example_vxlan.c.
References create_l3_egress_s::allocation_flags, create_l3_egress_s::arp_encap_id, opennsl_l3_egress_s::encap_id, create_l3_egress_s::fec_id, opennsl_l3_egress_s::flags, opennsl_l3_egress_s::flags2, opennsl_l3_egress_s::intf, create_l3_egress_s::l3_flags, create_l3_egress_s::l3_flags2, opennsl_l3_egress_s::mac_addr, create_l3_egress_s::next_hop_mac_addr, OPENNSL_E_NONE, opennsl_errmsg, opennsl_l3_egress_create(), opennsl_l3_egress_t_init(), create_l3_egress_s::out_gport, create_l3_egress_s::out_tunnel_or_rif, opennsl_l3_egress_s::port, opennsl_l3_egress_s::qos_map_id, create_l3_egress_s::qos_map_id, verbose, opennsl_l3_egress_s::vlan, and create_l3_egress_s::vlan.
Referenced by example_vxlan_egress_tunnel_fec_create().
int example_l3_intf_rif_create | ( | int | unit, |
struct create_l3_intf_s * | l3_intf | ||
) |
Create Router interface.
unit | [IN] Unit number |
l3_intf | [IN/OUT] L3 interface object holding routing interface information
|
Definition at line 768 of file example_vxlan.c.
References opennsl_l3_intf_s::dscp_qos, opennsl_l2_station_s::dst_mac, opennsl_l2_station_s::dst_mac_mask, example_is_qmx_device(), create_l3_intf_s::flags, opennsl_l3_ingress_s::flags, opennsl_l2_station_s::flags, create_l3_intf_s::ingress_flags, opennsl_l3_intf_s::l3a_flags, opennsl_l3_intf_s::l3a_intf_id, opennsl_l3_intf_s::l3a_mac_addr, opennsl_l3_intf_s::l3a_mtu, opennsl_l3_intf_s::l3a_mtu_forwarding, opennsl_l3_intf_s::l3a_ttl, opennsl_l3_intf_s::l3a_vid, create_l3_intf_s::mtu, create_l3_intf_s::mtu_forwarding, create_l3_intf_s::mtu_valid, create_l3_intf_s::my_global_mac, create_l3_intf_s::my_lsb_mac, opennsl_l3_intf_s::native_routing_vlan_tags, create_l3_intf_s::native_routing_vlan_tags, create_l3_intf_s::no_publc, OPENNSL_E_NONE, opennsl_errmsg, opennsl_l2_station_add(), opennsl_l2_station_t_init(), opennsl_l3_ingress_create(), OPENNSL_L3_INGRESS_DSCP_TRUST, OPENNSL_L3_INGRESS_GLOBAL_ROUTE, opennsl_l3_ingress_t_init(), OPENNSL_L3_INGRESS_WITH_ID, opennsl_l3_intf_create(), opennsl_l3_intf_get(), opennsl_l3_intf_t_init(), OPENNSL_L3_REPLACE, OPENNSL_L3_RPF, OPENNSL_L3_WITH_ID, opennsl_switch_control_set(), opennslL3IngressUrpfDisable, opennslSwitchL3UrpfMode, opennsl_l3_intf_qos_s::qos_map_id, create_l3_intf_s::qos_map_id, opennsl_l3_ingress_s::qos_map_id, create_l3_intf_s::qos_map_valid, create_l3_intf_s::rif, create_l3_intf_s::rpf_valid, create_l3_intf_s::skip_mymac, opennsl_l2_station_s::src_port_mask, create_l3_intf_s::ttl, create_l3_intf_s::ttl_valid, create_l3_intf_s::urpf_mode, opennsl_l3_ingress_s::urpf_mode, opennsl_l2_station_s::vlan_mask, create_l3_intf_s::vrf, opennsl_l3_ingress_s::vrf, create_l3_intf_s::vrf_valid, and create_l3_intf_s::vsi.
Referenced by example_ip_tunnel_term_create_l3_intf().
int example_multicast_group_open | ( | int | unit, |
int * | mc_group_id, | ||
int | extra_flags | ||
) |
Utility function to create multicast group.
unit | [IN] Unit number |
mc_group_id | [IN] Multicast group ID |
extra_flags | [IN] flags |
Definition at line 657 of file example_vxlan.c.
References egress_mc, vxlan_s::mc_group_id, OPENNSL_E_NONE, opennsl_errmsg, opennsl_multicast_create(), OPENNSL_MULTICAST_EGRESS_GROUP, OPENNSL_MULTICAST_INGRESS_GROUP, and OPENNSL_MULTICAST_WITH_ID.
Referenced by example_vxlan_open_vpn().
int example_multicast_vxlan_port_add | ( | int | unit, |
int | mc_group_id, | ||
int | sys_port, | ||
int | gport, | ||
uint8 | is_egress | ||
) |
Add gport of type vlan-port to the multicast.
unit | [IN] Unit number |
mc_group_id | [IN] Multicast group ID |
sys_port | [IN] System Port |
gport | [IN] gport |
is_egress | [IN] If true, add ingress multicast entry |
Definition at line 1145 of file example_vxlan.c.
References OPENNSL_E_EXISTS, OPENNSL_E_NONE, opennsl_errmsg, opennsl_multicast_ingress_add(), and opennsl_multicast_vxlan_encap_get().
Referenced by example_vxlan_port_add().
int example_open_vlan_per_mc | ( | int | unit, |
int | vlan, | ||
opennsl_multicast_t | mc_group | ||
) |
Create new VSI.
unit | [IN] Unit number |
vlan | [IN] VLAN ID |
mc_group | [IN] The multicast group to be assigned |
Definition at line 567 of file example_vxlan.c.
References OPENNSL_E_EXISTS, OPENNSL_E_NONE, opennsl_errmsg, opennsl_vlan_create(), OPENNSL_VLAN_MAX, opennsl_vswitch_create_with_id(), and verbose.
Referenced by example_add_vlan_on_port().
int example_vlan_inLif_create | ( | int | unit, |
opennsl_gport_t | in_port, | ||
opennsl_gport_t * | port_id | ||
) |
To create inLif for a port.
unit | [IN] Unit number |
in_port | [IN] Port number |
port_id | [OUT] inLif port idenfier |
Definition at line 1336 of file example_vxlan.c.
References ip_tunnel_glbl_info_s::access_vlan, opennsl_vlan_port_s::criteria, opennsl_vlan_port_s::egress_vlan, opennsl_vlan_port_s::flags, opennsl_vlan_port_s::match_inner_vlan, opennsl_vlan_port_s::match_vlan, OPENNSL_E_NONE, opennsl_errmsg, opennsl_vlan_port_create(), OPENNSL_VLAN_PORT_MATCH_PORT_VLAN, opennsl_vlan_port_t_init(), opennsl_vlan_port_s::port, verbose, opennsl_vlan_port_s::vlan_port_id, and opennsl_vlan_port_s::vsi.
Referenced by example_vxlan().
int example_vlan_port_add | ( | int | unit, |
int | mc_group_id, | ||
int | sys_port, | ||
int | gport, | ||
uint8 | is_egress | ||
) |
Add gport of type vlan-port to the multicast.
unit | [IN] Unit number |
mc_group_id | [IN] Multicast group ID |
sys_port | [IN] System port |
gport | [IN] gport |
is_egress | [IN] Is multicast group egress |
Definition at line 443 of file example_vxlan.c.
References example_add_multicast_entry(), OPENNSL_E_NONE, opennsl_errmsg, and opennsl_multicast_vlan_encap_get().
Referenced by example_add_inLif_to_vswitch(), and example_create_l3_intf().
int example_vxlan | ( | int | unit, |
int | network_port, | ||
int | access_port, | ||
int | vpn_id | ||
) |
Main function to build VxLAN IP tunnel.
- build IP tunnels. - add ip routes/host points to the tunnels
unit | [IN] Unit number |
network_port | [IN] Network Port number |
access_port | [IN] Access Port number |
vpn_id | [IN] VPN ID |
Definition at line 1382 of file example_vxlan.c.
References vxlan_s::access_port, ip_tunnel_glbl_info_s::access_vlan, vxlan_s::dip_sip_vrf_using_my_vtep_index_mode, vxlan_port_add_s::egress_if, example_add_inLif_to_vswitch(), example_add_ports_to_vlans(), example_ip_tunnel_term_create_l3_intf(), example_l2_addr_add(), example_vlan_inLif_create(), example_vxlan_egress_tunnel_create(), example_vxlan_egress_tunnel_fec_create(), example_vxlan_open_vpn(), example_vxlan_port_add(), example_vxlan_port_s_clear(), example_vxlan_tunnel_terminator_create(), opennsl_l2_addr_s::flags, vxlan_port_add_s::flags, vxlan_port_add_s::in_port, vxlan_port_add_s::in_tunnel, init_portmap(), opennsl_l2_addr_s::l2mc_group, vxlan_s::mc_group_id, vxlan_s::mc_mac, vxlan_port_add_s::network_group_id, vxlan_s::network_port, OPENNSL_E_NONE, opennsl_errmsg, opennsl_l2_addr_add(), opennsl_l2_addr_t_init(), OPENNSL_L2_MCAST, OPENNSL_L2_STATIC, opennsl_switch_control_set(), opennsl_vxlan_init(), opennslSwitchVxlanUdpDestPortSet, vxlan_port_add_s::out_tunnel, vxlan_s::prov_vlan_l3_intf_id, ip_tunnel_glbl_info_s::provider_vlan, vxlan_s::tunnel_init_gport, vxlan_s::tunnel_mac_address, vxlan_s::tunnel_term_gport, ip_tunnel_glbl_info_s::tunnel_vlan, vxlan_s::user_mac_address, verbose, vxlan_s::vlan_inLif, vxlan_s::vni, vxlan_port_add_s::vpn, vxlan_s::vpn_id, vxlan_s::vxlan_fec_intf_id, vxlan_s::vxlan_gport, vxlan_init(), vxlan_s::vxlan_network_group_id, vxlan_port_add_s::vxlan_port_id, and vxlan_struct_get().
Referenced by main().
int example_vxlan_egress_tunnel_create | ( | int | unit, |
int | tunnel_vlan, | ||
opennsl_gport_t * | tunnel_gportp | ||
) |
Build IP tunnel.
unit | [IN] Unit number |
tunnel_gportp | [IN/OUT] IP Tunnel information. Returns gport-id pointing to the IP tunnels |
Definition at line 978 of file example_vxlan.c.
References opennsl_tunnel_initiator_s::dip, ip_tunnel_s::dip, opennsl_tunnel_initiator_s::dscp, ip_tunnel_s::dscp, opennsl_tunnel_initiator_s::dscp_sel, ip_tunnel_s::dscp_sel, example_ip_tunnel_add(), opennsl_tunnel_initiator_s::flags, ip_tunnel_s::flags, ip_tunnel_glbl_info_s::ip_tunnel_info, OPENNSL_E_NONE, opennsl_errmsg, OPENNSL_STAT_LIF_COUNTING_PROFILE_NONE, opennsl_tunnel_initiator_t_init(), opennslTunnelDscpAssign, outlif_counting_profile, opennsl_tunnel_initiator_s::outlif_counting_profile, outlif_to_count2, print_ip_addr(), opennsl_tunnel_initiator_s::sip, ip_tunnel_s::sip, opennsl_tunnel_initiator_s::ttl, ip_tunnel_s::ttl, opennsl_tunnel_initiator_s::tunnel_id, vxlan_s::tunnel_init_intf_id, ip_tunnel_glbl_info_s::tunnel_type, opennsl_tunnel_initiator_s::type, verbose, and opennsl_tunnel_initiator_s::vlan.
Referenced by example_vxlan().
int example_vxlan_egress_tunnel_fec_create | ( | int | unit, |
int | tunnel_vlan, | ||
int | tunnel_port, | ||
opennsl_if_t * | tunnel_fec_p | ||
) |
Create Egress FEC object.
unit | [IN] Unit number |
tunnel_vlan | [IN] Tunnel VLAN ID |
tunnel_port | [IN] Tunnel Port |
tunnel_fec_p | [IN/OUT] Parameters required to hold FEC object |
Definition at line 1040 of file example_vxlan.c.
References create_l3_egress_s::arp_encap_id, ip_tunnel_s::da, example_l3_egress_create(), create_l3_egress_s::fec_id, ip_tunnel_glbl_info_s::ip_tunnel_info, create_l3_egress_s::next_hop_mac_addr, OPENNSL_E_NONE, opennsl_errmsg, create_l3_egress_s::out_gport, create_l3_egress_s::out_tunnel_or_rif, portmap, vxlan_s::tunnel_init_intf_id, verbose, and create_l3_egress_s::vlan.
Referenced by example_vxlan().
int example_vxlan_open_vpn | ( | int | unit, |
int | vpn, | ||
int | vni | ||
) |
To build L2 VPN.
unit | [IN] Unit number |
vpn | [IN] VPN ID |
vni | [IN] VN ID |
Definition at line 1287 of file example_vxlan.c.
References opennsl_vxlan_vpn_config_s::broadcast_group, egress_mc, example_multicast_group_open(), opennsl_vxlan_vpn_config_s::flags, opennsl_vxlan_vpn_config_s::match_port_class, OPENNSL_E_NONE, opennsl_errmsg, OPENNSL_MULTICAST_TYPE_L2, opennsl_vxlan_vpn_config_t_init(), opennsl_vxlan_vpn_create(), OPENNSL_VXLAN_VPN_ELAN, OPENNSL_VXLAN_VPN_WITH_ID, OPENNSL_VXLAN_VPN_WITH_VPNID, opennsl_vxlan_vpn_config_s::unknown_multicast_group, opennsl_vxlan_vpn_config_s::unknown_unicast_group, vdc_port_class, verbose, opennsl_vxlan_vpn_config_s::vnid, opennsl_vxlan_vpn_config_s::vpn, and vxlan_s::vxlan_vdc_enable.
Referenced by example_vxlan().
int example_vxlan_port_add | ( | int | unit, |
struct vxlan_port_add_s * | vxlan_port_add | ||
) |
To create VxLAN port.
unit | [IN] Unit number |
vxlan_port_add | [IN/OUT] VxLAN Port information |
Definition at line 1185 of file example_vxlan.c.
References opennsl_vxlan_port_s::criteria, vxlan_port_add_s::egress_if, opennsl_vxlan_port_s::egress_if, egress_mc, opennsl_vxlan_port_s::egress_tunnel_id, example_multicast_vxlan_port_add(), vxlan_port_add_s::flags, opennsl_vxlan_port_s::flags, vxlan_port_add_s::in_port, vxlan_port_add_s::in_tunnel, opennsl_vxlan_port_s::match_port, opennsl_vxlan_port_s::match_tunnel_id, vxlan_s::mc_group_id, vxlan_port_add_s::network_group_id, opennsl_vxlan_port_s::network_group_id, OPENNSL_E_NONE, opennsl_errmsg, opennsl_vxlan_port_add(), OPENNSL_VXLAN_PORT_EGRESS_TUNNEL, OPENNSL_VXLAN_PORT_MATCH_VN_ID, OPENNSL_VXLAN_PORT_NETWORK, opennsl_vxlan_port_t_init(), vxlan_port_add_s::out_tunnel, verbose, vxlan_port_add_s::vpn, vxlan_port_add_s::vxlan_port_id, and opennsl_vxlan_port_s::vxlan_port_id.
Referenced by example_vxlan().
int example_vxlan_port_s_clear | ( | struct vxlan_port_add_s * | vxlan_port_add | ) |
To initialize vxlan_port_add_s.
vxlan_port_add | [IN/OUT] vxlan_port_add_s structure |
Definition at line 1121 of file example_vxlan.c.
References OPENNSL_E_NONE, and vxlan_port_add_s::set_egress_orientation_using_vxlan_port_add.
Referenced by example_vxlan().
int example_vxlan_tunnel_terminator_create | ( | int | unit, |
opennsl_gport_t * | in_tunnel_gport_p | ||
) |
Create IP tunnel termination interface.
unit | [IN] Unit number |
in_tunnel_gport_p | [IN/OUT] Tunnel termination interface information |
Definition at line 939 of file example_vxlan.c.
References opennsl_tunnel_terminator_s::dip, ip_tunnel_s::dip, opennsl_tunnel_terminator_s::dip_mask, example_ip_tunnel_term_print_key(), ip_tunnel_glbl_info_s::ip_tunnel_info, OPENNSL_E_NONE, opennsl_errmsg, opennsl_tunnel_terminator_create(), opennsl_tunnel_terminator_t_init(), opennslTunnelTypeVxlan, opennsl_tunnel_terminator_s::sip, ip_tunnel_s::sip, opennsl_tunnel_terminator_s::sip_mask, opennsl_tunnel_terminator_s::tunnel_id, opennsl_tunnel_terminator_s::tunnel_if, opennsl_tunnel_terminator_s::type, and verbose.
Referenced by example_vxlan().
void init_portmap | ( | int | unit | ) |
OTP portmap for DNX device.
unit | [IN] Unit number |
Definition at line 284 of file example_vxlan.c.
References example_is_qmx_device(), OPENNSL_E_NONE, opennsl_errmsg, opennsl_info_get(), and portmap.
Referenced by example_vxlan().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main function for VxLAN application.
argc,argv | commands line arguments |
Definition at line 1551 of file example_vxlan.c.
References DEFAULT_UNIT, example_port_default_config(), example_read_user_choice(), example_usage, example_vxlan(), NULL, opennsl_driver_exit(), opennsl_driver_init(), OPENNSL_E_NONE, OPENNSL_E_PARAM, opennsl_errmsg, and vxlan_s::vpn_id.
int remove_inLif_from_vswitch | ( | int | unit, |
opennsl_vlan_t | vsi, | ||
opennsl_port_t | phy_port, | ||
opennsl_gport_t | vlan_port | ||
) |
Remove gport of type vlan-port from the multicast group.
unit | [IN] Unit number |
vsi | [IN] Virtual Switch ID |
phy_port | [IN] Physical port |
vlan_port | [IN] VLAN port ID |
Definition at line 519 of file example_vxlan.c.
References vxlan_s::mc_group_id, OPENNSL_E_NONE, OPENNSL_E_NOT_FOUND, opennsl_errmsg, opennsl_multicast_ingress_delete(), opennsl_multicast_vlan_encap_get(), opennsl_vswitch_port_delete(), and verbose.
void vxlan_init | ( | int | unit, |
struct vxlan_s * | vx_info | ||
) |
To initialize the global VxLAN structure.
unit | [IN] Unit number |
vx_info | [IN] VxLAN structure |
Definition at line 1256 of file example_vxlan.c.
References NULL.
Referenced by example_vxlan().
void vxlan_struct_get | ( | struct vxlan_s * | vx_info | ) |
To copy the global VxLAN structure.
unit | [IN] Unit number |
vx_info | [IN] VxLAN structure |
Definition at line 1272 of file example_vxlan.c.
Referenced by example_vxlan().
int egress_mc = 0 |
Definition at line 104 of file example_vxlan.c.
char example_usage[] |
Definition at line 95 of file example_vxlan.c.
struct vxlan_s g_vxlan |
Definition at line 210 of file example_vxlan.c.
struct ip_tunnel_glbl_info_s ip_tunnel_glbl_info |
Definition at line 258 of file example_vxlan.c.
int outlif_counting_profile = OPENNSL_STAT_LIF_COUNTING_PROFILE_NONE |
Definition at line 106 of file example_vxlan.c.
Referenced by example_vxlan_egress_tunnel_create().
int outlif_to_count2 |
Definition at line 105 of file example_vxlan.c.
Referenced by example_vxlan_egress_tunnel_create().
int portmap[100] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} |
Definition at line 275 of file example_vxlan.c.
Referenced by example_vxlan_egress_tunnel_fec_create(), and init_portmap().
uint32 vdc_port_class = 10 |
Definition at line 226 of file example_vxlan.c.
Referenced by example_vxlan_open_vpn().
int verbose = 0 |
Definition at line 103 of file example_vxlan.c.
Referenced by example_add_host(), example_add_inLif_to_vswitch(), example_create_l3_egress(), example_create_l3_intf(), example_fp_ip_block(), example_l2_addr_add(), example_l3_egress_create(), example_open_vlan_per_mc(), example_set_default_route(), example_sflow_handle_rx_event(), example_stg_create(), example_vlan_inLif_create(), example_vlan_port_add(), example_vxlan(), example_vxlan_egress_tunnel_create(), example_vxlan_egress_tunnel_fec_create(), example_vxlan_open_vpn(), example_vxlan_port_add(), example_vxlan_tunnel_terminator_create(), main(), and remove_inLif_from_vswitch().