40 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 42 #define REPLY_MSG_ID_BASE sm->msg_id_base 46 #define vl_api_version(n,v) static u32 api_version=(v); 53 vl_print (handle, (char *)s); \ 62 vl_api_snat_add_address_range_reply_t *rmp;
64 u32 start_host_order, end_host_order;
72 rv = VNET_API_ERROR_UNIMPLEMENTED;
76 if (sm->static_mapping_only)
78 rv = VNET_API_ERROR_FEATURE_DISABLED;
83 start_host_order = clib_host_to_net_u32 (tmp[0]);
85 end_host_order = clib_host_to_net_u32 (tmp[0]);
87 count = (end_host_order - start_host_order) + 1;
89 vrf_id = clib_host_to_net_u32 (mp->
vrf_id);
98 for (i = 0; i < count; i++)
120 s =
format (0,
"SCRIPT: snat_add_address_range ");
137 memset (rmp, 0,
sizeof (*rmp));
138 rmp->_vl_msg_id = ntohs (VL_API_SNAT_ADDRESS_DETAILS + sm->msg_id_base);
175 s =
format (0,
"SCRIPT: snat_address_dump ");
185 vl_api_snat_interface_add_del_feature_reply_t *rmp;
196 REPLY_MACRO (VL_API_SNAT_INTERFACE_ADD_DEL_FEATURE_REPLY);
204 s =
format (0,
"SCRIPT: snat_interface_add_del_feature ");
205 s =
format (s,
"sw_if_index %d %s %s",
220 memset (rmp, 0,
sizeof (*rmp));
221 rmp->_vl_msg_id = ntohs (VL_API_SNAT_INTERFACE_DETAILS + sm->msg_id_base);
243 send_snat_interface_details(i, q, mp->context);
253 s =
format (0,
"SCRIPT: snat_interface_dump ");
261 vl_api_snat_add_static_mapping_reply_t *rmp;
263 u16 local_port = 0, external_port = 0;
264 u32 vrf_id, external_sw_if_index;
270 rv = VNET_API_ERROR_UNIMPLEMENTED;
278 local_port = clib_net_to_host_u16 (mp->
local_port);
281 vrf_id = clib_net_to_host_u32 (mp->
vrf_id);
287 external_sw_if_index, proto, mp->
is_add);
298 s =
format (0,
"SCRIPT: snat_add_static_mapping ");
299 s =
format (s,
"protocol %d local_addr %U external_addr %U ",
305 s =
format (s,
"local_port %d external_port %d ",
310 s =
format (s,
"vrf %d", clib_net_to_host_u32 (mp->
vrf_id));
313 s =
format (s,
"external_sw_if_index %d",
326 memset (rmp, 0,
sizeof (*rmp));
328 ntohs (VL_API_SNAT_STATIC_MAPPING_DETAILS + sm->msg_id_base);
351 memset (rmp, 0,
sizeof (*rmp));
353 ntohs (VL_API_SNAT_STATIC_MAPPING_DETAILS + sm->msg_id_base);
384 send_snat_static_mapping_details (m, q, mp->context);
388 for (j = 0; j <
vec_len (sm->to_resolve); j++)
390 rp = sm->to_resolve + j;
400 s =
format (0,
"SCRIPT: snat_static_mapping_dump ");
415 rmp->
vpe_pid = ntohl (getpid ());
425 s =
format (0,
"SCRIPT: snat_control_ping ");
449 sm->static_mapping_connection_tracking;
460 s =
format (0,
"SCRIPT: snat_show_config ");
469 vl_api_snat_set_workers_reply_t *rmp;
474 if (sm->num_workers < 2)
476 rv = VNET_API_ERROR_FEATURE_DISABLED;
497 s =
format (0,
"SCRIPT: snat_set_workers ");
523 memset (rmp, 0,
sizeof (*rmp));
524 rmp->_vl_msg_id = ntohs (VL_API_SNAT_WORKER_DETAILS + sm->msg_id_base);
555 s =
format (0,
"SCRIPT: snat_worker_dump ");
565 vl_api_snat_add_del_interface_addr_reply_t *rmp;
576 REPLY_MACRO (VL_API_SNAT_ADD_DEL_INTERFACE_ADDR_REPLY);
584 s =
format (0,
"SCRIPT: snat_add_del_interface_addr ");
585 s =
format (s,
"sw_if_index %d %s",
600 memset (rmp, 0,
sizeof (*rmp));
602 ntohs (VL_API_SNAT_INTERFACE_ADDR_DETAILS + sm->msg_id_base);
632 s =
format (0,
"SCRIPT: snat_interface_addr_dump ");
642 vl_api_snat_ipfix_enable_disable_reply_t *rmp;
651 REPLY_MACRO (VL_API_SNAT_IPFIX_ENABLE_DISABLE_REPLY);
659 s =
format (0,
"SCRIPT: snat_ipfix_enable_disable ");
663 s =
format (s,
"src_port %d ", clib_net_to_host_u16 (mp->
src_port));
665 s =
format (s,
"disable ");
679 memset (rmp, 0,
sizeof (*rmp));
680 rmp->_vl_msg_id = ntohs (VL_API_SNAT_USER_DETAILS + sm->msg_id_base);
717 s =
format (0,
"SCRIPT: snat_user_dump ");
730 memset (rmp, 0,
sizeof (*rmp));
732 ntohs (VL_API_SNAT_USER_SESSION_DETAILS + sm->msg_id_base);
740 rmp->
last_heard = clib_host_to_net_u64 ((
u64) s->last_heard);
741 rmp->
total_bytes = clib_host_to_net_u64 (s->total_bytes);
759 u32 session_index, head_index, elt_index;
771 if (!clib_bihash_search_8_8 (&sm->worker_by_in, &key, &value))
775 if (clib_bihash_search_8_8 (&sm->user_hash, &key, &value))
783 elt_index = head->
next;
785 session_index = elt->
value;
786 while (session_index != ~0)
792 elt_index = elt->
next;
794 session_index = elt->
value;
803 s =
format (0,
"SCRIPT: snat_user_session_dump ");
804 s =
format (s,
"ip_address %U vrf_id %d\n",
806 clib_net_to_host_u32 (mp->
vrf_id));
819 vl_api_snat_add_det_map_reply_t *rmp;
836 s =
format (0,
"SCRIPT: snat_add_det_map ");
837 s =
format (s,
"inside address %U/%d outside address %U/%d\n",
850 u16 lo_port = 0, hi_port = 0;
859 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
884 s =
format (0,
"SCRIPT: smat_det_forward_t");
904 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
926 s =
format (0,
"SCRIPT: smat_det_reverse_t");
927 s =
format (s,
"outside ip address %U outside port %d",
941 memset (rmp, 0,
sizeof (*rmp));
942 rmp->_vl_msg_id = ntohs (VL_API_SNAT_DET_MAP_DETAILS + sm->msg_id_base);
978 s =
format (0,
"SCRIPT: snat_det_map_dump ");
987 vl_api_snat_det_set_timeouts_reply_t *rmp;
990 sm->udp_timeout = ntohl (mp->
udp);
993 sm->icmp_timeout = ntohl (mp->
icmp);
1003 s =
format (0,
"SCRIPT: snat_det_set_timeouts ");
1004 s =
format (s,
"udp %d tcp_established %d tcp_transitory %d icmp %d\n",
1022 rmp->
udp = htonl (sm->udp_timeout);
1025 rmp->
icmp = htonl (sm->icmp_timeout);
1035 s =
format (0,
"SCRIPT: snat_det_get_timeouts");
1045 vl_api_snat_det_close_session_out_reply_t *rmp;
1058 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1068 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1074 REPLY_MACRO (VL_API_SNAT_DET_CLOSE_SESSION_OUT_REPLY);
1082 s =
format (0,
"SCRIPT: snat_det_close_session_out ");
1083 s =
format (s,
"out_addr %U out_port %d " 1084 "ext_addr %U ext_port %d\n",
1096 vl_api_snat_det_close_session_in_reply_t *rmp;
1109 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1117 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1123 REPLY_MACRO (VL_API_SNAT_DET_CLOSE_SESSION_OUT_REPLY);
1130 s =
format (0,
"SCRIPT: snat_det_close_session_in ");
1131 s =
format (s,
"in_addr %U in_port %d " 1132 "ext_addr %U ext_port %d\n",
1147 memset (rmp, 0,
sizeof (*rmp));
1148 rmp->_vl_msg_id = ntohs (VL_API_SNAT_DET_SESSION_DETAILS + sm->msg_id_base);
1177 memset (&empty_ses, 0,
sizeof (empty_ses));
1197 s =
format (0,
"SCRIPT: snat_det_session_dump ");
1211 vl_api_nat64_add_del_pool_addr_range_reply_t *rmp;
1216 u32 start_host_order, end_host_order;
1223 rv = VNET_API_ERROR_FEATURE_DISABLED;
1228 start_host_order = clib_host_to_net_u32 (tmp[0]);
1230 end_host_order = clib_host_to_net_u32 (tmp[0]);
1232 count = (end_host_order - start_host_order) + 1;
1234 vrf_id = clib_host_to_net_u32 (mp->
vrf_id);
1238 for (i = 0; i < count; i++)
1247 REPLY_MACRO (VL_API_NAT64_ADD_DEL_POOL_ADDR_RANGE_REPLY);
1255 s =
format (0,
"SCRIPT: nat64_add_del_pool_addr_range ");
1256 s =
format (s,
"%U - %U vrf_id %u %s\n",
1278 memset (rmp, 0,
sizeof (*rmp));
1279 rmp->_vl_msg_id = ntohs (VL_API_NAT64_POOL_ADDR_DETAILS + sm->msg_id_base);
1324 s =
format (0,
"SCRIPT: nat64_pool_addr_dump\n");
1335 vl_api_nat64_add_del_interface_reply_t *rmp;
1340 rv = VNET_API_ERROR_FEATURE_DISABLED;
1353 REPLY_MACRO (VL_API_NAT64_ADD_DEL_INTERFACE_REPLY);
1362 s =
format (0,
"SCRIPT: nat64_add_del_interface ");
1363 s =
format (s,
"sw_if_index %d %s %s",
1378 memset (rmp, 0,
sizeof (*rmp));
1379 rmp->_vl_msg_id = ntohs (VL_API_NAT64_INTERFACE_DETAILS + sm->msg_id_base);
1416 s =
format (0,
"SCRIPT: snat_interface_dump ");
1427 vl_api_nat64_add_del_static_bib_reply_t *rmp;
1434 rv = VNET_API_ERROR_FEATURE_DISABLED;
1443 clib_net_to_host_u16 (mp->
i_port),
1444 clib_net_to_host_u16 (mp->
o_port),
1446 clib_net_to_host_u32 (mp->
vrf_id),
1450 REPLY_MACRO (VL_API_NAT64_ADD_DEL_STATIC_BIB_REPLY);
1458 s =
format (0,
"SCRIPT: nat64_add_del_static_bib ");
1459 s =
format (s,
"protocol %d i_addr %U o_addr %U ",
1464 s =
format (s,
"vrf %d", clib_net_to_host_u32 (mp->
vrf_id));
1482 memset (rmp, 0,
sizeof (*rmp));
1483 rmp->_vl_msg_id = ntohs (VL_API_NAT64_BIB_DETAILS + sm->msg_id_base);
1487 rmp->
i_port = bibe->in_port;
1488 rmp->
o_port = bibe->out_port;
1492 rmp->
ses_num = ntohl (bibe->ses_num);
1528 s =
format (0,
"SCRIPT: snat_bib_dump protocol %d", mp->
proto);
1538 vl_api_nat64_set_timeouts_reply_t *rmp;
1543 rv = VNET_API_ERROR_FEATURE_DISABLED;
1566 s =
format (0,
"SCRIPT: nat64_set_timeouts ");
1569 "udp %d icmp %d, tcp_trans %d, tcp_est %d, tcp_incoming_syn %d\n",
1604 s =
format (0,
"SCRIPT: nat64_get_timeouts");
1616 nat64_db_bib_entry_t *bibe;
1628 memset (rmp, 0,
sizeof (*rmp));
1629 rmp->_vl_msg_id = ntohs (VL_API_NAT64_ST_DETAILS + sm->msg_id_base);
1634 rmp->
ol_port = bibe->out_port;
1675 s =
format (0,
"SCRIPT: snat_st_dump protocol %d", mp->
proto);
1683 vl_api_nat64_add_del_prefix_reply_t *rmp;
1691 rv = VNET_API_ERROR_FEATURE_DISABLED;
1710 s =
format (0,
"SCRIPT: nat64_add_del_prefix %U/%u vrf_id %u %s\n",
1725 memset (rmp, 0,
sizeof (*rmp));
1726 rmp->_vl_msg_id = ntohs (VL_API_NAT64_PREFIX_DETAILS + sm->msg_id_base);
1764 s =
format (0,
"SCRIPT: nat64_prefix_dump\n");
1770 #define foreach_snat_plugin_api_msg \ 1771 _(SNAT_ADD_ADDRESS_RANGE, snat_add_address_range) \ 1772 _(SNAT_INTERFACE_ADD_DEL_FEATURE, snat_interface_add_del_feature) \ 1773 _(SNAT_ADD_STATIC_MAPPING, snat_add_static_mapping) \ 1774 _(SNAT_CONTROL_PING, snat_control_ping) \ 1775 _(SNAT_STATIC_MAPPING_DUMP, snat_static_mapping_dump) \ 1776 _(SNAT_SHOW_CONFIG, snat_show_config) \ 1777 _(SNAT_ADDRESS_DUMP, snat_address_dump) \ 1778 _(SNAT_INTERFACE_DUMP, snat_interface_dump) \ 1779 _(SNAT_SET_WORKERS, snat_set_workers) \ 1780 _(SNAT_WORKER_DUMP, snat_worker_dump) \ 1781 _(SNAT_ADD_DEL_INTERFACE_ADDR, snat_add_del_interface_addr) \ 1782 _(SNAT_INTERFACE_ADDR_DUMP, snat_interface_addr_dump) \ 1783 _(SNAT_IPFIX_ENABLE_DISABLE, snat_ipfix_enable_disable) \ 1784 _(SNAT_USER_DUMP, snat_user_dump) \ 1785 _(SNAT_USER_SESSION_DUMP, snat_user_session_dump) \ 1786 _(SNAT_ADD_DET_MAP, snat_add_det_map) \ 1787 _(SNAT_DET_FORWARD, snat_det_forward) \ 1788 _(SNAT_DET_REVERSE, snat_det_reverse) \ 1789 _(SNAT_DET_MAP_DUMP, snat_det_map_dump) \ 1790 _(SNAT_DET_SET_TIMEOUTS, snat_det_set_timeouts) \ 1791 _(SNAT_DET_GET_TIMEOUTS, snat_det_get_timeouts) \ 1792 _(SNAT_DET_CLOSE_SESSION_OUT, snat_det_close_session_out) \ 1793 _(SNAT_DET_CLOSE_SESSION_IN, snat_det_close_session_in) \ 1794 _(SNAT_DET_SESSION_DUMP, snat_det_session_dump) \ 1795 _(NAT64_ADD_DEL_POOL_ADDR_RANGE, nat64_add_del_pool_addr_range) \ 1796 _(NAT64_POOL_ADDR_DUMP, nat64_pool_addr_dump) \ 1797 _(NAT64_ADD_DEL_INTERFACE, nat64_add_del_interface) \ 1798 _(NAT64_INTERFACE_DUMP, nat64_interface_dump) \ 1799 _(NAT64_ADD_DEL_STATIC_BIB, nat64_add_del_static_bib) \ 1800 _(NAT64_BIB_DUMP, nat64_bib_dump) \ 1801 _(NAT64_SET_TIMEOUTS, nat64_set_timeouts) \ 1802 _(NAT64_GET_TIMEOUTS, nat64_get_timeouts) \ 1803 _(NAT64_ST_DUMP, nat64_st_dump) \ 1804 _(NAT64_ADD_DEL_PREFIX, nat64_add_del_prefix) \ 1805 _(NAT64_PREFIX_DUMP, nat64_prefix_dump) 1813 vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \ 1815 vl_api_##n##_t_handler, \ 1817 vl_api_##n##_t_endian, \ 1818 vl_api_##n##_t_print, \ 1819 sizeof(vl_api_##n##_t), 1); 1826 #define vl_msg_name_crc_list 1828 #undef vl_msg_name_crc_list 1833 #define _(id,n,crc) \ 1834 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + sm->msg_id_base); 1835 foreach_vl_msg_name_crc_snat;
1842 #define _(n,f) sm->api_main->msg_print_handlers \ 1843 [VL_API_##n + sm->msg_id_base] \ 1844 = (void *) vl_api_##f##_t_print; 1855 name =
format (0,
"snat_%08x%c", api_version, 0);
ip4_address_t external_addr
u32 nat64_get_icmp_timeout(void)
Get ICMP session timeout.
static void vl_api_snat_det_close_session_in_t_handler(vl_api_snat_det_close_session_in_t *mp)
static void vl_api_snat_det_forward_t_handler(vl_api_snat_det_forward_t *mp)
static void vl_api_nat64_st_dump_t_handler(vl_api_nat64_st_dump_t *mp)
u8 external_ip_address[16]
static int nat64_api_bib_walk(nat64_db_bib_entry_t *bibe, void *arg)
NAT64 interface details response.
Add/del S-NAT address range.
static void * vl_api_snat_add_static_mapping_t_print(vl_api_snat_add_static_mapping_t *mp, void *handle)
u32 sessions_per_user_list_head_index
u16 vl_msg_api_get_msg_ids(const char *name, int n)
void snat_add_address(snat_main_t *sm, ip4_address_t *addr, u32 vrf_id)
static void * vl_api_snat_show_config_t_print(vl_api_snat_show_config_t *mp, void *handle)
sll srl srl sll sra u16x4 i
int nat64_set_udp_timeout(u32 timeout)
Set UDP session timeout.
static void vl_api_snat_add_address_range_t_handler(vl_api_snat_add_address_range_t *mp)
Add/delete S-NAT pool address from specific interfce.
NAT64 BIB details response.
static void * vl_api_nat64_pool_addr_dump_t_print(vl_api_nat64_pool_addr_dump_t *mp, void *handle)
static void * vl_api_snat_det_session_dump_t_print(vl_api_snat_det_session_dump_t *mp, void *handle)
static void * vl_api_snat_add_del_interface_addr_t_print(vl_api_snat_add_del_interface_addr_t *mp, void *handle)
static void * vl_api_snat_address_dump_t_print(vl_api_snat_address_dump_t *mp, void *handle)
void nat64_db_st_walk(nat64_db_t *db, snat_protocol_t proto, nat64_db_st_walk_fn_t fn, void *ctx)
Walk NAT64 session table.
static void vl_api_snat_ipfix_enable_disable_t_handler(vl_api_snat_ipfix_enable_disable_t *mp)
static void * vl_api_nat64_add_del_prefix_t_print(vl_api_nat64_add_del_prefix_t *mp, void *handle)
#define REPLY_MACRO2(t, body)
int nat64_add_del_interface(u32 sw_if_index, u8 is_inside, u8 is_add)
Enable/disable NAT64 feature on the interface.
static void snat_det_reverse(snat_det_map_t *dm, ip4_address_t *out_addr, u16 out_port, ip4_address_t *in_addr)
static void * vl_api_nat64_interface_dump_t_print(vl_api_nat64_interface_dump_t *mp, void *handle)
Add/delete S-NAT deterministic mapping.
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_user_dump_t_handler(vl_api_snat_user_dump_t *mp)
int nat64_add_del_pool_addr(ip4_address_t *addr, u32 vrf_id, u8 is_add)
Add/delete address to NAT64 pool.
static void * vl_api_snat_det_close_session_out_t_print(vl_api_snat_det_close_session_out_t *mp, void *handle)
static int nat64_api_prefix_walk(nat64_prefix_t *p, void *arg)
static void vl_api_snat_control_ping_t_handler(vl_api_snat_control_ping_t *mp)
Dump S-NAT deterministic mappings.
static snat_det_map_t * snat_det_map_by_out(snat_main_t *sm, ip4_address_t *out_addr)
static void vl_api_snat_det_set_timeouts_t_handler(vl_api_snat_det_set_timeouts_t *mp)
static void * vl_api_snat_ipfix_enable_disable_t_print(vl_api_snat_ipfix_enable_disable_t *mp, void *handle)
Enable/disable S-NAT IPFIX logging.
static void snat_det_forward(snat_det_map_t *dm, ip4_address_t *in_addr, ip4_address_t *out_addr, u16 *lo_port)
int snat_ipfix_logging_enable_disable(int enable, u32 domain_id, u16 src_port)
Enable/disable SNAT IPFIX logging.
static void vl_api_snat_det_map_dump_t_handler(vl_api_snat_det_map_dump_t *mp)
static void vl_api_snat_det_close_session_out_t_handler(vl_api_snat_det_close_session_out_t *mp)
static int nat64_api_pool_walk(snat_address_t *a, void *arg)
static void * vl_api_snat_static_mapping_dump_t_print(vl_api_snat_static_mapping_dump_t *mp, void *handle)
static void vl_api_nat64_interface_dump_t_handler(vl_api_nat64_interface_dump_t *mp)
int nat64_set_tcp_timeouts(u32 trans, u32 est, u32 incoming_syn)
Set TCP session timeouts.
Enable/disable NAT64 feature on the interface.
static void vl_api_nat64_add_del_static_bib_t_handler(vl_api_nat64_add_del_static_bib_t *mp)
static void * vl_api_nat64_bib_dump_t_print(vl_api_nat64_bib_dump_t *mp, void *handle)
static void * vl_api_snat_add_address_range_t_print(vl_api_snat_add_address_range_t *mp, void *handle)
clib_error_t * snat_api_init(vlib_main_t *vm, snat_main_t *sm)
S-NAT deterministic sessions reply.
S-NAT user's sessions response.
static void vl_api_snat_interface_add_del_feature_t_handler(vl_api_snat_interface_add_del_feature_t *mp)
void increment_v4_address(ip4_address_t *a)
static void vl_api_snat_set_workers_t_handler(vl_api_snat_set_workers_t *mp)
static void send_snat_interface_addr_details(u32 sw_if_index, unix_shared_memory_queue_t *q, u32 context)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
Get values of timeouts for deterministic NAT reply.
Dump NAT64 session table.
ip4_address_t ext_host_addr
Get outside address and port range from inside address.
static void * vl_api_nat64_st_dump_t_print(vl_api_nat64_st_dump_t *mp, void *handle)
static clib_error_t * snat_plugin_api_hookup(vlib_main_t *vm)
int nat64_set_icmp_timeout(u32 timeout)
Set ICMP session timeout.
int snat_add_interface_address(snat_main_t *sm, u32 sw_if_index, int is_del)
static void vl_api_snat_interface_dump_t_handler(vl_api_snat_interface_dump_t *mp)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void vl_api_snat_static_mapping_dump_t_handler(vl_api_snat_static_mapping_dump_t *mp)
Set values of timeouts for deterministic NAT (seconds, 0 = default)
S-NAT user's sessions.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
Control ping from the client to the server response.
Close CGNAT session by outside address and port.
void * vl_msg_api_alloc(int nbytes)
nat64_db_t db
BIB and session DB.
u32 translation_memory_size
Get values of timeouts for NAT64 (seconds)
static heap_elt_t * first(heap_header_t *h)
struct nat64_api_walk_ctx_t_ nat64_api_walk_ctx_t
S-NAT static mapping details response.
vlib_worker_thread_t * vlib_worker_threads
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
deterministic NAT definitions
Add/delete address range to NAT64 pool.
snat_det_session_t * sessions
u32 nat64_get_udp_timeout(void)
Get UDP session timeout.
Dump NAT64 pool addresses.
static void * vl_api_snat_set_workers_t_print(vl_api_snat_set_workers_t *mp, void *handle)
void nat64_db_bib_walk(nat64_db_t *db, snat_protocol_t proto, nat64_db_bib_walk_fn_t fn, void *ctx)
Walk NAT64 BIB.
static void vl_api_snat_worker_dump_t_handler(vl_api_snat_worker_dump_t *mp)
S-NAT pool addresses interfaces details response.
u8 outside_ip_address[16]
int snat_del_address(snat_main_t *sm, ip4_address_t addr, u8 delete_sm)
static void send_snat_static_map_resolve_details(snat_static_map_resolve_t *m, unix_shared_memory_queue_t *q, u32 context)
static void * vl_api_snat_det_close_session_in_t_print(vl_api_snat_det_close_session_in_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_interface_dump_t_print(vl_api_snat_interface_dump_t *mp, void *handle)
static void vl_api_nat64_bib_dump_t_handler(vl_api_nat64_bib_dump_t *mp)
#define SNAT_DET_SES_PER_USER
Add/delete NAT64 static BIB entry.
Dump S-NAT static mappings.
Dump S-NAT deterministic sessions.
u8 external_ip_address[16]
#define BAD_SW_IF_INDEX_LABEL
u32 nat64_get_tcp_est_timeout(void)
Get TCP established timeout.
void nat64_pool_addr_walk(nat64_pool_addr_walk_fn_t fn, void *ctx)
Walk NAT64 pool.
u32 ft_table_id
Table ID (hash key) for this FIB.
nat64_db_bib_entry_t * nat64_db_bib_entry_by_index(nat64_db_t *db, snat_protocol_t proto, u32 bibe_index)
Get BIB entry by index and protocol.
#define vec_free(V)
Free vector's memory (no header).
Get outside address and port range from inside address.
Dump interfaces with S-NAT feature.
static void vl_api_nat64_pool_addr_dump_t_handler(vl_api_nat64_pool_addr_dump_t *mp)
int nat64_add_del_prefix(ip6_address_t *prefix, u8 plen, u32 vrf_id, u8 is_add)
Add/delete NAT64 prefix.
#define clib_warning(format, args...)
static void * vl_api_snat_det_get_timeouts_t_print(vl_api_snat_det_get_timeouts_t *mp, void *handle)
u32 max_translations_per_user
int snat_set_workers(uword *bitmap)
#define clib_memcpy(a, b, c)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
static void * vl_api_nat64_add_del_pool_addr_range_t_print(vl_api_nat64_add_del_pool_addr_range_t *mp, void *handle)
static void vl_api_nat64_add_del_pool_addr_range_t_handler(vl_api_nat64_add_del_pool_addr_range_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, snat_protocol_t proto, int is_add)
Add static mapping.
static void * vl_api_snat_control_ping_t_print(vl_api_snat_control_ping_t *mp, void *handle)
static void * vl_api_snat_worker_dump_t_print(vl_api_snat_worker_dump_t *mp, void *handle)
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
8 octet key, 8 octet key value pair
static void * vl_api_snat_det_set_timeouts_t_print(vl_api_snat_det_set_timeouts_t *mp, void *handle)
static u8 snat_proto_to_ip_proto(snat_protocol_t snat_proto)
static void * vl_api_snat_interface_add_del_feature_t_print(vl_api_snat_interface_add_del_feature_t *mp, void *handle)
S-NAT address details response.
static void sent_snat_det_map_details(snat_det_map_t *m, unix_shared_memory_queue_t *q, u32 context)
static void * vl_api_snat_interface_addr_dump_t_print(vl_api_snat_interface_addr_dump_t *mp, void *handle)
Add/delete S-NAT static mapping.
Enable/disable S-NAT feature on the interface.
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
static void * vl_api_snat_user_session_dump_t_print(vl_api_snat_user_session_dump_t *mp, void *handle)
static void send_snat_interface_details(snat_interface_t *i, unix_shared_memory_queue_t *q, u32 context)
Get values of timeouts for NAT64 reply.
u32 nat64_get_tcp_incoming_syn_timeout(void)
Get TCP incoming SYN timeout.
static void * vl_api_snat_det_forward_t_print(vl_api_snat_det_forward_t *mp, void *handle)
NAT64 pool address details response.
Dump NAT64 prefix details response.
Close CGNAT session by inside address and port.
static void vl_api_snat_det_get_timeouts_t_handler(vl_api_snat_det_get_timeouts_t *mp)
static void vl_api_snat_det_session_dump_t_handler(vl_api_snat_det_session_dump_t *mp)
static u32 snat_det_user_ses_offset(ip4_address_t *addr, u8 plen)
#define clib_bitmap_free(v)
Free a bitmap.
static void vl_api_nat64_get_timeouts_t_handler(vl_api_nat64_get_timeouts_t *mp)
static 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 snat_det_session_t * snat_det_get_ses_by_out(snat_det_map_t *dm, ip4_address_t *in_addr, u64 out_key)
void nat64_prefix_walk(nat64_prefix_walk_fn_t fn, void *ctx)
Walk NAT64 prefixes.
int snat_det_add_map(snat_main_t *sm, ip4_address_t *in_addr, u8 in_plen, ip4_address_t *out_addr, u8 out_plen, int is_add)
Add/delete deterministic NAT mapping.
void nat64_interfaces_walk(nat64_interface_walk_fn_t fn, void *ctx)
Walk NAT64 interfaces.
static void * vl_api_snat_user_dump_t_print(vl_api_snat_user_dump_t *mp, void *handle)
NAT64 global declarations.
S-NAT workers details response.
static void * vl_api_snat_det_map_dump_t_print(vl_api_snat_det_map_dump_t *mp, void *handle)
static void vl_api_snat_user_session_dump_t_handler(vl_api_snat_user_session_dump_t *mp)
static void vl_api_snat_add_static_mapping_t_handler(vl_api_snat_add_static_mapping_t *mp)
unix_shared_memory_queue_t * q
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void * vl_api_nat64_set_timeouts_t_print(vl_api_nat64_set_timeouts_t *mp, void *handle)
static void send_snat_worker_details(u32 worker_index, unix_shared_memory_queue_t *q, u32 context)
static snat_det_map_t * snat_det_map_by_user(snat_main_t *sm, ip4_address_t *user_addr)
static void vl_api_snat_add_del_interface_addr_t_handler(vl_api_snat_add_del_interface_addr_t *mp)
static void vl_api_nat64_add_del_interface_t_handler(vl_api_nat64_add_del_interface_t *mp)
Dump interfaces with NAT64 feature.
static void * vl_api_nat64_add_del_interface_t_print(vl_api_nat64_add_del_interface_t *mp, void *handle)
static void vl_api_snat_add_det_map_t_handler(vl_api_snat_add_det_map_t *mp)
static void * vl_api_nat64_prefix_dump_t_print(vl_api_nat64_prefix_dump_t *mp, void *handle)
static void * vl_api_nat64_get_timeouts_t_print(vl_api_nat64_get_timeouts_t *mp, void *handle)
static void * vl_api_snat_add_det_map_t_print(vl_api_snat_add_det_map_t *mp, void *handle)
#define foreach_snat_plugin_api_msg
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
static u32 ip_proto_to_snat_proto(u8 ip_proto)
S-NAT interface details response.
static int nat64_api_interface_walk(snat_interface_t *i, void *arg)
Dump S-NAT pool addresses interfaces.
static void send_snat_address_details(snat_address_t *a, unix_shared_memory_queue_t *q, u32 context)
static void snat_det_ses_close(snat_det_map_t *dm, snat_det_session_t *ses)
Get values of timeouts for deterministic NAT (seconds)
Show S-NAT plugin startup config reply.
static int nat64_api_st_walk(nat64_db_st_entry_t *ste, void *arg)
static void send_snat_user_session_details(snat_session_t *s, unix_shared_memory_queue_t *q, u32 context)
Control ping from client to api server request.
Get inside address from outside address and port reply.
#define vec_foreach(var, vec)
Vector iterator.
static void send_snat_user_details(snat_user_t *u, unix_shared_memory_queue_t *q, u32 context)
static void * vl_api_snat_det_reverse_t_print(vl_api_snat_det_reverse_t *mp, void *handle)
u8 static_mapping_connection_tracking
Set values of timeouts for NAT64 (seconds, 0 = default)
#define SNAT_SESSION_FLAG_STATIC_MAPPING
static void * vl_api_nat64_add_del_static_bib_t_print(vl_api_nat64_add_del_static_bib_t *mp, void *handle)
static void vl_api_nat64_set_timeouts_t_handler(vl_api_nat64_set_timeouts_t *mp)
static void vl_api_snat_det_reverse_t_handler(vl_api_snat_det_reverse_t *mp)
Show S-NAT plugin startup config.
int nat64_add_del_static_bib_entry(ip6_address_t *in_addr, ip4_address_t *out_addr, u16 in_port, u16 out_port, u8 proto, u32 vrf_id, u8 is_add)
Add/delete static NAT64 BIB entry.
int snat_interface_add_del(u32 sw_if_index, u8 is_inside, int is_del)
static void plugin_custom_dump_configure(snat_main_t *sm)
snat_session_t * sessions
static void vl_api_snat_interface_addr_dump_t_handler(vl_api_snat_interface_addr_dump_t *mp)
static void vl_api_nat64_add_del_prefix_t_handler(vl_api_nat64_add_del_prefix_t *mp)
Get inside address from outside address and port.
u32 nat64_get_tcp_trans_timeout(void)
Get TCP transitory timeout.
static void vl_api_nat64_prefix_dump_t_handler(vl_api_nat64_prefix_dump_t *mp)
static void vl_api_snat_address_dump_t_handler(vl_api_snat_address_dump_t *mp)
#define VALIDATE_SW_IF_INDEX(mp)
A protocol Independent FIB table.
struct _unix_shared_memory_queue unix_shared_memory_queue_t
NAT64 session table details response.
static void send_snat_det_session_details(snat_det_session_t *s, unix_shared_memory_queue_t *q, u32 context)