|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
31 #include <nat/nat44-ed/nat44_ed.api_enum.h>
32 #include <nat/nat44-ed/nat44_ed.api_types.h>
34 #define REPLY_MSG_ID_BASE sm->msg_id_base
45 vl_api_nat44_ed_plugin_enable_disable_reply_t *rmp;
50 c.static_mapping_only = mp->
flags & NAT44_API_IS_STATIC_MAPPING_ONLY;
51 c.connection_tracking = mp->
flags & NAT44_API_IS_CONNECTION_TRACKING;
65 REPLY_MACRO (VL_API_NAT44_ED_PLUGIN_ENABLE_DISABLE_REPLY);
72 vl_api_nat44_ed_set_fq_options_reply_t *rmp;
101 vl_api_nat_set_workers_reply_t *rmp;
110 rv = VNET_API_ERROR_FEATURE_DISABLED;
164 vl_api_nat44_set_session_limit_reply_t *rmp;
170 REPLY_MACRO (VL_API_NAT44_SET_SESSION_LIMIT_REPLY);
177 vl_api_nat_set_log_level_reply_t *rmp;
181 rv = VNET_API_ERROR_UNSUPPORTED;
193 vl_api_nat_ipfix_enable_disable_reply_t *rmp;
199 clib_host_to_net_u16 (mp->
src_port));
201 REPLY_MACRO (VL_API_NAT_IPFIX_ENABLE_DISABLE_REPLY);
208 vl_api_nat_set_timeouts_reply_t *rmp;
239 vl_api_nat_set_mss_clamping_reply_t *rmp;
269 vl_api_nat44_add_del_address_range_reply_t *rmp;
271 u8 is_add, twice_nat;
272 u32 start_host_order, end_host_order;
280 rv = VNET_API_ERROR_FEATURE_DISABLED;
285 twice_nat = mp->
flags & NAT_API_IS_TWICE_NAT;
288 start_host_order = clib_host_to_net_u32 (
tmp[0]);
290 end_host_order = clib_host_to_net_u32 (
tmp[0]);
292 count = (end_host_order - start_host_order) + 1;
321 REPLY_MACRO (VL_API_NAT44_ADD_DEL_ADDRESS_RANGE_REPLY);
336 if (
a->fib_index != ~0)
344 rmp->
flags |= NAT_API_IS_TWICE_NAT;
371 vl_api_nat44_interface_add_del_feature_reply_t *rmp;
379 is_inside = mp->
flags & NAT_API_IS_INSIDE;
392 REPLY_MACRO (VL_API_NAT44_INTERFACE_ADD_DEL_FEATURE_REPLY);
408 rmp->
flags |= NAT_API_IS_INSIDE;
410 rmp->
flags |= NAT_API_IS_OUTSIDE;
438 vl_api_nat44_interface_add_del_output_feature_reply_t *rmp;
457 REPLY_MACRO (VL_API_NAT44_INTERFACE_ADD_DEL_OUTPUT_FEATURE_REPLY);
476 rmp->
flags |= NAT_API_IS_INSIDE;
503 vl_api_nat44_add_del_static_mapping_reply_t *rmp;
510 u16 l_port = 0, e_port = 0;
516 if (mp->
flags & NAT_API_IS_ADDR_ONLY)
527 if (mp->
flags & NAT_API_IS_TWICE_NAT)
532 if (mp->
flags & NAT_API_IS_SELF_TWICE_NAT)
537 if (mp->
flags & NAT_API_IS_OUT2IN_ONLY)
556 mp->
tag[
sizeof (mp->
tag) - 1] = 0;
570 REPLY_MACRO (VL_API_NAT44_ADD_DEL_STATIC_MAPPING_REPLY);
577 vl_api_nat44_add_del_static_mapping_v2_reply_t *rmp;
584 u16 l_port = 0, e_port = 0;
591 if (pool_addr.
as_u32 != 0)
596 if (mp->
flags & NAT_API_IS_ADDR_ONLY)
606 if (mp->
flags & NAT_API_IS_TWICE_NAT)
611 if (mp->
flags & NAT_API_IS_SELF_TWICE_NAT)
616 if (mp->
flags & NAT_API_IS_OUT2IN_ONLY)
636 mp->
tag[
sizeof (mp->
tag) - 1] = 0;
650 REPLY_MACRO (VL_API_NAT44_ADD_DEL_STATIC_MAPPING_V2_REPLY);
676 rmp->
flags |= NAT_API_IS_SELF_TWICE_NAT;
681 rmp->
flags |= NAT_API_IS_OUT2IN_ONLY;
686 rmp->
flags |= NAT_API_IS_TWICE_NAT;
691 rmp->
flags |= NAT_API_IS_ADDR_ONLY;
724 rmp->
flags |= NAT_API_IS_TWICE_NAT;
728 rmp->
flags |= NAT_API_IS_ADDR_ONLY;
774 vl_api_nat44_add_del_identity_mapping_reply_t *rmp;
787 if (mp->
flags & NAT_API_IS_ADDR_ONLY)
811 mp->
tag[
sizeof (mp->
tag) - 1] = 0;
824 REPLY_MACRO (VL_API_NAT44_ADD_DEL_IDENTITY_MAPPING_REPLY);
841 rmp->
flags |= NAT_API_IS_ADDR_ONLY;
869 rmp->
flags = (vl_api_nat_config_flags_t) NAT_API_IS_ADDR_ONLY;
920 vl_api_nat44_add_del_interface_addr_reply_t *rmp;
927 rv = VNET_API_ERROR_FEATURE_DISABLED;
933 twice_nat = mp->
flags & NAT_API_IS_TWICE_NAT;
947 REPLY_MACRO (VL_API_NAT44_ADD_DEL_INTERFACE_ADDR_REPLY);
965 rmp->
flags = (vl_api_nat_config_flags_t) NAT_API_IS_TWICE_NAT;
995 u32 addr_port_pair_num)
999 vl_api_nat44_lb_addr_port_t *ap;
1001 for (
i = 0;
i < addr_port_pair_num;
i++)
1003 ap = &addr_port_pairs[
i];
1004 clib_memset (&lb_addr_port, 0,
sizeof (lb_addr_port));
1006 lb_addr_port.port = ap->port;
1007 lb_addr_port.probability = ap->probability;
1008 lb_addr_port.vrf_id = clib_net_to_host_u32 (ap->vrf_id);
1009 vec_add1 (lb_addr_port_pairs, lb_addr_port);
1012 return lb_addr_port_pairs;
1020 vl_api_nat44_add_del_lb_static_mapping_reply_t *rmp;
1033 if (mp->
flags & NAT_API_IS_TWICE_NAT)
1037 else if (mp->
flags & NAT_API_IS_SELF_TWICE_NAT)
1042 if (mp->
flags & NAT_API_IS_OUT2IN_ONLY)
1049 mp->
tag[
sizeof (mp->
tag) - 1] = 0;
1055 clib_net_to_host_u32 (mp->
affinity));
1065 REPLY_MACRO (VL_API_NAT44_ADD_DEL_LB_STATIC_MAPPING_REPLY);
1073 vl_api_nat44_lb_static_mapping_add_del_local_reply_t *rmp;
1084 clib_net_to_host_u32 (mp->
local.vrf_id), mp->
local.probability,
1087 REPLY_MACRO (VL_API_NAT44_LB_STATIC_MAPPING_ADD_DEL_LOCAL_REPLY);
1097 vl_api_nat44_lb_addr_port_t *locals;
1113 rmp->
flags |= NAT_API_IS_SELF_TWICE_NAT;
1118 rmp->
flags |= NAT_API_IS_OUT2IN_ONLY;
1123 rmp->
flags |= NAT_API_IS_TWICE_NAT;
1129 locals = (vl_api_nat44_lb_addr_port_t *) rmp->
locals;
1133 locals->port = ap->
port;
1135 locals->vrf_id = ntohl (ap->
vrf_id);
1167 vl_api_nat44_del_session_reply_t *rmp;
1180 is_in = mp->
flags & NAT_API_IS_INSIDE;
1192 vl_api_nat44_forwarding_enable_disable_reply_t *rmp;
1196 REPLY_MACRO (VL_API_NAT44_FORWARDING_ENABLE_DISABLE_REPLY);
1230 vl_api_nat_set_addr_and_port_alloc_alg_reply_t *rmp;
1231 int rv = VNET_API_ERROR_UNSUPPORTED;
1232 REPLY_MACRO (VL_API_NAT_SET_ADDR_AND_PORT_ALLOC_ALG_REPLY);
1241 int rv = VNET_API_ERROR_UNSUPPORTED;
1242 REPLY_MACRO (VL_API_NAT_GET_ADDR_AND_PORT_ALLOC_ALG_REPLY);
1249 vl_api_nat_ha_set_listener_reply_t *rmp;
1250 int rv = VNET_API_ERROR_UNSUPPORTED;
1259 int rv = VNET_API_ERROR_UNSUPPORTED;
1267 vl_api_nat_ha_set_failover_reply_t *rmp;
1268 int rv = VNET_API_ERROR_UNSUPPORTED;
1277 int rv = VNET_API_ERROR_UNSUPPORTED;
1285 vl_api_nat_ha_flush_reply_t *rmp;
1286 int rv = VNET_API_ERROR_UNSUPPORTED;
1294 vl_api_nat_ha_resync_reply_t *rmp;
1295 int rv = VNET_API_ERROR_UNSUPPORTED;
1303 vl_api_nat44_del_user_reply_t *rmp;
1304 int rv = VNET_API_ERROR_UNSUPPORTED;
1312 vl_api_nat44_session_cleanup_reply_t *rmp;
1313 int rv = VNET_API_ERROR_UNSUPPORTED;
1323 vl_api_nat44_plugin_enable_disable_reply_t *rmp;
1330 rv = VNET_API_ERROR_UNSUPPORTED;
1334 c.static_mapping_only = mp->
flags & NAT44_API_IS_STATIC_MAPPING_ONLY;
1335 c.connection_tracking = mp->
flags & NAT44_API_IS_CONNECTION_TRACKING;
1350 REPLY_MACRO (VL_API_NAT44_PLUGIN_ENABLE_DISABLE_REPLY);
1361 ({ rmp->
vpe_pid = ntohl (getpid ()); }));
1394 VL_API_NAT_SHOW_CONFIG_2_REPLY, ({
1421 VL_API_NAT44_SHOW_RUNNING_CONFIG_REPLY, ({
1508 k.
addr = s->in2out.addr;
1612 rmp->
flags |= NAT_API_IS_STATIC;
1615 rmp->
flags |= NAT_API_IS_TWICE_NAT;
1617 rmp->
flags |= NAT_API_IS_EXT_HOST_VALID;
1619 rmp->
last_heard = clib_host_to_net_u64 ((
u64) s->last_heard);
1620 rmp->
total_bytes = clib_host_to_net_u64 (s->total_bytes);
1672 if (s->in2out.addr.as_u32 == ukey.
addr.
as_u32)
1681 #include <nat/nat44-ed/nat44_ed.api.c>
static bool nat44_ed_is_interface_outside(snat_interface_t *i)
Check if NAT interface is outside.
snat_static_map_resolve_t * to_resolve
static bool is_sm_lb(u32 f)
vl_api_nat_config_flags_t flags
int nat_ipfix_logging_enabled()
vl_api_nat_timeouts_t timeouts
static bool snat_is_unk_proto_session(snat_session_t *s)
Check if SNAT session for unknown protocol.
struct nat_timeouts_t::@742 tcp
int snat_set_workers(uword *bitmap)
vnet_interface_main_t * im
static void vl_api_nat_show_config_2_t_handler(vl_api_nat_show_config_2_t *mp)
#define VALIDATE_SW_IF_INDEX(mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static nat44_lb_addr_port_t * unformat_nat44_lb_addr_port(vl_api_nat44_lb_addr_port_t *addr_port_pairs, u32 addr_port_pair_num)
int nat44_ed_del_static_mapping(ip4_address_t l_addr, ip4_address_t e_addr, u16 l_port, u16 e_port, nat_protocol_t proto, u32 vrf_id, u32 sw_if_index, u32 flags)
nat44_lb_addr_port_t * locals
int nat44_ed_add_output_interface(u32 sw_if_index)
static void send_nat44_address_details(snat_address_t *a, vl_api_registration_t *reg, u32 context, u8 twice_nat)
snat_static_mapping_t * static_mappings
static void nat_ed_users_create(snat_main_per_thread_data_t *tsm, user_create_helper_t *uch)
static void vl_api_nat44_lb_static_mapping_dump_t_handler(vl_api_nat44_lb_static_mapping_dump_t *mp)
u8 * format_user_kvp(u8 *s, va_list *args)
snat_address_t * twice_nat_addresses
#define nat_log_info(...)
static void vl_api_nat44_address_dump_t_handler(vl_api_nat44_address_dump_t *mp)
Show NAT handoff frame queue options reply.
vl_api_interface_index_t sw_if_index
#define REPLY_MACRO2(t, body)
static void vl_api_nat44_add_del_static_mapping_t_handler(vl_api_nat44_add_del_static_mapping_t *mp)
static void send_nat44_static_mapping_details(snat_static_mapping_t *m, vl_api_registration_t *reg, u32 context)
Run nat44 garbage collection.
static void vl_api_nat_ha_get_listener_t_handler(vl_api_nat_ha_get_listener_t *mp)
#define clib_memcpy(d, s, n)
Show NAT44 plugin running config reply.
vl_api_ip4_address_t external_addr
ip4_main_t ip4_main
Global ip4 main structure.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
vl_api_nat44_config_flags_t flags
int nat44_ed_add_static_mapping(ip4_address_t l_addr, ip4_address_t e_addr, u16 l_port, u16 e_port, nat_protocol_t proto, u32 vrf_id, u32 sw_if_index, u32 flags, ip4_address_t pool_addr, u8 *tag)
Get values of timeouts for NAT sessions (seconds)
bool ipfix_logging_enabled
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vl_api_interface_index_t sw_if_index
Add/delete NAT44 load-balancing static mapping rule backend.
vl_api_nat_config_flags_t flags
static void vl_api_nat_control_ping_t_handler(vl_api_nat_control_ping_t *mp)
int nat44_ed_del_session(snat_main_t *sm, ip4_address_t *addr, u16 port, ip4_address_t *eh_addr, u16 eh_port, u8 proto, u32 vrf_id, int is_in)
Delete NAT44 endpoint-dependent session.
static void vl_api_nat_ha_flush_t_handler(vl_api_nat_ha_flush_t *mp)
u32 max_translations_per_user
vl_api_interface_index_t sw_if_index
static nat_protocol_t ip_proto_to_nat_proto(u8 ip_proto)
Common NAT inline functions.
vl_api_ip4_address_t external_ip_address
NAT44 interface details response.
vl_api_interface_index_t sw_if_index
Get HA failover/remote settings.
Show NAT plugin startup config.
#define REPLY_MACRO2_ZERO(t, body)
vl_api_ip4_address_t external_ip_address
snat_interface_t * interfaces
vl_api_interface_index_t sw_if_index
#define NAT_SM_FLAG_ADDR_ONLY
vl_api_nat_config_flags_t flags
Get HA listener/local configuration reply.
Set values of timeouts for NAT sessions (seconds)
vl_api_nat_config_flags_t flags
Dump NAT44 static mappings.
vl_api_ip4_address_t ip_address
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static void vl_api_nat_get_addr_and_port_alloc_alg_t_handler(vl_api_nat_get_addr_and_port_alloc_alg_t *mp)
static bool is_sm_out2in_only(u32 f)
Resync HA (resend existing sessions to new failover)
Enable/disable NAT44ED plugin.
static void vl_api_nat44_forwarding_enable_disable_t_handler(vl_api_nat44_forwarding_enable_disable_t *mp)
vl_api_nat_config_flags_t flags
vl_api_ip4_address_t ext_host_nat_address
Set TCP MSS rewriting configuration.
vl_api_ip4_address_t outside_ip_address
static void send_nat44_interface_addr_details(u32 sw_if_index, vl_api_registration_t *reg, u32 context, u8 twice_nat)
void nat44_ed_forwarding_enable_disable(u8 is_enable)
int nat44_ed_add_lb_static_mapping(ip4_address_t e_addr, u16 e_port, nat_protocol_t proto, nat44_lb_addr_port_t *locals, u32 flags, u8 *tag, u32 affinity)
Control ping from the client to the server response.
snat_address_t * addresses
@ NAT44_IS_STATIC_MAPPING_ONLY
vl_api_ip4_address_t local_ip_address
static void vl_api_nat44_plugin_enable_disable_t_handler(vl_api_nat44_plugin_enable_disable_t *mp)
vlib_worker_thread_t * vlib_worker_threads
clib_bihash_8_8_t user_hash
Response to check if forwarding is enabled or disabled.
static void send_nat44_interface_details(snat_interface_t *i, vl_api_registration_t *reg, u32 context)
int nat44_ed_add_interface(u32 sw_if_index, u8 is_inside)
Set HA failover (remote settings)
#define NAT_SM_FLAG_OUT2IN_ONLY
static void vl_api_nat_set_addr_and_port_alloc_alg_t_handler(vl_api_nat_set_addr_and_port_alloc_alg_t *mp)
#define NAT_SM_FLAG_IDENTITY_NAT
vl_api_interface_index_t sw_if_index
vl_api_ip4_address_t external_addr
vl_api_nat_config_flags_t flags
NAT44 load-balancing static mapping rule details response.
vl_api_nat44_config_flags_t flags
static void vl_api_nat44_identity_mapping_dump_t_handler(vl_api_nat44_identity_mapping_dump_t *mp)
vl_api_ip4_address_t pool_ip_address
static void vl_api_nat44_add_del_lb_static_mapping_t_handler(vl_api_nat44_add_del_lb_static_mapping_t *mp)
static void vl_api_nat_get_mss_clamping_t_handler(vl_api_nat_get_mss_clamping_t *mp)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static void vl_api_nat44_set_session_limit_t_handler(vl_api_nat44_set_session_limit_t *mp)
static void vl_api_nat44_forwarding_is_enabled_t_handler(vl_api_nat44_forwarding_is_enabled_t *mp)
static void vl_api_nat_show_config_t_handler(vl_api_nat_show_config_t *mp)
Get address and port assignment algorithm.
static void vl_api_nat44_user_dump_t_handler(vl_api_nat44_user_dump_t *mp)
static void vl_api_nat44_static_mapping_dump_t_handler(vl_api_nat44_static_mapping_dump_t *mp)
A protocol Independent FIB table.
Get values of timeouts for NAT sessions reply.
static bool is_sm_twice_nat(u32 f)
#define pool_foreach(VAR, POOL)
Iterate through pool.
vl_api_ip4_address_t external_addr
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
snat_main_per_thread_data_t * per_thread_data
static void vl_api_nat44_interface_output_feature_dump_t_handler(vl_api_nat44_interface_output_feature_dump_t *mp)
static void send_nat44_static_map_resolve_details(snat_static_map_resolve_t *m, vl_api_registration_t *reg, u32 context)
int nat44_ed_del_output_interface(u32 sw_if_index)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
int nat44_ed_del_interface_address(u32 sw_if_index, u8 twice_nat)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
u32 ft_table_id
Table ID (hash key) for this FIB.
u32 max_translations_per_user
Dump interfaces with NAT44 feature.
static void vl_api_nat44_lb_static_mapping_add_del_local_t_handler(vl_api_nat44_lb_static_mapping_add_del_local_t *mp)
static void vl_api_nat44_del_session_t_handler(vl_api_nat44_del_session_t *mp)
An API client registration, only in vpp/vlib.
static void setup_message_id_table(api_main_t *am)
Enable/disable NAT IPFIX logging.
vl_api_nat_config_flags_t flags
static_always_inline u8 nat_proto_to_ip_proto(nat_protocol_t nat_proto)
static bool is_sm_addr_only(u32 f)
vl_api_ip4_address_t local_ip_address
static void send_nat44_lb_static_mapping_details(snat_static_mapping_t *m, vl_api_registration_t *reg, u32 context)
Set HA listener (local settings)
clib_error_t * nat44_api_hookup(vlib_main_t *vm)
NAT44 static mapping details response.
Flush the current HA data (for testing)
NAT44 pool addresses interfaces details response.
static_always_inline u32 nat_calc_bihash_buckets(u32 n_elts)
Set NAT handoff frame queue options.
#define clib_bitmap_free(v)
Free a bitmap.
vl_api_nat_config_flags_t flags
#define NAT_SM_FLAG_TWICE_NAT
static void vl_api_nat_ha_get_failover_t_handler(vl_api_nat_ha_get_failover_t *mp)
#define NAT_SM_FLAG_EXACT_ADDRESS
static bool nat44_ed_is_session_static(snat_session_t *s)
Check if SNAT session is created from static mapping.
bool static_mapping_connection_tracking
vl_api_nat_config_flags_t flags
vl_api_ip4_address_t last_ip_address
static void vl_api_nat_ipfix_enable_disable_t_handler(vl_api_nat_ipfix_enable_disable_t *mp)
static void send_nat_worker_details(u32 worker_index, vl_api_registration_t *reg, u32 context)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
Set address and port assignment algorithm.
vl_api_interface_index_t sw_if_index
int nat44_set_session_limit(u32 session_limit, u32 vrf_id)
Set NAT44 session limit (session limit, vrf id)
Dump NAT44 pool addresses interfaces.
Dump NAT44 load-balancing static mapping rules.
vl_api_ip4_address_t address
Show NAT plugin startup config.
vl_api_ip4_address_t ip_address
static void send_nat44_identity_mapping_details(snat_static_mapping_t *m, int index, vl_api_registration_t *reg, u32 context)
static void vl_api_nat44_interface_add_del_output_feature_t_handler(vl_api_nat44_interface_add_del_output_feature_t *mp)
static void vl_api_nat44_del_user_t_handler(vl_api_nat44_del_user_t *mp)
int nat44_ed_add_del_lb_static_mapping_local(ip4_address_t e_addr, u16 e_port, ip4_address_t l_addr, u16 l_port, nat_protocol_t proto, u32 vrf_id, u8 probability, u8 is_add)
snat_session_t * sessions
Add/delete NAT44 identity mapping.
int nat44_plugin_enable(nat44_config_t c)
vl_api_ip4_address_t local_ip_address
int nat44_ed_add_address(ip4_address_t *addr, u32 vrf_id, u8 twice_nat)
int nat44_ed_set_frame_queue_nelts(u32 frame_queue_nelts)
static void vl_api_nat_ha_set_failover_t_handler(vl_api_nat_ha_set_failover_t *mp)
vl_api_nat_config_flags_t flags
vl_api_nat_config_flags_t flags
Show NAT plugin startup config reply.
vl_api_nat44_lb_addr_port_t locals[local_num]
vl_api_interface_index_t sw_if_index
static void increment_v4_address(ip4_address_t *a)
#define BAD_SW_IF_INDEX_LABEL
static void nat_ed_users_destroy(user_create_helper_t *uch)
static bool nat44_ed_is_twice_nat_session(snat_session_t *s)
Check if NAT session is twice NAT.
vl_api_ip4_address_t ext_host_address
@ NAT44_IS_ENDPOINT_DEPENDENT
Add/delete NAT44 load-balancing static mapping rule.
int nat44_ed_del_lb_static_mapping(ip4_address_t e_addr, u16 e_port, nat_protocol_t proto, u32 flags)
vl_api_nat_config_flags_t flags
#define vec_free(V)
Free vector's memory (no header).
vl_api_nat_config_flags_t flags
vl_api_ip4_address_t ip_address
int nat_ipfix_logging_enable_disable(int enable, u32 domain_id, u16 src_port)
Enable/disable NAT plugin IPFIX logging.
#define pool_foreach_index(i, v)
static void vl_api_nat_set_mss_clamping_t_handler(vl_api_nat_set_mss_clamping_t *mp)
vl_api_ip4_address_t ip_address
static void vl_api_nat_set_log_level_t_handler(vl_api_nat_set_log_level_t *mp)
description fragment has unexpected format
Dump interfaces with NAT44 output feature.
NAT44 interface with output feature details response.
static void vl_api_nat_ha_set_listener_t_handler(vl_api_nat_ha_set_listener_t *mp)
static bool is_sm_self_twice_nat(u32 f)
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
static bool nat44_ed_is_interface_inside(snat_interface_t *i)
Check if NAT interface is inside.
static bool is_sm_identity_nat(u32 f)
Add/delete NAT44 pool address from specific interfce.
static void vl_api_nat44_add_del_interface_addr_t_handler(vl_api_nat44_add_del_interface_addr_t *mp)
static void vl_api_nat44_show_running_config_t_handler(vl_api_nat44_show_running_config_t *mp)
Check if forwarding is enabled or disabled.
u32 * auto_add_sw_if_indices
Enable/disable NAT44 plugin.
static void nat_ed_user_create_helper(user_create_helper_t *uch, snat_session_t *s)
static void vl_api_nat_ha_resync_t_handler(vl_api_nat_ha_resync_t *mp)
vl_api_ip4_address_t external_ip_address
#define vec_foreach(var, vec)
Vector iterator.
Get HA failover/remote settings reply.
static void vl_api_nat_get_timeouts_t_handler(vl_api_nat_get_timeouts_t *mp)
8 octet key, 8 octet key value pair
static void vl_api_nat_set_timeouts_t_handler(vl_api_nat_set_timeouts_t *mp)
u32 max_translations_per_thread
Add/del NAT44 address range.
static uword pool_elts(void *v)
Number of active elements in a pool.
u32 nat44_ed_get_in2out_worker_index(vlib_buffer_t *b, ip4_header_t *ip, u32 rx_fib_index, u8 is_output)
Get HA listener/local configuration.
vl_api_nat_config_flags_t flags
static void vl_api_nat44_add_del_static_mapping_v2_t_handler(vl_api_nat44_add_del_static_mapping_v2_t *mp)
vl_api_nat_log_level_t log_level
Add/delete NAT44 static mapping.
Enable/disbale NAT44 as an interface output feature (postrouting in2out translation)
bool static_mapping_connection_tracking
static void vl_api_nat44_interface_add_del_feature_t_handler(vl_api_nat44_interface_add_del_feature_t *mp)
#define NAT_SM_FLAG_SWITCH_ADDRESS
vl_api_nat44_config_flags_t flags
vl_api_interface_index_t external_sw_if_index
vl_api_nat44_lb_addr_port_t local
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vl_api_interface_index_t external_sw_if_index
#define NAT_SM_FLAG_SELF_TWICE_NAT
NAT44 identity mapping details response.
static void send_nat44_interface_output_feature_details(snat_interface_t *i, vl_api_registration_t *reg, u32 context)
vl_api_nat_config_flags_t flags
NAT44 user's sessions response.
u32 max_translations_per_thread
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
vl_api_interface_index_t external_sw_if_index
Get TCP MSS rewriting configuration reply.
#define pool_free(p)
Free a pool.
ip4_address_t external_addr
static void vl_api_nat_worker_dump_t_handler(vl_api_nat_worker_dump_t *mp)
vl_api_ip4_address_t ip_address
static void send_nat44_user_details(snat_user_t *u, vl_api_registration_t *reg, u32 context)
static void vl_api_nat_set_workers_t_handler(vl_api_nat_set_workers_t *mp)
int nat44_plugin_disable()
Enable/disable NAT44 feature on the interface.
static void vl_api_nat44_ed_show_fq_options_t_handler(vl_api_nat44_ed_show_fq_options_t *mp)
Enable/disable forwarding for NAT44 Forward packets which don't match existing translation or static ...
Add/delete NAT44 static mapping.
vl_api_ip4_address_t first_ip_address
static void vl_api_nat44_interface_dump_t_handler(vl_api_nat44_interface_dump_t *mp)
vl_api_nat44_lb_addr_port_t locals[local_num]
Get TCP MSS rewriting configuration.
@ NAT44_IS_CONNECTION_TRACKING
Show NAT handoff frame queue options.
vl_api_ip4_address_t ext_host_address
static void vl_api_nat44_add_del_identity_mapping_t_handler(vl_api_nat44_add_del_identity_mapping_t *mp)
static void vl_api_nat44_ed_set_fq_options_t_handler(vl_api_nat44_ed_set_fq_options_t *mp)
NAT44 address details response.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
static void send_nat44_identity_map_resolve_details(snat_static_map_resolve_t *m, vl_api_registration_t *reg, u32 context)
Show NAT44 plugin running config.
vl_api_interface_index_t sw_if_index
NAT workers details response.
static void vl_api_nat44_ed_plugin_enable_disable_t_handler(vl_api_nat44_ed_plugin_enable_disable_t *mp)
vl_api_nat_config_flags_t flags
int nat44_ed_del_interface(u32 sw_if_index, u8 is_inside)
Control ping from client to api server request.
Get address and port assignment algorithm reply.
static void send_nat44_user_session_details(snat_session_t *s, vl_api_registration_t *reg, u32 context)
int nat44_ed_add_interface_address(u32 sw_if_index, u8 twice_nat)
u8 static_mapping_connection_tracking
static void vl_api_nat44_user_session_dump_t_handler(vl_api_nat44_user_session_dump_t *mp)
static void vl_api_nat44_interface_addr_dump_t_handler(vl_api_nat44_interface_addr_dump_t *mp)
int nat44_ed_del_address(ip4_address_t addr, u8 delete_sm, u8 twice_nat)
u32 * auto_add_sw_if_indices_twice_nat
static void vl_api_nat44_session_cleanup_t_handler(vl_api_nat44_session_cleanup_t *mp)
static uword * clib_bitmap_set_multiple(uword *bitmap, uword i, uword value, uword n_bits)
sets the ith through ith + n_bits bits in a bitmap
Dump NAT44 identity mappings.
static void vl_api_nat44_add_del_address_range_t_handler(vl_api_nat44_add_del_address_range_t *mp)
void * vl_msg_api_alloc(int nbytes)
snat_interface_t * output_feature_interfaces
vl_api_ip4_address_t inside_ip_address
vl_api_wireguard_peer_flags_t flags
DEPRECATED: Show NAT plugin startup config reply.