FD.io VPP  v17.01.1-3-gc6833f8
Vector Packet Processing
snat.c File Reference
+ Include dependency graph for snat.c:

Go to the source code of this file.

Macros

#define vl_typedefs
 
#define vl_endianfun
 
#define vl_print(handle, ...)   vlib_cli_output (handle, __VA_ARGS__)
 
#define vl_api_version(n, v)   static u32 api_version=(v);
 
#define FINISH
 
#define REPLY_MACRO(t)
 
#define REPLY_MACRO2(t, body)
 
#define VALIDATE_SW_IF_INDEX(mp)
 
#define BAD_SW_IF_INDEX_LABEL
 
#define VALIDATE_RX_SW_IF_INDEX(mp)
 
#define BAD_RX_SW_IF_INDEX_LABEL
 
#define VALIDATE_TX_SW_IF_INDEX(mp)
 
#define BAD_TX_SW_IF_INDEX_LABEL
 
#define foreach_snat_plugin_api_msg
 
#define vl_msg_name_crc_list
 

Functions

 VNET_FEATURE_INIT (ip4_snat_in2out, static)
 
 VNET_FEATURE_INIT (ip4_snat_out2in, static)
 
 VNET_FEATURE_INIT (ip4_snat_in2out_worker_handoff, static)
 
 VNET_FEATURE_INIT (ip4_snat_out2in_worker_handoff, static)
 
 VNET_FEATURE_INIT (ip4_snat_in2out_fast, static)
 
 VNET_FEATURE_INIT (ip4_snat_out2in_fast, static)
 
clib_error_tvlib_plugin_register (vlib_main_t *vm, vnet_plugin_handoff_t *h, int from_early_init)
 
void snat_add_address (snat_main_t *sm, ip4_address_t *addr)
 
static int is_snat_address_used_in_static_mapping (snat_main_t *sm, ip4_address_t addr)
 
int snat_del_address (snat_main_t *sm, ip4_address_t addr)
 
static void increment_v4_address (ip4_address_t *a)
 
int snat_add_static_mapping (ip4_address_t l_addr, ip4_address_t e_addr, u16 l_port, u16 e_port, u32 vrf_id, int addr_only, int is_add)
 Add static mapping. More...
 
static int snat_interface_add_del (u32 sw_if_index, u8 is_inside, int is_del)
 
static int snat_set_workers (uword *bitmap)
 
static void vl_api_snat_add_address_range_t_handler (vl_api_snat_add_address_range_t *mp)
 
static void * vl_api_snat_add_address_range_t_print (vl_api_snat_add_address_range_t *mp, void *handle)
 
static void send_snat_address_details (snat_address_t *a, unix_shared_memory_queue_t *q, u32 context)
 
static void vl_api_snat_address_dump_t_handler (vl_api_snat_address_dump_t *mp)
 
static void * vl_api_snat_address_dump_t_print (vl_api_snat_address_dump_t *mp, void *handle)
 
static void vl_api_snat_interface_add_del_feature_t_handler (vl_api_snat_interface_add_del_feature_t *mp)
 
static void * vl_api_snat_interface_add_del_feature_t_print (vl_api_snat_interface_add_del_feature_t *mp, void *handle)
 
static void send_snat_interface_details (snat_interface_t *i, unix_shared_memory_queue_t *q, u32 context)
 
static void vl_api_snat_interface_dump_t_handler (vl_api_snat_interface_dump_t *mp)
 
static void * vl_api_snat_interface_dump_t_print (vl_api_snat_interface_dump_t *mp, void *handle)
 
static void vl_api_snat_add_static_mapping_t_handler (vl_api_snat_add_static_mapping_t *mp)
 
static void * vl_api_snat_add_static_mapping_t_print (vl_api_snat_add_static_mapping_t *mp, void *handle)
 
static void send_snat_static_mapping_details (snat_static_mapping_t *m, unix_shared_memory_queue_t *q, u32 context)
 
static void vl_api_snat_static_mapping_dump_t_handler (vl_api_snat_static_mapping_dump_t *mp)
 
static void * vl_api_snat_static_mapping_dump_t_print (vl_api_snat_static_mapping_dump_t *mp, void *handle)
 
static void vl_api_snat_control_ping_t_handler (vl_api_snat_control_ping_t *mp)
 
static void * vl_api_snat_control_ping_t_print (vl_api_snat_control_ping_t *mp, void *handle)
 
static void vl_api_snat_show_config_t_handler (vl_api_snat_show_config_t *mp)
 
