FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
svs.c File Reference
+ Include dependency graph for svs.c:

Go to the source code of this file.

Data Structures

struct  svs_input_trace_t_
 

Typedefs

typedef enum svs_next_t_ svs_next_t
 
typedef struct svs_input_trace_t_ svs_input_trace_t
 

Enumerations

enum  svs_next_t_ { SVS_NEXT_DROP, SVS_N_NEXT }
 

Functions

int svs_table_add (fib_protocol_t fproto, u32 table_id)
 
int svs_table_delete (fib_protocol_t fproto, u32 table_id)
 
static int svs_route_add_i (u32 fib_index, const fib_prefix_t *pfx, u32 src_fib_index)
 
int svs_route_add (u32 table_id, const fib_prefix_t *pfx, u32 source_table_id)
 
int svs_route_delete (u32 table_id, const fib_prefix_t *pfx)
 
int svs_enable (fib_protocol_t fproto, u32 table_id, u32 sw_if_index)
 
static void svs_table_bind (fib_protocol_t fproto, u32 sw_if_index, u32 itf_fib_index)
 
static void svs_ip6_table_bind (ip6_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)
 
static void svs_ip4_table_bind (ip4_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)
 
int svs_disable (fib_protocol_t fproto, u32 table_id, u32 sw_if_index)
 
void svs_walk (svs_walk_fn_t fn, void *ctx)
 
static uword svs_input_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, fib_protocol_t fproto)
 
