FD.io VPP
v17.10-9-gd594711
Vector Packet Processing
|
SR MPLS policy creation and application. More...
Go to the source code of this file.
Functions | |
static mpls_sr_sl_t * | create_sl (mpls_sr_policy_t *sr_policy, mpls_label_t *sl, u32 weight) |
Creates a Segment List and adds it to an SR policy. More... | |
int | sr_mpls_policy_add (mpls_label_t bsid, mpls_label_t *segments, u8 behavior, u32 weight) |
Create a new SR policy. More... | |
int | sr_mpls_policy_del (mpls_label_t bsid, u32 index) |
Delete a SR policy. More... | |
int | sr_mpls_policy_mod (mpls_label_t bsid, u32 index, u8 operation, mpls_label_t *segments, u32 sl_index, u32 weight) |
Modify an existing SR policy. More... | |
static clib_error_t * | sr_mpls_policy_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd) |
CLI for 'sr mpls policies' command family. More... | |
static clib_error_t * | show_sr_mpls_policies_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd) |
CLI to display onscreen all the SR MPLS policies. More... | |
clib_error_t * | sr_mpls_policy_rewrite_init (vlib_main_t *vm) |
SR MPLS Policy initialization. More... | |
Variables | |
mpls_sr_main_t | sr_mpls_main |
static vlib_cli_command_t | sr_mpls_policy_command |
(constructor) VLIB_CLI_COMMAND (sr_mpls_policy_command) More... | |
static vlib_cli_command_t | show_sr_mpls_policies_command |
(constructor) VLIB_CLI_COMMAND (show_sr_mpls_policies_command) More... | |
SR MPLS policy creation and application.
Create an SR policy. An SR policy can be either of 'default' type or 'spray' type An SR policy has attached a list of SID lists. In case the SR policy is a default one it will load balance among them. An SR policy has associated a BindingSID. In case any packet arrives with MPLS_label == BindingSID then the SR policy associated to such bindingSID will be applied to such packet.
Definition in file sr_mpls_policy.c.
|
inlinestatic |
Creates a Segment List and adds it to an SR policy.
Creates a Segment List and adds it to the SR policy. Notice that the SL are not necessarily unique. Hence there might be two Segment List within the same SR Policy with exactly the same segments and same weight.
sr_policy | is the SR policy where the SL will be added |
sl | is a vector of IPv6 addresses composing the Segment List |
weight | is the weight of the SegmentList (for load-balancing purposes) |
is_encap | represents the mode (SRH insertion vs Encapsulation) |
Definition at line 62 of file sr_mpls_policy.c.
|
static |
CLI to display onscreen all the SR MPLS policies.
Definition at line 491 of file sr_mpls_policy.c.
int sr_mpls_policy_add | ( | mpls_label_t | bsid, |
mpls_label_t * | segments, | ||
u8 | behavior, | ||
u32 | weight | ||
) |
Create a new SR policy.
bsid | is the bindingSID of the SR Policy |
segments | is a vector of MPLS labels composing the segment list |
behavior | is the behavior of the SR policy. (default//spray) |
fib_table | is the VRF where to install the FIB entry for the BSID |
weight | is the weight of this specific SID list |
Definition at line 137 of file sr_mpls_policy.c.
|
static |
CLI for 'sr mpls policies' command family.
Definition at line 367 of file sr_mpls_policy.c.
int sr_mpls_policy_del | ( | mpls_label_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 176 of file sr_mpls_policy.c.
int sr_mpls_policy_mod | ( | mpls_label_t | bsid, |
u32 | index, | ||
u8 | operation, | ||
mpls_label_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. |
Definition at line 262 of file sr_mpls_policy.c.
clib_error_t* sr_mpls_policy_rewrite_init | ( | vlib_main_t * | vm | ) |
SR MPLS Policy initialization.
Definition at line 551 of file sr_mpls_policy.c.
|
static |
(constructor) VLIB_CLI_COMMAND (show_sr_mpls_policies_command)
Definition at line 539 of file sr_mpls_policy.c.
mpls_sr_main_t sr_mpls_main |
Definition at line 44 of file sr_mpls_policy.c.
|
static |
(constructor) VLIB_CLI_COMMAND (sr_mpls_policy_command)
Definition at line 478 of file sr_mpls_policy.c.