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

Go to the source code of this file.

Functions

uword unformat_cnat_snat_interface_map_type (unformat_input_t *input, va_list *args)
 
u8format_cnat_snat_interface_map_type (u8 *s, va_list *args)
 
u8format_cnat_snat_prefix (u8 *s, va_list *args)
 
static void cnat_compute_prefix_lengths_in_search_order (cnat_snat_exclude_pfx_table_t *table, ip_address_family_t af)
 
int cnat_snat_policy_add_del_if (u32 sw_if_index, u8 is_add, cnat_snat_interface_map_type_t table)
 
static clib_error_tcnat_snat_policy_add_del_if_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
int cnat_snat_policy_add_pfx (ip_prefix_t *pfx)
 
int cnat_snat_policy_del_pfx (ip_prefix_t *pfx)
 
int cnat_search_snat_prefix (ip46_address_t *addr, ip_address_family_t af)
 
static_always_inline int cnat_snat_policy_interface_enabled (u32 sw_if_index, ip_address_family_t af)
 
int cnat_snat_policy_none (vlib_buffer_t *b, cnat_session_t *session)
 
int cnat_snat_policy_if_pfx (vlib_buffer_t *b, cnat_session_t *session)
 
int cnat_snat_policy_k8s (vlib_buffer_t *b, cnat_session_t *session)
 
void cnat_set_snat (ip4_address_t *ip4, ip6_address_t *ip6, u32 sw_if_index)
 
