FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
stn.c File Reference
+ Include dependency graph for stn.c:

Go to the source code of this file.

Data Structures

struct  stn_ip46_punt_trace_t
 

Macros

#define foreach_stn_ip_punt_error   _(NONE, "no error")
 

Enumerations

enum  stn_ip_punt_next_t { STN_IP_PUNT_DROP, STN_IP_PUNT_N_NEXT }
 
enum  ila_error_t { ILA_N_ERROR, STN_IP_PUNT_N_ERROR }
 

Functions

static u8format_stn_rule (u8 *s, va_list *args)
 
static_always_inline u8format_stn_ip46_punt_trace (u8 *s, va_list *args, u8 is_ipv4)
 
static_always_inline uword stn_ip46_punt_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 is_ipv4)
 
u8format_stn_ip6_punt_trace (u8 *s, va_list *args)
 
static uword stn_ip6_punt_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VNET_FEATURE_INIT (stn_ip6_punt_feat_node, static)
 
u8format_stn_ip4_punt_trace (u8 *s, va_list *args)
 INDENT-ON More...
 
static uword stn_ip4_punt_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VNET_FEATURE_INIT (stn_ip4_punt_feat_node, static)
 
clib_error_tstn_init (vlib_main_t *vm)
 INDENT-ON More...
 
 VLIB_PLUGIN_REGISTER ()
 
int stn_rule_add_del (stn_rule_add_del_args_t *args)
 Add or delete an stn rule. More...
 
static clib_error_tshow_stn_rules_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tstn_rule_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

stn_main_t stn_main
 
static vlib_node_registration_t stn_ip4_punt
 INDENT-OFF More...
 
static vlib_node_registration_t stn_ip6_punt
 INDENT-OFF More...
 
static u8 stn_hw_addr_local [6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01}
 
static u8 stn_hw_addr_dst [6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02}
 
static ethernet_header_t stn_ip4_ethernet_header = {}
 
static ethernet_header_t stn_ip6_ethernet_header = {}
 
static char * stn_ip_punt_error_strings []
 
static vlib_cli_command_t show_stn_rules_command
 (constructor) VLIB_CLI_COMMAND (show_stn_rules_command) More...
 
static vlib_cli_command_t stn_rule_command
 (constructor) VLIB_CLI_COMMAND (stn_rule_command) More...
 

Macro Definition Documentation

◆ foreach_stn_ip_punt_error

#define foreach_stn_ip_punt_error   _(NONE, "no error")

Definition at line 169 of file stn.c.

Enumeration Type Documentation

◆ ila_error_t

Enumerator
ILA_N_ERROR 
STN_IP_PUNT_N_ERROR 

Definition at line 172 of file stn.c.

◆ stn_ip_punt_next_t

Enumerator
STN_IP_PUNT_DROP 
STN_IP_PUNT_N_NEXT 

Definition at line 81 of file stn.c.

Function Documentation

◆ format_stn_ip46_punt_trace()

static_always_inline u8* format_stn_ip46_punt_trace ( u8 s,
va_list *  args,
u8  is_ipv4 
)

Definition at line 58 of file stn.c.

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

◆ format_stn_ip4_punt_trace()

u8* format_stn_ip4_punt_trace ( u8 s,
va_list *  args 
)

INDENT-ON

Definition at line 221 of file stn.c.

+ Here is the call graph for this function:

◆ format_stn_ip6_punt_trace()

u8* format_stn_ip6_punt_trace ( u8 s,
va_list *  args 
)

Definition at line 186 of file stn.c.

+ Here is the call graph for this function:

◆ format_stn_rule()

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

Definition at line 39 of file stn.c.

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

◆ show_stn_rules_fn()

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

Definition at line 375 of file stn.c.

+ Here is the call graph for this function:

◆ stn_init()

clib_error_t* stn_init ( vlib_main_t vm)

INDENT-ON

Definition at line 256 of file stn.c.

+ Here is the call graph for this function:

◆ stn_ip46_punt_fn()

static_always_inline uword stn_ip46_punt_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
u8  is_ipv4 
)

Definition at line 88 of file stn.c.

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

◆ stn_ip4_punt_fn()

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

Definition at line 227 of file stn.c.

+ Here is the call graph for this function:

◆ stn_ip6_punt_fn()

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

Definition at line 192 of file stn.c.

+ Here is the call graph for this function:

◆ stn_rule_add_del()

int stn_rule_add_del ( stn_rule_add_del_args_t args)

Add or delete an stn rule.

Definition at line 285 of file stn.c.

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

◆ stn_rule_fn()

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

Definition at line 399 of file stn.c.

