|
FD.io VPP
v21.06-3-gbb25fbf28
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;
317 REPLY_MACRO (VL_API_NAT44_ADD_DEL_ADDRESS_RANGE_REPLY);
332 if (
a->fib_index != ~0)
340 rmp->
flags |= NAT_API_IS_TWICE_NAT;
368 vl_api_nat44_interface_add_del_feature_reply_t *rmp;
383 REPLY_MACRO (VL_API_NAT44_INTERFACE_ADD_DEL_FEATURE_REPLY);
399 rmp->
flags |= NAT_API_IS_INSIDE;
401 rmp->
flags |= NAT_API_IS_OUTSIDE;
430 vl_api_nat44_interface_add_del_output_feature_reply_t *rmp;
437 mp->
flags & NAT_API_IS_INSIDE,
441 REPLY_MACRO (VL_API_NAT44_INTERFACE_ADD_DEL_OUTPUT_FEATURE_REPLY);
460 rmp->
flags |= NAT_API_IS_INSIDE;
488 vl_api_nat44_add_del_static_mapping_reply_t *rmp;
490 u16 local_port = 0, external_port = 0;
500 if (!(mp->
flags & NAT_API_IS_ADDR_ONLY))
510 if (mp->
flags & NAT_API_IS_TWICE_NAT)
512 else if (mp->
flags & NAT_API_IS_SELF_TWICE_NAT)
514 mp->
tag[
sizeof (mp->
tag) - 1] = 0;
519 local_addr, external_addr, local_port, external_port,
vrf_id,
521 twice_nat, mp->
flags & NAT_API_IS_OUT2IN_ONLY, tag, 0, pool_addr, 0);
524 REPLY_MACRO (VL_API_NAT44_ADD_DEL_STATIC_MAPPING_REPLY);
532 vl_api_nat44_add_del_static_mapping_v2_reply_t *rmp;
534 u16 local_port = 0, external_port = 0;
545 if (!(mp->
flags & NAT_API_IS_ADDR_ONLY))
555 if (mp->
flags & NAT_API_IS_TWICE_NAT)
557 else if (mp->
flags & NAT_API_IS_SELF_TWICE_NAT)
559 mp->
tag[
sizeof (mp->
tag) - 1] = 0;
565 mp->
flags & NAT_API_IS_ADDR_ONLY,
566 external_sw_if_index,
proto,
568 mp->
flags & NAT_API_IS_OUT2IN_ONLY, tag, 0,
572 REPLY_MACRO (VL_API_NAT44_ADD_DEL_STATIC_MAPPING_V2_REPLY);
595 rmp->
flags |= NAT_API_IS_TWICE_NAT;
597 rmp->
flags |= NAT_API_IS_SELF_TWICE_NAT;
600 rmp->
flags |= NAT_API_IS_OUT2IN_ONLY;
604 rmp->
flags |= NAT_API_IS_ADDR_ONLY;
637 rmp->
flags |= NAT_API_IS_TWICE_NAT;
641 rmp->
flags |= NAT_API_IS_ADDR_ONLY;
688 vl_api_nat44_add_del_identity_mapping_reply_t *rmp;
696 if (!(mp->
flags & NAT_API_IS_ADDR_ONLY))
707 mp->
tag[
sizeof (mp->
tag) - 1] = 0;
717 REPLY_MACRO (VL_API_NAT44_ADD_DEL_IDENTITY_MAPPING_REPLY);
734 rmp->
flags |= NAT_API_IS_ADDR_ONLY;
762 rmp->
flags = (vl_api_nat_config_flags_t) NAT_API_IS_ADDR_ONLY;
813 vl_api_nat44_add_del_interface_addr_reply_t *rmp;
820 rv = VNET_API_ERROR_FEATURE_DISABLED;
829 mp->
flags & NAT_API_IS_TWICE_NAT);
834 REPLY_MACRO (VL_API_NAT44_ADD_DEL_INTERFACE_ADDR_REPLY);
852 rmp->
flags = (vl_api_nat_config_flags_t) NAT_API_IS_TWICE_NAT;
882 u32 addr_port_pair_num)
886 vl_api_nat44_lb_addr_port_t *ap;
888 for (
i = 0;
i < addr_port_pair_num;
i++)
890 ap = &addr_port_pairs[
i];
891 clib_memset (&lb_addr_port, 0,
sizeof (lb_addr_port));
893 lb_addr_port.port = ap->port;
894 lb_addr_port.probability = ap->probability;
895 lb_addr_port.vrf_id = clib_net_to_host_u32 (ap->vrf_id);
896 vec_add1 (lb_addr_port_pairs, lb_addr_port);
899 return lb_addr_port_pairs;
907 vl_api_nat44_add_del_lb_static_mapping_reply_t *rmp;
920 if (mp->
flags & NAT_API_IS_TWICE_NAT)
922 else if (mp->
flags & NAT_API_IS_SELF_TWICE_NAT)
924 mp->
tag[
sizeof (mp->
tag) - 1] = 0;
930 mp->
flags & NAT_API_IS_OUT2IN_ONLY, tag,
931 clib_net_to_host_u32 (mp->
affinity));
935 REPLY_MACRO (VL_API_NAT44_ADD_DEL_LB_STATIC_MAPPING_REPLY);
943 vl_api_nat44_lb_static_mapping_add_del_local_reply_t *rmp;
954 clib_net_to_host_u32 (mp->
local.vrf_id), mp->
local.probability,
957 REPLY_MACRO (VL_API_NAT44_LB_STATIC_MAPPING_ADD_DEL_LOCAL_REPLY);
967 vl_api_nat44_lb_addr_port_t *locals;
982 rmp->
flags |= NAT_API_IS_TWICE_NAT;
984 rmp->
flags |= NAT_API_IS_SELF_TWICE_NAT;
986 rmp->
flags |= NAT_API_IS_OUT2IN_ONLY;
990 locals = (vl_api_nat44_lb_addr_port_t *) rmp->
locals;
994 locals->port = ap->
port;
996 locals->vrf_id = ntohl (ap->
vrf_id);
1028 vl_api_nat44_del_session_reply_t *rmp;
1041 is_in = mp->
flags & NAT_API_IS_INSIDE;
1053 vl_api_nat44_forwarding_enable_disable_reply_t *rmp;
1057 REPLY_MACRO (VL_API_NAT44_FORWARDING_ENABLE_DISABLE_REPLY);
1091 vl_api_nat_set_addr_and_port_alloc_alg_reply_t *rmp;
1092 int rv = VNET_API_ERROR_UNSUPPORTED;
1093 REPLY_MACRO (VL_API_NAT_SET_ADDR_AND_PORT_ALLOC_ALG_REPLY);
1102 int rv = VNET_API_ERROR_UNSUPPORTED;
1103 REPLY_MACRO (VL_API_NAT_GET_ADDR_AND_PORT_ALLOC_ALG_REPLY);
1110 vl_api_nat_ha_set_listener_reply_t *rmp;
1111 int rv = VNET_API_ERROR_UNSUPPORTED;
1120 int rv = VNET_API_ERROR_UNSUPPORTED;
1128 vl_api_nat_ha_set_failover_reply_t *rmp;
1129 int rv = VNET_API_ERROR_UNSUPPORTED;
1138 int rv = VNET_API_ERROR_UNSUPPORTED;
1146 vl_api_nat_ha_flush_reply_t *rmp;
1147 int rv = VNET_API_ERROR_UNSUPPORTED;
1155 vl_api_nat_ha_resync_reply_t *rmp;
1156 int rv = VNET_API_ERROR_UNSUPPORTED;
1164 vl_api_nat44_del_user_reply_t *rmp;
1165 int rv = VNET_API_ERROR_UNSUPPORTED;
1173 vl_api_nat44_session_cleanup_reply_t *rmp;
1174 int rv = VNET_API_ERROR_UNSUPPORTED;
1184 vl_api_nat44_plugin_enable_disable_reply_t *rmp;
1189 if (!(mp->
flags & NAT44_API_IS_ENDPOINT_DEPENDENT) ||
1190 (mp->
flags & NAT44_API_IS_OUT2IN_DPO) || mp->
users ||
1193 rv = VNET_API_ERROR_UNSUPPORTED;
1197 c.static_mapping_only = mp->
flags & NAT44_API_IS_STATIC_MAPPING_ONLY;
1198 c.connection_tracking = mp->
flags & NAT44_API_IS_CONNECTION_TRACKING;
1213 REPLY_MACRO (VL_API_NAT44_PLUGIN_ENABLE_DISABLE_REPLY);
1224 ({ rmp->
vpe_pid = ntohl (getpid ()); }));
1257 VL_API_NAT_SHOW_CONFIG_2_REPLY, ({
1284 VL_API_NAT44_SHOW_RUNNING_CONFIG_REPLY, ({
1371 k.
addr = s->in2out.addr;
1475 rmp->
flags |= NAT_API_IS_STATIC;
1478 rmp->
flags |= NAT_API_IS_TWICE_NAT;
1481 rmp->
flags |= NAT_API_IS_EXT_HOST_VALID;
1483 rmp->
last_heard = clib_host_to_net_u64 ((
u64) s->last_heard);
1484 rmp->
total_bytes = clib_host_to_net_u64 (s->total_bytes);
1539 if (s->in2out.addr.as_u32 == ukey.
addr.
as_u32)
1548 #include <nat/nat44-ed/nat44_ed.api.c>
snat_static_map_resolve_t * to_resolve
vl_api_nat_config_flags_t flags
int nat_ipfix_logging_enabled()
vl_api_nat_timeouts_t timeouts
vl_api_nat_config_flags_t flags
int snat_set_workers(uword *bitmap)
Set NAT plugin workers.
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)
nat44_lb_addr_port_t * locals
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.
struct nat_timeouts_t::@732 tcp
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
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.
#define is_out2in_only_static_mapping(sm)
Check if NAT static mapping match only out2in direction.
#define nat_interface_is_inside(i)
Check if NAT interface is inside.
#define is_ed_session(s)
Check if NAT session is endpoint dependent.
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)
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
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)
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)
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)
#define is_lb_static_mapping(sm)
Check if NAT static mapping is load-balancing.
vlib_worker_thread_t * vlib_worker_threads
clib_bihash_8_8_t user_hash
#define snat_is_session_static(s)
Check if SNAT session is created from static mapping.
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)
Set HA failover (remote settings)
static void vl_api_nat_set_addr_and_port_alloc_alg_t_handler(vl_api_nat_set_addr_and_port_alloc_alg_t *mp)
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 setup_message_id_table(api_main_t *am)
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.
#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)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#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.
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)
int nat44_lb_static_mapping_add_del_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)
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.
int snat_add_interface_address(snat_main_t *sm, u32 sw_if_index, int is_del, u8 twice_nat)
Add/delete NAT44 pool address from specific interface.
vl_api_nat_config_flags_t flags
static void vl_api_nat_ha_get_failover_t_handler(vl_api_nat_ha_get_failover_t *mp)
int nat44_del_ed_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.
bool static_mapping_connection_tracking
sll srl srl sll sra u16x4 i
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.
#define snat_is_unk_proto_session(s)
Check if SNAT session for unknown protocol.
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 snat_interface_add_del(u32 sw_if_index, u8 is_inside, int is_del)
Enable/disable NAT44 feature on the interface.
twice_nat_type_t twice_nat
snat_session_t * sessions
Add/delete NAT44 identity mapping.
int nat44_plugin_enable(nat44_config_t c)
Enable NAT44 plugin.
vl_api_ip4_address_t local_ip_address
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)
vl_api_ip4_address_t ext_host_address
@ NAT44_IS_ENDPOINT_DEPENDENT
Add/delete NAT44 load-balancing static mapping rule.
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)
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, u32 sw_if_index, nat_protocol_t proto, int is_add, twice_nat_type_t twice_nat, u8 out2in_only, u8 *tag, u8 identity_nat, ip4_address_t pool_addr, int exact)
Add/delete NAT44 static mapping.
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)
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
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)
int snat_del_address(snat_main_t *sm, ip4_address_t addr, u8 delete_sm, u8 twice_nat)
Delete external address from NAT44 pool.
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)
#define is_identity_static_mapping(sm)
Check if NAT static mapping is identity NAT.
static void vl_api_nat_ha_resync_t_handler(vl_api_nat_ha_resync_t *mp)
int snat_interface_add_del_output_feature(u32 sw_if_index, u8 is_inside, int is_del)
Enable/disable NAT44 output feature on the interface (postrouting NAT)
#define is_addr_only_static_mapping(sm)
Check if NAT static mapping is address only (1:1NAT).
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)
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
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
#define is_twice_nat_session(s)
Check if NAT session is twice NAT.
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)
#define is_fwd_bypass_session(s)
Check if NAT session is forwarding bypass.
static void vl_api_nat_set_workers_t_handler(vl_api_nat_set_workers_t *mp)
#define nat_interface_is_outside(i)
Check if NAT interface is outside.
int nat44_plugin_disable()
Disable NAT44 plugin.
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)
int snat_add_address(snat_main_t *sm, ip4_address_t *addr, u32 vrf_id, u8 twice_nat)
Add external address to NAT44 pool.
int nat44_add_del_lb_static_mapping(ip4_address_t e_addr, u16 e_port, nat_protocol_t proto, nat44_lb_addr_port_t *locals, u8 is_add, twice_nat_type_t twice_nat, u8 out2in_only, u8 *tag, u32 affinity)
Add/delete static mapping with load-balancing (multiple backends)
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
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)
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)
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
DEPRECATED: Show NAT plugin startup config reply.