FD.io VPP
v20.09-64-g4f7b92f0a
Vector Packet Processing
|
Segment Routing data structures definitions. More...
Go to the source code of this file.
Data Structures | |
struct | ip6srv_combo_header_t |
struct | ip6_sr_sl_t |
SR Segment List (SID list) More... | |
struct | ip6_sr_policy_t |
SR Policy. More... | |
struct | ip6_sr_localsid_t |
SR LocalSID. More... | |
struct | sr_localsid_fn_registration_t |
SR LocalSID behavior registration. More... | |
struct | sr_policy_fn_registration_t |
SR Policy behavior registration. More... | |
struct | sr_steering_key_t |
Steering db key. More... | |
struct | ip6_sr_steering_policy_t |
struct | sr_localsid_key_t |
struct | ip6_sr_main_t |
Segment Routing main datastructure. More... | |
Macros | |
#define | IPv6_DEFAULT_HEADER_LENGTH 40 |
#define | IPv6_DEFAULT_HOP_LIMIT 64 |
#define | IPv6_DEFAULT_MAX_MASK_WIDTH 128 |
#define | SR_BEHAVIOR_END 1 |
#define | SR_BEHAVIOR_X 2 |
#define | SR_BEHAVIOR_T 3 |
#define | SR_BEHAVIOR_D_FIRST 4 /* Unused. Separator in between regular and D */ |
#define | SR_BEHAVIOR_DX2 5 |
#define | SR_BEHAVIOR_DX6 6 |
#define | SR_BEHAVIOR_DX4 7 |
#define | SR_BEHAVIOR_DT6 8 |
#define | SR_BEHAVIOR_DT4 9 |
#define | SR_BEHAVIOR_END_UN_PERF 10 |
#define | SR_BEHAVIOR_END_UN 11 |
#define | SR_BEHAVIOR_LAST 12 /* Must always be the last one */ |
#define | SR_STEER_L2 2 |
#define | SR_STEER_IPV4 4 |
#define | SR_STEER_IPV6 6 |
#define | SR_FUNCTION_SIZE 4 |
#define | SR_ARGUMENT_SIZE 4 |
#define | SR_SEGMENT_LIST_WEIGHT_DEFAULT 1 |
#define | SR_POLICY_TYPE_DEFAULT 0 |
#define | SR_POLICY_TYPE_SPRAY 1 |
Typedefs | |
typedef int() | sr_p_plugin_callback_t(ip6_sr_policy_t *sr) |
typedef int() | sr_plugin_callback_t(ip6_sr_localsid_t *localsid) |
Functions | |
void | sr_dpo_lock (dpo_id_t *dpo) |
no-op lock function. More... | |
void | sr_dpo_unlock (dpo_id_t *dpo) |
no-op unlock function. More... | |
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. More... | |
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. More... | |
int | sr_policy_add (ip6_address_t *bsid, ip6_address_t *segments, u32 weight, u8 behavior, u32 fib_table, u8 is_encap, u16 plugin, void *plugin_mem) |
Create a new SR policy. More... | |
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. More... | |
int | sr_policy_del (ip6_address_t *bsid, u32 index) |
Delete a SR policy. More... | |
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. More... | |
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. More... | |
void | sr_set_source (ip6_address_t *address) |
void | sr_set_hop_limit (u8 hop_limit) |
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) More... | |
Variables | |
ip6_sr_main_t | sr_main |
vlib_node_registration_t | sr_policy_rewrite_encaps_node |
(constructor) VLIB_REGISTER_NODE (sr_policy_rewrite_encaps_node) More... | |
vlib_node_registration_t | sr_policy_rewrite_insert_node |
(constructor) VLIB_REGISTER_NODE (sr_policy_rewrite_insert_node) More... | |
vlib_node_registration_t | sr_localsid_node |
(constructor) VLIB_REGISTER_NODE (sr_localsid_node) More... | |
vlib_node_registration_t | sr_localsid_d_node |
(constructor) VLIB_REGISTER_NODE (sr_localsid_d_node) More... | |
Segment Routing data structures definitions.
Definition in file sr.h.
#define SR_BEHAVIOR_D_FIRST 4 /* Unused. Separator in between regular and D */ |
typedef int() sr_p_plugin_callback_t(ip6_sr_policy_t *sr) |
typedef int() sr_plugin_callback_t(ip6_sr_localsid_t *localsid) |
|
inlinestatic |
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.
Function to add or delete SR LocalSIDs.
is_del | Boolean of whether its a delete instruction |
localsid_addr | IPv6 address of the localsid |
is_decap | Boolean of whether decapsulation is allowed in this function |
behavior | Type of behavior (function) for this localsid |
sw_if_index | Only for L2/L3 xconnect. OIF. In VRF variant the fib_table. |
vlan_index | Only for L2 xconnect. Outgoing VLAN tag. |
fib_table | FIB table in which we should install the localsid entry |
nh_addr | Next Hop IPv4/IPv6 address. Only for L2/L3 xconnect. |
Definition at line 77 of file sr_localsid.c.
void sr_dpo_lock | ( | dpo_id_t * | dpo | ) |
void sr_dpo_unlock | ( | dpo_id_t * | dpo | ) |
u8 sr_get_hop_limit | ( | void | ) |
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.
Definition at line 2347 of file sr_localsid.c.
int sr_policy_add | ( | ip6_address_t * | bsid, |
ip6_address_t * | segments, | ||
u32 | weight, | ||
u8 | behavior, | ||
u32 | fib_table, | ||
u8 | is_encap, | ||
u16 | plugin, | ||
void * | ls_plugin_mem | ||
) |
Create a new SR policy.
bsid | is the bindingSID of the SR Policy |
segments | is a vector of IPv6 address composing the segment list |
weight | is the weight of the sid list. optional. |
behavior | is the behavior of the SR policy. (default//spray) |
fib_table | is the VRF where to install the FIB entry for the BSID |
is_encap | (bool) whether SR policy should behave as Encap/SRH Insertion |
Definition at line 626 of file sr_policy_rewrite.c.
int sr_policy_del | ( | ip6_address_t * | bsid, |
u32 | index | ||
) |
Delete a SR policy.
bsid | is the bindingSID of the SR Policy |
index | is the index of the SR policy |
Definition at line 714 of file sr_policy_rewrite.c.
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.
The possible modifications are adding a new Segment List, modifying an existing Segment List (modify the weight only) and delete a given Segment List from the SR Policy.
bsid | is the bindingSID of the SR Policy |
index | is the index of the SR policy |
fib_table | is the VRF where to install the FIB entry for the BSID |
operation | is the operation to perform (among the top ones) |
segments | is a vector of IPv6 address composing the segment list |
sl_index | is the index of the Segment List to modify/delete |
weight | is the weight of the sid list. optional. |
is_encap | Mode. Encapsulation or SRH insertion. |
Definition at line 822 of file sr_policy_rewrite.c.
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.
Definition at line 3304 of file sr_policy_rewrite.c.
void sr_set_hop_limit | ( | u8 | hop_limit | ) |
void sr_set_source | ( | ip6_address_t * | address | ) |
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.
is_del | |
bsid | is the bindingSID of the SR Policy (alt to sr_policy_index) |
sr_policy | is the index of the SR Policy (alt to bsid) |
table_id | is the VRF where to install the FIB entry for the BSID |
prefix | is the IPv4/v6 address for L3 traffic type |
mask_width | is the mask for L3 traffic type |
sw_if_index | is the incoming interface for L2 traffic |
traffic_type | describes the type of traffic |
Definition at line 60 of file sr_steering.c.
vlib_node_registration_t sr_localsid_d_node |
(constructor) VLIB_REGISTER_NODE (sr_localsid_d_node)
Definition at line 1442 of file sr_localsid.c.
vlib_node_registration_t sr_localsid_node |
(constructor) VLIB_REGISTER_NODE (sr_localsid_node)
Definition at line 1752 of file sr_localsid.c.
ip6_sr_main_t sr_main |
vlib_node_registration_t sr_policy_rewrite_encaps_node |
(constructor) VLIB_REGISTER_NODE (sr_policy_rewrite_encaps_node)
Definition at line 1436 of file sr_policy_rewrite.c.
vlib_node_registration_t sr_policy_rewrite_insert_node |
(constructor) VLIB_REGISTER_NODE (sr_policy_rewrite_insert_node)
Definition at line 2566 of file sr_policy_rewrite.c.