static void * vl_api_snat_show_config_t_print (vl_api_snat_show_config_t *mp, void *handle)
 
static void vl_api_snat_set_workers_t_handler (vl_api_snat_set_workers_t *mp)
 
static void * vl_api_snat_set_workers_t_print (vl_api_snat_set_workers_t *mp, void *handle)
 
static void send_snat_worker_details (u32 worker_index, unix_shared_memory_queue_t *q, u32 context)
 
static void vl_api_snat_worker_dump_t_handler (vl_api_snat_worker_dump_t *mp)
 
static void * vl_api_snat_worker_dump_t_print (vl_api_snat_worker_dump_t *mp, void *handle)
 
static clib_error_tsnat_plugin_api_hookup (vlib_main_t *vm)
 
static void setup_message_id_table (snat_main_t *sm, api_main_t *am)
 
static void plugin_custom_dump_configure (snat_main_t *sm)
 
static clib_error_tsnat_init (vlib_main_t *vm)
 
void snat_free_outside_address_and_port (snat_main_t *sm, snat_session_key_t *k, u32 address_index)
 
int snat_static_mapping_match (snat_main_t *sm, snat_session_key_t match, snat_session_key_t *mapping, u8 by_external)
 Match SNAT static mapping. More...
 
int snat_alloc_outside_address_and_port (snat_main_t *sm, snat_session_key_t *k, u32 *address_indexp)
 
static clib_error_tadd_address_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tsnat_feature_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tadd_static_mapping_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tset_workers_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tsnat_config (vlib_main_t *vm, unformat_input_t *input)
 
u8format_snat_key (u8 *s, va_list *args)
 
u8format_snat_session (u8 *s, va_list *args)
 
u8format_snat_user (u8 *s, va_list *args)
 
u8format_snat_static_mapping (u8 *s, va_list *args)
 
static clib_error_tshow_snat_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

snat_main_t snat_main
 
static vlib_cli_command_t add_address_command
 (constructor) VLIB_CLI_COMMAND (add_address_command) More...
 
static vlib_cli_command_t set_interface_snat_command
 (constructor) VLIB_CLI_COMMAND (set_interface_snat_command) More...
 
static vlib_cli_command_t add_static_mapping_command
 (constructor) VLIB_CLI_COMMAND (add_static_mapping_command) More...
 
static vlib_cli_command_t set_workers_command
 (constructor) VLIB_CLI_COMMAND (set_workers_command) More...
 
static vlib_cli_command_t show_snat_command
 (constructor) VLIB_CLI_COMMAND (show_snat_command) More...
 

Macro Definition Documentation

#define BAD_RX_SW_IF_INDEX_LABEL
Value:
do { \
bad_rx_sw_if_index: \
; \
} while (0);

Definition at line 178 of file snat.c.

#define BAD_SW_IF_INDEX_LABEL
Value:
do { \
bad_sw_if_index: \
; \
} while (0);

Definition at line 162 of file snat.c.

#define BAD_TX_SW_IF_INDEX_LABEL
Value:
do { \
bad_tx_sw_if_index: \
; \
} while (0);

Definition at line 194 of file snat.c.

#define FINISH
Value:
vec_add1 (s, 0); \
vl_print (handle, (char *)s); \
vec_free (s); \
return handle;
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:482
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:300
#define vl_print(handle,...)
Definition: snat.c:42

Definition at line 50 of file snat.c.

#define foreach_snat_plugin_api_msg
Value:
_(SNAT_ADD_ADDRESS_RANGE, snat_add_address_range) \
_(SNAT_INTERFACE_ADD_DEL_FEATURE, snat_interface_add_del_feature) \
_(SNAT_ADD_STATIC_MAPPING, snat_add_static_mapping) \
_(SNAT_CONTROL_PING, snat_control_ping) \
_(SNAT_STATIC_MAPPING_DUMP, snat_static_mapping_dump) \
_(SNAT_SHOW_CONFIG, snat_show_config) \
_(SNAT_ADDRESS_DUMP, snat_address_dump) \
_(SNAT_INTERFACE_DUMP, snat_interface_dump) \
_(SNAT_SET_WORKERS, snat_set_workers) \
_(SNAT_WORKER_DUMP, snat_worker_dump)
int snat_add_static_mapping(ip4_address_t l_addr, ip4_address_t e_addr, u16 l_port, u16 e_port, u32 vrf_id, int addr_only, int is_add)
Add static mapping.
Definition: snat.c:331
static int snat_set_workers(uword *bitmap)
Definition: snat.c:628