static clib_error_tcnat_set_snat_cli (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tcnat_snat_policy_add_del_pfx_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tcnat_show_snat (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
int cnat_set_snat_policy (cnat_snat_policy_type_t policy)
 
static clib_error_tcnat_snat_policy_set_cmd_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static void cnat_if_addr_add_del_snat_cb (addr_resolution_t *ar, ip_address_t *address, u8 is_del)
 
static clib_error_tcnat_snat_init (vlib_main_t *vm)
 

Variables

cnat_snat_policy_main_t cnat_snat_policy_main
 
static vlib_cli_command_t cnat_snat_policy_add_del_if_command
 (constructor) VLIB_CLI_COMMAND (cnat_snat_policy_add_del_if_command) More...
 
static vlib_cli_command_t cnat_set_snat_command
 (constructor) VLIB_CLI_COMMAND (cnat_set_snat_command) More...
 
static vlib_cli_command_t cnat_snat_policy_add_del_pfx_command
 (constructor) VLIB_CLI_COMMAND (cnat_snat_policy_add_del_pfx_command) More...
 
static vlib_cli_command_t cnat_show_snat_command
 (constructor) VLIB_CLI_COMMAND (cnat_show_snat_command) More...
 
static vlib_cli_command_t cnat_snat_policy_set_cmd
 (constructor) VLIB_CLI_COMMAND (cnat_snat_policy_set_cmd) More...
 

Function Documentation

◆ cnat_compute_prefix_lengths_in_search_order()

static void cnat_compute_prefix_lengths_in_search_order ( cnat_snat_exclude_pfx_table_t table,
ip_address_family_t  af 
)
static

Definition at line 74 of file cnat_snat_policy.c.

+ Here is the caller graph for this function:

◆ cnat_if_addr_add_del_snat_cb()

static void cnat_if_addr_add_del_snat_cb ( addr_resolution_t ar,
ip_address_t address,
u8  is_del 
)
static

Definition at line 522 of file cnat_snat_policy.c.

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

◆ cnat_search_snat_prefix()

int cnat_search_snat_prefix ( ip46_address_t *  addr,
ip_address_family_t  af 
)

Definition at line 218 of file cnat_snat_policy.c.

+ Here is the caller graph for this function:

◆ cnat_set_snat()

void cnat_set_snat ( ip4_address_t ip4,
ip6_address_t *  ip6,
u32  sw_if_index 
)

Definition at line 331 of file cnat_snat_policy.c.

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

◆ cnat_set_snat_cli()

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

Definition at line 353 of file cnat_snat_policy.c.

+ Here is the call graph for this function:

◆ cnat_set_snat_policy()

int cnat_set_snat_policy ( cnat_snat_policy_type_t  policy)

Definition at line 473 of file cnat_snat_policy.c.

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

◆ cnat_show_snat()

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

Definition at line 439 of file cnat_snat_policy.c.

+ Here is the call graph for this function:

◆ cnat_snat_init()

static clib_error_t* cnat_snat_init ( vlib_main_t vm)
static

Definition at line 549 of file cnat_snat_policy.c.

+ Here is the call graph for this function:

◆ cnat_snat_policy_add_del_if()

int cnat_snat_policy_add_del_if ( u32  sw_if_index,
u8  is_add,
cnat_snat_interface_map_type_t  table 
)

Definition at line 89 of file cnat_snat_policy.c.

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

◆ cnat_snat_policy_add_del_if_command_fn()

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

Definition at line 104 of file cnat_snat_policy.c.

+ Here is the call graph for this function:

◆ cnat_snat_policy_add_del_pfx_command_fn()

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

Definition at line 402 of file cnat_snat_policy.c.

+ Here is the call graph for this function:

◆ cnat_snat_policy_add_pfx()

int cnat_snat_policy_add_pfx ( ip_prefix_t pfx)

Definition at line 148 of file cnat_snat_policy.c.

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

◆ cnat_snat_policy_del_pfx()

int cnat_snat_policy_del_pfx ( ip_prefix_t pfx)

Definition at line 179 of file cnat_snat_policy.c.

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

◆ cnat_snat_policy_if_pfx()

int cnat_snat_policy_if_pfx ( vlib_buffer_t b,
cnat_session_t session 
)

Definition at line 274 of file cnat_snat_policy.c.

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

◆ cnat_snat_policy_interface_enabled()

static_always_inline int cnat_snat_policy_interface_enabled ( u32  sw_if_index,
ip_address_family_t  af 
)

Definition at line 260 of file cnat_snat_policy.c.

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

◆ cnat_snat_policy_k8s()

int cnat_snat_policy_k8s ( vlib_buffer_t b,
cnat_session_t session 
)

Definition at line 289 of file cnat_snat_policy.c.

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

◆ cnat_snat_policy_none()

int cnat_snat_policy_none ( vlib_buffer_t b,
cnat_session_t session 
)

Definition at line 267 of file cnat_snat_policy.c.

+ Here is the caller graph for this function:

◆ cnat_snat_policy_set_cmd_fn()

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

Definition at line 494 of file cnat_snat_policy.c.

+ Here is the call graph for this function:

◆ format_cnat_snat_interface_map_type()

u8* format_cnat_snat_interface_map_type ( u8 s,
va_list *  args 
)

Definition at line 38 of file cnat_snat_policy.c.

+ Here is the caller graph for this function:

◆ format_cnat_snat_prefix()

u8* format_cnat_snat_prefix ( u8 s,
va_list *  args 
)

Definition at line 60 of file cnat_snat_policy.c.

+ Here is the caller graph for this function:

◆ unformat_cnat_snat_interface_map_type()

uword unformat_cnat_snat_interface_map_type ( unformat_input_t input,
va_list *  args 
)

Definition at line 23 of file cnat_snat_policy.c.

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

Variable Documentation

◆ cnat_set_snat_command

vlib_cli_command_t cnat_set_snat_command
static
Initial value:
= {
.path = "set cnat snat-policy addr",
.short_help =
"set cnat snat-policy addr [<ip4-address>][<ip6-address>][sw_if_index]",
.function = cnat_set_snat_cli,
}

(constructor) VLIB_CLI_COMMAND (cnat_set_snat_command)

Definition at line 394 of file cnat_snat_policy.c.

◆ cnat_show_snat_command

vlib_cli_command_t cnat_show_snat_command
static
Initial value:
= {
.path = "show cnat snat-policy",
.short_help = "show cnat snat-policy",
.function = cnat_show_snat,
}

(constructor) VLIB_CLI_COMMAND (cnat_show_snat_command)

Definition at line 466 of file cnat_snat_policy.c.

◆ cnat_snat_policy_add_del_if_command

vlib_cli_command_t cnat_snat_policy_add_del_if_command
static
Initial value:
= {
.path = "set cnat snat-policy if",
.short_help = "set cnat snat-policy if [del]"
"[table [include-v4 include-v6 k8s]] [interface]",
}

(constructor) VLIB_CLI_COMMAND (cnat_snat_policy_add_del_if_command)

Definition at line 140 of file cnat_snat_policy.c.

◆ cnat_snat_policy_add_del_pfx_command

vlib_cli_command_t cnat_snat_policy_add_del_pfx_command
static
Initial value:
= {
.path = "set cnat snat-policy prefix",
.short_help = "set cnat snat-policy prefix [del] [prefix]",
}

(constructor) VLIB_CLI_COMMAND (cnat_snat_policy_add_del_pfx_command)

Definition at line 432 of file cnat_snat_policy.c.

◆ cnat_snat_policy_main

cnat_snat_policy_main_t cnat_snat_policy_main

Definition at line 20 of file cnat_snat_policy.c.

◆ cnat_snat_policy_set_cmd

vlib_cli_command_t cnat_snat_policy_set_cmd
static
Initial value:
= {
.path = "set cnat snat-policy",
.short_help = "set cnat snat-policy [none][if-pfx][k8s]",
}

(constructor) VLIB_CLI_COMMAND (cnat_snat_policy_set_cmd)

Definition at line 515 of file cnat_snat_policy.c.

cnat_snat_policy_add_del_pfx_command_fn
static clib_error_t * cnat_snat_policy_add_del_pfx_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cnat_snat_policy.c:402
cnat_snat_policy_set_cmd_fn
static clib_error_t * cnat_snat_policy_set_cmd_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cnat_snat_policy.c:494
cnat_set_snat_cli
static clib_error_t * cnat_set_snat_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cnat_snat_policy.c:353
cnat_show_snat
static clib_error_t * cnat_show_snat(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cnat_snat_policy.c:439
cnat_snat_policy_add_del_if_command_fn
static clib_error_t * cnat_snat_policy_add_del_if_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cnat_snat_policy.c:104