FD.io VPP
v18.07-34-g55fbdb9
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) |
Delete a SR policy. More... | |
int | sr_mpls_policy_mod (mpls_label_t bsid, 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... | |
int | sr_mpls_policy_assign_endpoint_color (mpls_label_t bsid, ip46_address_t *endpoint, u8 endpoint_type, u32 color) |
Update the Endpoint,Color tuple of an SR policy. More... | |
static clib_error_t * | cli_sr_mpls_policy_ec_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd) |
CLI to modify the Endpoint,Color of an SR policy. 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... | |
static vlib_cli_command_t | cli_sr_mpls_policy_ec_command |
(constructor) VLIB_CLI_COMMAND (cli_sr_mpls_policy_ec_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. Also, a BSID can be associated with a (Next-Hop, Color)
Definition in file sr_mpls_policy.c.
|
static |
CLI to modify the Endpoint,Color of an SR policy.
Definition at line 815 of 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 60 of file sr_mpls_policy.c.
|
static |
CLI to display onscreen all the SR MPLS policies.
Definition at line 567 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 152 of file sr_mpls_policy.c.
int sr_mpls_policy_assign_endpoint_color | ( | mpls_label_t | bsid, |
ip46_address_t * | endpoint, | ||
u8 | endpoint_type, | ||
u32 | color | ||
) |
Update the Endpoint,Color tuple of an SR policy.
bsid | is the bindingSID of the SR Policy |
endpoint | represents the IP46 of the endpoint |
color | represents the color (u32) |
To reset to NULL use ~0 as parameters.
Definition at line 652 of file sr_mpls_policy.c.
|
static |
CLI for 'sr mpls policies' command family.
Definition at line 448 of file sr_mpls_policy.c.
int sr_mpls_policy_del | ( | mpls_label_t | bsid | ) |
Delete a SR policy.
bsid | is the bindingSID of the SR Policy |
index | is the index of the SR policy |
Definition at line 196 of file sr_mpls_policy.c.
int sr_mpls_policy_mod | ( | mpls_label_t | bsid, |
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 |
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 284 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 886 of file sr_mpls_policy.c.
|
static |
(constructor) VLIB_CLI_COMMAND (cli_sr_mpls_policy_ec_command)
Definition at line 873 of file sr_mpls_policy.c.
|
static |
(constructor) VLIB_CLI_COMMAND (show_sr_mpls_policies_command)
Definition at line 632 of file sr_mpls_policy.c.
mpls_sr_main_t sr_mpls_main |
Definition at line 42 of file sr_mpls_policy.c.
|
static |
(constructor) VLIB_CLI_COMMAND (sr_mpls_policy_command)
Definition at line 553 of file sr_mpls_policy.c.