FD.io VPP  v16.09
Vector Packet Processing
sr.c File Reference

Segment Routing main functions. More...

+ Include dependency graph for sr.c:

Go to the source code of this file.

Data Structures

struct  sr_rewrite_trace_t
 Struct for data for SR rewrite packet trace. More...
 
struct  sr_fix_addr_trace_t
 Information for fix address trace. More...
 
struct  sr_local_trace_t
 Struct for packet trace of SR local. More...
 

Macros

#define foreach_sr_rewrite_next
 Defined valid next nodes. More...
 
#define sr_error(n, s)   s,
 
#define sr_error(n, s)   SR_REWRITE_ERROR_##n,
 
#define foreach_sr_fix_dst_addr_next   _(DROP, "error-drop")
 
#define sr_fix_dst_error(n, s)   s,
 
#define sr_fix_dst_error(n, s)   SR_FIX_DST_ERROR_##n,
 
#define foreach_sr_local_next
 Definition of next-nodes for SR local. More...
 
#define sr_error(n, s)   s,
 
#define sr_error(n, s)   SR_LOCAL_ERROR_##n,
 

Enumerations

enum  sr_rewrite_next_t { SR_REWRITE_N_NEXT }
 Struct for defined valid next nodes. More...
 
enum  sr_rewrite_error_t { sr_error, sr_error }
 Struct for SR rewrite error strings. More...
 
enum  sr_fix_dst_addr_next_t { SR_FIX_DST_ADDR_N_NEXT }
 Struct for valid next-nodes for SR fix destination address node. More...
 
enum  sr_fix_dst_error_t { sr_fix_dst_error, sr_fix_dst_error }
 Struct for errors for SR Fix Destination rewrite. More...
 
enum  sr_local_next_t { SR_LOCAL_N_NEXT }
 Struct for definition of next-nodes for SR local. More...
 
enum  sr_local_error_t { sr_error, sr_error }
 Struct for definition of SR local error-strings. More...
 

Functions

void sr_fix_hmac (ip6_sr_main_t *sm, ip6_header_t *ip, ip6_sr_header_t *sr)
 Use passed HMAC key in ip6_sr_header_t in OpenSSL HMAC routines. More...
 
u8format_ip6_sr_header_flags (u8 *s, va_list *args)
 Format function for decoding various SR flags. More...
 
u8format_ip6_sr_header (u8 *s, va_list *args)
 Format function for decoding ip6_sr_header_t. More...
 
u8format_ip6_sr_header_with_length (u8 *s, va_list *args)
 Format function for decoding ip6_sr_header_t with length. More...
 
u8format_sr_rewrite_trace (u8 *s, va_list *args)
 Format function for SR rewrite trace. More...
 
