|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
22 #ifndef included_vnet_srv6_h
23 #define included_vnet_srv6_h
33 #define IPv6_DEFAULT_HEADER_LENGTH 40
34 #define IPv6_DEFAULT_HOP_LIMIT 64
35 #define IPv6_DEFAULT_MAX_MASK_WIDTH 128
37 #define SR_BEHAVIOR_END 1
38 #define SR_BEHAVIOR_X 2
39 #define SR_BEHAVIOR_T 3
40 #define SR_BEHAVIOR_D_FIRST 4
41 #define SR_BEHAVIOR_DX2 5
42 #define SR_BEHAVIOR_DX6 6
43 #define SR_BEHAVIOR_DX4 7
44 #define SR_BEHAVIOR_DT6 8
45 #define SR_BEHAVIOR_DT4 9
46 #define SR_BEHAVIOR_END_UN_PERF 10
47 #define SR_BEHAVIOR_END_UN 11
48 #define SR_BEHAVIOR_LAST 12
51 #define SR_STEER_IPV4 4
52 #define SR_STEER_IPV6 6
54 #define SR_FUNCTION_SIZE 4
55 #define SR_ARGUMENT_SIZE 4
57 #define SR_SEGMENT_LIST_WEIGHT_DEFAULT 1
91 #define SR_POLICY_TYPE_DEFAULT 0
92 #define SR_POLICY_TYPE_SPRAY 1
346 extern int sr_policy_add (ip6_address_t *bsid, ip6_address_t *segments,
348 u16 plugin,
void *plugin_mem);
350 u8 operation, ip6_address_t * segments,
356 u16 localsid_prefix_len,
char end_psp,
u8 behavior,
358 ip46_address_t *
nh_addr,
int usid_len,
void *ls_plugin_mem);
382 ip6_address_t *addrp, *this_address;
383 u32 header_length = 0;
388 header_length += (
vec_len (sl) + 1) *
sizeof (ip6_address_t);
397 ((
vec_len (sl) + 1) *
sizeof (ip6_address_t))) / 8) - 1;
404 sizeof (ip6_address_t));
char end_psp
Combined with End.PSP?
u8 is_encap
Mode (0 is SRH insert, 1 Encaps)
u16 sr_localsid_function_number
SR LocalSID plugin function (>SR_BEHAVIOR_LAST)
void sr_dpo_lock(dpo_id_t *dpo)
no-op lock function.
ip46_address_t prefix
IP address of the prefix.
vlib_combined_counter_main_t sr_ls_valid_counters
void sr_dpo_unlock(dpo_id_t *dpo)
no-op unlock function.
unformat_function_t * ls_unformat
LocalSID unformat function.
int sr_localsid_register_function(vlib_main_t *vm, u8 *fn_name, u8 *keyword_str, u8 *def_str, u8 *params_str, u8 prefix_length, dpo_type_t *dpo, format_function_t *ls_format, unformat_function_t *ls_unformat, sr_plugin_callback_t *creation_fn, sr_plugin_callback_t *removal_fn)
SR LocalSID plugin registry.
u32 l2_sr_policy_rewrite_index
sr_p_plugin_callback_t * creation
Function within plugin that will be called after localsid creation.
format_function_t * ls_format
LocalSID format function.
void * plugin_mem
Memory to be used by the plugin callback functions.
uword * plugin_functions_by_key
u8 * params_str
Behavior parameters (i.e.
u32 sw_if_index
xconnect only
ip46_address_t next_hop
Next_hop for xconnect usage only.
ip6_sr_steering_policy_t * steer_policies
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
ip6_address_t usid_block_mask
u32 * sw_iface_sr_policies
uword * policy_plugin_functions_by_key
unsigned char def_str[64]
format_function_t * ls_format
LocalSID format function.
u8 * rewrite
Precomputed rewrite header.
int sr_cli_localsid(char is_del, ip6_address_t *localsid_addr, u16 localsid_prefix_len, char end_psp, u8 behavior, u32 sw_if_index, u32 vlan_index, u32 fib_table, ip46_address_t *nh_addr, int usid_len, void *ls_plugin_mem)
SR localsid add/del.
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
u32 vlan_index
VLAN tag (not an index)
sr_p_plugin_callback_t * removal
Function within plugin that will be called before localsid removal.
sr_steering_key_t classify
Traffic classification.
dpo_type_t dpo
DPO type registration.
dpo_id_t ip4_dpo
DPO for Encaps IPv6.
vlib_combined_counter_main_t sr_ls_invalid_counters
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 mask_width
Mask width of the prefix.
u32 fib_table
VRF of the prefix.
vlib_node_registration_t sr_policy_rewrite_insert_node
(constructor) VLIB_REGISTER_NODE (sr_policy_rewrite_insert_node)
u8 traffic_type
Traffic type (IPv4, IPv6, L2)
u32 egress_fib_table
Egress FIB table for encap packet.
SR Segment List (SID list)
int() sr_p_plugin_callback_t(ip6_sr_policy_t *sr)
int sr_policy_mod(ip6_address_t *bsid, u32 index, u32 fib_table, u8 operation, ip6_address_t *segments, u32 sl_index, u32 weight)
Modify an existing SR policy.
int sr_policy_del(ip6_address_t *bsid, u32 index)
Delete a SR policy.
u32 * segments_lists
SID lists indexes (vector)
vlib_node_registration_t sr_policy_rewrite_encaps_node
(constructor) VLIB_REGISTER_NODE (sr_policy_rewrite_encaps_node)
void sr_set_source(ip6_address_t *address)
vlib_node_registration_t sr_localsid_d_node
(constructor) VLIB_REGISTER_NODE (sr_localsid_d_node)
sr_policy_fn_registration_t * policy_plugin_functions
u8 * function_name
Function name.
u32 sr_policy
SR Policy index.
enum dpo_type_t_ dpo_type_t
Common types of data-path objects New types can be dynamically added using dpo_register_new_type()
ip6_address_t * sr_get_encaps_source()
u32 weight
SID list weight (wECMP / UCMP)
u32 sw_if_index
Incoming software interface.
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
int sr_policy_register_function(vlib_main_t *vm, u8 *fn_name, u8 *keyword_str, u8 *def_str, u8 *params_str, u8 prefix_length, dpo_type_t *dpo, format_function_t *ls_format, unformat_function_t *ls_unformat, sr_p_plugin_callback_t *creation_fn, sr_p_plugin_callback_t *removal_fn)
SR Policy plugin registry.
manual_print typedef address
dpo_id_t bsid_dpo
SR Policy specific DPO - BSID.
dpo_id_t ip4_dpo
SR Policy specific DPO - IPv6.
int sr_steering_policy(int is_del, ip6_address_t *bsid, u32 sr_policy_index, u32 table_id, ip46_address_t *prefix, u32 mask_width, u32 sw_if_index, u8 traffic_type)
Steer traffic L2 and L3 traffic through a given SR policy.
struct _vlib_node_registration vlib_node_registration_t
u32 nh_adj
Next_adj for xconnect usage only.
int() sr_plugin_callback_t(ip6_sr_localsid_t *localsid)
unsigned char params_str[32]
unformat_function_t * ls_unformat
LocalSID unformat function.
ip6_sr_localsid_t * localsids
unsigned char keyword_str[32]
u8 * keyword_str
Behavior keyword (i.e.
Segment Routing main datastructure.
ip6_address_t bsid
BindingSID (key)
vlib_node_registration_t sr_localsid_node
(constructor) VLIB_REGISTER_NODE (sr_localsid_node)
u8 type
Type (default is 0)
ip6_address_t localsid
LocalSID IPv6 address.
dpo_type_t dpo
DPO type registration.
A collection of combined counters.
sr_plugin_callback_t * creation
Function within plugin that will be called after localsid creation.
ip6_address_t * segments
SIDs (key)
void sr_set_hop_limit(u8 hop_limit)
#define vec_foreach(var, vec)
Vector iterator.
u8 * function_name
Function name.
#define ROUTING_HEADER_TYPE_SR
mhash_t sr_steer_policies_hash
u8 * def_str
Behavior definition (i.e.
dpo_type_t sr_pr_spray_dpo_type
int sr_policy_add(ip6_address_t *bsid, ip6_address_t *segments, u32 weight, u8 type, u32 fib_table, u8 is_encap, u16 plugin, void *plugin_mem)
Create a new SR policy.
sr_plugin_callback_t * removal
Function within plugin that will be called before localsid removal.
dpo_id_t ip6_dpo
DPO for Encaps/Insert IPv6.
sr_localsid_fn_registration_t * plugin_functions
u8 sr_get_hop_limit(void)
static u8 * ip6_sr_compute_rewrite_string_insert(ip6_address_t *sl)
SR rewrite string computation for SRH insertion (inline)
SR Policy behavior registration.
ip6_sr_policy_t * sr_policies
dpo_id_t ip6_dpo
SR Policy specific DPO - IPv4.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
u8 * params_str
Behavior parameters (i.e.
u16 sr_policy_function_number
SR Policy plugin function.
dpo_id_t bsid_dpo
DPO for Encaps/Insert for BSID.
u16 behavior
Behavior associated to this localsid.
vl_api_interface_index_t sw_if_index
u8 * keyword_str
Behavior keyword (i.e.
u32 fib_table
FIB table where localsid is registered.
mhash_t sr_policies_index_hash
u8 * def_str
Behavior definition (i.e.
vl_api_fib_path_type_t type
SR LocalSID behavior registration.
mhash_t sr_localsids_index_hash
u8 * rewrite_bsid
Precomputed rewrite header for bindingSID.