SAI Metadata
Loading...
Searching...
No Matches
SAI - Route specific API definitions

Classes

struct  _sai_route_entry_t
 Unicast route entry. More...
 
struct  _sai_route_api_t
 Router entry methods table retrieved with sai_api_query() More...
 

Typedefs

typedef enum _sai_route_entry_attr_t sai_route_entry_attr_t
 Attribute Id for SAI route object.
 
typedef struct _sai_route_entry_t sai_route_entry_t
 Unicast route entry.
 
typedef sai_status_t(* sai_create_route_entry_fn) (_In_ const sai_route_entry_t *route_entry, _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list)
 Create Route.
 
typedef sai_status_t(* sai_remove_route_entry_fn) (_In_ const sai_route_entry_t *route_entry)
 Remove Route.
 
typedef sai_status_t(* sai_set_route_entry_attribute_fn) (_In_ const sai_route_entry_t *route_entry, _In_ const sai_attribute_t *attr)
 Set route attribute value.
 
typedef sai_status_t(* sai_get_route_entry_attribute_fn) (_In_ const sai_route_entry_t *route_entry, _In_ uint32_t attr_count, _Inout_ sai_attribute_t *attr_list)
 Get route attribute value.
 
typedef sai_status_t(* sai_bulk_create_route_entry_fn) (_In_ uint32_t object_count, _In_ const sai_route_entry_t *route_entry, _In_ const uint32_t *attr_count, _In_ const sai_attribute_t **attr_list, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)
 Bulk create route entry.
 
typedef sai_status_t(* sai_bulk_remove_route_entry_fn) (_In_ uint32_t object_count, _In_ const sai_route_entry_t *route_entry, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)
 Bulk remove route entry.
 
typedef sai_status_t(* sai_bulk_set_route_entry_attribute_fn) (_In_ uint32_t object_count, _In_ const sai_route_entry_t *route_entry, _In_ const sai_attribute_t *attr_list, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)
 Bulk set attribute on route entry.
 
typedef sai_status_t(* sai_bulk_get_route_entry_attribute_fn) (_In_ uint32_t object_count, _In_ const sai_route_entry_t *route_entry, _In_ const uint32_t *attr_count, _Inout_ sai_attribute_t **attr_list, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)
 Bulk get attribute on route entry.
 
typedef struct _sai_route_api_t sai_route_api_t
 Router entry methods table retrieved with sai_api_query()
 

Enumerations

enum  _sai_route_entry_attr_t {
  SAI_ROUTE_ENTRY_ATTR_START , SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION = SAI_ROUTE_ENTRY_ATTR_START , SAI_ROUTE_ENTRY_ATTR_USER_TRAP_ID , SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID ,
  SAI_ROUTE_ENTRY_ATTR_META_DATA , SAI_ROUTE_ENTRY_ATTR_IP_ADDR_FAMILY , SAI_ROUTE_ENTRY_ATTR_COUNTER_ID , SAI_ROUTE_ENTRY_ATTR_PREFIX_AGG_ID ,
  SAI_ROUTE_ENTRY_ATTR_END , SAI_ROUTE_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000 , SAI_ROUTE_ENTRY_ATTR_CUSTOM_RANGE_END
}
 Attribute Id for SAI route object. More...
 

Detailed Description

Typedef Documentation

◆ sai_bulk_create_route_entry_fn

typedef sai_status_t(* sai_bulk_create_route_entry_fn) (_In_ uint32_t object_count, _In_ const sai_route_entry_t *route_entry, _In_ const uint32_t *attr_count, _In_ const sai_attribute_t **attr_list, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)

Bulk create route entry.

Parameters
[in]object_countNumber of objects to create
[in]route_entryList of object to create
[in]attr_countList of attr_count. Caller passes the number of attribute for each object to create.
[in]attr_listList of attributes for every object.
[in]modeBulk operation error handling mode.
[out]object_statusesList of status for every object. Caller needs to allocate the buffer
Returns
SAI_STATUS_SUCCESS on success when all objects are created or SAI_STATUS_FAILURE when any of the objects fails to create. When there is failure, Caller is expected to go through the list of returned statuses to find out which fails and which succeeds.

