36 #define vl_api_nat44_lb_addr_port_t_endian vl_noop_handler 37 #define vl_api_nat44_add_del_lb_static_mapping_t_endian vl_noop_handler 38 #define vl_api_nat44_nat44_lb_static_mapping_details_t_endian vl_noop_handler 50 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 52 #define REPLY_MSG_ID_BASE sm->msg_id_base 56 #define vl_api_version(n,v) static u32 api_version=(v); 63 vl_print (handle, (char *)s); \ 81 rmp->
vpe_pid = ntohl (getpid ());
91 s =
format (0,
"SCRIPT: nat_control_ping ");
135 s =
format (0,
"SCRIPT: nat_show_config ");
144 vl_api_nat_set_workers_reply_t *rmp;
151 rv = VNET_API_ERROR_UNSUPPORTED;
159 rv = VNET_API_ERROR_FEATURE_DISABLED;
180 s =
format (0,
"SCRIPT: nat_set_workers ");
207 rmp->_vl_msg_id = ntohs (VL_API_NAT_WORKER_DETAILS + sm->
msg_id_base);
241 s =
format (0,
"SCRIPT: nat_worker_dump ");
250 vl_api_nat_set_log_level_reply_t *rmp;
254 rv = VNET_API_ERROR_UNSUPPORTED;
267 s =
format (0,
"SCRIPT: nat_set_log_level ");
278 vl_api_nat_ipfix_enable_disable_reply_t *rmp;
287 REPLY_MACRO (VL_API_NAT_IPFIX_ENABLE_DISABLE_REPLY);
296 s =
format (0,
"SCRIPT: nat_ipfix_enable_disable ");
300 s =
format (s,
"src_port %d ", clib_net_to_host_u16 (mp->
src_port));
302 s =
format (s,
"disable ");
311 vl_api_nat_set_reass_reply_t *rmp;
326 s =
format (0,
"SCRIPT: nat_set_reass ");
327 s =
format (s,
"timeout %d max_reass %d max_frag %d drop_frag %d is_ip6 %d",
328 clib_host_to_net_u32 (mp->
timeout),
362 s =
format (0,
"SCRIPT: nat_get_reass");
383 rmp->_vl_msg_id = ntohs (VL_API_NAT_REASS_DETAILS + sm->
msg_id_base);
392 rmp->
proto = reass->key.proto;
393 rmp->
frag_id = ntohl (reass->key.frag_id);
394 rmp->
frag_n = reass->frag_n;
411 rmp->_vl_msg_id = ntohs (VL_API_NAT_REASS_DETAILS + sm->
msg_id_base);
414 clib_memcpy (&ip_address.ip6, &reass->key.src, 16);
417 clib_memcpy (&ip_address.ip6, &reass->key.dst, 16);
420 rmp->
proto = reass->key.proto;
421 rmp->
frag_id = ntohl (reass->key.frag_id);
422 rmp->
frag_n = reass->frag_n;
452 s =
format (0,
"SCRIPT: nat_reass_dump");
461 vl_api_nat_set_timeouts_reply_t *rmp;
488 s =
format (0,
"SCRIPT: nat_set_timeouts ");
489 s =
format (s,
"udp %d tcp_established %d tcp_transitory %d icmp %d\n",
520 s =
format (0,
"SCRIPT: nat_get_timeouts");
530 vl_api_nat_set_addr_and_port_alloc_alg_reply_t *rmp;
532 u16 port_start, port_end;
536 rv = VNET_API_ERROR_UNSUPPORTED;
542 case NAT_ADDR_AND_PORT_ALLOC_ALG_DEFAULT:
545 case NAT_ADDR_AND_PORT_ALLOC_ALG_MAPE:
549 case NAT_ADDR_AND_PORT_ALLOC_ALG_RANGE:
552 if (port_end <= port_start)
554 rv = VNET_API_ERROR_INVALID_VALUE;
560 rv = VNET_API_ERROR_INVALID_VALUE;
565 REPLY_MACRO (VL_API_NAT_SET_ADDR_AND_PORT_ALLOC_ALG_REPLY);
573 s =
format (0,
"SCRIPT: nat_set_addr_and_port_alloc_alg ");
574 s =
format (s,
"alg %d psid_offset %d psid_length %d psid %d start_port %d " 592 REPLY_MACRO2 (VL_API_NAT_GET_ADDR_AND_PORT_ALLOC_ALG_REPLY,
609 s =
format (0,
"SCRIPT: nat_get_addr_and_port_alloc_alg");
618 vl_api_nat_set_mss_clamping_reply_t *rmp;
638 s =
format (0,
"SCRIPT: nat_set_mss_clamping enable %d mss_value %d\n",
666 s =
format (0,
"SCRIPT: nat_get_mss_clamping");
675 vl_api_nat_ha_set_listener_reply_t *rmp;
679 memcpy (&addr, &mp->
ip_address, sizeof (addr));
682 clib_net_to_host_u32 (mp->
path_mtu));
693 s =
format (0,
"SCRIPT: nat_ha_set_listener ");
695 s =
format (s,
"port %d ", clib_net_to_host_u16 (mp->
port));
696 s =
format (s,
"path_mtu %d", clib_net_to_host_u32 (mp->
path_mtu));
717 rmp->
port = clib_host_to_net_u16 (port);
718 rmp->
path_mtu = clib_host_to_net_u32 (path_mtu);
729 s =
format (0,
"SCRIPT: nat_ha_get_listener");
738 vl_api_nat_ha_set_failover_reply_t *rmp;
742 memcpy (&addr, &mp->
ip_address, sizeof (addr));
756 s =
format (0,
"SCRIPT: nat_ha_set_failover ");
758 s =
format (s,
"port %d ", clib_net_to_host_u16 (mp->
port));
771 u32 session_refresh_interval;
779 rmp->
port = clib_host_to_net_u16 (port);
791 s =
format (0,
"SCRIPT: nat_ha_get_failover");
800 vl_api_nat_ha_flush_reply_t *rmp;
813 s =
format (0,
"SCRIPT: nat_ha_flush ");
835 ntohs (VL_API_NAT_HA_RESYNC_COMPLETED_EVENT + sm->
msg_id_base);
844 vl_api_nat_ha_resync_reply_t *rmp;
860 s =
format (0,
"SCRIPT: nat_ha_resync ");
863 clib_host_to_net_u32 (mp->
pid));
876 vl_api_nat44_add_del_address_range_reply_t *rmp;
878 u8 is_add, twice_nat;
879 u32 start_host_order, end_host_order;
887 rv = VNET_API_ERROR_UNSUPPORTED;
893 rv = VNET_API_ERROR_FEATURE_DISABLED;
898 twice_nat = mp->
flags & NAT_API_IS_TWICE_NAT;
901 start_host_order = clib_host_to_net_u32 (tmp[0]);
903 end_host_order = clib_host_to_net_u32 (tmp[0]);
905 count = (end_host_order - start_host_order) + 1;
907 vrf_id = clib_host_to_net_u32 (mp->
vrf_id);
916 for (i = 0; i <
count; i++)
933 REPLY_MACRO (VL_API_NAT44_ADD_DEL_ADDRESS_RANGE_REPLY);
941 s =
format (0,
"SCRIPT: nat44_add_address_range ");
947 s =
format (s,
"twice_nat %d ", mp->
flags & NAT_API_IS_TWICE_NAT);
961 rmp->_vl_msg_id = ntohs (VL_API_NAT44_ADDRESS_DETAILS + sm->
msg_id_base);
971 rmp->
flags |= NAT_API_IS_TWICE_NAT;
1005 s =
format (0,
"SCRIPT: nat44_address_dump ");
1015 vl_api_nat44_interface_add_del_feature_reply_t *rmp;
1030 REPLY_MACRO (VL_API_NAT44_INTERFACE_ADD_DEL_FEATURE_REPLY);
1038 s =
format (0,
"SCRIPT: nat44_interface_add_del_feature ");
1039 s =
format (s,
"sw_if_index %d %s %s",
1041 mp->
flags & NAT_API_IS_INSIDE ?
"in" :
"out",
1042 mp->
is_add ?
"" :
"del");
1056 rmp->_vl_msg_id = ntohs (VL_API_NAT44_INTERFACE_DETAILS + sm->
msg_id_base);
1060 rmp->
flags |= NAT_API_IS_INSIDE;
1062 rmp->
flags |= NAT_API_IS_OUTSIDE;
1083 send_nat44_interface_details(i, reg, mp->context);
1094 s =
format (0,
"SCRIPT: nat44_interface_dump ");
1104 vl_api_nat44_interface_add_del_output_feature_reply_t *rmp;
1110 rv = VNET_API_ERROR_UNSUPPORTED;
1117 mp->
flags & NAT_API_IS_INSIDE,
1122 REPLY_MACRO (VL_API_NAT44_INTERFACE_ADD_DEL_OUTPUT_FEATURE_REPLY);
1130 s =
format (0,
"SCRIPT: nat44_interface_add_del_output_feature ");
1131 s =
format (s,
"sw_if_index %d %s %s",
1133 mp->
flags & NAT_API_IS_INSIDE ?
"in" :
"out",
1134 mp->
is_add ?
"" :
"del");
1150 ntohs (VL_API_NAT44_INTERFACE_OUTPUT_FEATURE_DETAILS + sm->
msg_id_base);
1155 rmp->
flags |= NAT_API_IS_INSIDE;
1178 send_nat44_interface_output_feature_details(i, reg, mp->context);
1188 s =
format (0,
"SCRIPT: nat44_interface_output_feature_dump ");
1198 vl_api_nat44_add_del_static_mapping_reply_t *rmp;
1200 u16 local_port = 0, external_port = 0;
1201 u32 vrf_id, external_sw_if_index;
1209 rv = VNET_API_ERROR_UNSUPPORTED;
1216 if (!(mp->
flags & NAT_API_IS_ADDR_ONLY))
1218 local_port = clib_net_to_host_u16 (mp->
local_port);
1222 vrf_id = clib_net_to_host_u32 (mp->
vrf_id);
1226 if (mp->
flags & NAT_API_IS_TWICE_NAT)
1228 else if (mp->
flags & NAT_API_IS_SELF_TWICE_NAT)
1230 mp->
tag[
sizeof (mp->
tag) - 1] = 0;
1235 external_port, vrf_id,
1236 mp->
flags & NAT_API_IS_ADDR_ONLY,
1237 external_sw_if_index, proto,
1239 mp->
flags & NAT_API_IS_OUT2IN_ONLY, tag, 0);
1243 REPLY_MACRO (VL_API_NAT44_ADD_DEL_STATIC_MAPPING_REPLY);
1251 s =
format (0,
"SCRIPT: nat44_add_del_static_mapping ");
1252 s =
format (s,
"protocol %d local_addr %U external_addr %U ",
1257 if (!(mp->
flags & NAT_API_IS_ADDR_ONLY))
1258 s =
format (s,
"local_port %d external_port %d ",
1262 s =
format (s,
"twice_nat %d out2in_only %d ",
1263 mp->
flags & NAT_API_IS_TWICE_NAT,
1264 mp->
flags & NAT_API_IS_OUT2IN_ONLY);
1267 s =
format (s,
"vrf %d", clib_net_to_host_u32 (mp->
vrf_id));
1270 s =
format (s,
"external_sw_if_index %d",
1286 ntohs (VL_API_NAT44_STATIC_MAPPING_DETAILS + sm->
msg_id_base);
1295 rmp->
flags |= NAT_API_IS_TWICE_NAT;
1297 rmp->
flags |= NAT_API_IS_SELF_TWICE_NAT;
1300 rmp->
flags |= NAT_API_IS_OUT2IN_ONLY;
1304 rmp->
flags |= NAT_API_IS_ADDR_ONLY;
1330 ntohs (VL_API_NAT44_STATIC_MAPPING_DETAILS + sm->
msg_id_base);
1337 rmp->
flags |= NAT_API_IS_TWICE_NAT;
1341 rmp->
flags |= NAT_API_IS_ADDR_ONLY;
1375 if (!is_identity_static_mapping(m) && !is_lb_static_mapping (m))
1376 send_nat44_static_mapping_details (m, reg, mp->context);
1394 s =
format (0,
"SCRIPT: nat44_static_mapping_dump ");
1404 vl_api_nat44_add_del_identity_mapping_reply_t *rmp;
1414 rv = VNET_API_ERROR_UNSUPPORTED;
1418 if (!(mp->
flags & NAT_API_IS_ADDR_ONLY))
1420 port = clib_net_to_host_u16 (mp->
port);
1423 vrf_id = clib_net_to_host_u32 (mp->
vrf_id);
1424 sw_if_index = clib_net_to_host_u32 (mp->
sw_if_index);
1425 if (sw_if_index != ~0)
1429 mp->
tag[
sizeof (mp->
tag) - 1] = 0;
1435 mp->
flags & NAT_API_IS_ADDR_ONLY, sw_if_index,
1436 proto, mp->
is_add, 0, 0, tag, 1);
1440 REPLY_MACRO (VL_API_NAT44_ADD_DEL_IDENTITY_MAPPING_REPLY);
1448 s =
format (0,
"SCRIPT: nat44_add_del_identity_mapping ");
1454 if (!(mp->
flags & NAT_API_IS_ADDR_ONLY))
1457 clib_net_to_host_u16 (mp->
port));
1460 s =
format (s,
" vrf %d", clib_net_to_host_u32 (mp->
vrf_id));
1476 ntohs (VL_API_NAT44_IDENTITY_MAPPING_DETAILS + sm->
msg_id_base);
1479 rmp->
flags |= NAT_API_IS_ADDR_ONLY;
1504 ntohs (VL_API_NAT44_IDENTITY_MAPPING_DETAILS + sm->
msg_id_base);
1507 rmp->
flags = (vl_api_nat_config_flags_t) NAT_API_IS_ADDR_ONLY;
1540 if (is_identity_static_mapping(m) && !is_lb_static_mapping (m))
1542 pool_foreach_index (j, m->locals,
1544 send_nat44_identity_mapping_details (m, j, reg, mp->context);
1550 for (j = 0; j <
vec_len (sm->to_resolve); j++)
1552 rp = sm->to_resolve + j;
1553 if (rp->identity_nat)
1563 s =
format (0,
"SCRIPT: nat44_identity_mapping_dump ");
1573 vl_api_nat44_add_del_interface_addr_reply_t *rmp;
1580 rv = VNET_API_ERROR_UNSUPPORTED;
1589 mp->
flags & NAT_API_IS_TWICE_NAT);
1593 REPLY_MACRO (VL_API_NAT44_ADD_DEL_INTERFACE_ADDR_REPLY);
1601 s =
format (0,
"SCRIPT: nat44_add_del_interface_addr ");
1602 s =
format (s,
"sw_if_index %d twice_nat %d %s",
1604 mp->
flags & NAT_API_IS_TWICE_NAT, mp->
is_add ?
"" :
"del");
1620 ntohs (VL_API_NAT44_INTERFACE_ADDR_DETAILS + sm->
msg_id_base);
1624 rmp->
flags = (vl_api_nat_config_flags_t) NAT_API_IS_TWICE_NAT;
1659 s =
format (0,
"SCRIPT: nat44_interface_addr_dump ");
1674 rmp->_vl_msg_id = ntohs (VL_API_NAT44_USER_DETAILS + sm->
msg_id_base);
1710 send_nat44_user_details (u, reg, mp->context);
1721 s =
format (0,
"SCRIPT: nat44_user_dump ");
1736 ntohs (VL_API_NAT44_USER_SESSION_DETAILS + sm->
msg_id_base);
1741 rmp->
flags |= NAT_API_IS_STATIC;
1744 rmp->
flags |= NAT_API_IS_TWICE_NAT;
1747 rmp->
flags |= NAT_API_IS_EXT_HOST_VALID;
1749 rmp->
last_heard = clib_host_to_net_u64 ((
u64) s->last_heard);
1750 rmp->
total_bytes = clib_host_to_net_u64 (s->total_bytes);
1757 rmp->
protocol = ntohs (s->in2out.port);
1790 u32 session_index, head_index, elt_index;
1811 if (clib_bihash_search_8_8 (&tsm->user_hash, &key, &value))
1819 elt_index = head->
next;
1821 session_index = elt->
value;
1822 while (session_index != ~0)
1828 elt_index = elt->
next;
1830 session_index = elt->
value;
1840 s =
format (0,
"SCRIPT: nat44_user_session_dump ");
1841 s =
format (s,
"ip_address %U vrf_id %d\n",
1843 clib_net_to_host_u32 (mp->
vrf_id));
1850 u32 addr_port_pair_num)
1856 for (i = 0; i < addr_port_pair_num; i++)
1858 ap = &addr_port_pairs[
i];
1859 clib_memset (&lb_addr_port, 0,
sizeof (lb_addr_port));
1861 lb_addr_port.port = clib_net_to_host_u16 (ap->
port);
1863 lb_addr_port.vrf_id = clib_net_to_host_u32 (ap->
vrf_id);
1864 vec_add1 (lb_addr_port_pairs, lb_addr_port);
1867 return lb_addr_port_pairs;
1875 vl_api_nat44_add_del_lb_static_mapping_reply_t *rmp;
1885 rv = VNET_API_ERROR_UNSUPPORTED;
1895 if (mp->
flags & NAT_API_IS_TWICE_NAT)
1897 else if (mp->
flags & NAT_API_IS_SELF_TWICE_NAT)
1899 mp->
tag[
sizeof (mp->
tag) - 1] = 0;
1906 proto, locals, mp->
is_add,
1908 mp->
flags & NAT_API_IS_OUT2IN_ONLY, tag,
1909 clib_net_to_host_u32 (mp->
affinity));
1915 REPLY_MACRO (VL_API_NAT44_ADD_DEL_LB_STATIC_MAPPING_REPLY);
1923 s =
format (0,
"SCRIPT: nat44_add_del_lb_static_mapping ");
1924 s =
format (s,
"is_add %d twice_nat %d out2in_only %d ",
1926 mp->
flags & NAT_API_IS_TWICE_NAT,
1927 mp->
flags & NAT_API_IS_OUT2IN_ONLY);
1937 vl_api_nat44_lb_static_mapping_add_del_local_reply_t *rmp;
1944 rv = VNET_API_ERROR_UNSUPPORTED;
1954 clib_net_to_host_u16
1956 clib_net_to_host_u16 (mp->
1959 clib_net_to_host_u32 (mp->
1964 REPLY_MACRO (VL_API_NAT44_LB_STATIC_MAPPING_ADD_DEL_LOCAL_REPLY);
1972 s =
format (0,
"SCRIPT: nat44_lb_static_mapping_add_del_local ");
1995 ntohs (VL_API_NAT44_LB_STATIC_MAPPING_DETAILS + sm->
msg_id_base);
2003 rmp->
flags |= NAT_API_IS_TWICE_NAT;
2005 rmp->
flags |= NAT_API_IS_SELF_TWICE_NAT;
2007 rmp->
flags |= NAT_API_IS_OUT2IN_ONLY;
2015 clib_memcpy (locals->addr, &(ap->addr), 4);
2016 locals->port = htons (ap->port);
2017 locals->probability = ap->probability;
2018 locals->vrf_id = ntohl (ap->vrf_id);
2046 if (is_lb_static_mapping(m))
2047 send_nat44_lb_static_mapping_details (m, reg, mp->context);
2057 s =
format (0,
"SCRIPT: nat44_lb_static_mapping_dump ");
2066 vl_api_nat44_del_session_reply_t *rmp;
2076 rv = VNET_API_ERROR_UNSUPPORTED;
2081 port = clib_net_to_host_u16 (mp->
port);
2082 vrf_id = clib_net_to_host_u32 (mp->
vrf_id);
2087 is_in = mp->
flags & NAT_API_IS_INSIDE;
2089 if (mp->
flags & NAT_API_IS_EXT_HOST_VALID)
2106 s =
format (0,
"SCRIPT: nat44_add_del_static_mapping ");
2107 s =
format (s,
"addr %U port %d protocol %d vrf_id %d is_in %d",
2109 clib_net_to_host_u16 (mp->
port),
2111 mp->
flags & NAT_API_IS_INSIDE);
2112 if (mp->
flags & NAT_API_IS_EXT_HOST_VALID)
2113 s =
format (s,
"ext_host_address %U ext_host_port %d",
2125 vl_api_nat44_forwarding_enable_disable_reply_t *rmp;
2127 u32 *ses_to_be_removed = 0, *ses_index;
2140 if (is_fwd_bypass_session(s))
2142 vec_add1 (ses_to_be_removed, s - tsm->sessions);
2156 REPLY_MACRO (VL_API_NAT44_FORWARDING_ENABLE_DISABLE_REPLY);
2164 s =
format (0,
"SCRIPT: nat44_forwarding_enable_disable ");
2185 ntohs (VL_API_NAT44_FORWARDING_IS_ENABLED_REPLY + sm->
msg_id_base);
2198 s =
format (0,
"SCRIPT: nat44_forwarding_is_enabled ");
2211 vl_api_nat_det_add_del_map_reply_t *rmp;
2217 rv = VNET_API_ERROR_UNSUPPORTED;
2236 s =
format (0,
"SCRIPT: nat_det_add_del_map ");
2237 s =
format (s,
"inside address %U/%d outside address %U/%d\n",
2250 u16 lo_port = 0, hi_port = 0;
2256 rv = VNET_API_ERROR_UNSUPPORTED;
2266 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
2289 s =
format (0,
"SCRIPT: nat_det_forward");
2306 rv = VNET_API_ERROR_UNSUPPORTED;
2316 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
2336 s =
format (0,
"SCRIPT: nat_det_reverse");
2337 s =
format (s,
"outside ip address %U outside port %d",
2352 rmp->_vl_msg_id = ntohs (VL_API_NAT_DET_MAP_DETAILS + sm->
msg_id_base);
2390 s =
format (0,
"SCRIPT: nat_det_map_dump ");
2400 vl_api_nat_det_close_session_out_reply_t *rmp;
2409 rv = VNET_API_ERROR_UNSUPPORTED;
2419 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
2429 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
2435 REPLY_MACRO (VL_API_NAT_DET_CLOSE_SESSION_OUT_REPLY);
2444 s =
format (0,
"SCRIPT: nat_det_close_session_out ");
2445 s =
format (s,
"out_addr %U out_port %d " 2446 "ext_addr %U ext_port %d\n",
2458 vl_api_nat_det_close_session_in_reply_t *rmp;
2467 rv = VNET_API_ERROR_UNSUPPORTED;
2477 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
2485 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
2491 REPLY_MACRO (VL_API_NAT_DET_CLOSE_SESSION_OUT_REPLY);
2499 s =
format (0,
"SCRIPT: nat_det_close_session_in ");
2500 s =
format (s,
"in_addr %U in_port %d ext_addr %U ext_port %d\n",
2516 rmp->_vl_msg_id = ntohs (VL_API_NAT_DET_SESSION_DETAILS + sm->
msg_id_base);
2566 s =
format (0,
"SCRIPT: nat_det_session_dump ");
2580 vl_api_nat64_add_del_pool_addr_range_reply_t *rmp;
2584 u32 start_host_order, end_host_order;
2590 start_host_order = clib_host_to_net_u32 (tmp[0]);
2592 end_host_order = clib_host_to_net_u32 (tmp[0]);
2594 count = (end_host_order - start_host_order) + 1;
2596 vrf_id = clib_host_to_net_u32 (mp->
vrf_id);
2600 for (i = 0; i <
count; i++)
2609 REPLY_MACRO (VL_API_NAT64_ADD_DEL_POOL_ADDR_RANGE_REPLY);
2617 s =
format (0,
"SCRIPT: nat64_add_del_pool_addr_range ");
2618 s =
format (s,
"%U - %U vrf_id %u %s\n",
2642 rmp->_vl_msg_id = ntohs (VL_API_NAT64_POOL_ADDR_DETAILS + sm->
msg_id_base);
2683 s =
format (0,
"SCRIPT: nat64_pool_addr_dump\n");
2693 vl_api_nat64_add_del_interface_reply_t *rmp;
2704 REPLY_MACRO (VL_API_NAT64_ADD_DEL_INTERFACE_REPLY);
2713 s =
format (0,
"SCRIPT: nat64_add_del_interface ");
2714 s =
format (s,
"sw_if_index %d %s %s",
2716 mp->
flags & NAT_API_IS_INSIDE ?
"in" :
"out",
2717 mp->
is_add ?
"" :
"del");
2731 rmp->_vl_msg_id = ntohs (VL_API_NAT64_INTERFACE_DETAILS + sm->
msg_id_base);
2735 rmp->
flags |= NAT_API_IS_INSIDE;
2737 rmp->
flags |= NAT_API_IS_OUTSIDE;
2769 s =
format (0,
"SCRIPT: snat_interface_dump ");
2779 vl_api_nat64_add_del_static_bib_reply_t *rmp;
2789 clib_net_to_host_u16 (mp->
i_port),
2790 clib_net_to_host_u16 (mp->
o_port),
2792 clib_net_to_host_u32 (mp->
vrf_id),
2795 REPLY_MACRO (VL_API_NAT64_ADD_DEL_STATIC_BIB_REPLY);
2803 s =
format (0,
"SCRIPT: nat64_add_del_static_bib ");
2804 s =
format (s,
"protocol %d i_addr %U o_addr %U ",
2809 s =
format (s,
"vrf %d", clib_net_to_host_u32 (mp->
vrf_id));
2828 rmp->_vl_msg_id = ntohs (VL_API_NAT64_BIB_DETAILS + sm->
msg_id_base);
2832 rmp->
i_port = bibe->in_port;
2833 rmp->
o_port = bibe->out_port;
2835 rmp->
proto = bibe->proto;
2836 if (bibe->is_static)
2837 rmp->
flags |= NAT_API_IS_STATIC;
2838 rmp->
ses_num = ntohl (bibe->ses_num);
2872 s =
format (0,
"SCRIPT: snat_bib_dump protocol %d", mp->
proto);
2883 nat64_db_bib_entry_t *bibe;
2896 rmp->_vl_msg_id = ntohs (VL_API_NAT64_ST_DETAILS + sm->
msg_id_base);
2901 rmp->
ol_port = bibe->out_port;
2906 rmp->
proto = ste->proto;
2943 s =
format (0,
"SCRIPT: snat_st_dump protocol %d", mp->
proto);
2951 vl_api_nat64_add_del_prefix_reply_t *rmp;
2970 s =
format (0,
"SCRIPT: nat64_add_del_prefix %U/%u vrf_id %u %s\n",
2986 rmp->_vl_msg_id = ntohs (VL_API_NAT64_PREFIX_DETAILS + sm->
msg_id_base);
3020 s =
format (0,
"SCRIPT: nat64_prefix_dump\n");
3030 vl_api_nat64_add_del_interface_addr_reply_t *rmp;
3040 REPLY_MACRO (VL_API_NAT64_ADD_DEL_INTERFACE_ADDR_REPLY);
3048 s =
format (0,
"SCRIPT: nat64_add_del_interface_addr ");
3049 s =
format (s,
"sw_if_index %d %s",
3051 mp->
is_add ?
"" :
"del");
3063 vl_api_dslite_set_aftr_addr_reply_t *rmp;
3086 s =
format (0,
"SCRIPT: dslite_set_aftr_addr ");
3087 s =
format (s,
"ip6_addr %U ip4_addr %U\n",
3117 s =
format (0,
"SCRIPT: dslite_get_aftr_addr");
3125 vl_api_dslite_set_b4_addr_reply_t *rmp;
3148 s =
format (0,
"SCRIPT: dslite_set_b4_addr ");
3149 s =
format (s,
"ip6_addr %U ip4_addr %U\n",
3179 s =
format (0,
"SCRIPT: dslite_get_b4_addr");
3188 vl_api_dslite_add_del_pool_addr_range_reply_t *rmp;
3193 u32 start_host_order, end_host_order;
3198 start_host_order = clib_host_to_net_u32 (tmp[0]);
3200 end_host_order = clib_host_to_net_u32 (tmp[0]);
3202 count = (end_host_order - start_host_order) + 1;
3205 for (i = 0; i <
count; i++)
3214 REPLY_MACRO (VL_API_DSLITE_ADD_DEL_POOL_ADDR_RANGE_REPLY);
3228 rmp->_vl_msg_id = ntohs (VL_API_DSLITE_ADDRESS_DETAILS + sm->
msg_id_base);
3260 s =
format (0,
"SCRIPT: dslite_address_dump ");
3270 s =
format (0,
"SCRIPT: dslite_add_del_pool_addr_range ");
3271 s =
format (s,
"%U - %U\n",
3288 vl_api_nat66_add_del_interface_reply_t *rmp;
3299 REPLY_MACRO (VL_API_NAT66_ADD_DEL_INTERFACE_REPLY);
3308 s =
format (0,
"SCRIPT: nat66_add_del_interface ");
3309 s =
format (s,
"sw_if_index %d %s %s",
3311 mp->
flags & NAT_API_IS_INSIDE ?
"in" :
"out",
3312 mp->
is_add ?
"" :
"del");
3322 vl_api_nat66_add_del_static_mapping_reply_t *rmp;
3331 clib_net_to_host_u32 (mp->
vrf_id),
3334 REPLY_MACRO (VL_API_NAT66_ADD_DEL_STATIC_MAPPING_REPLY);
3342 s =
format (0,
"SCRIPT: nat66_add_del_static_mapping ");
3343 s =
format (s,
"local_ip_address %U external_ip_address %U vrf_id %d %s",
3346 clib_net_to_host_u32 (mp->
vrf_id), mp->
is_add ?
"" :
"del");
3366 rmp->_vl_msg_id = ntohs (VL_API_NAT66_INTERFACE_DETAILS + sm->
msg_id_base);
3369 rmp->
flags |= NAT_API_IS_INSIDE;
3400 s =
format (0,
"SCRIPT: nat66_interface_dump ");
3424 ntohs (VL_API_NAT66_STATIC_MAPPING_DETAILS + sm->
msg_id_base);
3461 s =
format (0,
"SCRIPT: nat66_static_mapping_dump ");
3468 #define foreach_snat_plugin_api_msg \ 3469 _(NAT_CONTROL_PING, nat_control_ping) \ 3470 _(NAT_SHOW_CONFIG, nat_show_config) \ 3471 _(NAT_SET_WORKERS, nat_set_workers) \ 3472 _(NAT_WORKER_DUMP, nat_worker_dump) \ 3473 _(NAT_SET_LOG_LEVEL, nat_set_log_level) \ 3474 _(NAT_IPFIX_ENABLE_DISABLE, nat_ipfix_enable_disable) \ 3475 _(NAT_SET_REASS, nat_set_reass) \ 3476 _(NAT_GET_REASS, nat_get_reass) \ 3477 _(NAT_REASS_DUMP, nat_reass_dump) \ 3478 _(NAT_SET_TIMEOUTS, nat_set_timeouts) \ 3479 _(NAT_GET_TIMEOUTS, nat_get_timeouts) \ 3480 _(NAT_SET_ADDR_AND_PORT_ALLOC_ALG, nat_set_addr_and_port_alloc_alg) \ 3481 _(NAT_GET_ADDR_AND_PORT_ALLOC_ALG, nat_get_addr_and_port_alloc_alg) \ 3482 _(NAT_SET_MSS_CLAMPING, nat_set_mss_clamping) \ 3483 _(NAT_GET_MSS_CLAMPING, nat_get_mss_clamping) \ 3484 _(NAT_HA_SET_LISTENER, nat_ha_set_listener) \ 3485 _(NAT_HA_SET_FAILOVER, nat_ha_set_failover) \ 3486 _(NAT_HA_GET_LISTENER, nat_ha_get_listener) \ 3487 _(NAT_HA_GET_FAILOVER, nat_ha_get_failover) \ 3488 _(NAT_HA_FLUSH, nat_ha_flush) \ 3489 _(NAT_HA_RESYNC, nat_ha_resync) \ 3490 _(NAT44_ADD_DEL_ADDRESS_RANGE, nat44_add_del_address_range) \ 3491 _(NAT44_INTERFACE_ADD_DEL_FEATURE, nat44_interface_add_del_feature) \ 3492 _(NAT44_ADD_DEL_STATIC_MAPPING, nat44_add_del_static_mapping) \ 3493 _(NAT44_ADD_DEL_IDENTITY_MAPPING, nat44_add_del_identity_mapping) \ 3494 _(NAT44_STATIC_MAPPING_DUMP, nat44_static_mapping_dump) \ 3495 _(NAT44_IDENTITY_MAPPING_DUMP, nat44_identity_mapping_dump) \ 3496 _(NAT44_ADDRESS_DUMP, nat44_address_dump) \ 3497 _(NAT44_INTERFACE_DUMP, nat44_interface_dump) \ 3498 _(NAT44_ADD_DEL_INTERFACE_ADDR, nat44_add_del_interface_addr) \ 3499 _(NAT44_INTERFACE_ADDR_DUMP, nat44_interface_addr_dump) \ 3500 _(NAT44_USER_DUMP, nat44_user_dump) \ 3501 _(NAT44_USER_SESSION_DUMP, nat44_user_session_dump) \ 3502 _(NAT44_INTERFACE_ADD_DEL_OUTPUT_FEATURE, \ 3503 nat44_interface_add_del_output_feature) \ 3504 _(NAT44_INTERFACE_OUTPUT_FEATURE_DUMP, \ 3505 nat44_interface_output_feature_dump) \ 3506 _(NAT44_ADD_DEL_LB_STATIC_MAPPING, nat44_add_del_lb_static_mapping) \ 3507 _(NAT44_LB_STATIC_MAPPING_ADD_DEL_LOCAL, \ 3508 nat44_lb_static_mapping_add_del_local) \ 3509 _(NAT44_LB_STATIC_MAPPING_DUMP, nat44_lb_static_mapping_dump) \ 3510 _(NAT44_DEL_SESSION, nat44_del_session) \ 3511 _(NAT44_FORWARDING_ENABLE_DISABLE, nat44_forwarding_enable_disable) \ 3512 _(NAT44_FORWARDING_IS_ENABLED, nat44_forwarding_is_enabled) \ 3513 _(NAT_DET_ADD_DEL_MAP, nat_det_add_del_map) \ 3514 _(NAT_DET_FORWARD, nat_det_forward) \ 3515 _(NAT_DET_REVERSE, nat_det_reverse) \ 3516 _(NAT_DET_MAP_DUMP, nat_det_map_dump) \ 3517 _(NAT_DET_CLOSE_SESSION_OUT, nat_det_close_session_out) \ 3518 _(NAT_DET_CLOSE_SESSION_IN, nat_det_close_session_in) \ 3519 _(NAT_DET_SESSION_DUMP, nat_det_session_dump) \ 3520 _(NAT64_ADD_DEL_POOL_ADDR_RANGE, nat64_add_del_pool_addr_range) \ 3521 _(NAT64_POOL_ADDR_DUMP, nat64_pool_addr_dump) \ 3522 _(NAT64_ADD_DEL_INTERFACE, nat64_add_del_interface) \ 3523 _(NAT64_INTERFACE_DUMP, nat64_interface_dump) \ 3524 _(NAT64_ADD_DEL_STATIC_BIB, nat64_add_del_static_bib) \ 3525 _(NAT64_BIB_DUMP, nat64_bib_dump) \ 3526 _(NAT64_ST_DUMP, nat64_st_dump) \ 3527 _(NAT64_ADD_DEL_PREFIX, nat64_add_del_prefix) \ 3528 _(NAT64_PREFIX_DUMP, nat64_prefix_dump) \ 3529 _(NAT64_ADD_DEL_INTERFACE_ADDR, nat64_add_del_interface_addr) \ 3530 _(DSLITE_ADD_DEL_POOL_ADDR_RANGE, dslite_add_del_pool_addr_range) \ 3531 _(DSLITE_ADDRESS_DUMP, dslite_address_dump) \ 3532 _(DSLITE_SET_AFTR_ADDR, dslite_set_aftr_addr) \ 3533 _(DSLITE_GET_AFTR_ADDR, dslite_get_aftr_addr) \ 3534 _(DSLITE_SET_B4_ADDR, dslite_set_b4_addr) \ 3535 _(DSLITE_GET_B4_ADDR, dslite_get_b4_addr) \ 3536 _(NAT66_ADD_DEL_INTERFACE, nat66_add_del_interface) \ 3537 _(NAT66_INTERFACE_DUMP, nat66_interface_dump) \ 3538 _(NAT66_ADD_DEL_STATIC_MAPPING, nat66_add_del_static_mapping) \ 3539 _(NAT66_STATIC_MAPPING_DUMP, nat66_static_mapping_dump) 3547 vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \ 3549 vl_api_##n##_t_handler, \ 3551 vl_api_##n##_t_endian, \ 3552 vl_api_##n##_t_print, \ 3553 sizeof(vl_api_##n##_t), 1); 3560 #define vl_msg_name_crc_list 3562 #undef vl_msg_name_crc_list 3567 #define _(id,n,crc) \ 3568 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + sm->msg_id_base); 3569 foreach_vl_msg_name_crc_nat;
3576 #define _(n,f) sm->api_main->msg_print_handlers \ 3577 [VL_API_##n + sm->msg_id_base] \ 3578 = (void *) vl_api_##f##_t_print; 3589 name =
format (0,
"nat_%08x%c", api_version, 0);
ip4_address_t external_addr
vl_api_ip4_address_t ext_host_address
NAT64 interface details response.
nat64_db_t * db
BIB and session DB per thread.
#define nat_log_info(...)
u32 nat_reass_get_timeout(u8 is_ip6)
Get reassembly timeout.
NAT virtual fragmentation reassemblies response.
#define snat_is_session_static(s)
Check if SNAT session is created from static mapping.
u32 sessions_per_user_list_head_index
NAT44 load-balancing static mapping rule details response.
vl_api_ip4_address_t ext_addr
static void vl_api_nat66_add_del_interface_t_handler(vl_api_nat66_add_del_interface_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.
int nat64_set_udp_timeout(u32 timeout)
Set UDP session timeout.
static void send_nat44_identity_map_resolve_details(snat_static_map_resolve_t *m, vl_api_registration_t *reg, u32 context)
static void vl_api_nat_worker_dump_t_handler(vl_api_nat_worker_dump_t *mp)
vl_api_interface_index_t sw_if_index
Get address and port assignment algorithm reply.
static int nat64_api_pool_walk(snat_address_t *a, void *arg)
vl_api_ip4_address_t out_addr
vl_api_nat_config_flags_t flags
NAT64 BIB details response.
Dump NAT virtual fragmentation reassemblies.
static void * vl_api_nat44_user_dump_t_print(vl_api_nat44_user_dump_t *mp, void *handle)
static void * vl_api_nat_ha_set_listener_t_print(vl_api_nat_ha_set_listener_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)
vl_api_ip4_address_t external_addr
static void vl_api_nat_ha_set_listener_t_handler(vl_api_nat_ha_set_listener_t *mp)
Get values of timeouts for NAT sessions (seconds)
NAT workers details response.
vl_api_interface_index_t external_sw_if_index
Get values of timeouts for NAT sessions reply.
Set AFTR IPv6 and IPv4 addresses.
static void * vl_api_nat64_interface_dump_t_print(vl_api_nat64_interface_dump_t *mp, void *handle)
vl_api_interface_index_t sw_if_index
static void send_nat44_user_session_details(snat_session_t *s, vl_api_registration_t *reg, u32 context)
vl_api_ip4_address_t external_addr
NAT44 interface with output feature details response.
static void * vl_api_nat_set_addr_and_port_alloc_alg_t_print(vl_api_nat_set_addr_and_port_alloc_alg_t *mp, void *handle)
vl_api_ip4_address_t out_addr
Dump NAT44 pool addresses interfaces.
static void vl_api_nat44_user_session_dump_t_handler(vl_api_nat44_user_session_dump_t *mp)
#define is_ed_session(s)
Check if NAT session is endpoint dependent.
static void * vl_api_nat44_del_session_t_print(vl_api_nat44_del_session_t *mp, void *handle)
ip4_address_t aftr_ip4_addr
NAT44 identity mapping details response.
vl_api_ip4_address_t external_addr
Add/delete NAT44 identity mapping.
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.
vl_api_ip4_address_t ip4_addr
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vl_api_nat_config_flags_t flags
vl_api_nat_config_flags_t flags
static void vl_api_nat44_lb_static_mapping_dump_t_handler(vl_api_nat44_lb_static_mapping_dump_t *mp)
vl_api_nat_config_flags_t flags
static void send_dslite_address_details(snat_address_t *ap, vl_api_registration_t *reg, u32 context)
static void vl_api_nat_reass_dump_t_handler(vl_api_nat_reass_dump_t *mp)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static int nat64_api_interface_walk(snat_interface_t *i, void *arg)
Add/delete address range to DS-Lite pool.
static void vl_api_nat64_bib_dump_t_handler(vl_api_nat64_bib_dump_t *mp)
static int nat_ip6_reass_walk_api(nat_reass_ip6_t *reass, void *arg)
static clib_error_t * snat_plugin_api_hookup(vlib_main_t *vm)
void nat_free_session_data(snat_main_t *sm, snat_session_t *s, u32 thread_index, u8 is_ha)
Free NAT44 session data (lookup keys, external addrres port)
Set NAT virtual fragmentation reassembly.
static void * vl_api_nat64_bib_dump_t_print(vl_api_nat64_bib_dump_t *mp, void *handle)
static void * vl_api_nat66_add_del_static_mapping_t_print(vl_api_nat66_add_del_static_mapping_t *mp, void *handle)
vl_api_ip6_address_t external_ip_address
Control ping from client to api server request.
Set values of timeouts for NAT sessions (seconds)
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
Get outside address and port range from inside address.
vl_api_ip4_address_t local_ip_address
vl_api_address_t dst_addr
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
vl_api_ip4_address_t ip_address
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.
Combined counter to hold both packets and byte differences.
Add/delete NAT44 load-balancing static mapping rule backend.
NAT44 interface details response.
u32 session_refresh_interval
vl_api_ip6_prefix_t prefix
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 send_nat44_interface_addr_details(u32 sw_if_index, vl_api_registration_t *reg, u32 context, u8 twice_nat)
Dump NAT66 static mappings.
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_dslite_add_del_pool_addr_range_t_print(vl_api_dslite_add_del_pool_addr_range_t *mp, void *handle)
static void vl_api_nat_get_addr_and_port_alloc_alg_t_handler(vl_api_nat_get_addr_and_port_alloc_alg_t *mp)
vl_api_nat_config_flags_t flags
vl_api_ip4_address_t first_ip_address
bool static_mapping_connection_tracking
static void * vl_api_nat64_add_del_static_bib_t_print(vl_api_nat64_add_del_static_bib_t *mp, void *handle)
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.
vl_api_ip4_address_t or_addr
static void * vl_api_nat64_pool_addr_dump_t_print(vl_api_nat64_pool_addr_dump_t *mp, void *handle)
vl_api_ip4_address_t ip_address
Response to check if forwarding is enabled or disabled.
snat_det_map_t * det_maps
vl_api_nat_config_flags_t flags
static void vl_api_nat_control_ping_t_handler(vl_api_nat_control_ping_t *mp)
Get NAT virtual fragmentation reassembly configuration reply.
int nat64_add_interface_address(u32 sw_if_index, int is_add)
NAT64 pool address from specific (DHCP addressed) interface.
Get HA failover/remote settings reply.
Add/delete NAT64 pool address from specific interfce.
static void snat_det_reverse(snat_det_map_t *dm, ip4_address_t *out_addr, u16 out_port, ip4_address_t *in_addr)
void * vl_msg_api_alloc(int nbytes)
#define snat_is_unk_proto_session(s)
Check if SNAT session for unknown protocol.
vl_api_ip4_address_t start_addr
Set HA failover (remote settings)
vl_api_nat_config_flags_t flags
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)
static void * vl_api_nat44_lb_static_mapping_add_del_local_t_print(vl_api_nat44_lb_static_mapping_add_del_local_t *mp, void *handle)
Enable/disable NAT64 feature on the interface.
void nat_ip4_reass_walk(nat_ip4_reass_walk_fn_t fn, void *ctx)
Walk IPv4 reassemblies.
static void * vl_api_nat_get_reass_t_print(vl_api_nat_get_reass_t *mp, void *handle)
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)
Enable/disable NAT44 feature on the interface.
nat44_lb_addr_port_t * locals
static void vl_api_nat_get_timeouts_t_handler(vl_api_nat_get_timeouts_t *mp)
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_nat44_forwarding_is_enabled_t_print(vl_api_nat44_forwarding_is_enabled_t *mp, void *handle)
vl_api_ip4_address_t out_addr
int nat44_add_del_lb_static_mapping(ip4_address_t e_addr, u16 e_port, snat_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)
#define clib_memcpy(d, s, n)
#define nat_interface_is_outside(i)
Check if NAT interface is outside.
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)
u32 session_refresh_interval
static void * vl_api_nat44_identity_mapping_dump_t_print(vl_api_nat44_identity_mapping_dump_t *mp, void *handle)
static void * vl_api_dslite_address_dump_t_print(vl_api_dslite_address_dump_t *mp, void *handle)
vl_api_ip4_address_t ip4_addr
vl_api_interface_index_t sw_if_index
static void * vl_api_nat_det_add_del_map_t_print(vl_api_nat_det_add_del_map_t *mp, void *handle)
vl_api_nat_config_flags_t flags
static void vl_api_nat44_user_dump_t_handler(vl_api_nat44_user_dump_t *mp)
vl_api_ip6_address_t ir_addr
int nat_ha_resync(u32 client_index, u32 pid, nat_ha_resync_event_cb_t event_callback)
Resync HA (resend existing sessions to new failover)
Check if forwarding is enabled or disabled.
vl_api_ip4_address_t o_addr
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
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)
vl_api_interface_index_t sw_if_index
static void vl_api_nat_ha_get_listener_t_handler(vl_api_nat_ha_get_listener_t *mp)
static void vl_api_nat_set_addr_and_port_alloc_alg_t_handler(vl_api_nat_set_addr_and_port_alloc_alg_t *mp)
ip4_address_t ext_host_addr
vl_api_nat_config_flags_t flags
NAT66 interface details response.
static int nat64_api_st_walk(nat64_db_st_entry_t *ste, void *arg)
Response to get AFTR IPv6 and IPv4 addresses.
Enable/disbale NAT44 as an interface output feature (postrouting in2out translation) ...
vl_api_nat_config_flags_t flags
static void sent_nat_det_map_details(snat_det_map_t *m, vl_api_registration_t *reg, u32 context)
int snat_add_address(snat_main_t *sm, ip4_address_t *addr, u32 vrf_id, u8 twice_nat)
Add external address to NAT44 pool.
vl_api_registration_t * rp
static void vl_api_nat_ha_resync_t_handler(vl_api_nat_ha_resync_t *mp)
int nat64_set_icmp_timeout(u32 timeout)
Set ICMP session timeout.
static void * vl_api_nat_ha_set_failover_t_print(vl_api_nat_ha_set_failover_t *mp, void *handle)
struct nat64_api_walk_ctx_t_ nat64_api_walk_ctx_t
ip6_address_t b4_ip6_addr
#define SNAT_DET_SES_PER_USER
NAT44 load-balancing address and port pair.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define is_fwd_bypass_session(s)
Check if NAT session is forwarding bypass.
#define foreach_snat_plugin_api_msg
vl_api_ip6_address_t i_addr
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 send_nat44_user_details(snat_user_t *u, vl_api_registration_t *reg, u32 context)
Dump interfaces with NAT44 output feature.
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)
vl_api_ip4_address_t ip_address
static void vl_api_nat44_forwarding_enable_disable_t_handler(vl_api_nat44_forwarding_enable_disable_t *mp)
static void vl_api_nat_det_map_dump_t_handler(vl_api_nat_det_map_dump_t *mp)
Get B4 IPv6 and IPv4 addresses.
vl_api_ip6_address_t local_ip_address
static void * vl_api_nat_set_log_level_t_print(vl_api_nat_set_log_level_t *mp, void *handle)
vl_api_ip4_address_t ext_addr
vl_api_nat_config_flags_t flags
Flush the current HA data (for testing)
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_nat66_add_del_interface_t_print(vl_api_nat66_add_del_interface_t *mp, void *handle)
vl_api_nat_config_flags_t flags
static void * vl_api_nat44_forwarding_enable_disable_t_print(vl_api_nat44_forwarding_enable_disable_t *mp, void *handle)
clib_error_t * snat_api_init(vlib_main_t *vm, snat_main_t *sm)
static void nat44_delete_session(snat_main_t *sm, snat_session_t *ses, u32 thread_index)
static void nat_ha_resync_completed_event_cb(u32 client_index, u32 pid, u32 missed_count)
static void * vl_api_nat_ha_resync_t_print(vl_api_nat_ha_resync_t *mp, void *handle)
static void * vl_api_nat_ha_get_listener_t_print(vl_api_nat_ha_get_listener_t *mp, void *handle)
static heap_elt_t * first(heap_header_t *h)
u8 nat_reass_get_max_frag(u8 is_ip6)
Get maximum number of fragmets per reassembly.
twice_nat_type_t twice_nat
u32 * auto_add_sw_if_indices_twice_nat
u32 max_translations_per_user
static void * vl_api_dslite_get_b4_addr_t_print(vl_api_dslite_get_b4_addr_t *mp, void *handle)
static u32 snat_det_user_ses_offset(ip4_address_t *addr, u8 plen)
static void * vl_api_nat_get_timeouts_t_print(vl_api_nat_get_timeouts_t *mp, void *handle)
vlib_worker_thread_t * vlib_worker_threads
static void send_nat44_address_details(snat_address_t *a, vl_api_registration_t *reg, u32 context, u8 twice_nat)
Get TCP MSS rewriting configuration.
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
vl_api_nat_config_flags_t flags
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Control ping from the client to the server response.
void nat66_static_mappings_walk(nat66_static_mapping_walk_fn_t fn, void *ctx)
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)
static void * vl_api_nat_ha_flush_t_print(vl_api_nat_ha_flush_t *mp, void *handle)
counter_t packets
packet counter
nat_addr_and_port_alloc_alg_t addr_and_port_alloc_alg
static void vl_api_nat44_forwarding_is_enabled_t_handler(vl_api_nat44_forwarding_is_enabled_t *mp)
Add/delete address range to NAT64 pool.
snat_det_session_t * sessions
Close deterministic NAT session by outside address and port.
vl_api_nat_config_flags_t flags
static void * vl_api_nat_get_addr_and_port_alloc_alg_t_print(vl_api_nat_get_addr_and_port_alloc_alg_t *mp, void *handle)
static snat_det_map_t * snat_det_map_by_out(snat_main_t *sm, ip4_address_t *out_addr)
vl_api_nat_config_flags_t flags
static void * vl_api_dslite_get_aftr_addr_t_print(vl_api_dslite_get_aftr_addr_t *mp, void *handle)
static void vl_api_nat_ha_get_failover_t_handler(vl_api_nat_ha_get_failover_t *mp)
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
Enable/disable forwarding for NAT44 Forward packets which don't match existing translation or static ...
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_nat_set_timeouts_t_handler(vl_api_nat_set_timeouts_t *mp)
Tell client about a HA resync completion event.
snat_static_mapping_t * static_mappings
vl_api_registration_t * reg
vl_api_ip4_address_t external_ip_address
void nat_ha_get_listener(ip4_address_t *addr, u16 *port, u32 *path_mtu)
Get HA listener/local configuration.
Set HA listener (local settings)
static void * vl_api_dslite_set_aftr_addr_t_print(vl_api_dslite_set_aftr_addr_t *mp, void *handle)
static void vl_api_nat_ha_set_failover_t_handler(vl_api_nat_ha_set_failover_t *mp)
void nat_ha_flush(u8 is_resync)
Flush the current HA data (for testing)
static int nat66_api_interface_walk(snat_interface_t *i, void *arg)
vl_api_ip6_address_t i_addr
static void vl_api_nat64_pool_addr_dump_t_handler(vl_api_nat64_pool_addr_dump_t *mp)
#define nat_interface_is_inside(i)
Check if NAT interface is inside.
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)
snat_address_t * addr_pool
Dump NAT44 identity mappings.
u32 translation_memory_size
vl_api_ip4_address_t ext_host_nat_address
vl_api_ip4_address_t outside_ip_address
int dslite_add_del_pool_addr(dslite_main_t *dm, ip4_address_t *addr, u8 is_add)
vl_api_ip4_address_t address
void nat_set_alloc_addr_and_port_default(void)
Set address and port assignment algorithm to default/standard.
int dslite_set_b4_ip4_addr(dslite_main_t *dm, ip4_address_t *addr)
static void vl_api_nat44_add_del_identity_mapping_t_handler(vl_api_nat44_add_del_identity_mapping_t *mp)
static void send_nat_det_session_details(snat_det_session_t *s, vl_api_registration_t *reg, u32 context)
static void * vl_api_nat66_static_mapping_dump_t_print(vl_api_nat66_static_mapping_dump_t *mp, void *handle)
static void vl_api_nat_get_mss_clamping_t_handler(vl_api_nat_get_mss_clamping_t *mp)
Add/delete NAT44 pool address from specific interfce.
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)
vl_api_ip4_address_t in_addr
vl_api_ip6_address_t il_addr
static void vl_api_dslite_set_aftr_addr_t_handler(vl_api_dslite_set_aftr_addr_t *mp)
Get address and port assignment algorithm.
static void vl_api_nat44_del_session_t_handler(vl_api_nat44_del_session_t *mp)
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)
Enable/disable NAT66 feature on the interface.
static void send_nat44_interface_details(snat_interface_t *i, vl_api_registration_t *reg, u32 context)
snat_interface_t * output_feature_interfaces
vl_api_ip6_address_t external_ip_address
vl_api_ip4_address_t last_ip_address
An API client registration, only in vpp/vlib.
u16 nat_reass_get_max_reass(u8 is_ip6)
Get maximum number of concurrent reassemblies.
vl_api_interface_index_t sw_if_index
vl_api_ip4_address_t ip_address
#define BAD_SW_IF_INDEX_LABEL
Add/delete NAT deterministic mapping.
vl_api_ip4_address_t ext_addr
static void vl_api_nat_ha_flush_t_handler(vl_api_nat_ha_flush_t *mp)
static void * vl_api_nat_set_timeouts_t_print(vl_api_nat_set_timeouts_t *mp, void *handle)
ip6_address_t aftr_ip6_addr
static int nat66_api_static_mapping_walk(nat66_static_mapping_t *m, void *arg)
vl_api_interface_index_t sw_if_index
vl_api_ip4_address_t ip4_addr
static void * vl_api_nat66_interface_dump_t_print(vl_api_nat66_interface_dump_t *mp, void *handle)
static void vl_api_nat66_add_del_static_mapping_t_handler(vl_api_nat66_add_del_static_mapping_t *mp)
static u8 snat_proto_to_ip_proto(snat_protocol_t snat_proto)
static void * vl_api_nat64_add_del_prefix_t_print(vl_api_nat64_add_del_prefix_t *mp, void *handle)
static void vl_api_nat64_add_del_interface_addr_t_handler(vl_api_nat64_add_del_interface_addr_t *mp)
Get HA failover/remote settings.
Dump interfaces with NAT44 feature.
int nat66_interface_add_del(u32 sw_if_index, u8 is_inside, u8 is_add)
void nat64_pool_addr_walk(nat64_pool_addr_walk_fn_t fn, void *ctx)
Walk NAT64 pool.
int nat_reass_set(u32 timeout, u16 max_reass, u8 max_frag, u8 drop_frag, u8 is_ip6)
Set NAT virtual fragmentation reassembly configuration.
u32 ft_table_id
Table ID (hash key) for this FIB.
u8 nat_reass_is_drop_frag(u8 is_ip6)
Get status of virtual fragmentation reassembly.
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
static void vl_api_nat44_identity_mapping_dump_t_handler(vl_api_nat44_identity_mapping_dump_t *mp)
static void vl_api_nat_det_forward_t_handler(vl_api_nat_det_forward_t *mp)
vl_api_ip4_address_t ip_address
static void * vl_api_nat64_add_del_pool_addr_range_t_print(vl_api_nat64_add_del_pool_addr_range_t *mp, void *handle)
void nat44_add_del_address_dpo(ip4_address_t addr, u8 is_add)
Add/delete external address to FIB DPO (out2in DPO mode)
static void vl_api_nat_show_config_t_handler(vl_api_nat_show_config_t *mp)
static void vl_api_dslite_address_dump_t_handler(vl_api_dslite_address_dump_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
Dump NAT44 load-balancing static mapping rules.
#define vec_free(V)
Free vector's memory (no header).
vl_api_ip4_address_t ip_address
ip4_address_t b4_ip4_addr
deterministic NAT definitions
NAT44 user's sessions response.
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.
u32 bib_buckets
config parameters
static void vl_api_nat44_interface_addr_dump_t_handler(vl_api_nat44_interface_addr_dump_t *mp)
NAT66 static mapping details response.
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)
vl_api_ip4_address_t out_addr
vl_api_ip4_address_t ol_addr
vl_api_nat_config_flags_t flags
static void vl_api_nat64_add_del_prefix_t_handler(vl_api_nat64_add_del_prefix_t *mp)
dslite_main_t dslite_main
vl_api_ip6_address_t ip6_addr
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
vl_api_nat_config_flags_t flags
static void vl_api_nat64_prefix_dump_t_handler(vl_api_nat64_prefix_dump_t *mp)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static void * vl_api_nat44_add_del_lb_static_mapping_t_print(vl_api_nat44_add_del_lb_static_mapping_t *mp, void *handle)
8 octet key, 8 octet key value pair
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
vl_api_ip4_address_t ext_host_address
vl_api_ip4_address_t in_addr
static void vl_api_dslite_set_b4_addr_t_handler(vl_api_dslite_set_b4_addr_t *mp)
static void send_nat44_lb_static_mapping_details(snat_static_mapping_t *m, vl_api_registration_t *reg, u32 context)
static void vl_api_nat44_lb_static_mapping_add_del_local_t_handler(vl_api_nat44_lb_static_mapping_add_del_local_t *mp)
vl_api_ip4_address_t end_addr
u32 tcp_transitory_timeout
int nat_ha_set_listener(ip4_address_t *addr, u16 port, u32 path_mtu)
Set HA listener (local settings)
static void vl_api_nat_det_close_session_out_t_handler(vl_api_nat_det_close_session_out_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, twice_nat_type_t twice_nat, u8 out2in_only, u8 *tag, u8 identity_nat)
Add/delete NAT44 static mapping.
static void send_nat44_static_map_resolve_details(snat_static_map_resolve_t *m, vl_api_registration_t *reg, u32 context)
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)
vl_api_ip6_address_t ip6_addr
static void vl_api_nat66_static_mapping_dump_t_handler(vl_api_nat66_static_mapping_dump_t *mp)
static void vl_api_dslite_get_aftr_addr_t_handler(vl_api_dslite_get_aftr_addr_t *mp)
Get NAT virtual fragmentation reassembly configuration.
static void vl_api_nat_get_reass_t_handler(vl_api_nat_get_reass_t *mp)
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)
Get HA listener/local configuration reply.
static snat_det_map_t * snat_det_map_by_user(snat_main_t *sm, ip4_address_t *user_addr)
static void * vl_api_nat64_add_del_interface_addr_t_print(vl_api_nat64_add_del_interface_addr_t *mp, void *handle)
vl_api_nat44_lb_addr_port_t locals[local_num]
#define is_addr_only_static_mapping(sm)
Check if NAT static mapping is address only (1:1NAT).
static int nat_ip4_reass_walk_api(nat_reass_ip4_t *reass, void *arg)
static void vl_api_dslite_add_del_pool_addr_range_t_handler(vl_api_dslite_add_del_pool_addr_range_t *mp)
DS-Lite address details response.
int nat_ha_set_failover(ip4_address_t *addr, u16 port, u32 session_refresh_interval)
Set HA failover (remote settings)
void nat64_db_st_walk(nat64_db_t *db, u8 proto, nat64_db_st_walk_fn_t fn, void *ctx)
Walk NAT64 session table.
static void * vl_api_nat44_interface_add_del_output_feature_t_print(vl_api_nat44_interface_add_del_output_feature_t *mp, void *handle)
static void send_nat44_static_mapping_details(snat_static_mapping_t *m, vl_api_registration_t *reg, u32 context)
vl_api_registration_t * reg
static void * vl_api_nat_ha_get_failover_t_print(vl_api_nat_ha_get_failover_t *mp, void *handle)
vl_api_ip6_address_t ip6_addr
NAT64 pool address details response.
static void * vl_api_nat_set_reass_t_print(vl_api_nat_set_reass_t *mp, void *handle)
static void vl_api_nat_ipfix_enable_disable_t_handler(vl_api_nat_ipfix_enable_disable_t *mp)
Dump NAT64 prefix details response.
Set B4 IPv6 and IPv4 addresses.
static void send_nat_worker_details(u32 worker_index, vl_api_registration_t *reg, u32 context)
vl_api_ip4_address_t in_addr
vl_api_ip6_address_t ip6_addr
Set address and port assignment algorithm.
static void vl_api_nat_det_session_dump_t_handler(vl_api_nat_det_session_dump_t *mp)
static void * vl_api_nat44_add_del_identity_mapping_t_print(vl_api_nat44_add_del_identity_mapping_t *mp, void *handle)
Add/del NAT44 address range.
void nat_set_alloc_addr_and_port_range(u16 start_port, u16 end_port)
Set address and port assignment algorithm for port 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.
static void * vl_api_nat_get_mss_clamping_t_print(vl_api_nat_get_mss_clamping_t *mp, void *handle)
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.
int nat64_add_del_pool_addr(u32 thread_index, ip4_address_t *addr, u32 vrf_id, u8 is_add)
Add/delete address to NAT64 pool.
static void * vl_api_nat_det_forward_t_print(vl_api_nat_det_forward_t *mp, void *handle)
static void vl_api_nat66_interface_dump_t_handler(vl_api_nat66_interface_dump_t *mp)
static void * vl_api_nat_set_mss_clamping_t_print(vl_api_nat_set_mss_clamping_t *mp, void *handle)
int nat44_del_session(snat_main_t *sm, ip4_address_t *addr, u16 port, snat_protocol_t proto, u32 vrf_id, int is_in)
Delete NAT44 session.
snat_address_t * twice_nat_addresses
void nat64_prefix_walk(nat64_prefix_walk_fn_t fn, void *ctx)
Walk NAT64 prefixes.
Set TCP MSS rewriting configuration.
vl_api_ip4_address_t ip4_addr
vl_api_ip4_address_t o_addr
void nat64_interfaces_walk(nat64_interface_walk_fn_t fn, void *ctx)
Walk NAT64 interfaces.
vl_api_nat_config_flags_t flags
int dslite_set_aftr_ip4_addr(dslite_main_t *dm, ip4_address_t *addr)
NAT64 global declarations.
counter_t bytes
byte counter
int nat64_set_tcp_timeouts(u32 trans, u32 est)
Set TCP session timeouts.
void increment_v4_address(ip4_address_t *a)
Increment IPv4 address.
vlib_combined_counter_main_t session_counters
Session counters.
static void * vl_api_nat44_add_del_address_range_t_print(vl_api_nat44_add_del_address_range_t *mp, void *handle)
void nat66_interfaces_walk(nat66_interface_walk_fn_t fn, void *ctx)
vl_api_interface_index_t sw_if_index
Add/delete NAT44 load-balancing static mapping rule.
Dump NAT deterministic mappings.
Get TCP MSS rewriting configuration reply.
Show NAT plugin startup config reply.
static u32 ip_proto_to_snat_proto(u8 ip_proto)
Get outside address and port range from inside address.
static void vl_api_dslite_get_b4_addr_t_handler(vl_api_dslite_get_b4_addr_t *mp)
static void vl_api_nat44_interface_dump_t_handler(vl_api_nat44_interface_dump_t *mp)
Dump interfaces with NAT66 feature.
Add/delete NAT44 static mapping.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
int dslite_set_b4_ip6_addr(dslite_main_t *dm, ip6_address_t *addr)
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_nat_set_log_level_t_handler(vl_api_nat_set_log_level_t *mp)
static void * vl_api_nat44_user_session_dump_t_print(vl_api_nat44_user_session_dump_t *mp, void *handle)
vl_api_ip4_address_t start_addr
#define is_out2in_only_static_mapping(sm)
Check if NAT static mapping match only out2in direction.
Dump NAT44 static mappings.
vl_api_interface_index_t external_sw_if_index
vl_api_interface_index_t sw_if_index
Deterministic NAT sessions reply.
static void vl_api_nat64_add_del_static_bib_t_handler(vl_api_nat64_add_del_static_bib_t *mp)
Dump interfaces with NAT64 feature.
NAT44 pool addresses interfaces details response.
snat_main_per_thread_data_t * per_thread_data
vl_api_interface_index_t sw_if_index
vl_api_interface_index_t sw_if_index
vl_api_ip4_address_t ip_address
void nat_ip6_reass_walk(nat_ip6_reass_walk_fn_t fn, void *ctx)
Walk IPv6 reassemblies.
static void vl_api_nat_set_mss_clamping_t_handler(vl_api_nat_set_mss_clamping_t *mp)
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)
vl_api_interface_index_t sw_if_index
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
vl_api_ip4_address_t ip_address
int nat66_static_mapping_add_del(ip6_address_t *l_addr, ip6_address_t *e_addr, u32 vrf_id, u8 is_add)
Enable/disable NAT IPFIX logging.
vl_api_ip4_address_t end_addr
snat_address_t * addresses
NAT44 user's sessions.
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 interfce.
void nat_ha_get_failover(ip4_address_t *addr, u16 *port, u32 *session_refresh_interval)
Get HA failover/remote settings.
static void * vl_api_nat64_add_del_interface_t_print(vl_api_nat64_add_del_interface_t *mp, void *handle)
vl_api_ip4_address_t ip_address
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
vl_api_interface_index_t sw_if_index
vl_api_address_t ip_address
static snat_det_session_t * snat_det_get_ses_by_out(snat_det_map_t *dm, ip4_address_t *in_addr, u64 out_key)
vl_api_ip4_address_t addr
snat_static_map_resolve_t * to_resolve
vl_api_ip4_address_t external_ip_address
ip4_main_t ip4_main
Global ip4 main structure.
static void vl_api_nat44_address_dump_t_handler(vl_api_nat44_address_dump_t *mp)
struct fib_table_t_ * fibs
Vector of FIBs.
u32 translation_memory_size
vl_api_ip4_address_t inside_ip_address
vl_api_ip6_prefix_t prefix
#define vec_foreach(var, vec)
Vector iterator.
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
vl_api_ip4_address_t address
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)
nat66_static_mapping_t * sm
Static mapping pool.
static void vl_api_nat64_st_dump_t_handler(vl_api_nat64_st_dump_t *mp)
int snat_set_workers(uword *bitmap)
Set NAT plugin workers.
#define is_twice_nat_session(s)
Check if NAT session is twice NAT.
struct nat66_api_walk_ctx_t_ nat66_api_walk_ctx_t
u32 nat64_bib_memory_size
vl_api_nat_config_flags_t flags
Response to get B4 IPv6 and IPv4 addresses.
vl_api_ip4_address_t local_ip_address
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)
Resync HA (resend existing sessions to new failover)
static void * vl_api_nat64_prefix_dump_t_print(vl_api_nat64_prefix_dump_t *mp, void *handle)
NAT plugin virtual fragmentation reassembly.
Get inside address from outside address and port.
vl_api_ip4_address_t user_addr
void nat_set_alloc_addr_and_port_mape(u16 psid, u16 psid_offset, u16 psid_length)
Set address and port assignment algorithm for MAP-E CE.
NAT66 global declarations.
static void * vl_api_dslite_set_b4_addr_t_print(vl_api_dslite_set_b4_addr_t *mp, void *handle)
Get AFTR IPv6 and IPv4 addresses.
static void * vl_api_nat_reass_dump_t_print(vl_api_nat_reass_dump_t *mp, void *handle)
vl_api_ip4_address_t in_addr
vl_api_nat_log_level_t log_level
Enable/disable NAT44 feature on the interface.
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.
vl_api_interface_index_t sw_if_index
snat_session_t * sessions
vl_api_interface_index_t sw_if_index
int dslite_set_aftr_ip6_addr(dslite_main_t *dm, ip6_address_t *addr)
static void vl_api_nat44_static_mapping_dump_t_handler(vl_api_nat44_static_mapping_dump_t *mp)
vl_api_ip4_address_t in_addr
vl_api_ip4_address_t out_addr
vl_api_nat44_lb_addr_port_t local
static void vl_api_nat_set_reass_t_handler(vl_api_nat_set_reass_t *mp)
int nat44_lb_static_mapping_add_del_local(ip4_address_t e_addr, u16 e_port, ip4_address_t l_addr, u16 l_port, snat_protocol_t proto, u32 vrf_id, u8 probability, u8 is_add)
vl_api_ip6_address_t local_ip_address
Get HA listener/local configuration.
snat_interface_t * interfaces
vl_api_nat_config_flags_t flags
vl_api_ip4_address_t ip_address
vl_api_fib_path_nh_proto_t proto
#define VALIDATE_SW_IF_INDEX(mp)
A protocol Independent FIB table.
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.
NAT44 address details response.
u16 vl_msg_api_get_msg_ids(const char *name, int n)
NAT64 session table details response.
static void vl_api_nat64_add_del_interface_t_handler(vl_api_nat64_add_del_interface_t *mp)
vl_api_address_t src_addr
u32 tcp_established_timeout
struct nat_api_walk_ctx_t_ nat_api_walk_ctx_t
static uword pool_elts(void *v)
Number of active elements in a pool.