static uword sr_rewrite (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 Main processing dual-loop for Segment Routing Rewrite. More...
 
static int ip6_delete_route_no_next_hop (ip6_address_t *dst_address_arg, u32 dst_address_length, u32 rx_table_id)
 
static ip6_sr_hmac_key_tfind_or_add_shared_secret (ip6_sr_main_t *sm, u8 *secret, u32 *indexp)
 Find or add if not found - HMAC shared secret. More...
 
int ip6_sr_add_del_tunnel (ip6_sr_add_del_tunnel_args_t *a)
 Add or Delete a Segment Routing tunnel. More...
 
static clib_error_tsr_add_del_tunnel_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 CLI parser for Add or Delete a Segment Routing tunnel. More...
 
void ip6_sr_tunnel_display (vlib_main_t *vm, ip6_sr_tunnel_t *t)
 Display Segment Routing tunnel. More...
 
static clib_error_tshow_sr_tunnel_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 CLI Parser for Display Segment Routing tunnel. More...
 
int ip6_sr_add_del_policy (ip6_sr_add_del_policy_args_t *a)
 Add or Delete a Segment Routing policy. More...
 
static clib_error_tsr_add_del_policy_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 CLI Parser for Add or Delete a Segment Routing policy. More...
 
static clib_error_tshow_sr_policy_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 CLI Parser for Displaying Segment Routing policy. More...
 
int ip6_sr_add_del_multicastmap (ip6_sr_add_del_multicastmap_args_t *a)
 Add or Delete a mapping of IP6 multicast address to Segment Routing policy. More...
 
static clib_error_tsr_add_del_multicast_map_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 CLI Parser for Adding or Delete a mapping of IP6 multicast address to Segment Routing policy. More...
 
static clib_error_tshow_sr_multicast_map_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 CLI Parser for Displaying a mapping of IP6 multicast address to Segment Routing policy. More...
 
u8format_sr_fix_addr_trace (u8 *s, va_list *args)
 Formatter for fix address trace. More...
 
static uword sr_fix_dst_addr (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 Fix SR destination address - dual-loop. More...
 
static clib_error_tsr_init (vlib_main_t *vm)
 
u8format_sr_local_trace (u8 *s, va_list *args)
 Format SR local trace. More...
 
static int sr_validate_hmac (ip6_sr_main_t *sm, ip6_header_t *ip, ip6_sr_header_t *sr)
 Validate the SR HMAC. More...
 
static uword sr_local (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 SR local node. More...
 
ip6_sr_main_tsr_get_main (vlib_main_t *vm)
 
static clib_error_tset_ip6_sr_rewrite_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 CLI parser for SR fix destination rewrite node. More...
 
void vnet_register_sr_app_callback (void *cb)
 Register a callback routine to set next0 in sr_local. More...
 
static clib_error_ttest_sr_hmac_validate_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Test routine for validation of HMAC. More...
 
i32 sr_hmac_add_del_key (ip6_sr_main_t *sm, u32 key_id, u8 *shared_secret, u8 is_del)
 Add or Delete HMAC key. More...
 
static clib_error_tsr_hmac_add_del_key_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tshow_sr_hmac_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 CLI parser for show HMAC key shared secrets. More...
 
static clib_error_ttest_sr_debug_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Test for SR debug flag. More...
 

Variables

ip6_sr_main_t sr_main
 
static vlib_node_registration_t sr_local_node
 (constructor) VLIB_REGISTER_NODE (sr_local_node) More...
 
static char * sr_rewrite_error_strings []
 Error strings for SR rewrite. More...
 
vlib_node_registration_t sr_rewrite_node
 (constructor) VLIB_REGISTER_NODE (sr_rewrite_node) More...
 
static vlib_cli_command_t sr_tunnel_command
 (constructor) VLIB_CLI_COMMAND (sr_tunnel_command) More...
 
static vlib_cli_command_t show_sr_tunnel_command
 (constructor) VLIB_CLI_COMMAND (show_sr_tunnel_command) More...
 
static vlib_cli_command_t sr_policy_command
 (constructor) VLIB_CLI_COMMAND (sr_policy_command) More...
 
static vlib_cli_command_t show_sr_policy_command
 (constructor) VLIB_CLI_COMMAND (show_sr_policy_command) More...
 
static vlib_cli_command_t sr_multicast_map_command
 (constructor) VLIB_CLI_COMMAND (sr_multicast_map_command) More...
 
static vlib_cli_command_t show_sr_multicast_map_command
 (constructor) VLIB_CLI_COMMAND (show_sr_multicast_map_command) More...
 
static char * sr_fix_dst_error_strings []
 Error strings for SR Fix Destination rewrite. More...
 
vlib_node_registration_t sr_fix_dst_addr_node
 (constructor) VLIB_REGISTER_NODE (sr_fix_dst_addr_node) More...
 
static char * sr_local_error_strings []
 Definition of SR local error-strings. More...
 
static vlib_cli_command_t set_ip6_sr_rewrite
 (constructor) VLIB_CLI_COMMAND (set_ip6_sr_rewrite) More...
 
static vlib_cli_command_t test_sr_hmac_validate
 (constructor) VLIB_CLI_COMMAND (test_sr_hmac_validate) More...
 
static vlib_cli_command_t sr_hmac
 (constructor) VLIB_CLI_COMMAND (sr_hmac) More...
 
static vlib_cli_command_t show_sr_hmac
 (constructor) VLIB_CLI_COMMAND (show_sr_hmac) More...
 
static vlib_cli_command_t test_sr_debug
 (constructor) VLIB_CLI_COMMAND (test_sr_debug) More...
 

Detailed Description

Segment Routing main functions.

Definition in file sr.c.

Macro Definition Documentation

#define foreach_sr_fix_dst_addr_next   _(DROP, "error-drop")

Definition at line 1925 of file sr.c.

#define foreach_sr_local_next
Value:
_ (ERROR, "error-drop") \
_ (IP6_LOOKUP, "ip6-lookup")

Definition of next-nodes for SR local.

Definition at line 2255 of file sr.c.

#define foreach_sr_rewrite_next
Value:
_(ERROR, "error-drop") \
_(IP6_LOOKUP, "ip6-lookup") \
_(SR_LOCAL, "sr-local") \
_(SR_REPLICATE,"sr-replicate")

Defined valid next nodes.

Note
Cannot call replicate yet without DPDK

Definition at line 257 of file sr.c.

#define sr_error (   n,
 
)    s,

Definition at line 2296 of file sr.c.

#define sr_error (   n,
 
)    SR_REWRITE_ERROR_##n,

Definition at line 2296 of file sr.c.

#define sr_error (   n,
 
)    s,