Definition at line 1096 of file snat.c.

#define REPLY_MACRO (   t)
Value:
do { \
if (!q) \
return; \
\
rmp = vl_msg_api_alloc (sizeof (*rmp)); \
rmp->_vl_msg_id = ntohs((t)+sm->msg_id_base); \
rmp->context = mp->context; \
rmp->retval = ntohl(rv); \
vl_msg_api_send_shmem (q, (u8 *)&rmp); \
} while(0);
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
void * vl_msg_api_alloc(int nbytes)
unsigned char u8
Definition: types.h:56
struct _unix_shared_memory_queue unix_shared_memory_queue_t

Definition at line 64 of file snat.c.

#define REPLY_MACRO2 (   t,
  body 
)
Value:
do { \
if (!q) \
return; \
\
rmp = vl_msg_api_alloc (sizeof (*rmp)); \
rmp->_vl_msg_id = ntohs((t)+sm->msg_id_base); \
rmp->context = mp->context; \
rmp->retval = ntohl(rv); \
do {body;} while (0); \
vl_msg_api_send_shmem (q, (u8 *)&rmp); \
} while(0);
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
void * vl_msg_api_alloc(int nbytes)
unsigned char u8
Definition: types.h:56
struct _unix_shared_memory_queue unix_shared_memory_queue_t

Definition at line 79 of file snat.c.

#define VALIDATE_RX_SW_IF_INDEX (   mp)
Value:
do { u32 __rx_sw_if_index = ntohl(mp->rx_sw_if_index); \
if (pool_is_free_index(__vnm->interface_main.sw_interfaces, \
__rx_sw_if_index)) { \
rv = VNET_API_ERROR_INVALID_SW_IF_INDEX; \
goto bad_rx_sw_if_index; \
} \
} while(0);
vnet_main_t * vnet_get_main(void)
Definition: misc.c:46
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Definition: pool.h:211
unsigned int u32
Definition: types.h:88
struct vnet_main_t vnet_main_t

Definition at line 168 of file snat.c.

#define VALIDATE_SW_IF_INDEX (   mp)
Value:
do { u32 __sw_if_index = ntohl(mp->sw_if_index); \
if (pool_is_free_index(__vnm->interface_main.sw_interfaces, \
__sw_if_index)) { \
rv = VNET_API_ERROR_INVALID_SW_IF_INDEX; \
goto bad_sw_if_index; \
} \
} while(0);
vnet_main_t * vnet_get_main(void)
Definition: misc.c:46
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Definition: pool.h:211
unsigned int u32
Definition: types.h:88
struct vnet_main_t vnet_main_t

Definition at line 152 of file snat.c.

#define VALIDATE_TX_SW_IF_INDEX (   mp)
Value:
do { u32 __tx_sw_if_index = ntohl(mp->tx_sw_if_index); \
if (pool_is_free_index(__vnm->interface_main.sw_interfaces, \
__tx_sw_if_index)) { \
rv = VNET_API_ERROR_INVALID_SW_IF_INDEX; \
goto bad_tx_sw_if_index; \
} \
} while(0);
vnet_main_t * vnet_get_main(void)
Definition: misc.c:46
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Definition: pool.h:211
unsigned int u32
Definition: types.h:88
struct vnet_main_t vnet_main_t

Definition at line 184 of file snat.c.

#define vl_api_version (   n,
  v 
)    static u32 api_version=(v);

Definition at line 45 of file snat.c.

#define vl_endianfun

Definition at line 38 of file snat.c.

#define vl_msg_name_crc_list

Definition at line 1127 of file snat.c.

#define vl_print (   handle,
  ... 
)    vlib_cli_output (handle, __VA_ARGS__)

Definition at line 42 of file snat.c.

#define vl_typedefs

Definition at line 33 of file snat.c.

Function Documentation

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

Definition at line 1330 of file snat.c.

+ Here is the call graph for this function:

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

Definition at line 1479 of file snat.c.

+ Here is the call graph for this function:

u8* format_snat_key ( u8 s,
va_list *  args 
)

Definition at line 1717 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_snat_session ( u8 s,
va_list *  args 
)

Definition at line 1736 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_snat_static_mapping ( u8 s,
va_list *  args 
)

Definition at line 1794 of file snat.c.

+ Here is the call graph for this function:

u8* format_snat_user ( u8 s,
va_list *  args 
)

Definition at line 1754 of file snat.c.

+ Here is the call graph for this function:

static void increment_v4_address ( ip4_address_t a)
static