Definition at line 255 of file sairoute.h.

◆ sai_bulk_get_route_entry_attribute_fn

typedef sai_status_t(* sai_bulk_get_route_entry_attribute_fn) (_In_ uint32_t object_count, _In_ const sai_route_entry_t *route_entry, _In_ const uint32_t *attr_count, _Inout_ sai_attribute_t **attr_list, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)

Bulk get attribute on route entry.

Parameters
[in]object_countNumber of objects to set attribute
[in]route_entryList of objects to set attribute
[in]attr_countList of attr_count. Caller passes the number of attribute for each object to get
[in,out]attr_listList of attributes to set on objects, one attribute per object
[in]modeBulk operation error handling mode
[out]object_statusesList of status for every object. Caller needs to allocate the buffer
Returns
SAI_STATUS_SUCCESS on success when all objects are removed or SAI_STATUS_FAILURE when any of the objects fails to remove. When there is failure, Caller is expected to go through the list of returned statuses to find out which fails and which succeeds.

Definition at line 322 of file sairoute.h.

◆ sai_bulk_remove_route_entry_fn

typedef sai_status_t(* sai_bulk_remove_route_entry_fn) (_In_ uint32_t object_count, _In_ const sai_route_entry_t *route_entry, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)

Bulk remove route entry.

Parameters
[in]object_countNumber of objects to remove
[in]route_entryList of objects to remove
[in]modeBulk operation error handling mode.
[out]object_statusesList of status for every object. Caller needs to allocate the buffer
Returns
SAI_STATUS_SUCCESS on success when all objects are removed or SAI_STATUS_FAILURE when any of the objects fails to remove. When there is failure, Caller is expected to go through the list of returned statuses to find out which fails and which succeeds.

Definition at line 277 of file sairoute.h.

◆ sai_bulk_set_route_entry_attribute_fn

typedef sai_status_t(* sai_bulk_set_route_entry_attribute_fn) (_In_ uint32_t object_count, _In_ const sai_route_entry_t *route_entry, _In_ const sai_attribute_t *attr_list, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)

Bulk set attribute on route entry.

Parameters
[in]object_countNumber of objects to set attribute
[in]route_entryList of objects to set attribute
[in]attr_listList of attributes to set on objects, one attribute per object
[in]modeBulk operation error handling mode.
[out]object_statusesList of status for every object. Caller needs to allocate the buffer
Returns
SAI_STATUS_SUCCESS on success when all objects are removed or SAI_STATUS_FAILURE when any of the objects fails to remove. When there is failure, Caller is expected to go through the list of returned statuses to find out which fails and which succeeds.

Definition at line 298 of file sairoute.h.

◆ sai_create_route_entry_fn

typedef sai_status_t(* sai_create_route_entry_fn) (_In_ const sai_route_entry_t *route_entry, _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list)

Create Route.

Note: IP prefix/mask expected in Network Byte Order.

Parameters
[in]route_entryRoute entry
[in]attr_countNumber of attributes
[in]attr_listArray of attributes
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 195 of file sairoute.h.

◆ sai_get_route_entry_attribute_fn

typedef sai_status_t(* sai_get_route_entry_attribute_fn) (_In_ const sai_route_entry_t *route_entry, _In_ uint32_t attr_count, _Inout_ sai_attribute_t *attr_list)

Get route attribute value.

Parameters
[in]route_entryRoute entry
[in]attr_countNumber of attributes
[in,out]attr_listArray of attributes
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 233 of file sairoute.h.

◆ sai_remove_route_entry_fn

typedef sai_status_t(* sai_remove_route_entry_fn) (_In_ const sai_route_entry_t *route_entry)

Remove Route.

Note: IP prefix/mask expected in Network Byte Order.

Parameters
[in]route_entryRoute entry
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 209 of file sairoute.h.

◆ sai_set_route_entry_attribute_fn