+ Here is the call graph for this function:

◆ VLIB_PLUGIN_REGISTER()

VLIB_PLUGIN_REGISTER ( )

◆ VNET_FEATURE_INIT() [1/2]

VNET_FEATURE_INIT ( stn_ip4_punt_feat_node  ,
static   
)

◆ VNET_FEATURE_INIT() [2/2]

VNET_FEATURE_INIT ( stn_ip6_punt_feat_node  ,
static   
)

Variable Documentation

◆ show_stn_rules_command

vlib_cli_command_t show_stn_rules_command
static
Initial value:
=
{
.path = "show stn rules",
.short_help = "",
.function = show_stn_rules_fn,
}

(constructor) VLIB_CLI_COMMAND (show_stn_rules_command)

Definition at line 391 of file stn.c.

◆ stn_hw_addr_dst

u8 stn_hw_addr_dst[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02}
static

Definition at line 29 of file stn.c.

◆ stn_hw_addr_local

u8 stn_hw_addr_local[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01}
static

Definition at line 28 of file stn.c.

◆ stn_ip4_ethernet_header

ethernet_header_t stn_ip4_ethernet_header = {}
static

Definition at line 31 of file stn.c.

◆ stn_ip4_punt

static vlib_node_registration_t stn_ip4_punt
static
Initial value:
=
{
.function = stn_ip4_punt_fn,
.name = "stn-ip4-punt",
.vector_size = sizeof (u32),
.format_trace = format_stn_ip4_punt_trace,
.n_errors = STN_IP_PUNT_N_ERROR,
.error_strings = stn_ip_punt_error_strings,
.n_next_nodes = STN_IP_PUNT_N_NEXT,
.next_nodes =
{
[STN_IP_PUNT_DROP] = "error-drop",
},
}

INDENT-OFF

(constructor) VLIB_REGISTER_NODE (stn_ip4_punt)

Definition at line 25 of file stn.c.

◆ stn_ip6_ethernet_header

ethernet_header_t stn_ip6_ethernet_header = {}
static

Definition at line 32 of file stn.c.

◆ stn_ip6_punt

static vlib_node_registration_t stn_ip6_punt
static
Initial value:
=
{
.function = stn_ip6_punt_fn,
.name = "stn-ip6-punt",
.vector_size = sizeof (u32),
.format_trace = format_stn_ip6_punt_trace,
.n_errors = STN_IP_PUNT_N_ERROR,
.error_strings = stn_ip_punt_error_strings,
.n_next_nodes = STN_IP_PUNT_N_NEXT,
.next_nodes =
{
[STN_IP_PUNT_DROP] = "error-drop"
},
}

INDENT-OFF

(constructor) VLIB_REGISTER_NODE (stn_ip6_punt)

Definition at line 26 of file stn.c.

◆ stn_ip_punt_error_strings

char* stn_ip_punt_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}

Definition at line 179 of file stn.c.

◆ stn_main

stn_main_t stn_main

Definition at line 24 of file stn.c.

◆ stn_rule_command

vlib_cli_command_t stn_rule_command
static
Initial value:
=
{
.path = "stn rule",
.short_help = "address <addr> interface <iface> [del]",
.function = stn_rule_fn,
}

(constructor) VLIB_CLI_COMMAND (stn_rule_command)

Definition at line 454 of file stn.c.

foreach_stn_ip_punt_error
#define foreach_stn_ip_punt_error
Definition: stn.c:169
STN_IP_PUNT_DROP
@ STN_IP_PUNT_DROP
Definition: stn.c:83
stn_ip4_punt_fn
static uword stn_ip4_punt_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: stn.c:227
stn_ip_punt_error_strings
static char * stn_ip_punt_error_strings[]
Definition: stn.c:179
format_stn_ip4_punt_trace
u8 * format_stn_ip4_punt_trace(u8 *s, va_list *args)
INDENT-ON
Definition: stn.c:221
stn_ip6_punt_fn
static uword stn_ip6_punt_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: stn.c:192
STN_IP_PUNT_N_NEXT
@ STN_IP_PUNT_N_NEXT
Definition: stn.c:84
show_stn_rules_fn
static clib_error_t * show_stn_rules_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: stn.c:375
stn_rule_fn
static clib_error_t * stn_rule_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: stn.c:399
STN_IP_PUNT_N_ERROR
@ STN_IP_PUNT_N_ERROR
Definition: stn.c:176
u32
unsigned int u32
Definition: types.h:88
format_stn_ip6_punt_trace
u8 * format_stn_ip6_punt_trace(u8 *s, va_list *args)
Definition: stn.c:186