Definition at line 308 of file snat.c.

+ Here is the caller graph for this function:

static int is_snat_address_used_in_static_mapping ( snat_main_t sm,
ip4_address_t  addr 
)
static

Definition at line 227 of file snat.c.

+ Here is the caller graph for this function:

static void plugin_custom_dump_configure ( snat_main_t sm)
static

Definition at line 1140 of file snat.c.

+ Here is the caller graph for this function:

static void send_snat_address_details ( snat_address_t a,
unix_shared_memory_queue_t q,
u32  context 
)
static

Definition at line 720 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void send_snat_interface_details ( snat_interface_t i,
unix_shared_memory_queue_t q,
u32  context 
)
static

Definition at line 796 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void send_snat_static_mapping_details ( snat_static_mapping_t m,
unix_shared_memory_queue_t q,
u32  context 
)
static

Definition at line 895 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void send_snat_worker_details ( u32  worker_index,
unix_shared_memory_queue_t q,
u32  context 
)
static

Definition at line 1049 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1565 of file snat.c.

+ Here is the call graph for this function:

static void setup_message_id_table ( snat_main_t sm,
api_main_t am 
)
static

Definition at line 1132 of file snat.c.

+ Here is the caller graph for this function:

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

Definition at line 1813 of file snat.c.

+ Here is the call graph for this function:

void snat_add_address ( snat_main_t sm,
ip4_address_t addr 
)

Definition at line 211 of file snat.c.

+ Here is the caller graph for this function:

int snat_add_static_mapping ( ip4_address_t  l_addr,
ip4_address_t  e_addr,
u16  l_port,
u16  e_port,
u32  vrf_id,
int  addr_only,
int  is_add 
)

Add static mapping.

Create static mapping between local addr+port and external addr+port.

Parameters
l_addrLocal IPv4 address.
e_addrExternal IPv4 address.
l_portLocal port number.
e_portExternal port number.
vrf_idVRF ID.
addr_onlyIf 0 address port and pair mapping, otherwise address only.
is_addIf 0 delete static mapping, otherwise add.
Returns

Definition at line 331 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int snat_alloc_outside_address_and_port ( snat_main_t sm,
snat_session_key_t k,
u32 address_indexp 
)

Definition at line 1292 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* snat_config ( vlib_main_t vm,
unformat_input_t input 
)
static

Definition at line 1625 of file snat.c.

+ Here is the call graph for this function:

int snat_del_address ( snat_main_t sm,
ip4_address_t  addr 
)

Definition at line 240 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1413 of file snat.c.

+ Here is the call graph for this function:

void snat_free_outside_address_and_port ( snat_main_t sm,
snat_session_key_t k,
u32  address_index 
)

Definition at line 1213 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* snat_init ( vlib_main_t vm)
static

Definition at line 1149 of file snat.c.

+ Here is the call graph for this function:

static int snat_interface_add_del ( u32  sw_if_index,
u8  is_inside,
int  is_del 
)
static

Definition at line 580 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* snat_plugin_api_hookup ( vlib_main_t vm)
static

Definition at line 1110 of file snat.c.

+ Here is the caller graph for this function:

static int snat_set_workers ( uword bitmap)
static

Definition at line 628 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int snat_static_mapping_match ( snat_main_t sm,
snat_session_key_t  match,
snat_session_key_t mapping,
u8  by_external 
)

Match SNAT static mapping.

Parameters
smSNAT main.
matchAddress and port to match.
mappingExternal or local address and port of the matched mapping.
by_externalIf 0 match by local address otherwise match by external address.
Returns
0 if match found otherwise 1.

Definition at line 1242 of file snat.c.

+ Here is the caller graph for this function:

static void vl_api_snat_add_address_range_t_handler ( vl_api_snat_add_address_range_t mp)
static

Definition at line 650 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* vl_api_snat_add_address_range_t_print ( vl_api_snat_add_address_range_t mp,
void *  handle 
)
static

Definition at line 705 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_snat_add_static_mapping_t_handler ( vl_api_snat_add_static_mapping_t mp)
static

Definition at line 840 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* vl_api_snat_add_static_mapping_t_print ( vl_api_snat_add_static_mapping_t mp,
void *  handle 
)
static

Definition at line 873 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_snat_address_dump_t_handler ( vl_api_snat_address_dump_t mp)
static

Definition at line 737 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* vl_api_snat_address_dump_t_print ( vl_api_snat_address_dump_t mp,
void *  handle 
)
static

