30 #define vl_api_nat44_lb_addr_port_t_endian vl_noop_handler 31 #define vl_api_nat44_add_del_lb_static_mapping_t_endian vl_noop_handler 32 #define vl_api_nat44_nat44_lb_static_mapping_details_t_endian vl_noop_handler 44 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 46 #define REPLY_MSG_ID_BASE sm->msg_id_base 50 #define vl_api_version(n,v) static u32 api_version=(v); 57 vl_print (handle, (char *)s); \ 66 vl_api_snat_add_address_range_reply_t *rmp;
68 u32 start_host_order, end_host_order;
76 rv = VNET_API_ERROR_UNIMPLEMENTED;
82 rv = VNET_API_ERROR_FEATURE_DISABLED;
87 start_host_order = clib_host_to_net_u32 (tmp[0]);
89 end_host_order = clib_host_to_net_u32 (tmp[0]);
91 count = (end_host_order - start_host_order) + 1;
93 vrf_id = clib_host_to_net_u32 (mp->
vrf_id);
102 for (i = 0; i <
count; i++)
124 s =
format (0,
"SCRIPT: snat_add_address_range ");
141 memset (rmp, 0,
sizeof (*rmp));
142 rmp->_vl_msg_id = ntohs (VL_API_SNAT_ADDRESS_DETAILS + sm->
msg_id_base);
179 s =
format (0,
"SCRIPT: snat_address_dump ");
189 vl_api_snat_interface_add_del_feature_reply_t *rmp;
200 REPLY_MACRO (VL_API_SNAT_INTERFACE_ADD_DEL_FEATURE_REPLY);
208 s =
format (0,
"SCRIPT: snat_interface_add_del_feature ");
209 s =
format (s,
"sw_if_index %d %s %s",
224 memset (rmp, 0,
sizeof (*rmp));
225 rmp->_vl_msg_id = ntohs (VL_API_SNAT_INTERFACE_DETAILS + sm->
msg_id_base);
247 send_snat_interface_details(i, q, mp->context);
257 s =
format (0,
"SCRIPT: snat_interface_dump ");
267 vl_api_snat_interface_add_del_output_feature_reply_t *rmp;
279 REPLY_MACRO (VL_API_SNAT_INTERFACE_ADD_DEL_OUTPUT_FEATURE_REPLY);
287 s =
format (0,
"SCRIPT: snat_interface_add_del_output_feature ");
288 s =
format (s,
"sw_if_index %d %s %s",
304 memset (rmp, 0,
sizeof (*rmp));
306 ntohs (VL_API_SNAT_INTERFACE_OUTPUT_FEATURE_DETAILS + sm->
msg_id_base);
329 send_snat_interface_output_feature_details(i, q, mp->context);
339 s =
format (0,
"SCRIPT: snat_interface_output_feature_dump ");
349 vl_api_snat_add_static_mapping_reply_t *rmp;
351 u16 local_port = 0, external_port = 0;
352 u32 vrf_id, external_sw_if_index;
358 rv = VNET_API_ERROR_UNIMPLEMENTED;
366 local_port = clib_net_to_host_u16 (mp->
local_port);
369 vrf_id = clib_net_to_host_u32 (mp->
vrf_id);
375 external_sw_if_index, proto, mp->
is_add);
386 s =
format (0,
"SCRIPT: snat_add_static_mapping ");
387 s =
format (s,
"protocol %d local_addr %U external_addr %U ",
393 s =
format (s,
"local_port %d external_port %d ",
398 s =
format (s,
"vrf %d", clib_net_to_host_u32 (mp->
vrf_id));
401 s =
format (s,
"external_sw_if_index %d",
414 memset (rmp, 0,
sizeof (*rmp));
416 ntohs (VL_API_SNAT_STATIC_MAPPING_DETAILS + sm->
msg_id_base);
439 memset (rmp, 0,
sizeof (*rmp));
441 ntohs (VL_API_SNAT_STATIC_MAPPING_DETAILS + sm->
msg_id_base);
472 if (!vec_len(m->locals))
473 send_snat_static_mapping_details (m, q, mp->context);
489 s =
format (0,
"SCRIPT: snat_static_mapping_dump ");
504 rmp->
vpe_pid = ntohl (getpid ());
514 s =
format (0,
"SCRIPT: snat_control_ping ");
549 s =
format (0,
"SCRIPT: snat_show_config ");
558 vl_api_snat_set_workers_reply_t *rmp;
565 rv = VNET_API_ERROR_FEATURE_DISABLED;
586 s =
format (0,
"SCRIPT: snat_set_workers ");
612 memset (rmp, 0,
sizeof (*rmp));
613 rmp->_vl_msg_id = ntohs (VL_API_SNAT_WORKER_DETAILS + sm->
msg_id_base);
644 s =
format (0,
"SCRIPT: snat_worker_dump ");
654 vl_api_snat_add_del_interface_addr_reply_t *rmp;
665 REPLY_MACRO (VL_API_SNAT_ADD_DEL_INTERFACE_ADDR_REPLY);
673 s =
format (0,
"SCRIPT: snat_add_del_interface_addr ");
674 s =
format (s,
"sw_if_index %d %s",
689 memset (rmp, 0,
sizeof (*rmp));
691 ntohs (VL_API_SNAT_INTERFACE_ADDR_DETAILS + sm->
msg_id_base);
721 s =
format (0,
"SCRIPT: snat_interface_addr_dump ");
731 vl_api_snat_ipfix_enable_disable_reply_t *rmp;
740 REPLY_MACRO (VL_API_SNAT_IPFIX_ENABLE_DISABLE_REPLY);
748 s =
format (0,
"SCRIPT: snat_ipfix_enable_disable ");
752 s =
format (s,
"src_port %d ", clib_net_to_host_u16 (mp->
src_port));
754 s =
format (s,
"disable ");
768 memset (rmp, 0,
sizeof (*rmp));
769 rmp->_vl_msg_id = ntohs (VL_API_SNAT_USER_DETAILS + sm->
msg_id_base);
806 s =
format (0,
"SCRIPT: snat_user_dump ");
819 memset (rmp, 0,
sizeof (*rmp));
821 ntohs (VL_API_SNAT_USER_SESSION_DETAILS + sm->
msg_id_base);
826 rmp->
last_heard = clib_host_to_net_u64 ((
u64) s->last_heard);
827 rmp->
total_bytes = clib_host_to_net_u64 (s->total_bytes);
834 rmp->
protocol = ntohs (s->in2out.port);
857 u32 session_index, head_index, elt_index;
877 if (clib_bihash_search_8_8 (&tsm->user_hash, &key, &value))
885 elt_index = head->
next;
887 session_index = elt->
value;
888 while (session_index != ~0)
894 elt_index = elt->
next;
896 session_index = elt->
value;
905 s =
format (0,
"SCRIPT: snat_user_session_dump ");
906 s =
format (s,
"ip_address %U vrf_id %d\n",
908 clib_net_to_host_u32 (mp->
vrf_id));
921 vl_api_snat_add_det_map_reply_t *rmp;
938 s =
format (0,
"SCRIPT: snat_add_det_map ");
939 s =
format (s,
"inside address %U/%d outside address %U/%d\n",
952 u16 lo_port = 0, hi_port = 0;
961 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
986 s =
format (0,
"SCRIPT: smat_det_forward_t");
1006 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1028 s =
format (0,
"SCRIPT: smat_det_reverse_t");
1029 s =
format (s,
"outside ip address %U outside port %d",
1043 memset (rmp, 0,
sizeof (*rmp));
1044 rmp->_vl_msg_id = ntohs (VL_API_SNAT_DET_MAP_DETAILS + sm->
msg_id_base);
1080 s =
format (0,
"SCRIPT: snat_det_map_dump ");
1089 vl_api_snat_det_set_timeouts_reply_t *rmp;
1105 s =
format (0,
"SCRIPT: snat_det_set_timeouts ");
1106 s =
format (s,
"udp %d tcp_established %d tcp_transitory %d icmp %d\n",
1137 s =
format (0,
"SCRIPT: snat_det_get_timeouts");
1147 vl_api_snat_det_close_session_out_reply_t *rmp;
1160 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1170 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1176 REPLY_MACRO (VL_API_SNAT_DET_CLOSE_SESSION_OUT_REPLY);
1184 s =
format (0,
"SCRIPT: snat_det_close_session_out ");
1185 s =
format (s,
"out_addr %U out_port %d " 1186 "ext_addr %U ext_port %d\n",
1198 vl_api_snat_det_close_session_in_reply_t *rmp;
1211 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1219 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1225 REPLY_MACRO (VL_API_SNAT_DET_CLOSE_SESSION_OUT_REPLY);
1232 s =
format (0,
"SCRIPT: snat_det_close_session_in ");
1233 s =
format (s,
"in_addr %U in_port %d " 1234 "ext_addr %U ext_port %d\n",
1249 memset (rmp, 0,
sizeof (*rmp));
1250 rmp->_vl_msg_id = ntohs (VL_API_SNAT_DET_SESSION_DETAILS + sm->
msg_id_base);
1279 memset (&empty_ses, 0,
sizeof (empty_ses));
1299 s =
format (0,
"SCRIPT: snat_det_session_dump ");
1319 rmp->
vpe_pid = ntohl (getpid ());
1329 s =
format (0,
"SCRIPT: nat_control_ping ");
1364 s =
format (0,
"SCRIPT: nat_show_config ");
1373 vl_api_snat_set_workers_reply_t *rmp;
1380 rv = VNET_API_ERROR_FEATURE_DISABLED;
1401 s =
format (0,
"SCRIPT: nat_set_workers ");
1409 s =
format (s,
",%d", i);
1427 memset (rmp, 0,
sizeof (*rmp));
1428 rmp->_vl_msg_id = ntohs (VL_API_NAT_WORKER_DETAILS + sm->
msg_id_base);
1459 s =
format (0,
"SCRIPT: nat_worker_dump ");
1469 vl_api_nat_ipfix_enable_disable_reply_t *rmp;
1473 clib_host_to_net_u32
1475 clib_host_to_net_u16
1478 REPLY_MACRO (VL_API_NAT_IPFIX_ENABLE_DISABLE_REPLY);
1487 s =
format (0,
"SCRIPT: nat_ipfix_enable_disable ");
1491 s =
format (s,
"src_port %d ", clib_net_to_host_u16 (mp->
src_port));
1493 s =
format (s,
"disable ");
1506 vl_api_nat44_add_del_address_range_reply_t *rmp;
1508 u32 start_host_order, end_host_order;
1516 rv = VNET_API_ERROR_FEATURE_DISABLED;
1521 start_host_order = clib_host_to_net_u32 (tmp[0]);
1523 end_host_order = clib_host_to_net_u32 (tmp[0]);
1525 count = (end_host_order - start_host_order) + 1;
1527 vrf_id = clib_host_to_net_u32 (mp->
vrf_id);
1536 for (i = 0; i <
count; i++)
1550 REPLY_MACRO (VL_API_NAT44_ADD_DEL_ADDRESS_RANGE_REPLY);
1558 s =
format (0,
"SCRIPT: nat44_add_address_range ");
1575 memset (rmp, 0,
sizeof (*rmp));
1576 rmp->_vl_msg_id = ntohs (VL_API_NAT44_ADDRESS_DETAILS + sm->
msg_id_base);
1613 s =
format (0,
"SCRIPT: nat44_address_dump ");
1623 vl_api_nat44_interface_add_del_feature_reply_t *rmp;
1634 REPLY_MACRO (VL_API_NAT44_INTERFACE_ADD_DEL_FEATURE_REPLY);
1642 s =
format (0,
"SCRIPT: nat44_interface_add_del_feature ");
1643 s =
format (s,
"sw_if_index %d %s %s",
1658 memset (rmp, 0,
sizeof (*rmp));
1659 rmp->_vl_msg_id = ntohs (VL_API_NAT44_INTERFACE_DETAILS + sm->
msg_id_base);
1681 send_nat44_interface_details(i, q, mp->context);
1692 s =
format (0,
"SCRIPT: nat44_interface_dump ");
1702 vl_api_nat44_interface_add_del_output_feature_reply_t *rmp;
1714 REPLY_MACRO (VL_API_NAT44_INTERFACE_ADD_DEL_OUTPUT_FEATURE_REPLY);
1722 s =
format (0,
"SCRIPT: nat44_interface_add_del_output_feature ");
1723 s =
format (s,
"sw_if_index %d %s %s",
1739 memset (rmp, 0,
sizeof (*rmp));
1741 ntohs (VL_API_NAT44_INTERFACE_OUTPUT_FEATURE_DETAILS + sm->
msg_id_base);
1764 send_nat44_interface_output_feature_details(i, q, mp->context);
1774 s =
format (0,
"SCRIPT: nat44_interface_output_feature_dump ");
1784 vl_api_nat44_add_del_static_mapping_reply_t *rmp;
1786 u16 local_port = 0, external_port = 0;
1787 u32 vrf_id, external_sw_if_index;
1795 local_port = clib_net_to_host_u16 (mp->
local_port);
1798 vrf_id = clib_net_to_host_u32 (mp->
vrf_id);
1804 external_sw_if_index, proto, mp->
is_add);
1806 REPLY_MACRO (VL_API_NAT44_ADD_DEL_STATIC_MAPPING_REPLY);
1814 s =
format (0,
"SCRIPT: nat44_add_del_static_mapping ");
1815 s =
format (s,
"protocol %d local_addr %U external_addr %U ",
1821 s =
format (s,
"local_port %d external_port %d ",
1826 s =
format (s,
"vrf %d", clib_net_to_host_u32 (mp->
vrf_id));
1829 s =
format (s,
"external_sw_if_index %d",
1843 memset (rmp, 0,
sizeof (*rmp));
1845 ntohs (VL_API_NAT44_STATIC_MAPPING_DETAILS + sm->
msg_id_base);
1868 memset (rmp, 0,
sizeof (*rmp));
1870 ntohs (VL_API_NAT44_STATIC_MAPPING_DETAILS + sm->
msg_id_base);
1900 if (!vec_len(m->locals))
1901 send_nat44_static_mapping_details (m, q, mp->context);
1918 s =
format (0,
"SCRIPT: nat44_static_mapping_dump ");
1928 vl_api_nat44_add_del_interface_addr_reply_t *rmp;
1939 REPLY_MACRO (VL_API_NAT44_ADD_DEL_INTERFACE_ADDR_REPLY);
1947 s =
format (0,
"SCRIPT: nat44_add_del_interface_addr ");
1948 s =
format (s,
"sw_if_index %d %s",
1950 mp->
is_add ?
"" :
"del");
1964 memset (rmp, 0,
sizeof (*rmp));
1966 ntohs (VL_API_NAT44_INTERFACE_ADDR_DETAILS + sm->
msg_id_base);
1997 s =
format (0,
"SCRIPT: nat44_interface_addr_dump ");
2011 memset (rmp, 0,
sizeof (*rmp));
2012 rmp->_vl_msg_id = ntohs (VL_API_NAT44_USER_DETAILS + sm->
msg_id_base);
2048 s =
format (0,
"SCRIPT: nat44_user_dump ");
2061 memset (rmp, 0,
sizeof (*rmp));
2063 ntohs (VL_API_NAT44_USER_SESSION_DETAILS + sm->
msg_id_base);
2067 rmp->
last_heard = clib_host_to_net_u64 ((
u64) s->last_heard);
2068 rmp->
total_bytes = clib_host_to_net_u64 (s->total_bytes);
2075 rmp->
protocol = ntohs (s->in2out.port);
2098 u32 session_index, head_index, elt_index;
2116 if (clib_bihash_search_8_8 (&tsm->user_hash, &key, &value))
2124 elt_index = head->
next;
2126 session_index = elt->
value;
2127 while (session_index != ~0)
2133 elt_index = elt->
next;
2135 session_index = elt->
value;
2145 s =
format (0,
"SCRIPT: nat44_user_session_dump ");
2146 s =
format (s,
"ip_address %U vrf_id %d\n",
2148 clib_net_to_host_u32 (mp->
vrf_id));
2155 u8 addr_port_pair_num)
2161 for (i = 0; i < addr_port_pair_num; i++)
2163 ap = &addr_port_pairs[
i];
2164 memset (&lb_addr_port, 0,
sizeof (lb_addr_port));
2166 lb_addr_port.port = clib_net_to_host_u16 (ap->
port);
2168 vec_add1 (lb_addr_port_pairs, lb_addr_port);
2171 return lb_addr_port_pairs;
2179 vl_api_nat44_add_del_lb_static_mapping_reply_t *rmp;
2192 proto, clib_net_to_host_u32 (mp->
vrf_id),
2197 REPLY_MACRO (VL_API_NAT44_ADD_DEL_LB_STATIC_MAPPING_REPLY);
2205 s =
format (0,
"SCRIPT: nat44_add_del_lb_static_mapping ");
2224 memset (rmp, 0,
sizeof (*rmp));
2226 ntohs (VL_API_NAT44_LB_STATIC_MAPPING_DETAILS + sm->
msg_id_base);
2262 if (vec_len(m->locals))
2263 send_nat44_lb_static_mapping_details (m, q, mp->context);
2273 s =
format (0,
"SCRIPT: nat44_lb_static_mapping_dump ");
2286 vl_api_nat_det_add_del_map_reply_t *rmp;
2292 rv = VNET_API_ERROR_UNIMPLEMENTED;
2311 s =
format (0,
"SCRIPT: nat_det_add_del_map ");
2312 s =
format (s,
"inside address %U/%d outside address %U/%d\n",
2325 u16 lo_port = 0, hi_port = 0;
2332 rv = VNET_API_ERROR_UNIMPLEMENTED;
2341 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
2364 s =
format (0,
"SCRIPT: nat_det_forward");
2384 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
2406 s =
format (0,
"SCRIPT: nat_det_reverse");
2407 s =
format (s,
"outside ip address %U outside port %d",
2421 memset (rmp, 0,
sizeof (*rmp));
2422 rmp->_vl_msg_id = ntohs (VL_API_NAT_DET_MAP_DETAILS + sm->
msg_id_base);
2458 s =
format (0,
"SCRIPT: nat_det_map_dump ");
2467 vl_api_nat_det_set_timeouts_reply_t *rmp;
2484 s =
format (0,
"SCRIPT: nat_det_set_timeouts ");
2485 s =
format (s,
"udp %d tcp_established %d tcp_transitory %d icmp %d\n",
2517 s =
format (0,
"SCRIPT: nat_det_get_timeouts");
2527 vl_api_nat_det_close_session_out_reply_t *rmp;
2540 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
2550 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
2556 REPLY_MACRO (VL_API_NAT_DET_CLOSE_SESSION_OUT_REPLY);
2565 s =
format (0,
"SCRIPT: nat_det_close_session_out ");
2566 s =
format (s,
"out_addr %U out_port %d " 2567 "ext_addr %U ext_port %d\n",
2579 vl_api_nat_det_close_session_in_reply_t *rmp;
2588 rv = VNET_API_ERROR_UNIMPLEMENTED;
2598 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
2606 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
2612 REPLY_MACRO (VL_API_NAT_DET_CLOSE_SESSION_OUT_REPLY);
2620 s =
format (0,
"SCRIPT: nat_det_close_session_in ");
2621 s =
format (s,
"in_addr %U in_port %d ext_addr %U ext_port %d\n",
2636 memset (rmp, 0,
sizeof (*rmp));
2637 rmp->_vl_msg_id = ntohs (VL_API_NAT_DET_SESSION_DETAILS + sm->
msg_id_base);
2665 memset (&empty_ses, 0,
sizeof (empty_ses));
2686 s =
format (0,
"SCRIPT: nat_det_session_dump ");
2700 vl_api_nat64_add_del_pool_addr_range_reply_t *rmp;
2705 u32 start_host_order, end_host_order;
2712 rv = VNET_API_ERROR_FEATURE_DISABLED;
2717 start_host_order = clib_host_to_net_u32 (tmp[0]);
2719 end_host_order = clib_host_to_net_u32 (tmp[0]);
2721 count = (end_host_order - start_host_order) + 1;
2723 vrf_id = clib_host_to_net_u32 (mp->
vrf_id);
2727 for (i = 0; i <
count; i++)
2736 REPLY_MACRO (VL_API_NAT64_ADD_DEL_POOL_ADDR_RANGE_REPLY);
2744 s =
format (0,
"SCRIPT: nat64_add_del_pool_addr_range ");
2745 s =
format (s,
"%U - %U vrf_id %u %s\n",
2767 memset (rmp, 0,
sizeof (*rmp));
2768 rmp->_vl_msg_id = ntohs (VL_API_NAT64_POOL_ADDR_DETAILS + sm->
msg_id_base);
2813 s =
format (0,
"SCRIPT: nat64_pool_addr_dump\n");
2824 vl_api_nat64_add_del_interface_reply_t *rmp;
2829 rv = VNET_API_ERROR_FEATURE_DISABLED;
2842 REPLY_MACRO (VL_API_NAT64_ADD_DEL_INTERFACE_REPLY);
2851 s =
format (0,
"SCRIPT: nat64_add_del_interface ");
2852 s =
format (s,
"sw_if_index %d %s %s",
2867 memset (rmp, 0,
sizeof (*rmp));
2868 rmp->_vl_msg_id = ntohs (VL_API_NAT64_INTERFACE_DETAILS + sm->
msg_id_base);
2905 s =
format (0,
"SCRIPT: snat_interface_dump ");
2916 vl_api_nat64_add_del_static_bib_reply_t *rmp;
2923 rv = VNET_API_ERROR_FEATURE_DISABLED;
2932 clib_net_to_host_u16 (mp->
i_port),
2933 clib_net_to_host_u16 (mp->
o_port),
2935 clib_net_to_host_u32 (mp->
vrf_id),
2939 REPLY_MACRO (VL_API_NAT64_ADD_DEL_STATIC_BIB_REPLY);
2947 s =
format (0,
"SCRIPT: nat64_add_del_static_bib ");
2948 s =
format (s,
"protocol %d i_addr %U o_addr %U ",
2953 s =
format (s,
"vrf %d", clib_net_to_host_u32 (mp->
vrf_id));
2971 memset (rmp, 0,
sizeof (*rmp));
2972 rmp->_vl_msg_id = ntohs (VL_API_NAT64_BIB_DETAILS + sm->
msg_id_base);
2976 rmp->
i_port = bibe->in_port;
2977 rmp->
o_port = bibe->out_port;
2979 rmp->
proto = bibe->proto;
2981 rmp->
ses_num = ntohl (bibe->ses_num);
3014 s =
format (0,
"SCRIPT: snat_bib_dump protocol %d", mp->
proto);
3024 vl_api_nat64_set_timeouts_reply_t *rmp;
3029 rv = VNET_API_ERROR_FEATURE_DISABLED;
3052 s =
format (0,
"SCRIPT: nat64_set_timeouts ");
3055 "udp %d icmp %d, tcp_trans %d, tcp_est %d, tcp_incoming_syn %d\n",
3090 s =
format (0,
"SCRIPT: nat64_get_timeouts");
3102 nat64_db_bib_entry_t *bibe;
3114 memset (rmp, 0,
sizeof (*rmp));
3115 rmp->_vl_msg_id = ntohs (VL_API_NAT64_ST_DETAILS + sm->
msg_id_base);
3120 rmp->
ol_port = bibe->out_port;
3125 rmp->
proto = ste->proto;
3158 s =
format (0,
"SCRIPT: snat_st_dump protocol %d", mp->
proto);
3166 vl_api_nat64_add_del_prefix_reply_t *rmp;
3174 rv = VNET_API_ERROR_FEATURE_DISABLED;
3193 s =
format (0,
"SCRIPT: nat64_add_del_prefix %U/%u vrf_id %u %s\n",
3208 memset (rmp, 0,
sizeof (*rmp));
3209 rmp->_vl_msg_id = ntohs (VL_API_NAT64_PREFIX_DETAILS + sm->
msg_id_base);
3247 s =
format (0,
"SCRIPT: nat64_prefix_dump\n");
3253 #define foreach_snat_plugin_api_msg \ 3254 _(SNAT_ADD_ADDRESS_RANGE, snat_add_address_range) \ 3255 _(SNAT_INTERFACE_ADD_DEL_FEATURE, snat_interface_add_del_feature) \ 3256 _(SNAT_ADD_STATIC_MAPPING, snat_add_static_mapping) \ 3257 _(SNAT_CONTROL_PING, snat_control_ping) \ 3258 _(SNAT_STATIC_MAPPING_DUMP, snat_static_mapping_dump) \ 3259 _(SNAT_SHOW_CONFIG, snat_show_config) \ 3260 _(SNAT_ADDRESS_DUMP, snat_address_dump) \ 3261 _(SNAT_INTERFACE_DUMP, snat_interface_dump) \ 3262 _(SNAT_SET_WORKERS, snat_set_workers) \ 3263 _(SNAT_WORKER_DUMP, snat_worker_dump) \ 3264 _(SNAT_ADD_DEL_INTERFACE_ADDR, snat_add_del_interface_addr) \ 3265 _(SNAT_INTERFACE_ADDR_DUMP, snat_interface_addr_dump) \ 3266 _(SNAT_IPFIX_ENABLE_DISABLE, snat_ipfix_enable_disable) \ 3267 _(SNAT_USER_DUMP, snat_user_dump) \ 3268 _(SNAT_USER_SESSION_DUMP, snat_user_session_dump) \ 3269 _(SNAT_INTERFACE_ADD_DEL_OUTPUT_FEATURE, \ 3270 snat_interface_add_del_output_feature) \ 3271 _(SNAT_INTERFACE_OUTPUT_FEATURE_DUMP, \ 3272 snat_interface_output_feature_dump) \ 3273 _(SNAT_ADD_DET_MAP, snat_add_det_map) \ 3274 _(SNAT_DET_FORWARD, snat_det_forward) \ 3275 _(SNAT_DET_REVERSE, snat_det_reverse) \ 3276 _(SNAT_DET_MAP_DUMP, snat_det_map_dump) \ 3277 _(SNAT_DET_SET_TIMEOUTS, snat_det_set_timeouts) \ 3278 _(SNAT_DET_GET_TIMEOUTS, snat_det_get_timeouts) \ 3279 _(SNAT_DET_CLOSE_SESSION_OUT, snat_det_close_session_out) \ 3280 _(SNAT_DET_CLOSE_SESSION_IN, snat_det_close_session_in) \ 3281 _(SNAT_DET_SESSION_DUMP, snat_det_session_dump) \ 3282 _(NAT_CONTROL_PING, nat_control_ping) \ 3283 _(NAT_SHOW_CONFIG, nat_show_config) \ 3284 _(NAT_SET_WORKERS, nat_set_workers) \ 3285 _(NAT_WORKER_DUMP, nat_worker_dump) \ 3286 _(NAT_IPFIX_ENABLE_DISABLE, nat_ipfix_enable_disable) \ 3287 _(NAT44_ADD_DEL_ADDRESS_RANGE, nat44_add_del_address_range) \ 3288 _(NAT44_INTERFACE_ADD_DEL_FEATURE, nat44_interface_add_del_feature) \ 3289 _(NAT44_ADD_DEL_STATIC_MAPPING, nat44_add_del_static_mapping) \ 3290 _(NAT44_STATIC_MAPPING_DUMP, nat44_static_mapping_dump) \ 3291 _(NAT44_ADDRESS_DUMP, nat44_address_dump) \ 3292 _(NAT44_INTERFACE_DUMP, nat44_interface_dump) \ 3293 _(NAT44_ADD_DEL_INTERFACE_ADDR, nat44_add_del_interface_addr) \ 3294 _(NAT44_INTERFACE_ADDR_DUMP, nat44_interface_addr_dump) \ 3295 _(NAT44_USER_DUMP, nat44_user_dump) \ 3296 _(NAT44_USER_SESSION_DUMP, nat44_user_session_dump) \ 3297 _(NAT44_INTERFACE_ADD_DEL_OUTPUT_FEATURE, \ 3298 nat44_interface_add_del_output_feature) \ 3299 _(NAT44_INTERFACE_OUTPUT_FEATURE_DUMP, \ 3300 nat44_interface_output_feature_dump) \ 3301 _(NAT44_ADD_DEL_LB_STATIC_MAPPING, nat44_add_del_lb_static_mapping) \ 3302 _(NAT44_LB_STATIC_MAPPING_DUMP, nat44_lb_static_mapping_dump) \ 3303 _(NAT_DET_ADD_DEL_MAP, nat_det_add_del_map) \ 3304 _(NAT_DET_FORWARD, nat_det_forward) \ 3305 _(NAT_DET_REVERSE, nat_det_reverse) \ 3306 _(NAT_DET_MAP_DUMP, nat_det_map_dump) \ 3307 _(NAT_DET_SET_TIMEOUTS, nat_det_set_timeouts) \ 3308 _(NAT_DET_GET_TIMEOUTS, nat_det_get_timeouts) \ 3309 _(NAT_DET_CLOSE_SESSION_OUT, nat_det_close_session_out) \ 3310 _(NAT_DET_CLOSE_SESSION_IN, nat_det_close_session_in) \ 3311 _(NAT_DET_SESSION_DUMP, nat_det_session_dump) \ 3312 _(NAT64_ADD_DEL_POOL_ADDR_RANGE, nat64_add_del_pool_addr_range) \ 3313 _(NAT64_POOL_ADDR_DUMP, nat64_pool_addr_dump) \ 3314 _(NAT64_ADD_DEL_INTERFACE, nat64_add_del_interface) \ 3315 _(NAT64_INTERFACE_DUMP, nat64_interface_dump) \ 3316 _(NAT64_ADD_DEL_STATIC_BIB, nat64_add_del_static_bib) \ 3317 _(NAT64_BIB_DUMP, nat64_bib_dump) \ 3318 _(NAT64_SET_TIMEOUTS, nat64_set_timeouts) \ 3319 _(NAT64_GET_TIMEOUTS, nat64_get_timeouts) \ 3320 _(NAT64_ST_DUMP, nat64_st_dump) \ 3321 _(NAT64_ADD_DEL_PREFIX, nat64_add_del_prefix) \ 3322 _(NAT64_PREFIX_DUMP, nat64_prefix_dump) 3330 vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \ 3332 vl_api_##n##_t_handler, \ 3334 vl_api_##n##_t_endian, \ 3335 vl_api_##n##_t_print, \ 3336 sizeof(vl_api_##n##_t), 1); 3343 #define vl_msg_name_crc_list 3345 #undef vl_msg_name_crc_list 3350 #define _(id,n,crc) \ 3351 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + sm->msg_id_base); 3352 foreach_vl_msg_name_crc_nat;
3359 #define _(n,f) sm->api_main->msg_print_handlers \ 3360 [VL_API_##n + sm->msg_id_base] \ 3361 = (void *) vl_api_##f##_t_print; 3372 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 send_snat_user_session_details(snat_session_t *s, unix_shared_memory_queue_t *q, u32 context)
int snat_add_interface_address(snat_main_t *sm, u32 sw_if_index, int is_del)
static void * vl_api_snat_det_reverse_t_print(vl_api_snat_det_reverse_t *mp, void *handle)
static void * vl_api_snat_interface_addr_dump_t_print(vl_api_snat_interface_addr_dump_t *mp, void *handle)
static void send_nat_worker_details(u32 worker_index, unix_shared_memory_queue_t *q, u32 context)
u8 external_ip_address[16]
NAT64 interface details response.
Add/del NAT44 address range.
u32 sessions_per_user_list_head_index
static void * vl_api_snat_det_close_session_out_t_print(vl_api_snat_det_close_session_out_t *mp, void *handle)
u16 vl_msg_api_get_msg_ids(const char *name, int n)
static void vl_api_snat_det_reverse_t_handler(vl_api_snat_det_reverse_t *mp)
sll srl srl sll sra u16x4 i
static void * vl_api_snat_interface_add_del_output_feature_t_print(vl_api_snat_interface_add_del_output_feature_t *mp, void *handle)
int nat64_set_udp_timeout(u32 timeout)
Set UDP session timeout.
static void vl_api_nat_worker_dump_t_handler(vl_api_nat_worker_dump_t *mp)
Add/delete NAT44 pool address from specific interfce.
static int nat64_api_pool_walk(snat_address_t *a, void *arg)
NAT64 BIB details response.
static void send_nat44_address_details(snat_address_t *a, unix_shared_memory_queue_t *q, u32 context)
static void * vl_api_nat44_user_dump_t_print(vl_api_nat44_user_dump_t *mp, void *handle)
static void * vl_api_nat_ipfix_enable_disable_t_print(vl_api_nat_ipfix_enable_disable_t *mp, void *handle)
static void * vl_api_nat_det_close_session_in_t_print(vl_api_nat_det_close_session_in_t *mp, void *handle)
NAT workers details response.
static void * vl_api_nat64_interface_dump_t_print(vl_api_nat64_interface_dump_t *mp, void *handle)
NAT44 interface with output feature details response.
Dump NAT44 pool addresses interfaces.
static void vl_api_nat44_user_session_dump_t_handler(vl_api_nat44_user_session_dump_t *mp)
static void * vl_api_snat_det_set_timeouts_t_print(vl_api_snat_det_set_timeouts_t *mp, void *handle)
vl_api_nat44_lb_addr_port_t locals[local_num]
#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 vl_api_nat44_lb_static_mapping_dump_t_handler(vl_api_nat44_lb_static_mapping_dump_t *mp)
static void vl_api_snat_det_set_timeouts_t_handler(vl_api_snat_det_set_timeouts_t *mp)
static void vl_api_snat_user_session_dump_t_handler(vl_api_snat_user_session_dump_t *mp)
static int nat64_api_interface_walk(snat_interface_t *i, void *arg)
static void vl_api_nat64_bib_dump_t_handler(vl_api_nat64_bib_dump_t *mp)
Add/delete NAT deterministic mapping.
static void * vl_api_snat_add_static_mapping_t_print(vl_api_snat_add_static_mapping_t *mp, void *handle)
static clib_error_t * snat_plugin_api_hookup(vlib_main_t *vm)
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_nat64_bib_dump_t_print(vl_api_nat64_bib_dump_t *mp, void *handle)
Control ping from client to api server request.
Get outside address and port range from inside address.
u8 external_ip_address[4]
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Dump NAT deterministic mappings.
static void send_nat44_interface_output_feature_details(snat_interface_t *i, unix_shared_memory_queue_t *q, u32 context)
static void vl_api_nat64_add_del_pool_addr_range_t_handler(vl_api_nat64_add_del_pool_addr_range_t *mp)
static void snat_det_ses_close(snat_det_map_t *dm, snat_det_session_t *ses)
Get inside address from outside address and port reply.
NAT44 interface details response.
static nat44_lb_addr_port_t * unformat_nat44_lb_addr_port(vl_api_nat44_lb_addr_port_t *addr_port_pairs, u8 addr_port_pair_num)
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 void vl_api_snat_interface_dump_t_handler(vl_api_snat_interface_dump_t *mp)
Enable/disable 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)
NAT44 static mapping details response.
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_snat_add_det_map_t_handler(vl_api_snat_add_det_map_t *mp)
static void * vl_api_nat64_pool_addr_dump_t_print(vl_api_nat64_pool_addr_dump_t *mp, void *handle)
static void send_nat44_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)
snat_det_map_t * det_maps
Get values of timeouts for deterministic NAT (seconds)
static void vl_api_nat_control_ping_t_handler(vl_api_nat_control_ping_t *mp)
static void vl_api_snat_control_ping_t_handler(vl_api_snat_control_ping_t *mp)
static void snat_det_reverse(snat_det_map_t *dm, ip4_address_t *out_addr, u16 out_port, ip4_address_t *in_addr)
#define snat_is_unk_proto_session(s)
Check if SNAT session for unknown protocol.
int nat64_set_tcp_timeouts(u32 trans, u32 est, u32 incoming_syn)
Set TCP session timeouts.
static void vl_api_nat44_add_del_interface_addr_t_handler(vl_api_nat44_add_del_interface_addr_t *mp)
static void vl_api_nat_set_workers_t_handler(vl_api_nat_set_workers_t *mp)
Enable/disable NAT64 feature on the interface.
static int nat64_api_prefix_walk(nat64_prefix_t *p, void *arg)
int snat_interface_add_del(u32 sw_if_index, u8 is_inside, int is_del)
static void send_snat_interface_addr_details(u32 sw_if_index, unix_shared_memory_queue_t *q, u32 context)
nat44_lb_addr_port_t * locals
static void send_snat_static_mapping_details(snat_static_mapping_t *m, unix_shared_memory_queue_t *q, u32 context)
static void * vl_api_nat_det_reverse_t_print(vl_api_nat_det_reverse_t *mp, void *handle)
static void * vl_api_nat_show_config_t_print(vl_api_nat_show_config_t *mp, void *handle)
static void vl_api_snat_set_workers_t_handler(vl_api_snat_set_workers_t *mp)
u32 max_translations_per_user
static void * vl_api_nat44_interface_addr_dump_t_print(vl_api_nat44_interface_addr_dump_t *mp, void *handle)
Deterministic NAT sessions reply.
NAT44 user's sessions response.
static void * vl_api_nat_det_add_del_map_t_print(vl_api_nat_det_add_del_map_t *mp, void *handle)
static void vl_api_nat44_user_dump_t_handler(vl_api_nat44_user_dump_t *mp)
static void * vl_api_snat_det_get_timeouts_t_print(vl_api_snat_det_get_timeouts_t *mp, void *handle)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
Get values of timeouts for deterministic NAT reply.
Dump NAT64 session table.
static void * vl_api_nat44_lb_static_mapping_dump_t_print(vl_api_nat44_lb_static_mapping_dump_t *mp, void *handle)
ip4_address_t ext_host_addr
Get outside address and port range from inside address.
static void vl_api_snat_det_map_dump_t_handler(vl_api_snat_det_map_dump_t *mp)
static int nat64_api_st_walk(nat64_db_st_entry_t *ste, void *arg)
Enable/disbale NAT44 as an interface output feature (postrouting in2out translation) ...
static void * vl_api_snat_add_det_map_t_print(vl_api_snat_add_det_map_t *mp, void *handle)
int nat64_set_icmp_timeout(u32 timeout)
Set ICMP session timeout.
struct nat64_api_walk_ctx_t_ nat64_api_walk_ctx_t
Enable/disbale NAT44 as an interface output feature (postrouting in2out translation) ...
u8 external_ip_address[4]
#define SNAT_DET_SES_PER_USER
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define foreach_snat_plugin_api_msg
static void vl_api_nat44_interface_add_del_output_feature_t_handler(vl_api_nat44_interface_add_del_output_feature_t *mp)
int snat_ipfix_logging_enable_disable(int enable, u32 domain_id, u16 src_port)
Enable/disable NAT plugin IPFIX logging.
static void vl_api_nat64_get_timeouts_t_handler(vl_api_nat64_get_timeouts_t *mp)
Set values of timeouts for deterministic NAT (seconds, 0 = default)
Dump interfaces with NAT44 output feature.
NAT44 user's sessions.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
static void vl_api_nat44_add_del_address_range_t_handler(vl_api_nat44_add_del_address_range_t *mp)
static void vl_api_nat_det_map_dump_t_handler(vl_api_nat_det_map_dump_t *mp)
static void send_snat_interface_output_feature_details(snat_interface_t *i, 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)
Control ping from the client to the server response.
Close deterministic NAT session by outside address and port.
void * vl_msg_api_alloc(int nbytes)
nat64_db_t db
BIB and session DB.
static void * vl_api_snat_user_session_dump_t_print(vl_api_snat_user_session_dump_t *mp, void *handle)
u32 translation_memory_size
clib_error_t * snat_api_init(vlib_main_t *vm, snat_main_t *sm)
Get values of timeouts for NAT64 (seconds)
static heap_elt_t * first(heap_header_t *h)
u32 max_translations_per_user
NAT44 static mapping details response.
static u32 snat_det_user_ses_offset(ip4_address_t *addr, u8 plen)
vlib_worker_thread_t * vlib_worker_threads
static void * vl_api_snat_interface_dump_t_print(vl_api_snat_interface_dump_t *mp, void *handle)
#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.
Control ping from the client to the server response.
static void * vl_api_snat_add_address_range_t_print(vl_api_snat_add_address_range_t *mp, void *handle)
static void * vl_api_snat_show_config_t_print(vl_api_snat_show_config_t *mp, void *handle)
static void * vl_api_nat64_st_dump_t_print(vl_api_nat64_st_dump_t *mp, void *handle)
static void * vl_api_nat_control_ping_t_print(vl_api_nat_control_ping_t *mp, void *handle)
Add/delete address range to NAT64 pool.
snat_det_session_t * sessions
Close deterministic NAT session by outside address and port.
static void vl_api_snat_ipfix_enable_disable_t_handler(vl_api_snat_ipfix_enable_disable_t *mp)
static void vl_api_nat_det_set_timeouts_t_handler(vl_api_nat_det_set_timeouts_t *mp)
static snat_det_map_t * snat_det_map_by_out(snat_main_t *sm, ip4_address_t *out_addr)
static void * vl_api_snat_add_del_interface_addr_t_print(vl_api_snat_add_del_interface_addr_t *mp, void *handle)
static void send_nat_det_session_details(snat_det_session_t *s, unix_shared_memory_queue_t *q, u32 context)
u32 nat64_get_udp_timeout(void)
Get UDP session timeout.
Dump NAT64 pool addresses.
static void * vl_api_nat_set_workers_t_print(vl_api_nat_set_workers_t *mp, void *handle)
static void * vl_api_snat_ipfix_enable_disable_t_print(vl_api_snat_ipfix_enable_disable_t *mp, void *handle)
static void send_nat44_lb_static_mapping_details(snat_static_mapping_t *m, unix_shared_memory_queue_t *q, u32 context)
snat_static_mapping_t * static_mappings
static void * vl_api_snat_det_session_dump_t_print(vl_api_snat_det_session_dump_t *mp, void *handle)
NAT44 pool addresses interfaces details response.
static void vl_api_nat64_set_timeouts_t_handler(vl_api_nat64_set_timeouts_t *mp)
u8 outside_ip_address[16]
static void vl_api_nat64_pool_addr_dump_t_handler(vl_api_nat64_pool_addr_dump_t *mp)
static void * vl_api_nat44_interface_output_feature_dump_t_print(vl_api_nat44_interface_output_feature_dump_t *mp, void *handle)
static void vl_api_nat_det_reverse_t_handler(vl_api_nat_det_reverse_t *mp)
static void vl_api_snat_det_close_session_out_t_handler(vl_api_snat_det_close_session_out_t *mp)
u32 translation_memory_size
static void vl_api_snat_add_static_mapping_t_handler(vl_api_snat_add_static_mapping_t *mp)
Add/delete NAT44 pool address from specific interfce.
static void vl_api_snat_interface_addr_dump_t_handler(vl_api_snat_interface_addr_dump_t *mp)
static void * vl_api_nat_worker_dump_t_print(vl_api_nat_worker_dump_t *mp, void *handle)
static void * vl_api_nat44_address_dump_t_print(vl_api_nat44_address_dump_t *mp, void *handle)
static void send_snat_worker_details(u32 worker_index, unix_shared_memory_queue_t *q, u32 context)
u8 static_mapping_connection_tracking
static void * vl_api_nat_det_session_dump_t_print(vl_api_nat_det_session_dump_t *mp, void *handle)
Add/delete NAT64 static BIB entry.
API main structure, used by both vpp and binary API clients.
static void vl_api_nat44_add_del_static_mapping_t_handler(vl_api_nat44_add_del_static_mapping_t *mp)
Dump NAT44 static mappings.
Dump determinstic NAT sessions.
snat_interface_t * output_feature_interfaces
u8 external_ip_address[16]
static void * vl_api_snat_set_workers_t_print(vl_api_snat_set_workers_t *mp, void *handle)
static void vl_api_snat_add_address_range_t_handler(vl_api_snat_add_address_range_t *mp)
static void send_snat_user_details(snat_user_t *u, unix_shared_memory_queue_t *q, u32 context)
#define BAD_SW_IF_INDEX_LABEL
Add/delete NAT deterministic mapping.
u32 nat64_get_tcp_est_timeout(void)
Get TCP established timeout.
static void * vl_api_nat64_add_del_prefix_t_print(vl_api_nat64_add_del_prefix_t *mp, void *handle)
Dump interfaces with NAT44 feature.
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.
static void vl_api_nat_det_forward_t_handler(vl_api_nat_det_forward_t *mp)
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_nat_show_config_t_handler(vl_api_nat_show_config_t *mp)
static void vl_api_nat44_add_del_lb_static_mapping_t_handler(vl_api_nat44_add_del_lb_static_mapping_t *mp)
snat_get_worker_function_t * worker_in2out_cb
u8 static_mapping_connection_tracking
#define vec_free(V)
Free vector's memory (no header).
static void vl_api_snat_interface_add_del_feature_t_handler(vl_api_snat_interface_add_del_feature_t *mp)
Get outside address and port range from inside address.
deterministic NAT definitions
NAT44 user's sessions response.
Dump interfaces with NAT44 feature.
static void * vl_api_nat44_interface_dump_t_print(vl_api_nat44_interface_dump_t *mp, void *handle)
static void * vl_api_nat_det_map_dump_t_print(vl_api_nat_det_map_dump_t *mp, void *handle)
int nat64_add_del_prefix(ip6_address_t *prefix, u8 plen, u32 vrf_id, u8 is_add)
Add/delete NAT64 prefix.
static void vl_api_nat44_interface_addr_dump_t_handler(vl_api_nat44_interface_addr_dump_t *mp)
#define clib_warning(format, args...)
u32 max_translations_per_user
static void send_nat44_interface_details(snat_interface_t *i, unix_shared_memory_queue_t *q, u32 context)
int snat_interface_add_del_output_feature(u32 sw_if_index, u8 is_inside, int is_del)
#define clib_memcpy(a, b, c)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
static void * vl_api_snat_det_map_dump_t_print(vl_api_snat_det_map_dump_t *mp, void *handle)
static void vl_api_nat64_add_del_prefix_t_handler(vl_api_nat64_add_del_prefix_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
static void vl_api_nat64_prefix_dump_t_handler(vl_api_nat64_prefix_dump_t *mp)
static void * vl_api_nat44_add_del_lb_static_mapping_t_print(vl_api_nat44_add_del_lb_static_mapping_t *mp, void *handle)
static void vl_api_nat_det_get_timeouts_t_handler(vl_api_nat_det_get_timeouts_t *mp)
8 octet key, 8 octet key value pair
int snat_del_address(snat_main_t *sm, ip4_address_t addr, u8 delete_sm)
NAT44 address details response.
u32 tcp_transitory_timeout
static void send_nat44_static_mapping_details(snat_static_mapping_t *m, unix_shared_memory_queue_t *q, u32 context)
NAT44 interface with output feature details response.
static void vl_api_nat_det_close_session_out_t_handler(vl_api_nat_det_close_session_out_t *mp)
Add/delete NAT44 static mapping.
Enable/disable NAT44 feature on the interface.
static void vl_api_nat_det_add_del_map_t_handler(vl_api_nat_det_add_del_map_t *mp)
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.
u32 * auto_add_sw_if_indices
static int nat64_api_bib_walk(nat64_db_bib_entry_t *bibe, void *arg)
static void vl_api_snat_add_del_interface_addr_t_handler(vl_api_snat_add_del_interface_addr_t *mp)
static void * vl_api_snat_interface_output_feature_dump_t_print(vl_api_snat_interface_output_feature_dump_t *mp, void *handle)
int nat44_add_del_lb_static_mapping(ip4_address_t e_addr, u16 e_port, snat_protocol_t proto, u32 vrf_id, nat44_lb_addr_port_t *locals, u8 is_add)
static void * vl_api_nat44_add_del_static_mapping_t_print(vl_api_nat44_add_del_static_mapping_t *mp, void *handle)
static void vl_api_nat_det_close_session_in_t_handler(vl_api_nat_det_close_session_in_t *mp)
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
static snat_det_map_t * snat_det_map_by_user(snat_main_t *sm, ip4_address_t *user_addr)
vl_api_nat44_lb_addr_port_t locals[local_num]
static void sent_snat_det_map_details(snat_det_map_t *m, unix_shared_memory_queue_t *q, u32 context)
Get values of timeouts for NAT64 reply.
void nat64_db_st_walk(nat64_db_t *db, u8 proto, nat64_db_st_walk_fn_t fn, void *ctx)
Walk NAT64 session table.
u32 nat64_get_tcp_incoming_syn_timeout(void)
Get TCP incoming SYN timeout.
static void * vl_api_nat44_interface_add_del_output_feature_t_print(vl_api_nat44_interface_add_del_output_feature_t *mp, void *handle)
NAT64 pool address details response.
static u32 ip_proto_to_snat_proto(u8 ip_proto)
static void vl_api_nat_ipfix_enable_disable_t_handler(vl_api_nat_ipfix_enable_disable_t *mp)
static void send_nat44_user_session_details(snat_session_t *s, unix_shared_memory_queue_t *q, u32 context)
Dump NAT64 prefix details response.
Close deterministic NAT session by inside address and port.
static void * vl_api_nat64_get_timeouts_t_print(vl_api_nat64_get_timeouts_t *mp, void *handle)
static void vl_api_nat_det_session_dump_t_handler(vl_api_nat_det_session_dump_t *mp)
Add/del NAT44 address range.
nat64_db_bib_entry_t * nat64_db_bib_entry_by_index(nat64_db_t *db, u8 proto, u32 bibe_index)
Get BIB entry by index and protocol.
Close deterministic NAT session by inside address and port.
static void vl_api_nat64_interface_dump_t_handler(vl_api_nat64_interface_dump_t *mp)
static void * vl_api_nat44_static_mapping_dump_t_print(vl_api_nat44_static_mapping_dump_t *mp, void *handle)
#define clib_bitmap_free(v)
Free a bitmap.
Dump determinstic NAT sessions.
static void * vl_api_nat_det_forward_t_print(vl_api_nat_det_forward_t *mp, void *handle)
static void * vl_api_snat_interface_add_del_feature_t_print(vl_api_snat_interface_add_del_feature_t *mp, void *handle)
static void sent_nat_det_map_details(snat_det_map_t *m, unix_shared_memory_queue_t *q, u32 context)
void nat64_prefix_walk(nat64_prefix_walk_fn_t fn, void *ctx)
Walk NAT64 prefixes.
static void vl_api_snat_worker_dump_t_handler(vl_api_snat_worker_dump_t *mp)
void nat64_interfaces_walk(nat64_interface_walk_fn_t fn, void *ctx)
Walk NAT64 interfaces.
static void send_snat_address_details(snat_address_t *a, unix_shared_memory_queue_t *q, u32 context)
static void * vl_api_nat_det_get_timeouts_t_print(vl_api_nat_det_get_timeouts_t *mp, void *handle)
NAT64 global declarations.
NAT workers details response.
void increment_v4_address(ip4_address_t *a)
static void * vl_api_nat44_add_del_address_range_t_print(vl_api_nat44_add_del_address_range_t *mp, void *handle)
Dump NAT deterministic mappings.
static void vl_api_snat_det_get_timeouts_t_handler(vl_api_snat_det_get_timeouts_t *mp)
Show NAT plugin startup config reply.
unix_shared_memory_queue_t * q
static void vl_api_snat_user_dump_t_handler(vl_api_snat_user_dump_t *mp)
Get outside address and port range from inside address.
static void vl_api_snat_show_config_t_handler(vl_api_snat_show_config_t *mp)
static void vl_api_nat44_interface_dump_t_handler(vl_api_nat44_interface_dump_t *mp)
Add/delete NAT44 static mapping.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void * vl_api_nat44_add_del_interface_addr_t_print(vl_api_nat44_add_del_interface_addr_t *mp, void *handle)
static void * vl_api_nat44_user_session_dump_t_print(vl_api_nat44_user_session_dump_t *mp, void *handle)
Dump NAT44 static mappings.
static void send_nat44_interface_addr_details(u32 sw_if_index, unix_shared_memory_queue_t *q, u32 context)
Deterministic NAT sessions reply.
static void vl_api_nat64_add_del_static_bib_t_handler(vl_api_nat64_add_del_static_bib_t *mp)
static void send_snat_det_session_details(snat_det_session_t *s, unix_shared_memory_queue_t *q, u32 context)
Dump interfaces with NAT64 feature.
NAT44 pool addresses interfaces details response.
snat_main_per_thread_data_t * per_thread_data
Dump interfaces with NAT44 output feature.
static void vl_api_snat_det_close_session_in_t_handler(vl_api_snat_det_close_session_in_t *mp)
static void send_snat_interface_details(snat_interface_t *i, unix_shared_memory_queue_t *q, u32 context)
static void * vl_api_nat_det_set_timeouts_t_print(vl_api_nat_det_set_timeouts_t *mp, void *handle)
static void send_nat44_user_details(snat_user_t *u, unix_shared_memory_queue_t *q, u32 context)
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
Enable/disable NAT IPFIX logging.
snat_address_t * addresses
NAT44 user's sessions.
static void vl_api_snat_det_session_dump_t_handler(vl_api_snat_det_session_dump_t *mp)
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_interface_add_del_output_feature_t_handler(vl_api_snat_interface_add_del_output_feature_t *mp)
NAT44 interface details response.
static void vl_api_snat_address_dump_t_handler(vl_api_snat_address_dump_t *mp)
static void * vl_api_nat64_set_timeouts_t_print(vl_api_nat64_set_timeouts_t *mp, void *handle)
Dump NAT44 pool addresses interfaces.
static snat_det_session_t * snat_det_get_ses_by_out(snat_det_map_t *dm, ip4_address_t *in_addr, u64 out_key)
snat_static_map_resolve_t * to_resolve
static void vl_api_snat_interface_output_feature_dump_t_handler(vl_api_snat_interface_output_feature_dump_t *mp)
static void * vl_api_snat_det_forward_t_print(vl_api_snat_det_forward_t *mp, void *handle)
#define SNAT_SESSION_FLAG_STATIC_MAPPING
Get values of timeouts for deterministic NAT (seconds)
Show NAT plugin startup config reply.
Control ping from client to api server request.
Set values of timeouts for deterministic NAT (seconds, 0 = default)
static void vl_api_nat44_address_dump_t_handler(vl_api_nat44_address_dump_t *mp)
Get inside address from outside address and port reply.
u32 translation_memory_size
#define vec_foreach(var, vec)
Vector iterator.
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 void vl_api_nat44_interface_add_del_feature_t_handler(vl_api_nat44_interface_add_del_feature_t *mp)
static void vl_api_nat64_st_dump_t_handler(vl_api_nat64_st_dump_t *mp)
int snat_set_workers(uword *bitmap)
static void vl_api_snat_det_forward_t_handler(vl_api_snat_det_forward_t *mp)
u8 static_mapping_connection_tracking
Set values of timeouts for NAT64 (seconds, 0 = default)
static void * vl_api_nat_det_close_session_out_t_print(vl_api_nat_det_close_session_out_t *mp, void *handle)
static void * vl_api_nat44_interface_add_del_feature_t_print(vl_api_nat44_interface_add_del_feature_t *mp, void *handle)
static void * vl_api_snat_user_dump_t_print(vl_api_snat_user_dump_t *mp, void *handle)
static void * vl_api_nat64_prefix_dump_t_print(vl_api_nat64_prefix_dump_t *mp, void *handle)
void snat_add_address(snat_main_t *sm, ip4_address_t *addr, u32 vrf_id)
Get inside address from outside address and port.
Get values of timeouts for deterministic NAT reply.
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.
Enable/disable NAT44 feature on the interface.
Show NAT plugin startup config.
void nat64_db_bib_walk(nat64_db_t *db, u8 proto, nat64_db_bib_walk_fn_t fn, void *ctx)
Walk NAT64 BIB.
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.
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_nat44_static_mapping_dump_t_handler(vl_api_nat44_static_mapping_dump_t *mp)
Get inside address from outside address and port.
snat_interface_t * interfaces
static void * vl_api_snat_worker_dump_t_print(vl_api_snat_worker_dump_t *mp, void *handle)
u32 nat64_get_tcp_trans_timeout(void)
Get TCP transitory timeout.
#define VALIDATE_SW_IF_INDEX(mp)
A protocol Independent FIB table.
static void * vl_api_snat_static_mapping_dump_t_print(vl_api_snat_static_mapping_dump_t *mp, void *handle)
static void vl_api_nat44_interface_output_feature_dump_t_handler(vl_api_nat44_interface_output_feature_dump_t *mp)
Show NAT plugin startup config.
static u8 snat_proto_to_ip_proto(snat_protocol_t snat_proto)
struct _unix_shared_memory_queue unix_shared_memory_queue_t
NAT44 address details response.
NAT64 session table details response.
static void * vl_api_snat_control_ping_t_print(vl_api_snat_control_ping_t *mp, void *handle)
static void vl_api_nat64_add_del_interface_t_handler(vl_api_nat64_add_del_interface_t *mp)
u32 tcp_established_timeout
static void * vl_api_snat_address_dump_t_print(vl_api_snat_address_dump_t *mp, void *handle)