typedef sai_status_t(* sai_set_route_entry_attribute_fn) (_In_ const sai_route_entry_t *route_entry, _In_ const sai_attribute_t *attr)

Set route attribute value.

Parameters
[in]route_entryRoute entry
[in]attrAttribute
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 220 of file sairoute.h.

Enumeration Type Documentation

◆ _sai_route_entry_attr_t

Attribute Id for SAI route object.

Enumerator
SAI_ROUTE_ENTRY_ATTR_START 

Start of attributes.

SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION 

Packet action.

Value Type:
sai_packet_action_t
Flags:
CREATE_AND_SET
Default value:
SAI_PACKET_ACTION_FORWARD
SAI_ROUTE_ENTRY_ATTR_USER_TRAP_ID 

Generate User Defined Trap ID for trap/log actions.

When it is SAI_NULL_OBJECT_ID, then packet will not be trapped.

Value Type:
sai_object_id_t
Flags:
CREATE_AND_SET
Allowed object types
SAI_OBJECT_TYPE_HOSTIF_USER_DEFINED_TRAP
Allows NULL object ID
true
Default value:
SAI_NULL_OBJECT_ID
SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID 

Next hop or next hop group id for the packet, or a router interface in case of directly reachable route, or the CPU port in case of IP2ME route.

The next hop id is only effective when the packet action is one of the following: FORWARD, COPY, LOG, TRANSIT.

The next hop id can be a generic next hop object, such as next hop, next hop group. Directly reachable routes are the IP subnets that are directly attached to the router. For such routes, fill the router interface id to which the subnet is attached. IP2ME route adds a local router IP address. For such routes, fill the CPU port (SAI_SWITCH_ATTR_CPU_PORT). When pointing to a next hop group which is empty, the effective routing action will be DROP.

When it is SAI_NULL_OBJECT_ID, then packet will be dropped.

Value Type:
sai_object_id_t
Flags:
CREATE_AND_SET
Allowed object types
SAI_OBJECT_TYPE_NEXT_HOP, SAI_OBJECT_TYPE_NEXT_HOP_GROUP, SAI_OBJECT_TYPE_ROUTER_INTERFACE, SAI_OBJECT_TYPE_PORT
Allows NULL object ID
true
Default value:
SAI_NULL_OBJECT_ID
SAI_ROUTE_ENTRY_ATTR_META_DATA 

User based Meta Data.

Value Range SAI_SWITCH_ATTR_ROUTE_DST_USER_META_DATA_RANGE

Value Type:
sai_uint32_t
Flags:
CREATE_AND_SET
Default value:
0
SAI_ROUTE_ENTRY_ATTR_IP_ADDR_FAMILY 

Route entry IP address family.

READ-ONLY

Value Type:
sai_ip_addr_family_t
Flags:
READ_ONLY
IsResourceType:
true
SAI_ROUTE_ENTRY_ATTR_COUNTER_ID 

Attach a counter.

When it is empty, then packet hits won't be counted

Value Type:
sai_object_id_t
Flags:
CREATE_AND_SET
Allowed object types
SAI_OBJECT_TYPE_COUNTER
Allows NULL object ID
true
Default value:
SAI_NULL_OBJECT_ID
SAI_ROUTE_ENTRY_ATTR_PREFIX_AGG_ID 

Route Prefix Aggregation ID.

Prefix aggregation ID is used for SRV6 VPN cases. When multiple prefixes use the same set of remote SRV6 Endpoint(s) but with different VPN SID values, prefix aggregation id allows SAI to derive different VPN SID while keeping using single destination (NH or Next hop group)

Value Type:
sai_uint32_t
Flags:
CREATE_AND_SET
Default value:
0
SAI_ROUTE_ENTRY_ATTR_END 

End of attributes.

SAI_ROUTE_ENTRY_ATTR_CUSTOM_RANGE_START 

Custom range base value

SAI_ROUTE_ENTRY_ATTR_CUSTOM_RANGE_END 

End of custom range base

Definition at line 39 of file sairoute.h.