Definition at line 2296 of file sr.c.

#define sr_error (   n,
 
)    SR_LOCAL_ERROR_##n,

Definition at line 2296 of file sr.c.

#define sr_fix_dst_error (   n,
 
)    s,

Definition at line 1953 of file sr.c.

#define sr_fix_dst_error (   n,
 
)    SR_FIX_DST_ERROR_##n,

Definition at line 1953 of file sr.c.

Enumeration Type Documentation

Struct for valid next-nodes for SR fix destination address node.

Enumerator
SR_FIX_DST_ADDR_N_NEXT 

Definition at line 1931 of file sr.c.

Struct for errors for SR Fix Destination rewrite.

Enumerator
sr_fix_dst_error 
sr_fix_dst_error 

Definition at line 1951 of file sr.c.

Struct for definition of SR local error-strings.

Enumerator
sr_error 
sr_error 

Definition at line 2294 of file sr.c.

Struct for definition of next-nodes for SR local.

Enumerator
SR_LOCAL_N_NEXT 

Definition at line 2262 of file sr.c.

Struct for SR rewrite error strings.

Enumerator
sr_error 
sr_error 

Definition at line 304 of file sr.c.

Struct for defined valid next nodes.

Enumerator
SR_REWRITE_N_NEXT 

Definition at line 272 of file sr.c.

Function Documentation

static ip6_sr_hmac_key_t* find_or_add_shared_secret ( ip6_sr_main_t sm,
u8 secret,
u32 indexp 
)
static

Find or add if not found - HMAC shared secret.

Parameters
smip6_sr_main_t *
secretu8 *
indexpu32 *
Returns
ip6_sr_hmac_key_t *

Definition at line 781 of file sr.c.

+ Here is the caller graph for this function:

u8* format_ip6_sr_header ( u8 s,
va_list *  args 
)

Format function for decoding ip6_sr_header_t.

Parameters
su8 * - formatted string
argsva_list * - ip6_sr_header_t
Returns
formatted output string u8 *

Definition at line 167 of file sr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_ip6_sr_header_flags ( u8 s,
va_list *  args 
)

Format function for decoding various SR flags.

Parameters
su8 * - formatted string
argsva_list * - u16 flags
Returns
formatted output string u8 *

Definition at line 116 of file sr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_ip6_sr_header_with_length ( u8 s,
va_list *  args 
)

Format function for decoding ip6_sr_header_t with length.

Parameters
su8 * - formatted string
argsva_list * - ip6_header_t + ip6_sr_header_t
Returns
formatted output string u8 *

Definition at line 235 of file sr.c.

+ Here is the call graph for this function:

u8* format_sr_fix_addr_trace ( u8 s,
va_list *  args 
)

Formatter for fix address trace.

Definition at line 1974 of file sr.c.

+ Here is the call graph for this function:

u8* format_sr_local_trace ( u8 s,
va_list *  args 
)

Format SR local trace.

Parameters
su8 *
argsva_list *
Returns
s u8 *

Definition at line 2311 of file sr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_sr_rewrite_trace ( u8 s,
va_list *  args 
)

Format function for SR rewrite trace.

Definition at line 317 of file sr.c.

static int ip6_delete_route_no_next_hop ( ip6_address_t dst_address_arg,
u32  dst_address_length,
u32  rx_table_id 
)
static

