|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
21 #define DET44_EXPECTED_ARGUMENT "expected required argument(s)"
29 u32 in_plen, out_plen;
46 else if (
unformat (line_input,
"del"))
160 if (out_port < 1024 || out_port > 65535)
210 u32 out_port, ext_port;
221 if (
unformat (line_input,
"%U:%d %U:%d",
241 key.ext_host_addr = out_addr;
263 u32 in_port, ext_port;
274 if (
unformat (line_input,
"%U:%d %U:%d",
293 key.ext_host_addr = ext_addr;
324 if (
unformat (line_input,
"udp %u", &timeouts.
udp));
325 else if (
unformat (line_input,
"tcp established %u",
327 else if (
unformat (line_input,
"tcp transitory %u",
329 else if (
unformat (line_input,
"icmp %u", &timeouts.
icmp));
330 else if (
unformat (line_input,
"reset"))
376 u8 enable = 0, is_set = 0;
385 if (!is_set &&
unformat (line_input,
"enable"))
387 unformat (line_input,
"inside vrf %u", &
c.inside_vrf_id);
388 unformat (line_input,
"outside vrf %u", &
c.outside_vrf_id);
391 else if (!is_set &&
unformat (line_input,
"disable"));
438 vnm, &e.sw_if_index))
444 vnm, &e.sw_if_index))
449 else if (
unformat (line_input,
"del"))
464 is_del ?
"del" :
"add",
465 p->is_inside ?
"inside" :
"outside",
467 vnm, p->sw_if_index);
509 .short_help =
"det44 add in <addr>/<plen> out <addr>/<plen> [del]",
526 .path =
"show det44 mappings",
527 .short_help =
"show det44 mappings",
541 .path =
"det44 forward",
542 .short_help =
"det44 forward <addr>",
556 .path =
"det44 reverse",
557 .short_help =
"det44 reverse <addr>:<port>",
573 .path =
"show det44 sessions",
574 .short_help =
"show det44 sessions",
587 .path =
"det44 close session out",
588 .short_help =
"det44 close session out "
589 "<out_addr>:<out_port> <ext_addr>:<ext_port>",
602 .path =
"det44 close session in",
603 .short_help =
"det44 close session in "
604 "<in_addr>:<in_port> <ext_addr>:<ext_port>",
619 .path =
"set det44 timeouts",
620 .short_help =
"set det44 timeouts <[udp <sec>] [tcp established <sec>] "
621 "[tcp transitory <sec>] [icmp <sec>]|reset>",
638 .path =
"show det44 timeouts",
639 .short_help =
"show det44 timeouts",
651 .path =
"det44 plugin",
652 .short_help =
"det44 plugin <enable [inside vrf] [outside vrf]|disable>",
668 .path =
"set interface det44",
669 .short_help =
"set interface det44 inside <intfc> outside <intfc> [del]",
685 .path =
"show det44 interfaces",
686 .short_help =
"show det44 interfaces",
static vlib_cli_command_t det44_show_timeouts_command
(constructor) VLIB_CLI_COMMAND (det44_show_timeouts_command)
#define det44_interface_is_inside(i)
Check if Deterministic NAT interface is inside.
Deterministic NAT (CGN) definitions.
struct nat_timeouts_t::@742 tcp
#define DET44_EXPECTED_ARGUMENT
int snat_det_add_map(ip4_address_t *in_addr, u8 in_plen, ip4_address_t *out_addr, u8 out_plen, int is_add)
Add/delete deterministic NAT mapping.
nat_timeouts_t det44_get_timeouts()
static clib_error_t * det44_reverse_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define clib_error_return(e, args...)
static clib_error_t * det44_map_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * det44_show_mappings_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * det44_close_session_in_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
det44_interface_t * interfaces
static clib_error_t * det44_show_interfaces_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * det44_set_timeouts_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static_always_inline snat_det_map_t * snat_det_map_by_user(ip4_address_t *user_addr)
int det44_plugin_disable()
#define pool_foreach(VAR, POOL)
Iterate through pool.
static_always_inline void snat_det_reverse(snat_det_map_t *dm, ip4_address_t *out_addr, u16 out_port, ip4_address_t *in_addr)
static vlib_cli_command_t det44_map_command
(constructor) VLIB_CLI_COMMAND (det44_map_command)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
snat_det_map_t * det_maps
int det44_plugin_enable(det44_config_t c)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
vnet_main_t * vnet_get_main(void)
#define vec_foreach_index(var, v)
Iterate over vector indices.
static clib_error_t * det44_show_timeouts_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void det44_reset_timeouts()
#define VLIB_CLI_COMMAND(x,...)
static vlib_cli_command_t det44_close_session_in_command
(constructor) VLIB_CLI_COMMAND (det44_close_session_in_command)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static vlib_cli_command_t det44_feature_command
(constructor) VLIB_CLI_COMMAND (det44_feature_command)
static vlib_cli_command_t det44_show_interfaces_command
(constructor) VLIB_CLI_COMMAND (det44_show_interfaces_command)
#define vec_free(V)
Free vector's memory (no header).
static_always_inline void snat_det_ses_close(snat_det_map_t *dm, snat_det_session_t *ses)
format_function_t format_det_map_ses
int det44_interface_add_del(u32 sw_if_index, u8 is_inside, int is_del)
static_always_inline snat_det_session_t * snat_det_get_ses_by_out(snat_det_map_t *dm, ip4_address_t *in_addr, u64 out_key)
static_always_inline snat_det_session_t * snat_det_find_ses_by_in(snat_det_map_t *dm, ip4_address_t *in_addr, u16 in_port, snat_det_out_key_t out_key)
static clib_error_t * det44_show_sessions_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
format_function_t format_vnet_sw_if_index_name
static vlib_cli_command_t det44_forward_command
(constructor) VLIB_CLI_COMMAND (det44_forward_command)
unformat_function_t unformat_vnet_sw_interface
static vlib_cli_command_t det44_close_sesion_out_command
(constructor) VLIB_CLI_COMMAND (det44_close_sesion_out_command)
static vlib_cli_command_t det44_set_timeouts_command
(constructor) VLIB_CLI_COMMAND (det44_set_timeouts_command)
static clib_error_t * det44_plugin_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int det44_set_timeouts(nat_timeouts_t *timeouts)
static vlib_cli_command_t det44_show_mappings_command
(constructor) VLIB_CLI_COMMAND (det44_show_mappings_command)
#define vec_foreach(var, vec)
Vector iterator.
static clib_error_t * det44_feature_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
snat_det_session_t * sessions
static vlib_cli_command_t det44_show_sessions_command
(constructor) VLIB_CLI_COMMAND (det44_show_sessions_command)
static_always_inline void snat_det_forward(snat_det_map_t *dm, ip4_address_t *in_addr, ip4_address_t *out_addr, u16 *lo_port)
static clib_error_t * det44_forward_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * det44_close_session_out_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static vlib_cli_command_t det44_plugin_enable_disable_command
(constructor) VLIB_CLI_COMMAND (det44_plugin_enable_disable_command)
#define det44_interface_is_outside(i)
Check if Deterministic NAT interface is outside.
static vlib_cli_command_t det44_reverse_command
(constructor) VLIB_CLI_COMMAND (det44_reverse_command)
u32 sw_if_indices[VLIB_FRAME_SIZE]
static_always_inline snat_det_map_t * snat_det_map_by_out(ip4_address_t *out_addr)