FD.io VPP  v19.01.3-6-g70449b9b9
Vector Packet Processing
sr_steering.c File Reference

Packet steering into SR Policies. More...

+ Include dependency graph for sr_steering.c:

Go to the source code of this file.

Functions

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 clib_error_tsr_steer_policy_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tshow_sr_steering_policies_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
clib_error_tsr_steering_init (vlib_main_t *vm)
 
 VNET_FEATURE_INIT (sr_pl_rewrite_encaps_l2, static)
 

Variables

static vlib_cli_command_t sr_steer_policy_command
 (constructor) VLIB_CLI_COMMAND (sr_steer_policy_command) More...
 
static vlib_cli_command_t show_sr_steering_policies_command
 (constructor) VLIB_CLI_COMMAND (show_sr_steering_policies_command) More...
 

Detailed Description

Packet steering into SR Policies.

This file is in charge of handling the FIB appropiatly to steer packets through SR Policies as defined in 'sr_policy_rewrite.c'. Notice that here we are only doing steering. SR policy application is done in sr_policy_rewrite.c

Supports:

  • Steering of IPv6 traffic Destination Address based
  • Steering of IPv4 traffic Destination Address based
  • Steering of L2 frames, interface based (sw interface)

Definition in file sr_steering.c.

Function Documentation

◆ show_sr_steering_policies_command_fn()

static clib_error_t* show_sr_steering_policies_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 482 of file sr_steering.c.

+ Here is the call graph for this function:

◆ sr_steer_policy_command_fn()

static clib_error_t* sr_steer_policy_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 364 of file sr_steering.c.

+ Here is the call graph for this function:

◆ sr_steering_init()

clib_error_t* sr_steering_init ( vlib_main_t vm)

Definition at line 540 of file sr_steering.c.

+ Here is the call graph for this function:

◆ sr_steering_policy()

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.

Parameters
is_del
bsidis the bindingSID of the SR Policy (alt to sr_policy_index)
sr_policyis the index of the SR Policy (alt to bsid)
table_idis the VRF where to install the FIB entry for the BSID
prefixis the IPv4/v6 address for L3 traffic type
mask_widthis the mask for L3 traffic type
sw_if_indexis the incoming interface for L2 traffic
traffic_typedescribes the type of traffic
Returns
0 if correct, else error

Definition at line 60 of file sr_steering.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VNET_FEATURE_INIT()

VNET_FEATURE_INIT ( sr_pl_rewrite_encaps_l2  ,
static   
)

Variable Documentation

◆ show_sr_steering_policies_command

vlib_cli_command_t show_sr_steering_policies_command
static
Initial value:
= {
.path = "show sr steering-policies",
.short_help = "show sr steering-policies",
}
static clib_error_t * show_sr_steering_policies_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: sr_steering.c:482

(constructor) VLIB_CLI_COMMAND (show_sr_steering_policies_command)

Definition at line 532 of file sr_steering.c.

◆ sr_steer_policy_command

vlib_cli_command_t sr_steer_policy_command
static
Initial value:
= {
.path = "sr steer",
.short_help = "sr steer (del) [l3 <ip_addr/mask>|l2 <sf_if>] "
"via [index <sr_policy_index>|bsid <bsid_ip6_addr>] "
"(fib-table <fib_table_index>)",
.long_help =
"\tSteer a L2 or L3 traffic through an existing SR policy.\n"
"\tExamples:\n"
"\t\tsr steer l3 2001::/64 via sr_policy index 5\n"
"\t\tsr steer l3 2001::/64 via sr_policy bsid 2010::9999:1\n"
"\t\tsr steer l2 GigabitEthernet0/5/0 via sr_policy index 5\n"
"\t\tsr steer del l3 2001::/64 via sr_policy index 5\n",
}
static clib_error_t * sr_steer_policy_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: sr_steering.c:364

(constructor) VLIB_CLI_COMMAND (sr_steer_policy_command)

Definition at line 465 of file sr_steering.c.