Definition at line 732 of file sr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ip6_sr_add_del_multicastmap ( ip6_sr_add_del_multicastmap_args_t a)

Add or Delete a mapping of IP6 multicast address to Segment Routing policy.

Parameters
aip6_sr_add_del_multicastmap_args_t *
Returns
retval int

Definition at line 1678 of file sr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ip6_sr_add_del_policy ( ip6_sr_add_del_policy_args_t a)

Add or Delete a Segment Routing policy.

Parameters
aip6_sr_add_del_policy_args_t *
Returns
retval int

Definition at line 1426 of file sr.c.

+ Here is the caller graph for this function:

int ip6_sr_add_del_tunnel ( ip6_sr_add_del_tunnel_args_t a)

Add or Delete a Segment Routing tunnel.

Parameters
aip6_sr_add_del_tunnel_args_t *
Returns
retval int

Definition at line 837 of file sr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip6_sr_tunnel_display ( vlib_main_t vm,
ip6_sr_tunnel_t t 
)

Display Segment Routing tunnel.

Parameters
vmvlib_main_t *
tip6_sr_tunnel_t *

Definition at line 1316 of file sr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

CLI parser for SR fix destination rewrite node.

Parameters
vmvlib_main_t *
inputunformat_input_t *
cmdvlib_cli_command_t *
Returns
error clib_error_t *

Definition at line 2884 of file sr.c.

+ Here is the call graph for this function:

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

CLI parser for show HMAC key shared secrets.

Parameters
vmvlib_main_t *
inputunformat_input_t *
cmdvlib_cli_command_t *
Returns
error clib_error_t *

Definition at line 3107 of file sr.c.

+ Here is the call graph for this function:

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

CLI Parser for Displaying a mapping of IP6 multicast address to Segment Routing policy.

Parameters
vmvlib_main_t *
inputunformat_input_t *
cmdvlib_cli_command_t *
Returns
error clib_error_t *

Definition at line 1877 of file sr.c.

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

CLI Parser for Displaying Segment Routing policy.

Parameters
vmvlib_main_t *
inputunformat_input_t *
cmdvlib_cli_command_t *
Returns
error clib_error_t *

Definition at line 1599 of file sr.c.

+ Here is the call graph for this function:

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

CLI Parser for Display Segment Routing tunnel.

Parameters
vmvlib_main_t *
inputunformat_input_t *
cmdvlib_cli_command_t *
Returns
error clib_error_t *

Definition at line 1361 of file sr.c.

+ Here is the call graph for this function:

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

CLI Parser for Adding or Delete a mapping of IP6 multicast address to Segment Routing policy.

Parameters
vmvlib_main_t *
inputunformat_input_t *
cmdvlib_cli_command_t *
Returns
error clib_error_t *

Definition at line 1785 of file sr.c.

+ Here is the call graph for this function:

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

CLI Parser for Add or Delete a Segment Routing policy.

Parameters
vmvlib_main_t *
inputunformat_input_t *
cmdvlib_cli_command_t *
Returns
error clib_error_t *

Definition at line 1508 of file sr.c.

+ Here is the call graph for this function:

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

CLI parser for Add or Delete a Segment Routing tunnel.

Parameters
vmvlib_main_t *
inputunformat_input_t *
cmdvlib_cli_command_t *
Returns
error clib_error_t *

Definition at line 1138 of file sr.c.

+ Here is the call graph for this function:

static uword sr_fix_dst_addr ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Fix SR destination address - dual-loop.

Node Identifier:
sr-fix-dst-addr
Parameters
vmvlib_main_t *
nodevlib_node_runtime_t *
from_framevlib_frame_t *
Returns
from_frame->n_vectors uword

Definition at line 2017 of file sr.c.

+ Here is the call graph for this function:

void sr_fix_hmac ( ip6_sr_main_t sm,
ip6_header_t ip,
ip6_sr_header_t sr 
)

Use passed HMAC key in ip6_sr_header_t in OpenSSL HMAC routines.

Parameters
smip6_sr_main_t *
ipip6_header_t *
srip6_sr_header_t *

Definition at line 39 of file sr.c.

+ Here is the caller graph for this function:

ip6_sr_main_t* sr_get_main ( vlib_main_t vm)

Definition at line 2867 of file sr.c.

+ Here is the call graph for this function:

