OpenNSL API Guide and Reference Manual
Data Structures | Macros | Typedefs | Enumerations | Functions
l3.h File Reference
#include <opennsl/types.h>
#include <opennsl/stat.h>
#include <opennsl/mpls.h>
#include <opennsl/l3X.h>

Go to the source code of this file.

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...
 

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_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_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 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_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_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.
 
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_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.
 
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_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.