FD.io VPP
v17.04.2-2-ga8f93f8
Vector Packet Processing
|
Segment Routing data structures definitions. More...
Go to the source code of this file.
Data Structures | |
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_steering_key_t |
Steering db key. More... | |
struct | ip6_sr_steering_policy_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_D_FIRST 3 /* Unused. Separator in between regular and D */ |
#define | SR_BEHAVIOR_DX2 4 |
#define | SR_BEHAVIOR_DX6 5 |
#define | SR_BEHAVIOR_DX4 6 |
#define | SR_BEHAVIOR_DT6 7 |
#define | SR_BEHAVIOR_DT4 8 |
#define | SR_BEHAVIOR_LAST 9 /* 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_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, 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_add (ip6_address_t *bsid, ip6_address_t *segments, u32 weight, u8 behavior, u32 fib_table, u8 is_encap) |
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, char end_psp, u8 behavior, u32 sw_if_index, u32 vlan_index, u32 fib_table, ip46_address_t *nh_addr, 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... | |
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 3 /* Unused. Separator in between regular and D */ |
typedef int( sr_plugin_callback_t) (ip6_sr_localsid_t *localsid) |
|
inlinestatic |
int sr_cli_localsid | ( | char | is_del, |
ip6_address_t * | localsid_addr, | ||
char | end_psp, | ||
u8 | behavior, | ||
u32 | sw_if_index, | ||
u32 | vlan_index, | ||
u32 | fib_table, | ||
ip46_address_t * | nh_addr, | ||
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 66 of file sr_localsid.c.
void sr_dpo_lock | ( | dpo_id_t * | dpo | ) |
void sr_dpo_unlock | ( | dpo_id_t * | dpo | ) |
int sr_localsid_register_function | ( | vlib_main_t * | vm, |
u8 * | fn_name, | ||
u8 * | keyword_str, | ||
u8 * | def_str, | ||
u8 * | params_str, | ||
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 1366 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 | ||
) |
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 543 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 623 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 717 of file sr_policy_rewrite.c.
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 1077 of file sr_localsid.c.
vlib_node_registration_t sr_localsid_node |
(constructor) VLIB_REGISTER_NODE (sr_localsid_node)
Definition at line 1310 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 1286 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 2382 of file sr_policy_rewrite.c.