i32 sr_hmac_add_del_key ( ip6_sr_main_t sm,
u32  key_id,
u8 shared_secret,
u8  is_del 
)

Add or Delete HMAC key.

Parameters
smip6_sr_main_t *
key_idu32
shared_secretu8 *
is_delu8
Returns
retval i32

Definition at line 3000 of file sr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 3042 of file sr.c.

+ Here is the call graph for this function:

static clib_error_t* sr_init ( vlib_main_t vm)
static

Definition at line 2189 of file sr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword sr_local ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

SR local node.

Node Identifier:
sr-local
Parameters
vmvlib_main_t *
nodevlib_node_runtime_t *
from_framevlib_frame_t *
Returns
from_frame->n_vectors uword

Definition at line 2442 of file sr.c.

+ Here is the call graph for this function:

static uword sr_rewrite ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Main processing dual-loop for Segment Routing Rewrite.

Node Identifier:
sr-rewrite
Parameters
vmvlib_main_t *
nodevlib_node_runtime_t *
from_framevlib_frame_t *
Returns
from_frame->n_vectors uword

Definition at line 356 of file sr.c.

+ Here is the call graph for this function:

static int sr_validate_hmac ( ip6_sr_main_t sm,
ip6_header_t ip,
ip6_sr_header_t sr 
)
static

Validate the SR HMAC.

Parameters
smip6_sr_main_t *
ipip6_header_t *
srip6_sr_header_t *
Returns
retval int

Definition at line 2341 of file sr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Test for SR debug flag.

Parameters
vmvlib_main_t *
inputunformat_input_t *
cmdvlib_cli_command_t *
Returns
error clib_error_t *

Definition at line 3140 of file sr.c.

+ Here is the call graph for this function:

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

Test routine for validation of HMAC.

Definition at line 2962 of file sr.c.

+ Here is the call graph for this function:

void vnet_register_sr_app_callback ( void *  cb)

Register a callback routine to set next0 in sr_local.

Parameters
cbvoid *

Definition at line 2951 of file sr.c.

Variable Documentation

vlib_cli_command_t set_ip6_sr_rewrite
static
Initial value:
= {
.path = "set ip6 sr rewrite",
.short_help = "set ip6 sr rewrite <ip6-address> [fib-id <id>]",
.function = set_ip6_sr_rewrite_fn,
}
static clib_error_t * set_ip6_sr_rewrite_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI parser for SR fix destination rewrite node.
Definition: sr.c:2884

(constructor) VLIB_CLI_COMMAND (set_ip6_sr_rewrite)

Definition at line 2938 of file sr.c.

vlib_cli_command_t show_sr_hmac
static
Initial value:
= {
.path = "show sr hmac",
.short_help = "show sr hmac",
.function = show_sr_hmac_fn,
}
static clib_error_t * show_sr_hmac_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI parser for show HMAC key shared secrets.
Definition: sr.c:3107

(constructor) VLIB_CLI_COMMAND (show_sr_hmac)

Definition at line 3123 of file sr.c.

vlib_cli_command_t show_sr_multicast_map_command
static
Initial value:
= {
.path = "show sr multicast-map",
.short_help = "show sr multicast-map",
}
static clib_error_t * show_sr_multicast_map_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI Parser for Displaying a mapping of IP6 multicast address to Segment Routing policy.
Definition: sr.c:1877

(constructor) VLIB_CLI_COMMAND (show_sr_multicast_map_command)

Definition at line 1917 of file sr.c.

vlib_cli_command_t show_sr_policy_command
static
Initial value:
= {
.path = "show sr policy",
.short_help = "show sr policy [name <sr-policy-name>]",
.function = show_sr_policy_fn,
}
static clib_error_t * show_sr_policy_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI Parser for Displaying Segment Routing policy.
Definition: sr.c:1599

(constructor) VLIB_CLI_COMMAND (show_sr_policy_command)

Definition at line 1662 of file sr.c.

vlib_cli_command_t show_sr_tunnel_command
static
Initial value:
= {
.path = "show sr tunnel",
.short_help = "show sr tunnel [name <sr-tunnel-name>]",
.function = show_sr_tunnel_fn,
}
static clib_error_t * show_sr_tunnel_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI Parser for Display Segment Routing tunnel.
Definition: sr.c:1361