static uword svs_input_ip4 (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword svs_input_ip6 (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static u8format_svs_input_trace (u8 *s, va_list *args)
 
 VNET_FEATURE_INIT (svs_ip4_feat, static)
 
 VNET_FEATURE_INIT (svs_ip6_feat, static)
 
static clib_error_tsvs_table_cli (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tsvs_enable_cli (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tsvs_route_cli (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tsvs_show_cli (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tsvs_init (vlib_main_t *vm)
 

Variables

u32svs_itf_db [FIB_PROTOCOL_IP_MAX]
 
static fib_source_t svs_fib_src
 
vlib_node_registration_t svs_ip4_node
 (constructor) VLIB_REGISTER_NODE (svs_ip4_node) More...
 
vlib_node_registration_t svs_ip6_node
 (constructor) VLIB_REGISTER_NODE (svs_ip6_node) More...
 
static vlib_cli_command_t svs_table_cmd_cli
 (constructor) VLIB_CLI_COMMAND (svs_table_cmd_cli) More...
 
static vlib_cli_command_t svs_enable_cli_cmd
 (constructor) VLIB_CLI_COMMAND (svs_enable_cli_cmd) More...
 
static vlib_cli_command_t svs_route_cmd_cli
 (constructor) VLIB_CLI_COMMAND (svs_route_cmd_cli) More...
 
static vlib_cli_command_t svs_show_cli_cmd
 (constructor) VLIB_CLI_COMMAND (svs_show_cli_cmd) More...
 

Typedef Documentation

◆ svs_input_trace_t

◆ svs_next_t

typedef enum svs_next_t_ svs_next_t

Enumeration Type Documentation

◆ svs_next_t_

Enumerator
SVS_NEXT_DROP 
SVS_N_NEXT 

Definition at line 247 of file svs.c.

Function Documentation

◆ format_svs_input_trace()

static u8* format_svs_input_trace ( u8 s,
va_list *  args 
)
static

Definition at line 356 of file svs.c.

+ Here is the call graph for this function:

◆ svs_disable()

int svs_disable ( fib_protocol_t  fproto,
u32  table_id,
u32  sw_if_index 
)

Definition at line 195 of file svs.c.

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

◆ svs_enable()

int svs_enable ( fib_protocol_t  fproto,
u32  table_id,
u32  sw_if_index 
)

Definition at line 118 of file svs.c.

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

◆ svs_enable_cli()

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

Definition at line 455 of file svs.c.

+ Here is the call graph for this function:

◆ svs_init()

static clib_error_t* svs_init ( vlib_main_t vm)
static

Definition at line 600 of file svs.c.

+ Here is the call graph for this function:

◆ svs_input_inline()

static uword svs_input_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
fib_protocol_t  fproto 
)
inlinestatic

Definition at line 259 of file svs.c.

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

◆ svs_input_ip4()

static uword svs_input_ip4 ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 342 of file svs.c.

+ Here is the call graph for this function:

◆ svs_input_ip6()

static uword svs_input_ip6 ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 349 of file svs.c.

+ Here is the call graph for this function:

◆ svs_ip4_table_bind()

static void svs_ip4_table_bind ( ip4_main_t im,
uword  opaque,
u32  sw_if_index,
u32  new_fib_index,
u32  old_fib_index 
)
static

Definition at line 187 of file svs.c.

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

◆ svs_ip6_table_bind()

static void svs_ip6_table_bind ( ip6_main_t im,
uword  opaque,
u32  sw_if_index,
u32  new_fib_index,
u32  old_fib_index 
)
static

Definition at line 179 of file svs.c.

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

◆ svs_route_add()

int svs_route_add ( u32  table_id,
const fib_prefix_t pfx,
u32  source_table_id 
)

Definition at line 82 of file svs.c.

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

◆ svs_route_add_i()

static int svs_route_add_i ( u32  fib_index,
const fib_prefix_t pfx,
u32  src_fib_index 
)
static

Definition at line 61 of file svs.c.

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

◆ svs_route_cli()

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

Definition at line 509 of file svs.c.

+ Here is the call graph for this function:

◆ svs_route_delete()

int svs_route_delete ( u32  table_id,
const fib_prefix_t pfx 
)

Definition at line 103 of file svs.c.

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

◆ svs_show_cli()

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

Definition at line 571 of file svs.c.

+ Here is the call graph for this function:

◆ svs_table_add()

int svs_table_add ( fib_protocol_t  fproto,
u32  table_id 
)

Definition at line 32 of file svs.c.

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

◆ svs_table_bind()

static void svs_table_bind ( fib_protocol_t  fproto,
u32  sw_if_index,
u32  itf_fib_index 
)
static

Definition at line 152 of file svs.c.

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

◆ svs_table_cli()

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

Definition at line 408 of file svs.c.

+ Here is the call graph for this function:

◆ svs_table_delete()

int svs_table_delete ( fib_protocol_t  fproto,
u32  table_id 
)

Definition at line 40 of file svs.c.

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

◆ svs_walk()

void svs_walk ( svs_walk_fn_t  fn,
void *  ctx 
)

Definition at line 225 of file svs.c.

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

◆ VNET_FEATURE_INIT() [1/2]

VNET_FEATURE_INIT ( svs_ip4_feat  ,
static   
)

◆ VNET_FEATURE_INIT() [2/2]

VNET_FEATURE_INIT ( svs_ip6_feat  ,
static   
)

Variable Documentation

◆ svs_enable_cli_cmd

vlib_cli_command_t svs_enable_cli_cmd
static
Initial value:
= {
.path = "svs enable",
.short_help = "Source VRF select [enable|disable] [ip4|ip6] <table-id> X <interface>",
.function = svs_enable_cli,
}
static clib_error_t * svs_enable_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: svs.c:455

(constructor) VLIB_CLI_COMMAND (svs_enable_cli_cmd)

Definition at line 501 of file svs.c.

◆ svs_fib_src

fib_source_t svs_fib_src
static

Definition at line 29 of file svs.c.

◆ svs_ip4_node

Initial value:
=
{
.function = svs_input_ip4,
.name = "svs-ip4",
.vector_size = sizeof (u32),
.format_trace = format_svs_input_trace,
.n_next_nodes = SVS_N_NEXT,
.next_nodes =
{
[SVS_NEXT_DROP] = "error-drop",
}
}
static uword svs_input_ip4(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: svs.c:342
static u8 * format_svs_input_trace(u8 *s, va_list *args)
Definition: svs.c:356
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123

(constructor) VLIB_REGISTER_NODE (svs_ip4_node)

Definition at line 367 of file svs.c.

◆ svs_ip6_node

Initial value:
=
{
.function = svs_input_ip6,
.name = "svs-ip6",
.vector_size = sizeof (u32),
.format_trace = format_svs_input_trace,
.next_nodes =
{
[SVS_NEXT_DROP] = "error-drop",
}
}
static u8 * format_svs_input_trace(u8 *s, va_list *args)
Definition: svs.c:356
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
static uword svs_input_ip6(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: svs.c:349

(constructor) VLIB_REGISTER_NODE (svs_ip6_node)

Definition at line 381 of file svs.c.

◆ svs_itf_db

u32* svs_itf_db[FIB_PROTOCOL_IP_MAX]

Definition at line 27 of file svs.c.

◆ svs_route_cmd_cli

vlib_cli_command_t svs_route_cmd_cli
static
Initial value:
= {
.path = "svs route",
.short_help = "Source VRF select route [add|delete] <table-id> <prefix> <src-table-id>",
.function = svs_route_cli,
}
static clib_error_t * svs_route_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: svs.c:509

(constructor) VLIB_CLI_COMMAND (svs_route_cmd_cli)

Definition at line 563 of file svs.c.

◆ svs_show_cli_cmd

vlib_cli_command_t svs_show_cli_cmd
static
Initial value:
= {
.path = "show svs",
.short_help = "Source VRF select show",
.function = svs_show_cli,
}
static clib_error_t * svs_show_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: svs.c:571

(constructor) VLIB_CLI_COMMAND (svs_show_cli_cmd)

Definition at line 592 of file svs.c.

◆ svs_table_cmd_cli

vlib_cli_command_t svs_table_cmd_cli
static
Initial value:
= {
.path = "svs table",
.short_help = "Source VRF select table [add|delete] [ip4|ip6] table-id X",
.function = svs_table_cli,
}
static clib_error_t * svs_table_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: svs.c:408

(constructor) VLIB_CLI_COMMAND (svs_table_cmd_cli)

Definition at line 447 of file svs.c.