FD.io VPP  v17.01-9-ge7dcee4
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 void sr_dpo_lock (dpo_id_t *dpo)
 no-op lock function. More...
 
static void sr_dpo_unlock (dpo_id_t *dpo)
 no-op unlock function. More...
 
u8format_sr_dpo (u8 *s, va_list *args)
 
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 dpo_type_t sr_dpo_type
 Dynamically added SR DPO type. 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 const dpo_vft_t sr_vft
 
static const char *const sr_ip6_nodes []
 
static const char *const *const sr_nodes [DPO_PROTO_NUM]
 
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 1994 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 2324 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 264 of file sr.c.

#define sr_error (   n,
 
)    s,

Definition at line 2365 of file sr.c.

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

Definition at line 2365 of file sr.c.

#define sr_error (   n,
 
)    s,

Definition at line 2365 of file sr.c.

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

Definition at line 2365 of file sr.c.

#define sr_fix_dst_error (   n,
 
)    s,

Definition at line 2022 of file sr.c.

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

Definition at line 2022 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 2000 of file sr.c.

Struct for errors for SR Fix Destination rewrite.

Enumerator
sr_fix_dst_error 
sr_fix_dst_error 

Definition at line 2020 of file sr.c.

Struct for definition of SR local error-strings.

Enumerator
sr_error 
sr_error 

Definition at line 2363 of file sr.c.

Struct for definition of next-nodes for SR local.

Enumerator
SR_LOCAL_N_NEXT 

Definition at line 2331 of file sr.c.

Struct for SR rewrite error strings.

Enumerator
sr_error 
sr_error 

Definition at line 311 of file sr.c.

Struct for defined valid next nodes.

Enumerator
SR_REWRITE_N_NEXT 

Definition at line 279 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 840 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 174 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 123 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 242 of file sr.c.

+ Here is the call graph for this function:

u8* format_sr_dpo ( u8 s,
va_list *  args 
)

Definition at line 1192 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 2043 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 2380 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 324 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 812 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 1761 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 1509 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 896 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 1403 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 3038 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 3268 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 1946 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 1682 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 1444 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 1854 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 1591 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 1225 of file sr.c.

+ Here is the call graph for this function:

static void sr_dpo_lock ( dpo_id_t dpo)
static

no-op lock function.

The lifetime of the SR entry is managed by the control plane

Definition at line 1178 of file sr.c.

static void sr_dpo_unlock ( dpo_id_t dpo)
static

no-op unlock function.

The lifetime of the SR entry is managed by the control plane

Definition at line 1187 of file sr.c.

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 2086 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 46 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 3021 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 3161 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 3203 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 2260 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 2511 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 359 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 2410 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 3301 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 3123 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 3112 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:3038

(constructor) VLIB_CLI_COMMAND (set_ip6_sr_rewrite)

Definition at line 3099 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:3268

(constructor) VLIB_CLI_COMMAND (show_sr_hmac)

Definition at line 3284 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:1946

(constructor) VLIB_CLI_COMMAND (show_sr_multicast_map_command)

Definition at line 1986 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:1682

(constructor) VLIB_CLI_COMMAND (show_sr_policy_command)

Definition at line 1745 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:1444

(constructor) VLIB_CLI_COMMAND (show_sr_tunnel_command)

Definition at line 1494 of file sr.c.

dpo_type_t sr_dpo_type
static

Dynamically added SR DPO type.

Definition at line 36 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:2011
u8 * format_sr_fix_addr_trace(u8 *s, va_list *args)
Formatter for fix address trace.
Definition: sr.c:2043
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:242
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:2086
#define foreach_sr_fix_dst_addr_next
Definition: sr.c:1994

(constructor) VLIB_REGISTER_NODE (sr_fix_dst_addr_node)

Definition at line 2235 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:2022

Error strings for SR Fix Destination rewrite.

Definition at line 2011 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:3203

(constructor) VLIB_CLI_COMMAND (sr_hmac)

Definition at line 3251 of file sr.c.

const char* const sr_ip6_nodes[]
static
Initial value:
= {
"sr-rewrite",
}
#define NULL
Definition: clib.h:55

Definition at line 1206 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:2365
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS

Definition of SR local error-strings.

Definition at line 2354 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:2511
static char * sr_local_error_strings[]
Definition of SR local error-strings.
Definition: sr.c:2354
unsigned int u32
Definition: types.h:88
#define foreach_sr_local_next
Definition of next-nodes for SR local.
Definition: sr.c:2324
u8 * format_sr_local_trace(u8 *s, va_list *args)
Format SR local trace.
Definition: sr.c:2380

(constructor) VLIB_REGISTER_NODE (sr_local_node)

Definition at line 31 of file sr.c.

ip6_sr_main_t sr_main

Definition at line 30 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:1854

(constructor) VLIB_CLI_COMMAND (sr_multicast_map_command)

Definition at line 1927 of file sr.c.

const char* const* const sr_nodes[DPO_PROTO_NUM]
static
Initial value:
= {
}
static const char *const sr_ip6_nodes[]
Definition: sr.c:1206

Definition at line 1211 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:1591

(constructor) VLIB_CLI_COMMAND (sr_policy_command)

Definition at line 1664 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:2365
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS

Error strings for SR rewrite.

Definition at line 302 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:302
u8 * format_sr_rewrite_trace(u8 *s, va_list *args)
Format function for SR rewrite trace.
Definition: sr.c:324
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:359
#define foreach_sr_rewrite_next
Defined valid next nodes.
Definition: sr.c:264
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:242
unsigned int u32
Definition: types.h:88

(constructor) VLIB_REGISTER_NODE (sr_rewrite_node)

Definition at line 787 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:1225

(constructor) VLIB_CLI_COMMAND (sr_tunnel_command)

Definition at line 1385 of file sr.c.

const dpo_vft_t sr_vft
static
Initial value:
= {
.dv_lock = sr_dpo_lock,
.dv_unlock = sr_dpo_unlock,
.dv_format = format_sr_dpo,
}
u8 * format_sr_dpo(u8 *s, va_list *args)
Definition: sr.c:1192
static void sr_dpo_unlock(dpo_id_t *dpo)
no-op unlock function.
Definition: sr.c:1187
static void sr_dpo_lock(dpo_id_t *dpo)
no-op lock function.
Definition: sr.c:1178

Definition at line 1200 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:3301

(constructor) VLIB_CLI_COMMAND (test_sr_debug)

Definition at line 3320 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:3123

(constructor) VLIB_CLI_COMMAND (test_sr_hmac_validate)

Definition at line 3142 of file sr.c.