(constructor) VLIB_CLI_COMMAND (show_sr_tunnel_command)

Definition at line 1411 of file sr.c.

vlib_node_registration_t sr_fix_dst_addr_node
Initial value:
= {
.function = sr_fix_dst_addr,
.name = "sr-fix-dst-addr",
.vector_size = sizeof (u32),
.format_trace = format_sr_fix_addr_trace,
.runtime_data_bytes = 0,
.n_errors = SR_FIX_DST_N_ERROR,
.error_strings = sr_fix_dst_error_strings,
.n_next_nodes = SR_FIX_DST_ADDR_N_NEXT,
.next_nodes = {
#define _(s,n)
},
}
static char * sr_fix_dst_error_strings[]
Error strings for SR Fix Destination rewrite.
Definition: sr.c:1942
u8 * format_sr_fix_addr_trace(u8 *s, va_list *args)
Formatter for fix address trace.
Definition: sr.c:1974
u8 * format_ip6_sr_header_with_length(u8 *s, va_list *args)
Format function for decoding ip6_sr_header_t with length.
Definition: sr.c:235
unsigned int u32
Definition: types.h:88
static uword sr_fix_dst_addr(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Fix SR destination address - dual-loop.
Definition: sr.c:2017
#define foreach_sr_fix_dst_addr_next
Definition: sr.c:1925

(constructor) VLIB_REGISTER_NODE (sr_fix_dst_addr_node)

Definition at line 2166 of file sr.c.

char* sr_fix_dst_error_strings[]
static
Initial value:
= {
#define sr_fix_dst_error(n,s)
sr_fix_dst_error (NONE, "no error")
sr_fix_dst_error (NO_SR_HEADER, "no SR header present")
sr_fix_dst_error (NO_MORE_SEGMENTS, "no more SR segments")
}
#define sr_fix_dst_error(n, s)
Definition: sr.c:1953

Error strings for SR Fix Destination rewrite.

Definition at line 1942 of file sr.c.

vlib_cli_command_t sr_hmac
static
Initial value:
= {
.path = "sr hmac",
.short_help = "sr hmac [del] id <nn> key <str>",
}
static clib_error_t * sr_hmac_add_del_key_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: sr.c:3042

(constructor) VLIB_CLI_COMMAND (sr_hmac)

Definition at line 3090 of file sr.c.

char* sr_local_error_strings[]
static
Initial value:
= {
#define sr_error(n,s)
sr_error (NONE, "no error")
sr_error (BAD_ROUTING_HEADER_TYPE, "bad routing header type (not 4)")
sr_error (NO_MORE_SEGMENTS, "out of SR segment drops")
sr_error (PKTS_PROCESSED, "SR packets processed")
sr_error (APP_CALLBACK, "SR application callback errors")
sr_error (HMAC_INVALID, "SR packets with invalid HMAC signatures")
}
#define sr_error(n, s)
Definition: sr.c:2296
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS

Definition of SR local error-strings.

Definition at line 2285 of file sr.c.

static vlib_node_registration_t sr_local_node
static
Initial value:
= {
.function = sr_local,
.name = "sr-local",
.vector_size = sizeof (u32),
.format_trace = format_sr_local_trace,
.runtime_data_bytes = 0,
.n_errors = SR_LOCAL_N_ERROR,
.error_strings = sr_local_error_strings,
.n_next_nodes = SR_LOCAL_N_NEXT,
.next_nodes = {
#define _(s,n)
},
}
static uword sr_local(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
SR local node.
Definition: sr.c:2442
static char * sr_local_error_strings[]
Definition of SR local error-strings.
Definition: sr.c:2285
unsigned int u32
Definition: types.h:88
#define foreach_sr_local_next
Definition of next-nodes for SR local.
Definition: sr.c:2255
u8 * format_sr_local_trace(u8 *s, va_list *args)
Format SR local trace.
Definition: sr.c:2311

(constructor) VLIB_REGISTER_NODE (sr_local_node)

Definition at line 29 of file sr.c.

ip6_sr_main_t sr_main

Definition at line 28 of file sr.c.

vlib_cli_command_t sr_multicast_map_command
static
Initial value:
= {
.path = "sr multicast-map",
.short_help =
"sr multicast-map address <multicast-ip6-address> sr-policy <sr-policy-name> [del]",
}
static clib_error_t * sr_add_del_multicast_map_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI Parser for Adding or Delete a mapping of IP6 multicast address to Segment Routing policy...
Definition: sr.c:1785

(constructor) VLIB_CLI_COMMAND (sr_multicast_map_command)

Definition at line 1858 of file sr.c.

vlib_cli_command_t sr_policy_command
static
Initial value:
= {
.path = "sr policy",
.short_help =
"sr policy [del] name <policy-name> tunnel <sr-tunnel-name> [tunnel <sr-tunnel-name>]*",
}
static clib_error_t * sr_add_del_policy_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI Parser for Add or Delete a Segment Routing policy.
Definition: sr.c:1508

(constructor) VLIB_CLI_COMMAND (sr_policy_command)

Definition at line 1581 of file sr.c.

char* sr_rewrite_error_strings[]
static
Initial value:
= {
#define sr_error(n,s)
sr_error (NONE, "no error")
sr_error (BAD_ROUTING_HEADER_TYPE, "bad routing header type (not 4)")
sr_error (NO_MORE_SEGMENTS, "out of SR segment drops")
sr_error (PKTS_PROCESSED, "SR packets processed")
sr_error (APP_CALLBACK, "SR application callback errors")
sr_error (HMAC_INVALID, "SR packets with invalid HMAC signatures")
}
#define sr_error(n, s)
Definition: sr.c:2296
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS

Error strings for SR rewrite.

Definition at line 295 of file sr.c.

vlib_node_registration_t sr_rewrite_node
Initial value:
= {
.function = sr_rewrite,
.name = "sr-rewrite",
.vector_size = sizeof (u32),
.format_trace = format_sr_rewrite_trace,
.n_errors = SR_REWRITE_N_ERROR,
.error_strings = sr_rewrite_error_strings,
.runtime_data_bytes = 0,
.n_next_nodes = SR_REWRITE_N_NEXT,
.next_nodes = {
#define _(s,n)
},
}
static char * sr_rewrite_error_strings[]
Error strings for SR rewrite.
Definition: sr.c:295
u8 * format_sr_rewrite_trace(u8 *s, va_list *args)
Format function for SR rewrite trace.
Definition: sr.c:317
static uword sr_rewrite(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Main processing dual-loop for Segment Routing Rewrite.
Definition: sr.c:356
#define foreach_sr_rewrite_next
Defined valid next nodes.
Definition: sr.c:257
u8 * format_ip6_sr_header_with_length(u8 *s, va_list *args)
Format function for decoding ip6_sr_header_t with length.
Definition: sr.c:235
unsigned int u32
Definition: types.h:88

(constructor) VLIB_REGISTER_NODE (sr_rewrite_node)

Definition at line 709 of file sr.c.

vlib_cli_command_t sr_tunnel_command
static
Initial value:
= {
.path = "sr tunnel",
.short_help =
"sr tunnel [del] [name <name>] src <addr> dst <addr> [next <addr>] "
"[clean] [reroute] [key <secret>] [policy <policy_name>]"
"[rx-fib-id <fib_id>] [tx-fib-id <fib_id>]",
}
static clib_error_t * sr_add_del_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI parser for Add or Delete a Segment Routing tunnel.
Definition: sr.c:1138

(constructor) VLIB_CLI_COMMAND (sr_tunnel_command)

Definition at line 1298 of file sr.c.

vlib_cli_command_t test_sr_debug
static
Initial value:
= {
.path = "test sr debug",
.short_help = "test sr debug on|off",
.function = test_sr_debug_fn,
}
static clib_error_t * test_sr_debug_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Test for SR debug flag.
Definition: sr.c:3140

(constructor) VLIB_CLI_COMMAND (test_sr_debug)

Definition at line 3159 of file sr.c.

vlib_cli_command_t test_sr_hmac_validate
static
Initial value:
= {
.path = "test sr hmac",
.short_help = "test sr hmac validate [on|off]",
}
static clib_error_t * test_sr_hmac_validate_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Test routine for validation of HMAC.
Definition: sr.c:2962

(constructor) VLIB_CLI_COMMAND (test_sr_hmac_validate)

Definition at line 2981 of file sr.c.