OpenNSL API Guide and Reference Manual
Data Structures | Files | Macros | Typedefs | Enumerations | Functions
Layer 3 Management

Data Structures

struct  opennsl_l3_dgm_s
 L3 DGM structure. More...
 
struct  opennsl_l3_ecmp_member_s
 L3 ECMP member structure. More...
 
struct  opennsl_l3_egress_ecmp_s
 L3 ECMP structure. More...
 
struct  opennsl_l3_egress_s
 L3 Egress Structure. More...
 
struct  opennsl_l3_host_s
 L3 Host Structure. More...
 
struct  opennsl_l3_info_s
 L3 Information Structure. More...
 
struct  opennsl_l3_ingress_s
 L3 Ingress Structure. More...
 
struct  opennsl_l3_intf_qos_s
 L3 Interface QOS setting. More...
 
struct  opennsl_l3_intf_s
 L3 Interface Structure. More...
 
struct  opennsl_l3_route_s
 L3 Route Structure. More...
 

Files

file  l3.h
 
file  l3X.h
 

Macros

#define OPENNSL_L3_ADD_TO_ARL   (1 << 5)
 Add interface address MAC to ARL.
 
#define OPENNSL_L3_COPY_TO_CPU   (1 << 23)
 Send a copy to CPU.
 
#define OPENNSL_L3_D_HIT   (1 << 3)
 Destination IP address match.
 
#define OPENNSL_L3_DEFIP_CPU   (1 << 13)
 switch family: DEFIP CPU bit set.
 
#define OPENNSL_L3_DEFIP_LOCAL   OPENNSL_L3_DEFIP_CPU
 XGS: Local DEFIP route.
 
#define OPENNSL_L3_DEREFERENCED_NEXTHOP   (1 << 30)
 Indicates this is a wider L3 entry.
 
#define OPENNSL_L3_DST_DISCARD   (1 << 20)
 Destination match discard.
 
#define OPENNSL_L3_ECMP_DYNAMIC_LOAD_WEIGHT_INVALID   -1
 Invalid value for dynamic_load_weight.
 
#define OPENNSL_L3_ECMP_DYNAMIC_MODE_NORMAL   1
 ECMP dynamic load balancing normal mode: if inactivity duration lapsed, use optimal member, else use assigned member.
 
#define OPENNSL_L3_ECMP_DYNAMIC_MODE_RESILIENT   4
 ECMP resilient load balancing mode: minimize reassignment of flows to members.
 
#define OPENNSL_L3_ECMP_DYNAMIC_SCALING_FACTOR_INVALID   -1
 Invalid value for dynamic_scaling_factor.
 
#define OPENNSL_L3_ECMP_RH_REPLACE   OPENNSL_L3_DEREFERENCED_NEXTHOP
 Replace ECMP member without RH flowset table shuffle.
 
#define OPENNSL_L3_HIT   (OPENNSL_L3_S_HIT | OPENNSL_L3_D_HIT)
 
#define OPENNSL_L3_HIT_CLEAR   (1 << 4)
 Clear HIT bit.
 
#define OPENNSL_L3_HOST_AS_ROUTE   (1 << 16)
 Use LPM if host table full.
 
#define OPENNSL_L3_HOST_LOCAL   (1 << 15)
 Packet to local IP stack.
 
#define OPENNSL_L3_INGRESS_DSCP_TRUST   (1 << 3)
 Trust incoming DSCP on L3 Ingress.
 
#define OPENNSL_L3_INGRESS_GLOBAL_ROUTE   (1 << 2)
 Allow Global Route on L3 Ingress Interface.
 
#define OPENNSL_L3_INGRESS_REPLACE   (1 << 1)
 Replace existing L3 Ingress entry.
 
#define OPENNSL_L3_INGRESS_WITH_ID   (1 << 0)
 L3 Ingress ID is provided.
 
#define OPENNSL_L3_IP4_OPTIONS_REPLACE   0x00000002
 Replace existing entry.
 
#define OPENNSL_L3_IP4_OPTIONS_WITH_ID   0x00000001
 With ID option creation.
 
#define OPENNSL_L3_IP6   (1 << 17)
 IPv6.
 
#define OPENNSL_L3_IPMC   (1 << 11)
 Set IPMC for real IPMC entry.
 
#define OPENNSL_L3_L2ONLY   (1 << 0)
 L2 switch only on interface.
 
#define OPENNSL_L3_L2TOCPU   (1 << 12)
 Packet to CPU unrouted, XGS12: Set IPMC for UC address.
 
#define OPENNSL_L3_MULTIPATH   (1 << 14)
 Specify ECMP treatment.
 
#define OPENNSL_L3_REPLACE   (1 << 8)
 Replace existing entry.
 
#define OPENNSL_L3_ROUTE_LABEL   (1 << 22)
 Indicates that MPLS label in route entry is valid.
 
#define OPENNSL_L3_RPE   (1 << 10)
 Pick up new priority (COS).
 
#define OPENNSL_L3_RPF   (1 << 18)
 RPF check.
 
#define OPENNSL_L3_S_HIT   (1 << 2)
 Source IP address match.
 
#define OPENNSL_L3_TGID   (1 << 9)
 Port belongs to trunk.
 
#define OPENNSL_L3_UNTAG   (1 << 1)
 Packet goes out untagged.
 
#define OPENNSL_L3_VXLAN_ONLY   (1 << 31)
 Specific for VXLAN Nexthop.
 
#define OPENNSL_L3_WITH_ID   (1 << 6)
 ID is provided.
 

Typedefs

typedef struct opennsl_l3_dgm_s opennsl_l3_dgm_t
 L3 DGM structure.
 
typedef struct
opennsl_l3_ecmp_member_s 
opennsl_l3_ecmp_member_t
 L3 ECMP member structure.
 
typedef struct
opennsl_l3_egress_ecmp_s 
opennsl_l3_egress_ecmp_t
 L3 ECMP structure.
 
typedef int(* opennsl_l3_egress_ecmp_traverse_cb )(int unit, opennsl_l3_egress_ecmp_t *ecmp, int intf_count, opennsl_if_t *intf_array, void *user_data)
 
typedef int(* opennsl_l3_egress_multipath_traverse_cb )(int unit, opennsl_if_t mpintf, int intf_count, opennsl_if_t *intf_array, void *user_data)
 
typedef struct opennsl_l3_egress_s opennsl_l3_egress_t
 L3 Egress Structure.
 
typedef int(* opennsl_l3_egress_traverse_cb )(int unit, opennsl_if_t intf, opennsl_l3_egress_t *info, void *user_data)
 
typedef struct opennsl_l3_host_s opennsl_l3_host_t
 L3 Host Structure.
 
typedef int(* opennsl_l3_host_traverse_cb )(int unit, int index, opennsl_l3_host_t *info, void *user_data)
 
typedef struct opennsl_l3_info_s opennsl_l3_info_t
 L3 Information Structure.
 
typedef struct opennsl_l3_ingress_s opennsl_l3_ingress_t
 L3 Ingress Structure.
 
typedef enum
opennsl_l3_ingress_urpf_mode_e 
opennsl_l3_ingress_urpf_mode_t
 L3 Ingress Interface URPF Mode setting.
 
typedef struct
opennsl_l3_intf_qos_s 
opennsl_l3_intf_qos_t
 L3 Interface QOS setting.
 
typedef struct opennsl_l3_intf_s opennsl_l3_intf_t
 L3 Interface Structure.
 
typedef enum
opennsl_l3_ip4_options_action_e 
opennsl_l3_ip4_options_action_t
 L3 IP options handing actions.
 
typedef struct opennsl_l3_route_s opennsl_l3_route_t
 L3 Route Structure.
 
typedef int(* opennsl_l3_route_traverse_cb )(int unit, int index, opennsl_l3_route_t *info, void *user_data)
 
typedef enum opennsl_l3_stat_e opennsl_l3_stat_t
 Types of counters per L3 object.
 

Enumerations

enum  opennsl_l3_ingress_urpf_mode_e {
  opennslL3IngressUrpfDisable = 0,
  opennslL3IngressUrpfLoose = 1,
  opennslL3IngressUrpfStrict = 2
}
 L3 Ingress Interface URPF Mode setting. More...
 