Definition at line 752 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_snat_control_ping_t_handler ( vl_api_snat_control_ping_t mp)
static

Definition at line 945 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* vl_api_snat_control_ping_t_print ( vl_api_snat_control_ping_t mp,
void *  handle 
)
static

Definition at line 958 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_snat_interface_add_del_feature_t_handler ( vl_api_snat_interface_add_del_feature_t mp)
static

Definition at line 763 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* vl_api_snat_interface_add_del_feature_t_print ( vl_api_snat_interface_add_del_feature_t mp,
void *  handle 
)
static

Definition at line 781 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_snat_interface_dump_t_handler ( vl_api_snat_interface_dump_t mp)
static

Definition at line 813 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* vl_api_snat_interface_dump_t_print ( vl_api_snat_interface_dump_t mp,
void *  handle 
)
static

Definition at line 830 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_snat_set_workers_t_handler ( vl_api_snat_set_workers_t mp)
static

Definition at line 1002 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* vl_api_snat_set_workers_t_print ( vl_api_snat_set_workers_t mp,
void *  handle 
)
static

Definition at line 1025 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_snat_show_config_t_handler ( vl_api_snat_show_config_t mp)
static

Definition at line 969 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* vl_api_snat_show_config_t_print ( vl_api_snat_show_config_t mp,
void *  handle 
)
static

Definition at line 991 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_snat_static_mapping_dump_t_handler ( vl_api_snat_static_mapping_dump_t mp)
static

Definition at line 917 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* vl_api_snat_static_mapping_dump_t_print ( vl_api_snat_static_mapping_dump_t mp,
void *  handle 
)
static

Definition at line 934 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_snat_worker_dump_t_handler ( vl_api_snat_worker_dump_t mp)
static

Definition at line 1069 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* vl_api_snat_worker_dump_t_print ( vl_api_snat_worker_dump_t mp,
void *  handle 
)
static

Definition at line 1086 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_plugin_register ( vlib_main_t vm,
vnet_plugin_handoff_t h,
int  from_early_init 
)

Definition at line 136 of file snat.c.

VNET_FEATURE_INIT ( ip4_snat_in2out  ,
static   
)
VNET_FEATURE_INIT ( ip4_snat_out2in  ,
static   
)
VNET_FEATURE_INIT ( ip4_snat_in2out_worker_handoff  ,
static   
)
VNET_FEATURE_INIT ( ip4_snat_out2in_worker_handoff  ,
static   
)
VNET_FEATURE_INIT ( ip4_snat_in2out_fast  ,
static   
)
VNET_FEATURE_INIT ( ip4_snat_out2in_fast  ,
static   
)

Variable Documentation

vlib_cli_command_t add_address_command
static
Initial value:
= {
.path = "snat add address",
.short_help = "snat add addresses <ip4-range-start> [- <ip4-range-end>] [del]",
}
static clib_error_t * add_address_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: snat.c:1330

(constructor) VLIB_CLI_COMMAND (add_address_command)

Definition at line 1406 of file snat.c.

vlib_cli_command_t add_static_mapping_command
static
Initial value:
= {
.path = "snat add static mapping",
.short_help =
"snat add static mapping local <addr> [<port>] external <addr> [<port>] [vrf <table-id>] [del]",
}
static clib_error_t * add_static_mapping_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: snat.c:1479

(constructor) VLIB_CLI_COMMAND (add_static_mapping_command)

Definition at line 1557 of file snat.c.

vlib_cli_command_t set_interface_snat_command
static
Initial value:
= {
.path = "set interface snat",
.short_help = "set interface snat in <intfc> out <intfc> [del]",
}
static clib_error_t * snat_feature_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: snat.c:1413

(constructor) VLIB_CLI_COMMAND (set_interface_snat_command)

Definition at line 1472 of file snat.c.

vlib_cli_command_t set_workers_command
static
Initial value:
= {
.path = "set snat workers",
.short_help =
"set snat workers <workers-list>",
}
static clib_error_t * set_workers_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: snat.c:1565

(constructor) VLIB_CLI_COMMAND (set_workers_command)

Definition at line 1617 of file snat.c.

vlib_cli_command_t show_snat_command
static
Initial value:
= {
.path = "show snat",
.short_help = "show snat",
.function = show_snat_command_fn,
}
static clib_error_t * show_snat_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: snat.c:1813

(constructor) VLIB_CLI_COMMAND (show_snat_command)

Definition at line 1953 of file snat.c.

snat_main_t snat_main

Definition at line 27 of file snat.c.