enum  opennsl_l3_ip4_options_action_e {
  opennslIntfIPOptionActionNone = 0,
  opennslIntfIPOptionActionCopyToCPU = 1,
  opennslIntfIPOptionActionDrop = 2,
  opennslIntfIPOptionActionCopyCPUAndDrop = 3
}
 L3 IP options handing actions. More...
 
enum  opennsl_l3_stat_e {
  opennslL3StatOutPackets = 0,
  opennslL3StatOutBytes = 1,
  opennslL3StatDropPackets = 2,
  opennslL3StatDropBytes = 3,
  opennslL3StatInPackets = 4,
  opennslL3StatInBytes = 5
}
 Types of counters per L3 object. More...
 

Functions

int opennsl_l3_ecmp_get (int unit, opennsl_l3_egress_ecmp_t *ecmp_info, int ecmp_member_size, opennsl_l3_ecmp_member_t *ecmp_member_array, int *ecmp_member_count) LIB_DLL_EXPORTED
 Get info about an Egress ECMP forwarding object.
 
int opennsl_l3_egress_create (int unit, uint32 flags, opennsl_l3_egress_t *egr, opennsl_if_t *if_id) LIB_DLL_EXPORTED
 Create an Egress forwarding object.
 
int opennsl_l3_egress_destroy (int unit, opennsl_if_t intf) LIB_DLL_EXPORTED
 Destroy an Egress forwarding object.
 
int opennsl_l3_egress_ecmp_add (int unit, opennsl_l3_egress_ecmp_t *ecmp, opennsl_if_t intf) LIB_DLL_EXPORTED
 Add an Egress forwarding object to an Egress ECMP forwarding object.
 
int opennsl_l3_egress_ecmp_create (int unit, opennsl_l3_egress_ecmp_t *ecmp, int intf_count, opennsl_if_t *intf_array) LIB_DLL_EXPORTED
 Create an Egress ECMP forwarding object.
 
int opennsl_l3_egress_ecmp_delete (int unit, opennsl_l3_egress_ecmp_t *ecmp, opennsl_if_t intf) LIB_DLL_EXPORTED
 Delete an Egress forwarding object from an Egress ECMP forwarding object.
 
int opennsl_l3_egress_ecmp_destroy (int unit, opennsl_l3_egress_ecmp_t *ecmp) LIB_DLL_EXPORTED
 Destroy an Egress ECMP forwarding object.
 
int opennsl_l3_egress_ecmp_find (int unit, int intf_count, opennsl_if_t *intf_array, opennsl_l3_egress_ecmp_t *ecmp) LIB_DLL_EXPORTED
 Find an Egress ECMP forwarding object.
 
int opennsl_l3_egress_ecmp_get (int unit, opennsl_l3_egress_ecmp_t *ecmp, int intf_size, opennsl_if_t *intf_array, int *intf_count) LIB_DLL_EXPORTED
 Get info about an Egress ECMP forwarding object.
 
void opennsl_l3_egress_ecmp_t_init (opennsl_l3_egress_ecmp_t *ecmp) LIB_DLL_EXPORTED
 Initialize L3 Egress ECMP object structure.
 
int opennsl_l3_egress_ecmp_traverse (int unit, opennsl_l3_egress_ecmp_traverse_cb trav_fn, void *user_data) LIB_DLL_EXPORTED
 Traverse through the valid Egress ECMP forwarding objects and run callback.
 
int opennsl_l3_egress_find (int unit, opennsl_l3_egress_t *egr, opennsl_if_t *intf) LIB_DLL_EXPORTED
 Find an interface pointing to an Egress forwarding object.
 
int opennsl_l3_egress_get (int unit, opennsl_if_t intf, opennsl_l3_egress_t *egr) LIB_DLL_EXPORTED
 Get an Egress forwarding object.
 
int opennsl_l3_egress_multipath_add (int unit, opennsl_if_t mpintf, opennsl_if_t intf) LIB_DLL_EXPORTED
 Add an Egress forwarding object to an Egress Multipath forwarding object.
 
int opennsl_l3_egress_multipath_create (int unit, uint32 flags, int intf_count, opennsl_if_t *intf_array, opennsl_if_t *mpintf) LIB_DLL_EXPORTED
 Create a Multipath Egress forwarding object.
 
int opennsl_l3_egress_multipath_delete (int unit, opennsl_if_t mpintf, opennsl_if_t intf) LIB_DLL_EXPORTED
 Delete an Egress forwarding object from an Egress Multipath forwarding object.
 
int opennsl_l3_egress_multipath_destroy (int unit, opennsl_if_t mpintf) LIB_DLL_EXPORTED
 Destroy an Egress Multipath forwarding object.
 
int opennsl_l3_egress_multipath_find (int unit, int intf_count, opennsl_if_t *intf_array, opennsl_if_t *mpintf) LIB_DLL_EXPORTED
 Find an interface pointing to an Egress Multipath forwarding object.
 
int opennsl_l3_egress_multipath_get (int unit, opennsl_if_t mpintf, int intf_size, opennsl_if_t *intf_array, int *intf_count) LIB_DLL_EXPORTED
 Get an Egress Multipath forwarding object.
 
int opennsl_l3_egress_multipath_traverse (int unit, opennsl_l3_egress_multipath_traverse_cb trav_fn, void *user_data) LIB_DLL_EXPORTED
 Traverse through the multipath egress object table and run callback at each valid entry.
 
int opennsl_l3_egress_stat_attach (int unit, opennsl_if_t intf_id, uint32 stat_counter_id) LIB_DLL_EXPORTED
 Attach counters entries to the given L3 Egress interface.
 
int opennsl_l3_egress_stat_counter_get (int unit, opennsl_if_t intf_id, opennsl_l3_stat_t stat, uint32 num_entries, uint32 *counter_indexes, opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED
 Get the specified counter statistic for a L3 egress interface.
 
int opennsl_l3_egress_stat_detach (int unit, opennsl_if_t intf_id) LIB_DLL_EXPORTED
 Detach counters entries to the given L3 Egress interface.
 
void opennsl_l3_egress_t_init (opennsl_l3_egress_t *egr) LIB_DLL_EXPORTED
 Initialize a opennsl_l3_egress_t structure.
 
int opennsl_l3_egress_traverse (int unit, opennsl_l3_egress_traverse_cb trav_fn, void *user_data) LIB_DLL_EXPORTED
 Traverse through the egress object table and run callback at each valid entry.
 
int opennsl_l3_host_add (int unit, opennsl_l3_host_t *info) LIB_DLL_EXPORTED
 Add an entry into the L3 switching table.
 
int opennsl_l3_host_delete (int unit, opennsl_l3_host_t *ip_addr) LIB_DLL_EXPORTED
 Delete an entry from the L3 host table.
 
int opennsl_l3_host_delete_all (int unit, opennsl_l3_host_t *info) LIB_DLL_EXPORTED
 Deletes all L3 host table entries.
 
int opennsl_l3_host_delete_by_interface (int unit, opennsl_l3_host_t *info) LIB_DLL_EXPORTED
 Deletes L3 entries that match or do not match a specified L3 interface number.
 
int opennsl_l3_host_find (int unit, opennsl_l3_host_t *info) LIB_DLL_EXPORTED
 Look up an L3 host table entry based on IP address.
 
void opennsl_l3_host_t_init (opennsl_l3_host_t *ip) LIB_DLL_EXPORTED
 Initialize a opennsl_l3_host_t structure.
 
int opennsl_l3_host_traverse (int unit, uint32 flags, uint32 start, uint32 end, opennsl_l3_host_traverse_cb cb, void *user_data) LIB_DLL_EXPORTED
 Traverse through the L3 table and run callback at each valid L3 entry.
 
int opennsl_l3_info (int unit, opennsl_l3_info_t *l3info) LIB_DLL_EXPORTED
 Get the status of hardware tables.
 
void opennsl_l3_info_t_init (opennsl_l3_info_t *info) LIB_DLL_EXPORTED
 Initialize a opennsl_l3_info_t_init structure.
 
int opennsl_l3_ingress_create (int unit, opennsl_l3_ingress_t *ing_intf, opennsl_if_t *intf_id) LIB_DLL_EXPORTED
 Create L3 Ingress Interface object.
 
int opennsl_l3_ingress_stat_attach (int unit, opennsl_if_t intf_id, uint32 stat_counter_id) LIB_DLL_EXPORTED
 Attach counters entries to the given L3 ingress interface.
 
int opennsl_l3_ingress_stat_counter_get (int unit, opennsl_if_t intf_id, opennsl_l3_stat_t stat, uint32 num_entries, uint32 *counter_indexes, opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED
 Get counter statistic values for a l3 interface object.
 
int opennsl_l3_ingress_stat_detach (int unit, opennsl_if_t intf_id) LIB_DLL_EXPORTED
 Detach counters entries to the given L3 ingress interface.
 
void opennsl_l3_ingress_t_init (opennsl_l3_ingress_t *ing_intf) LIB_DLL_EXPORTED
 Initialize L3 Ingress Interface object structure.
 
int opennsl_l3_init (int unit) LIB_DLL_EXPORTED
 Initialize the OPENNSL L3 subsystem.
 
int opennsl_l3_intf_create (int unit, opennsl_l3_intf_t *intf) LIB_DLL_EXPORTED
 Create a new L3 interface.
 
int opennsl_l3_intf_delete (int unit, opennsl_l3_intf_t *intf) LIB_DLL_EXPORTED
 Delete an L3 interface.
 
int opennsl_l3_intf_find (int unit, opennsl_l3_intf_t *intf) LIB_DLL_EXPORTED
 Search for L3 interface by MAC address and VLAN.
 
int opennsl_l3_intf_find_vlan (int unit, opennsl_l3_intf_t *intf) LIB_DLL_EXPORTED
 Search for L3 interface by VLAN only.
 
int opennsl_l3_intf_get (int unit, opennsl_l3_intf_t *intf) LIB_DLL_EXPORTED
 Given the L3 interface number, return the interface information.
 
void opennsl_l3_intf_t_init (opennsl_l3_intf_t *intf) LIB_DLL_EXPORTED
 Initialize a opennsl_l3_intf_t structure.
 
int opennsl_l3_ip4_options_action_get (int unit, int ip4_options_profile_id, int ip4_option, opennsl_l3_ip4_options_action_t *action) LIB_DLL_EXPORTED
 Get Individual IP options action for a given IP option profile.
 
int opennsl_l3_ip4_options_action_set (int unit, int ip4_options_profile_id, int ip4_option, opennsl_l3_ip4_options_action_t action) LIB_DLL_EXPORTED
 Set Individual IP options action for a given IP option profile.
 
int opennsl_l3_ip4_options_profile_create (int unit, uint32 flags, opennsl_l3_ip4_options_action_t default_action, int *ip4_options_profile_id) LIB_DLL_EXPORTED
 Create a new L3 IP options handling profile.
 
int opennsl_l3_ip4_options_profile_destroy (int unit, int ip4_options_profile_id) LIB_DLL_EXPORTED
 Delete an L3 IP options Profile.
 
int opennsl_l3_route_add (int unit, opennsl_l3_route_t *info) LIB_DLL_EXPORTED
 Add an IP route to the L3 route table.
 
int opennsl_l3_route_delete (int unit, opennsl_l3_route_t *info) LIB_DLL_EXPORTED
 Delete an IP route from the DEFIP table.
 
int opennsl_l3_route_delete_all (int unit, opennsl_l3_route_t *info) LIB_DLL_EXPORTED
 Delete all routes.
 
int opennsl_l3_route_delete_by_interface (int unit, opennsl_l3_route_t *info) LIB_DLL_EXPORTED
 Delete routes based on matching or non-matching L3 interface number.
 
int opennsl_l3_route_get (int unit, opennsl_l3_route_t *info) LIB_DLL_EXPORTED
 Look up a route given the network and netmask.
 
int opennsl_l3_route_max_ecmp_get (int unit, int *max) LIB_DLL_EXPORTED
 Get the maximum ECMP paths allowed for a route (switch family only).
 
int opennsl_l3_route_max_ecmp_set (int unit, int max) LIB_DLL_EXPORTED
 Set the maximum ECMP paths allowed for a route (switch family only).
 
int opennsl_l3_route_multipath_get (int unit, opennsl_l3_route_t *the_route, opennsl_l3_route_t *path_array, int max_path, int *path_count) LIB_DLL_EXPORTED
 Given a network, return all the paths for this route.
 
void opennsl_l3_route_t_init (opennsl_l3_route_t *route) LIB_DLL_EXPORTED
 Initialize a opennsl_l3_route_t structure.
 
int opennsl_l3_route_traverse (int unit, uint32 flags, uint32 start, uint32 end, opennsl_l3_route_traverse_cb trav_fn, void *user_data) LIB_DLL_EXPORTED
 Traverse through the routing table and run callback at each route.
 
int opennsl_l3_vrrp_add (int unit, opennsl_vlan_t vlan, uint32 vrid) LIB_DLL_EXPORTED
 Add VRID for the given VSI.
 
int opennsl_l3_vrrp_delete (int unit, opennsl_vlan_t vlan, uint32 vrid) LIB_DLL_EXPORTED
 Delete VRID for a particular VLAN/VSI.
 
int opennsl_l3_vrrp_delete_all (int unit, opennsl_vlan_t vlan) LIB_DLL_EXPORTED
 Delete all the VRIDs for a particular VLAN/VSI.
 
int opennsl_l3_vrrp_get (int unit, opennsl_vlan_t vlan, int alloc_size, int *vrid_array, int *count) LIB_DLL_EXPORTED
 Get all the VRIDs for which the physical node is master for the virtual routers on the given VLAN/VSI.
 

Detailed Description

Macro Definition Documentation

#define OPENNSL_L3_ADD_TO_ARL   (1 << 5)

Add interface address MAC to ARL.

Definition at line 41 of file l3.h.

#define OPENNSL_L3_COPY_TO_CPU   (1 << 23)

Send a copy to CPU.

Definition at line 65 of file l3.h.

#define OPENNSL_L3_D_HIT   (1 << 3)

Destination IP address match.

Definition at line 37 of file l3.h.

#define OPENNSL_L3_DEFIP_CPU   (1 << 13)

switch family: DEFIP CPU bit set.

Definition at line 53 of file l3.h.

#define OPENNSL_L3_DEFIP_LOCAL   OPENNSL_L3_DEFIP_CPU

XGS: Local DEFIP route.

Definition at line 55 of file l3.h.

#define OPENNSL_L3_DEREFERENCED_NEXTHOP   (1 << 30)

Indicates this is a wider L3 entry.

Definition at line 66 of file l3.h.

#define OPENNSL_L3_DST_DISCARD   (1 << 20)

Destination match discard.

Definition at line 62 of file l3.h.

#define OPENNSL_L3_ECMP_DYNAMIC_LOAD_WEIGHT_INVALID   -1

Invalid value for dynamic_load_weight.

Definition at line 112 of file l3.h.

#define OPENNSL_L3_ECMP_DYNAMIC_MODE_NORMAL   1

ECMP dynamic load balancing normal mode: if inactivity duration lapsed, use optimal member, else use assigned member.

Definition at line 25 of file l3X.h.

#define OPENNSL_L3_ECMP_DYNAMIC_MODE_RESILIENT   4

ECMP resilient load balancing mode: minimize reassignment of flows to members.

Definition at line 320 of file l3.h.

#define OPENNSL_L3_ECMP_DYNAMIC_SCALING_FACTOR_INVALID   -1

Invalid value for dynamic_scaling_factor.

Definition at line 110 of file l3.h.

#define OPENNSL_L3_ECMP_RH_REPLACE   OPENNSL_L3_DEREFERENCED_NEXTHOP

Replace ECMP member without RH flowset table shuffle.

Definition at line 68 of file l3.h.

#define OPENNSL_L3_HIT   (OPENNSL_L3_S_HIT | OPENNSL_L3_D_HIT)

Definition at line 39 of file l3.h.

#define OPENNSL_L3_HIT_CLEAR   (1 << 4)

Clear HIT bit.

Definition at line 40 of file l3.h.

#define OPENNSL_L3_HOST_AS_ROUTE   (1 << 16)

Use LPM if host table full.

Definition at line 58 of file l3.h.

#define OPENNSL_L3_HOST_LOCAL   (1 << 15)

Packet to local IP stack.

Definition at line 57 of file l3.h.

#define OPENNSL_L3_INGRESS_DSCP_TRUST   (1 << 3)

Trust incoming DSCP on L3 Ingress.

Definition at line 77 of file l3.h.

Referenced by example_l3_intf_rif_create().

#define OPENNSL_L3_INGRESS_GLOBAL_ROUTE   (1 << 2)

Allow Global Route on L3 Ingress Interface.

Definition at line 75 of file l3.h.

Referenced by example_create_l3_intf(), example_ip_tunnel_term_create_l3_intf(), and example_l3_intf_rif_create().

#define OPENNSL_L3_INGRESS_REPLACE   (1 << 1)

Replace existing L3 Ingress entry.

Definition at line 73 of file l3.h.

#define OPENNSL_L3_INGRESS_WITH_ID   (1 << 0)

L3 Ingress ID is provided.

Definition at line 72 of file l3.h.

Referenced by example_create_l3_intf(), and example_l3_intf_rif_create().

#define OPENNSL_L3_IP4_OPTIONS_REPLACE   0x00000002

Replace existing entry.

Definition at line 100 of file l3X.h.

#define OPENNSL_L3_IP4_OPTIONS_WITH_ID   0x00000001

With ID option creation.

Definition at line 99 of file l3X.h.

#define OPENNSL_L3_IP6   (1 << 17)

IPv6.

Definition at line 60 of file l3.h.

#define OPENNSL_L3_IPMC   (1 << 11)

Set IPMC for real IPMC entry.

Definition at line 48 of file l3.h.

#define OPENNSL_L3_L2ONLY   (1 << 0)

L2 switch only on interface.

Definition at line 33 of file l3.h.

#define OPENNSL_L3_L2TOCPU   (1 << 12)

Packet to CPU unrouted, XGS12: Set IPMC for UC address.

Definition at line 50 of file l3.h.

#define OPENNSL_L3_MULTIPATH   (1 << 14)

Specify ECMP treatment.

Definition at line 56 of file l3.h.

#define OPENNSL_L3_REPLACE   (1 << 8)

Replace existing entry.

Definition at line 44 of file l3.h.

Referenced by example_l3_intf_rif_create().

#define OPENNSL_L3_ROUTE_LABEL   (1 << 22)

Indicates that MPLS label in route entry is valid.

Definition at line 63 of file l3.h.

#define OPENNSL_L3_RPE   (1 << 10)

Pick up new priority (COS).

Definition at line 46 of file l3.h.

#define OPENNSL_L3_RPF   (1 << 18)

RPF check.

Definition at line 61 of file l3.h.

Referenced by example_l3_intf_rif_create().

#define OPENNSL_L3_S_HIT   (1 << 2)

Source IP address match.

Definition at line 36 of file l3.h.

#define OPENNSL_L3_TGID   (1 << 9)

Port belongs to trunk.

Definition at line 45 of file l3.h.

#define OPENNSL_L3_UNTAG   (1 << 1)

Packet goes out untagged.

Definition at line 35 of file l3.h.

#define OPENNSL_L3_VXLAN_ONLY   (1 << 31)

Specific for VXLAN Nexthop.

Definition at line 71 of file l3.h.

#define OPENNSL_L3_WITH_ID   (1 << 6)

ID is provided.

Definition at line 43 of file l3.h.

Referenced by example_l3_intf_rif_create().

Typedef Documentation

L3 DGM structure.

L3 ECMP member structure.

L3 ECMP structure.

typedef int(* opennsl_l3_egress_ecmp_traverse_cb)(int unit, opennsl_l3_egress_ecmp_t *ecmp, int intf_count, opennsl_if_t *intf_array, void *user_data)

Definition at line 349 of file l3.h.

typedef int(* opennsl_l3_egress_multipath_traverse_cb)(int unit, opennsl_if_t mpintf, int intf_count, opennsl_if_t *intf_array, void *user_data)

Definition at line 342 of file l3.h.

L3 Egress Structure.

Description of an L3 forwarding destination.

typedef int(* opennsl_l3_egress_traverse_cb)(int unit, opennsl_if_t intf, opennsl_l3_egress_t *info, void *user_data)

Definition at line 336 of file l3.h.

L3 Host Structure.

Contains information required for manipulating L3 host table entries.

The OPENNSL_L3_IP6 flag in l3a_flags must be set to specify whether the IPv4 or IPv6 addresses are valid.

typedef int(* opennsl_l3_host_traverse_cb)(int unit, int index, opennsl_l3_host_t *info, void *user_data)

Definition at line 324 of file l3.h.

L3 Information Structure.

Contains information about L3 hardware capacity and utilization.

L3 Ingress Structure.

Description of an L3 Ingress interface.

L3 Ingress Interface URPF Mode setting.

L3 Interface QOS setting.

L3 Interface Structure.

Contains information required for manipulating L3 interfaces.

L3 IP options handing actions.

L3 Route Structure.

Contains information required for manipulating L3 route table entries.

The OPENNSL_L3_IP6 flag in l3a_flags must be set to specify whether the IPv4 or IPv6 addresses are valid.

typedef int(* opennsl_l3_route_traverse_cb)(int unit, int index, opennsl_l3_route_t *info, void *user_data)

Definition at line 330 of file l3.h.

Types of counters per L3 object.

Enumeration Type Documentation

L3 Ingress Interface URPF Mode setting.

Enumerator:
opennslL3IngressUrpfDisable 

Disable unicast RPF.

opennslL3IngressUrpfLoose 

Loose mode Unicast RPF.

opennslL3IngressUrpfStrict 

Strict mode Unicast RPF.

Definition at line 115 of file l3.h.

L3 IP options handing actions.

Enumerator:
opennslIntfIPOptionActionNone 

No action.

opennslIntfIPOptionActionCopyToCPU 

Copy to CPU action.

opennslIntfIPOptionActionDrop 

Drop action.

opennslIntfIPOptionActionCopyCPUAndDrop 

Copy to CPU and Drop action.

Definition at line 102 of file l3X.h.

Types of counters per L3 object.

Enumerator:
opennslL3StatOutPackets 
opennslL3StatOutBytes 
opennslL3StatDropPackets 
opennslL3StatDropBytes 
opennslL3StatInPackets 
opennslL3StatInBytes 

Definition at line 1317 of file l3.h.

Function Documentation

int opennsl_l3_ecmp_get ( int  unit,
opennsl_l3_egress_ecmp_t ecmp_info,
int  ecmp_member_size,
opennsl_l3_ecmp_member_t ecmp_member_array,
int *  ecmp_member_count 
)

Get info about an Egress ECMP forwarding object.

Description
Get info about the Egress ECMP forwarding object pointed to by ecmp_info->ecmp_intf.
Parameters
unit[IN] Unit number.
ecmp_info[IN,OUT] ECMP group info.
ecmp_member_size[IN] Size of allocated entries in ecmp_member_array.
ecmp_member_array[OUT] Member array of Egress forwarding objects.
ecmp_member_count[OUT] Number of entries of ecmp_member_count actually filled in. This will be a value less than or equal to the value passed in as ecmp_member_size unless ecmp_member_size is 0. If ecmp_member_size is 0 then ecmp_member_array is ignored and ecmp_member_count is filled in with the number of entries that would have been filled into ecmp_member_array if ecmp_member_size was arbitrarily large.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_create ( int  unit,
uint32  flags,
opennsl_l3_egress_t egr,
opennsl_if_t if_id 
)

Create an Egress forwarding object.

Description
Create a unicast L3 Egress forwarding object on a physical port. On network switch, this API can be used to create additional types of L3 Egress objects:.
Parameters
unit[IN] Unit number.
flags[IN] OPENNSL_L3_REPLACE: replace existing. OPENNSL_L3_WITH_ID: intf argument is given.
egr[IN,OUT] Egress forwarding destination.
if_id[IN,OUT]
Return values
OPENNSL_E_XXX

Referenced by example_create_l3_egress(), and example_l3_egress_create().

int opennsl_l3_egress_destroy ( int  unit,
opennsl_if_t  intf 
)

Destroy an Egress forwarding object.

Description
Destroy an Egress forwarding path. Only unused egress objects can be deleted. That is, if forwarding path is used by routes/hosts/multipath objects operation will return OPENNSL_E_BUSY. .
Parameters
unit[IN] Unit number.
intf[IN] L3 interface ID pointing to Egress object.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_ecmp_add ( int  unit,
opennsl_l3_egress_ecmp_t ecmp,
opennsl_if_t  intf 
)

Add an Egress forwarding object to an Egress ECMP forwarding object.

Description
Add an Egress forwarding object to the Egress ECMP forwarding object pointed to by ecmp->ecmp_intf.
Parameters
unit[IN] Unit number.
ecmp[IN] ECMP group info.
intf[IN] L3 interface ID pointing to Egress forwarding object.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_ecmp_create ( int  unit,
opennsl_l3_egress_ecmp_t ecmp,
int  intf_count,
opennsl_if_t intf_array 
)

Create an Egress ECMP forwarding object.

Description
Create an Egress ECMP forwarding object. The L3 interface ID pointing to the created Egress ECMP object is returned in ecmp->ecmp_intf.
Parameters
unit[IN] Unit number.
ecmp[IN,OUT] ECMP group info.
intf_count[IN] Number of elements in intf_array.
intf_array[IN] Array of Egress forwarding objects.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_ecmp_delete ( int  unit,
opennsl_l3_egress_ecmp_t ecmp,
opennsl_if_t  intf 
)

Delete an Egress forwarding object from an Egress ECMP forwarding object.

Description
Delete an Egress forwarding object from the Egress ECMP forwarding object pointed to by ecmp->ecmp_intf.
Parameters
unit[IN] Unit number.
ecmp[IN] ECMP group info.
intf[IN] L3 interface ID pointing to Egress forwarding object.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_ecmp_destroy ( int  unit,
opennsl_l3_egress_ecmp_t ecmp 
)

Destroy an Egress ECMP forwarding object.

Description
Destroy the Egress ECMP forwarding object pointed to by ecmp->ecmp_intf. Only unused egress objects can be deleted. If forwarding path is used by routes/hosts objects, operation will return OPENNSL_E_BUSY. .
Parameters
unit[IN] Unit number.
ecmp[IN] ECMP group info.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_ecmp_find ( int  unit,
int  intf_count,
opennsl_if_t intf_array,
opennsl_l3_egress_ecmp_t ecmp 
)

Find an Egress ECMP forwarding object.

Description
Find an Egress ECMP forwarding object with the specified set of Egress forwarding objects.
Parameters
unit[IN] Unit number.
intf_count[IN] Number of elements in intf_array.
intf_array[IN] Array of Egress forwarding objects.
ecmp[OUT] ECMP group info.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_ecmp_get ( int  unit,
opennsl_l3_egress_ecmp_t ecmp,
int  intf_size,
opennsl_if_t intf_array,
int *  intf_count 
)

Get info about an Egress ECMP forwarding object.

Description
Get info about the Egress ECMP forwarding object pointed to by ecmp->ecmp_intf.
Parameters
unit[IN] Unit number.
ecmp[IN,OUT] ECMP group info.
intf_size[IN] Size of allocated entries in intf_array.
intf_array[OUT] Array of Egress forwarding objects.
intf_count[OUT] Number of entries of intf_count actually filled in. This will be a value less than or equal to the value passed in as intf_size unless intf_size is 0. If intf_size is 0 then intf_array is ignored and intf_count is filled in with the number of entries that would have been filled into intf_array if intf_size was arbitrarily large.
Return values
OPENNSL_E_XXX
void opennsl_l3_egress_ecmp_t_init ( opennsl_l3_egress_ecmp_t ecmp)

Initialize L3 Egress ECMP object structure.

Description
Initializes a L3 Egress ECMP object structure to default values. This function should be used to initialize the L3 Egress ECMP object structure prior to invocation of opennsl_l3_egress_ecmp_* APIs. This ensures that the structure members are initialized to the correct default values.
Parameters
ecmp[IN,OUT] L3 Egress ECMP object structure
Return values
Nothing
int opennsl_l3_egress_ecmp_traverse ( int  unit,
opennsl_l3_egress_ecmp_traverse_cb  trav_fn,
void *  user_data 
)

Traverse through the valid Egress ECMP forwarding objects and run callback.

Description
Goes through all the valid Egress ECMP forwarding objects and runs the user callback function, passing back the information for that Egress ECMP forwarding object (including its set of Egress forwarding objects).
Parameters
unit[IN] Unit number.
trav_fn[IN] Callback function
user_data[IN] User data to be passed to callback function
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_find ( int  unit,
opennsl_l3_egress_t egr,
opennsl_if_t intf 
)

Find an interface pointing to an Egress forwarding object.

Description
Find an interface pointing to Egress forwarding path with specified properties.
Parameters
unit[IN] Unit number.
egr[IN] Egress forwarding path properties.
intf[OUT] L3 interface ID pointing to Egress object.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_get ( int  unit,
opennsl_if_t  intf,
opennsl_l3_egress_t egr 
)

Get an Egress forwarding object.

Description
Get an Egress forwarding path properties. .
Parameters
unit[IN] Unit number.
intf[IN] L3 interface ID pointing to Egress object.
egr[OUT] Egress forwarding path properties.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_multipath_add ( int  unit,
opennsl_if_t  mpintf,
opennsl_if_t  intf 
)

Add an Egress forwarding object to an Egress Multipath forwarding object.

Description
This API is deprecated and should not be used. This API group has been deprecated by opennsl_l3_egress_ecmp_xxx APIs, which allow the configuration of per ECMP group attributes such as dynamic load balancing and resilient hashing.
Parameters
unit[IN] Unit number.
mpintf[IN] L3 interface ID pointing to Egress multipath object.
intf[IN] L3 interface ID pointing to Egress forwarding object.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_multipath_create ( int  unit,
uint32  flags,
int  intf_count,
opennsl_if_t intf_array,
opennsl_if_t mpintf 
)

Create a Multipath Egress forwarding object.

Description
This API is deprecated and should not be used. This API group has been deprecated by opennsl_l3_egress_ecmp_xxx APIs, which allow the configuration of per ECMP group attributes such as dynamic load balancing and resilient hashing.
Parameters
unit[IN] Unit number.
flags[IN] OPENNSL_L3_REPLACE: replace existing. OPENNSL_L3_WITH_ID: intf argument is given.
intf_count[IN] Number of elements in intf_array.
intf_array[IN] Array of Egress forwarding objects.
mpintf[IN,OUT] L3 interface ID pointing to Egress object. This is an IN argument if either OPENNSL_L3_REPLACE or OPENNSL_L3_WITH_ID are given in flags.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_multipath_delete ( int  unit,
opennsl_if_t  mpintf,
opennsl_if_t  intf 
)

Delete an Egress forwarding object from an Egress Multipath forwarding object.

Description
This API is deprecated and should not be used. This API group has been deprecated by opennsl_l3_egress_ecmp_xxx APIs, which allow the configuration of per ECMP group attributes such as dynamic load balancing and resilient hashing.
Parameters
unit[IN] Unit number.
mpintf[IN] L3 interface ID pointing to Egress multipath object.
intf[IN] L3 interface ID pointing to Egress forwarding object.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_multipath_destroy ( int  unit,
opennsl_if_t  mpintf 
)

Destroy an Egress Multipath forwarding object.

Description
This API is deprecated and should not be used. This API group has been deprecated by opennsl_l3_egress_ecmp_xxx APIs, which allow the configuration of per ECMP group attributes such as dynamic load balancing and resilient hashing.
Parameters
unit[IN] Unit number.
mpintf[IN] L3 interface ID pointing to Egress multipath object.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_multipath_find ( int  unit,
int  intf_count,
opennsl_if_t intf_array,
opennsl_if_t mpintf 
)

Find an interface pointing to an Egress Multipath forwarding object.

Description
This API is deprecated and should not be used. This API group has been deprecated by opennsl_l3_egress_ecmp_xxx APIs, which allow the configuration of per ECMP group attributes such as dynamic load balancing and resilient hashing.
Parameters
unit[IN] Unit number.
intf_count[IN] Number of elements in intf_array.
intf_array[IN] Array of Egress forwarding objects.
mpintf[OUT] L3 interface ID pointing to Multipath Egress object.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_multipath_get ( int  unit,
opennsl_if_t  mpintf,
int  intf_size,
opennsl_if_t intf_array,
int *  intf_count 
)

Get an Egress Multipath forwarding object.

Description
This API is deprecated and should not be used. This API group has been deprecated by opennsl_l3_egress_ecmp_xxx APIs, which allow the configuration of per ECMP group attributes such as dynamic load balancing and resilient hashing.
Parameters
unit[IN] Unit number.
mpintf[IN] L3 interface ID pointing to Egress multipath object.
intf_size[IN] Size of allocated entries in intf_array.
intf_array[OUT] Array of Egress forwarding objects.
intf_count[OUT] Number of entries of intf_count actually filled in. This will be a value less than or equal to the value passed in as intf_size unless intf_size is 0. If intf_size is 0 then intf_array is ignored and intf_count is filled in with the number of entries that would have been filled into intf_array if intf_size was arbitrarily large.
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_multipath_traverse ( int  unit,
opennsl_l3_egress_multipath_traverse_cb  trav_fn,
void *  user_data 
)

Traverse through the multipath egress object table and run callback at each valid entry.

Description
This API is deprecated and should not be used. This API group has been deprecated by opennsl_l3_egress_ecmp_xxx APIs, which allow the configuration of per ECMP group attributes such as dynamic load balancing and resilient hashing.
Parameters
unit[IN] Unit number.
trav_fn[IN] Callback function
user_data[IN] User data to be passed to callback function
Return values
OPENNSL_E_XXX
int opennsl_l3_egress_stat_attach ( int  unit,
opennsl_if_t  intf_id,
uint32  stat_counter_id 
)

Attach counters entries to the given L3 Egress interface.

Description
This API will attach counters entries to the given L3 Egress interface. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
intf_id[IN] Interface ID of a egress L3 object
stat_counter_id[IN] Stat Counter ID
Return values
OPENNSL_E_xxx
int opennsl_l3_egress_stat_counter_get ( int  unit,
opennsl_if_t  intf_id,
opennsl_l3_stat_t  stat,
uint32  num_entries,
uint32 counter_indexes,
opennsl_stat_value_t counter_values 
)

Get the specified counter statistic for a L3 egress interface.

Description
This API will retrieve set of counter statistic values for the specified L3 egress. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
intf_id[IN] Interface ID of a egress L3 object.
stat[IN] Type of the counter to retrieve that is, ingress/egress byte/packet
num_entries[IN] Number of counter Entries
counter_indexes[IN] Pointer to Counter indexes entries
counter_values[OUT] Pointer to counter values
Return values
OPENNSL_E_xxx
int opennsl_l3_egress_stat_detach ( int  unit,
opennsl_if_t  intf_id 
)

Detach counters entries to the given L3 Egress interface.

Description
This API will detach counters entries to the given L3 Egress interface. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
intf_id[IN] Interface ID of a egress L3 object.
Return values
OPENNSL_E_xxx
void opennsl_l3_egress_t_init ( opennsl_l3_egress_t egr)

Initialize a opennsl_l3_egress_t structure.

Description
Initializes an egress object structure to default values. This function should be used to initialize any host structure prior to filling it out and passing it to an API function. This ensures that subsequent API releases may add new structure members to the opennsl_l3_egress_t structure, and opennsl_l3_egress_t_init will initialize the new members to correct default values.
Parameters
egr[IN,OUT] Egress object entry information
Return values
Nothing

Referenced by example_create_l3_egress(), and example_l3_egress_create().

int opennsl_l3_egress_traverse ( int  unit,
opennsl_l3_egress_traverse_cb  trav_fn,
void *  user_data 
)

Traverse through the egress object table and run callback at each valid entry.

Description
Goes through L3 egress table and runs the user callback function at each valid entry, passing back the information for that egress object entry.
Parameters
unit[IN] Unit number.
trav_fn[IN] Callback function
user_data[IN] User data to be passed to callback function
Return values
OPENNSL_E_XXX
int opennsl_l3_host_add ( int  unit,
opennsl_l3_host_t info 
)

Add an entry into the L3 switching table.

Description
Add an entry to the L3 host table The valid flags are as follows:.
Parameters
unit[IN] Unit number.
info[IN] Pointer to opennsl_l3_host_t containing fields related to L3 host table: =L3_HOST_ADD_FIELDS_table
Return values
OPENNSL_E_XXX
Thisfunction supersedes .

Referenced by example_add_host(), and example_host_add().

int opennsl_l3_host_delete ( int  unit,
opennsl_l3_host_t ip_addr 
)

Delete an entry from the L3 host table.

Description
Deletes an L3 host table entry matching the IP address specified. The valid flag is:.
Parameters
unit[IN] Unit number.
ip_addr[IN] Pointer to opennsl_l3_host_t containing fields related to the IP address to be deleted from the L3 host table: =L3_HOST_DELETE_FIELDS_table
Return values
OPENNSL_E_XXX
Thisfunction supersedes .
int opennsl_l3_host_delete_all ( int  unit,
opennsl_l3_host_t info 
)

Deletes all L3 host table entries.

Description
Deletes all L3 host table entries.
Parameters
unit[IN] Unit number.
info[IN] Structure containing flags
Return values
OPENNSL_E_XXX
Thisfunction supersedes .
int opennsl_l3_host_delete_by_interface ( int  unit,
opennsl_l3_host_t info 
)

Deletes L3 entries that match or do not match a specified L3 interface number.

Description
Deletes all the L3 entries that match/do not match the specified L3 interface. The valid flag is:.
Parameters
unit[IN] Unit number.
info[IN] Structure specifying the L3 interface: =L3_HOST_DELETE_IF_FIELDS_table
Return values
OPENNSL_E_XXX
Thisfunction supersedes .
Trident3- This function cannot be used to delete flex L3 Host entries
pointingto IPMC group.
int opennsl_l3_host_find ( int  unit,
opennsl_l3_host_t info 
)

Look up an L3 host table entry based on IP address.

Description
Given an IP address, look for a corresponding entry in the L3 host table, and if found, return the entry's associated information. The valid flags are as follows:.
Parameters
unit[IN] Unit number.
info[IN,OUT] Pointer to opennsl_l3_host_t =L3_HOST_FIND_FIELDS_table
Return values
OPENNSL_E_NOT_FOUND- Matching host table entry not found
OPENNSL_E_XXX- Other error code
Thisfunction supersedes .
void opennsl_l3_host_t_init ( opennsl_l3_host_t ip)

Initialize a opennsl_l3_host_t structure.

Description
Initializes a host structure to default values. This function should be used to initialize any host structure prior to filling it out and passing it to an API function. This ensures that subsequent API releases may add new structure members to the opennsl_l3_host_t structure, and opennsl_l3_host_t_init will initialize the new members to correct default values.
Parameters
ip[IN,OUT]
Return values
Nothing

Referenced by example_add_host(), and example_host_add().

int opennsl_l3_host_traverse ( int  unit,
uint32  flags,
uint32  start,
uint32  end,
opennsl_l3_host_traverse_cb  cb,
void *  user_data 
)

Traverse through the L3 table and run callback at each valid L3 entry.

Description
Goes through L3 host table and runs the user callback function at each valid L3 host entry, passing back the information for that L3 host entry. The valid flag is:.
Parameters
unit[IN] Unit number.
flags[IN] Operation control flags
start[IN] The starting valid entry number to be traversed
end[IN] The last valid entry number to be traversed
cb[IN] Callback function
user_data[IN] User data to be passed to callback function
Return values
OPENNSL_E_XXX
int opennsl_l3_info ( int  unit,
opennsl_l3_info_t l3info 
)

Get the status of hardware tables.

Description
Returns the L3 table capacities and usage, including information about the host and route tables.
Parameters
unit[IN] Unit number.
l3info[OUT] L3 capacity and usage information
Return values
OPENNSL_E_XXX
void opennsl_l3_info_t_init ( opennsl_l3_info_t info)

Initialize a opennsl_l3_info_t_init structure.

Description
Initializes a L3 information structure to default values. This function should be used to initialize any L3 information structure prior to filling it out and passing it to an API function. This ensures that subsequent API releases may add new structure members to the opennsl_l3_info_t structure, and opennsl_l3_info_t_init will initialize the new members to correct default values.
Parameters
info[IN,OUT] Pointer to L3 information structure to initialize.
Return values
Nothing
int opennsl_l3_ingress_create ( int  unit,
opennsl_l3_ingress_t ing_intf,
opennsl_if_t intf_id 
)

Create L3 Ingress Interface object.

Parameters
unit[IN] Unit number.
ing_intf[IN] Egress forwarding destination.
intf_id[IN,OUT] L3 Ingress Interface ID pointing to L3 IIF object. This is an IN argument if either OPENNSL_L3_INGRESS_REPLACE or OPENNSL_L3_INGRESS_WITH_ID are given in flags.
Return values
OPENNSL_E_XXX

Referenced by example_create_l3_intf(), and example_l3_intf_rif_create().

int opennsl_l3_ingress_stat_attach ( int  unit,
opennsl_if_t  intf_id,
uint32  stat_counter_id 
)

Attach counters entries to the given L3 ingress interface.

Description
This API will attach counters entries to the given L3 ingress Interface. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
intf_id[IN] Interface ID of a L3 ingress object or a valid VLAN
stat_counter_id[IN] Stat Counter ID
Return values
OPENNSL_E_xxx
int opennsl_l3_ingress_stat_counter_get ( int  unit,
opennsl_if_t  intf_id,
opennsl_l3_stat_t  stat,
uint32  num_entries,
uint32 counter_indexes,
opennsl_stat_value_t counter_values 
)

Get counter statistic values for a l3 interface object.

Description
This API will retrieve set of counter statistic values for a l3 interface object. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
intf_id[IN] Interface ID of a L3 ingress object or a valid VLAN
stat[IN] Type of the counter to retrieve that is, ingress/egress byte/packet
num_entries[IN] Number of counter Entries
counter_indexes[IN] Pointer to Counter indexes entries
counter_values[OUT] Pointer to counter values
Return values
OPENNSL_E_xxx
int opennsl_l3_ingress_stat_detach ( int  unit,
opennsl_if_t  intf_id 
)

Detach counters entries to the given L3 ingress interface.

Description
This API will detach counters entries to the given L3 ingress Interface. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
intf_id[IN] Interface ID of a L3 ingress object or a valid VLAN
Return values
OPENNSL_E_xxx
void opennsl_l3_ingress_t_init ( opennsl_l3_ingress_t ing_intf)

Initialize L3 Ingress Interface object structure.

Description
Initializes an ingress object structure to default values. This function should be used to initialize the ingress interface structure prior to invocation of Ingress APIs. This ensures that the structure members are initialized to the correct default values.
Parameters
ing_intf[IN,OUT] Ingress object entry information
Return values
Nothing

Referenced by example_create_l3_intf(), and example_l3_intf_rif_create().

int opennsl_l3_init ( int  unit)

Initialize the OPENNSL L3 subsystem.

Description
Initialize all L3 tables and internal data structures.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_XXX
int opennsl_l3_intf_create ( int  unit,
opennsl_l3_intf_t intf 
)

Create a new L3 interface.

Description
Creates a new L3 interface. The MAC address for the new L3 interface is l3a_mac_addr, and the VLAN identifier is l3a_vid. The valid flags are as follows:.
Parameters
unit[IN] Unit number.
intf[IN,OUT] Interface information =L3_INTF_CREATE_FLAGS_table
Return values
OPENNSL_E_XXX

Referenced by example_create_l3_intf(), and example_l3_intf_rif_create().

int opennsl_l3_intf_delete ( int  unit,
opennsl_l3_intf_t intf 
)

Delete an L3 interface.

Description
Deletes an entry from the L3 interface table. This function supersedes =opennsl_l3_interface_destroy .
Parameters
unit[IN] Unit number.
intf[IN] L3 interface information. Valid fields: l3a_intf_id - ID of interface to be deleted
Return values
OPENNSL_E_XXX
int opennsl_l3_intf_find ( int  unit,
opennsl_l3_intf_t intf 
)

Search for L3 interface by MAC address and VLAN.

Description
Finds an L3 interface ID based on MAC address and VLAN. This function supersedes =opennsl_l3_interface_lookup .
Parameters
unit[IN] Unit number.
intf[IN,OUT] L3 interface information =L3_INTF_FIND_FLAGS_table
Return values
OPENNSL_E_NOT_FOUND- Interface not found
OPENNSL_E_XXX- Other error code
int opennsl_l3_intf_find_vlan ( int  unit,
opennsl_l3_intf_t intf 
)

Search for L3 interface by VLAN only.

Description
Find the L3 interface ID based on VLAN. If more than one interface is found in the same VLAN, only the first is returned. This function supersedes =opennsl_l3_interface_find_by_vlan .
Parameters
unit[IN] Unit number.
intf[IN,OUT] L3 interface information. Valid Input: l3a_vid - Interface VLAN, l3a_intf_id - L3 interface number, if found
Return values
OPENNSL_E_NOT_FOUND- Interface not found
OPENNSL_E_XXX- Other error code
int opennsl_l3_intf_get ( int  unit,
opennsl_l3_intf_t intf 
)

Given the L3 interface number, return the interface information.

Description
Given the L3 interface number, returns the MAC and VLAN of the interface.
Parameters
unit[IN] Unit number.
intf[IN,OUT] L3 interface information. =L3_INTF_GET_INPUT_table
Return values
OPENNSL_E_XXX

Referenced by example_l3_intf_rif_create().

void opennsl_l3_intf_t_init ( opennsl_l3_intf_t intf)

Initialize a opennsl_l3_intf_t structure.

Description
Initializes an interface structure to default values. This function should be used to initialize any interface structure prior to filling it out and passing it to an API function. This ensures that subsequent API releases may add new structure members to the opennsl_l3_intf_t structure, and opennsl_l3_intf_t_init will initialize the new members to correct default values.
Parameters
intf[IN,OUT] Interface information
Return values
Nothing

Referenced by example_create_l3_intf(), example_ip_tunnel_add(), and example_l3_intf_rif_create().

int opennsl_l3_ip4_options_action_get ( int  unit,
int  ip4_options_profile_id,
int  ip4_option,
opennsl_l3_ip4_options_action_t action 
)

Get Individual IP options action for a given IP option profile.

Description
Retrieve the action for the specified IP option for a given IP option profile.
Parameters
unit[IN] Unit number.
ip4_options_profile_id[IN] ID of IP options profile
ip4_option[IN] ID of IP options profile
action[OUT] Retrieved action for the IP option specified in ip4_option
Return values
OPENNSL_E_XXX
int opennsl_l3_ip4_options_action_set ( int  unit,
int  ip4_options_profile_id,
int  ip4_option,
opennsl_l3_ip4_options_action_t  action 
)

Set Individual IP options action for a given IP option profile.

Description
Update the action for the specified IP option for a given IP option profile.
Parameters
unit[IN] Unit number.
ip4_options_profile_id[IN] ID of IP options profile. ID 0 is reserved and cannot be Modified.
ip4_option[IN] ID of IP options profile. ID 0 is reserved and cannot be Modified.
action[IN] new action for the IP option specified in ip4_option
Return values
OPENNSL_E_XXX
int opennsl_l3_ip4_options_profile_create ( int  unit,
uint32  flags,
opennsl_l3_ip4_options_action_t  default_action,
int *  ip4_options_profile_id 
)

Create a new L3 IP options handling profile.

Description
Creates a new L3 IP option handling profile. The specified default action will be applied to all the IP options in the profile that is being created. The valid flags are as follows:.
Parameters
unit[IN] Unit number.
flags[IN] Flags
default_action[IN] default action to apply for all IP options in the profile.
ip4_options_profile_id[IN,OUT] Created Profile ID
Return values
OPENNSL_E_XXX
int opennsl_l3_ip4_options_profile_destroy ( int  unit,
int  ip4_options_profile_id 
)

Delete an L3 IP options Profile.

Description
Deletes an IP options profile.
Parameters
unit[IN] Unit number.
ip4_options_profile_id[OUT] ID of IP options profile. ID 0 is reserved and cannot be deleted.
Return values
OPENNSL_E_XXX
int opennsl_l3_route_add ( int  unit,
opennsl_l3_route_t info 
)

Add an IP route to the L3 route table.

Description
Adds an L3 route to the route table. The valid flags are as follows:.
Parameters
unit[IN] Unit number.
info[IN] Pointer to opennsl_l3_host_t containing fields related to routing table: =L3_ROUTE_ADD_FIELDS_table
Return values
OPENNSL_E_XXX

Referenced by example_route_add(), and example_set_default_route().

int opennsl_l3_route_delete ( int  unit,
opennsl_l3_route_t info 
)

Delete an IP route from the DEFIP table.

Description
Deletes an L3 route from the route table. The valid flags are as follows:.
Parameters
unit[IN] Unit number.
info[IN] Pointer to opennsl_l3_route_t containing the route to delete. Valid Fields: =L3_ROUTE_DELETE_FIELDS_table and if OPENNSL_L3_MULTIPATH flag is set, the following fields are also applicable: =L3_ROUTE_DELETE_MULTICAST_FIELDS_table
Return values
OPENNSL_E_XXX
int opennsl_l3_route_delete_all ( int  unit,
opennsl_l3_route_t info 
)

Delete all routes.

Description
Delete all the routes installed, including default unicast IP routes and IPMC routes.
Parameters
unit[IN] Unit number.
info[IN] Route information, of which only l3a_flags is used.
Return values
OPENNSL_E_XXX
int opennsl_l3_route_delete_by_interface ( int  unit,
opennsl_l3_route_t info 
)

Delete routes based on matching or non-matching L3 interface number.

Description
Delete all the routes which match or do not match a specified outgoing L3 interface, including the default routes. .
Parameters
unit[IN] Unit number.
info[IN] Structure containing the L3 interface. Valid fields: =L3_ROUTE_DEL_BY_INTF_FIELDS_table
Return values
OPENNSL_E_XXX
int opennsl_l3_route_get ( int  unit,
opennsl_l3_route_t info 
)

Look up a route given the network and netmask.

Description
Gets information for an IP route from the route table. The valid flags are as follows:.
Parameters
unit[IN] Unit number.
info[IN,OUT] Pointer to opennsl_l3_route_t specifying the network number. =L3_ROUTE_GET_FIELDS_table
Return values
OPENNSL_E_XXX
int opennsl_l3_route_max_ecmp_get ( int  unit,
int *  max 
)

Get the maximum ECMP paths allowed for a route (switch family only).

Description
For switch family only, gets the maximum ECMP paths allowed for a route.
Parameters
unit[IN] Unit number.
max[OUT] Maximum number of ECMP paths
Return values
OPENNSL_E_XXX
AdditionalInformation
int opennsl_l3_route_max_ecmp_set ( int  unit,
int  max 
)

Set the maximum ECMP paths allowed for a route (switch family only).

For optimized Resilient Hashing, maximum ECMP paths is a dummy variable.

Description
For switch family only, set the maximum ECMP paths allowed for a route (the default is the maximum allowed by the hardware).
Parameters
unit[IN] Unit number.
max[IN] Maximum number of ECMP paths allowed
Return values
OPENNSL_E_XXX
int opennsl_l3_route_multipath_get ( int  unit,
opennsl_l3_route_t the_route,
opennsl_l3_route_t path_array,
int  max_path,
int *  path_count 
)

Given a network, return all the paths for this route.

Description
Get information for all ECMP paths for a route. For a non-ECMP route, only one path is returned. The valid flags are as follows:.
Parameters
unit[IN] Unit number.
the_route[IN] Pointer to opennsl_l3_route_t specifying the network number. Valid fields: =L3_ROUTE_MP_GET_ROUTE_FIELDS_table
path_array[OUT] Array of opennsl_l3_route_t to hold output path information for the network. Valid fields: =L3_ROUTE_MP_PATH_FIELDS_table
max_path[IN] Maximum number of ECMP paths that may be returned.
path_count[OUT]
Return values
OPENNSL_E_XXX
void opennsl_l3_route_t_init ( opennsl_l3_route_t route)

Initialize a opennsl_l3_route_t structure.

Description
Initializes a route structure to default values. This function should be used to initialize any route structure prior to filling it out and passing it to an API function. This ensures that subsequent API releases may add new structure members to the opennsl_l3_route_t structure, and opennsl_l3_route_t_init will initialize the new members to correct default values.
Parameters
route[IN,OUT] Route information
Return values
Nothing

Referenced by example_route_add(), and example_set_default_route().

int opennsl_l3_route_traverse ( int  unit,
uint32  flags,
uint32  start,
uint32  end,
opennsl_l3_route_traverse_cb  trav_fn,
void *  user_data 
)

Traverse through the routing table and run callback at each route.

Description
Goes through the route table and runs the callback function at each valid route, passing it the route information. The valid flag is:.
Parameters
unit[IN] Unit number.
flags[IN] Operation control flags
start[IN] The starting route number to be traversed
end[IN] The last route number to be traversed
trav_fn[IN] Callback function
user_data[IN] User data to be passed to callback routine
Return values
OPENNSL_E_XXX
int opennsl_l3_vrrp_add ( int  unit,
opennsl_vlan_t  vlan,
uint32  vrid 
)

Add VRID for the given VSI.

Adding a VRID using this API means the physical node has become the master for the virtual router.

Description
Configure an active VRID (Virtual Router ID) for the given VSI or VLAN. OPENNSL8802x devices support a maximum of 4 active VR IDs on a given VLAN.
Parameters
unit[IN] Unit number.
vlan[IN] VLAN/VSI/VPN Identifier
vrid[IN] VRID - Virtual router ID to be added
Return values
OPENNSL_E_XXX
int opennsl_l3_vrrp_delete ( int  unit,
opennsl_vlan_t  vlan,
uint32  vrid 
)

Delete VRID for a particular VLAN/VSI.

Description
Remove a VRID from the configured list of active VRIDs for a given VLAN.
Parameters
unit[IN] Unit number.
vlan[IN] VLAN/VSI
vrid[IN] VRID - Virtual router ID to be deleted
Return values
OPENNSL_E_XXX
int opennsl_l3_vrrp_delete_all ( int  unit,
opennsl_vlan_t  vlan 
)

Delete all the VRIDs for a particular VLAN/VSI.

Description
Delete all the VRIDs for a particular VLAN/VSI.
Parameters
unit[IN] Unit number.
vlan[IN] VLAN/VSI
Return values
OPENNSL_E_XXX
int opennsl_l3_vrrp_get ( int  unit,
opennsl_vlan_t  vlan,
int  alloc_size,
int *  vrid_array,
int *  count 
)

Get all the VRIDs for which the physical node is master for the virtual routers on the given VLAN/VSI.

Description
Get all the VRIDs for which the physical node is master for the virtual routers on the given VLAN/VSI.
Parameters
unit[IN] Unit number.
vlan[IN] VLAN/VSI
alloc_size[IN] Number of vrid_array elements
vrid_array[OUT] Pointer to the array to which the VRIDs will be copied
count[OUT] Number of VRIDs copied
Return values
OPENNSL_E_XXX