32 #define vl_api_nat44_lb_addr_port_t_endian vl_noop_handler 33 #define vl_api_nat44_add_del_lb_static_mapping_t_endian vl_noop_handler 34 #define vl_api_nat44_nat44_lb_static_mapping_details_t_endian vl_noop_handler 46 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 48 #define REPLY_MSG_ID_BASE sm->msg_id_base 52 #define vl_api_version(n,v) static u32 api_version=(v); 59 vl_print (handle, (char *)s); \ 78 rmp->
vpe_pid = ntohl (getpid ());
88 s =
format (0,
"SCRIPT: nat_control_ping ");
123 s =
format (0,
"SCRIPT: nat_show_config ");
132 vl_api_nat_set_workers_reply_t *rmp;
139 rv = VNET_API_ERROR_FEATURE_DISABLED;
160 s =
format (0,
"SCRIPT: nat_set_workers ");
186 memset (rmp, 0,
sizeof (*rmp));
187 rmp->_vl_msg_id = ntohs (VL_API_NAT_WORKER_DETAILS + sm->
msg_id_base);
218 s =
format (0,
"SCRIPT: nat_worker_dump ");
228 vl_api_nat_ipfix_enable_disable_reply_t *rmp;
237 REPLY_MACRO (VL_API_NAT_IPFIX_ENABLE_DISABLE_REPLY);
246 s =
format (0,
"SCRIPT: nat_ipfix_enable_disable ");
250 s =
format (s,
"src_port %d ", clib_net_to_host_u16 (mp->
src_port));
252 s =
format (s,
"disable ");
261 vl_api_nat_set_reass_reply_t *rmp;
276 s =
format (0,
"SCRIPT: nat_set_reass ");
277 s =
format (s,
"timeout %d max_reass %d max_frag %d drop_frag %d is_ip6 %d",
278 clib_host_to_net_u32 (mp->
timeout),
312 s =
format (0,
"SCRIPT: nat_get_reass");
331 memset (rmp, 0,
sizeof (*rmp));
332 rmp->_vl_msg_id = ntohs (VL_API_NAT_REASS_DETAILS + sm->
msg_id_base);
336 rmp->
proto = reass->key.proto;
337 rmp->
frag_id = ntohl (reass->key.frag_id);
338 rmp->
frag_n = reass->frag_n;
354 memset (rmp, 0,
sizeof (*rmp));
355 rmp->_vl_msg_id = ntohs (VL_API_NAT_REASS_DETAILS + sm->
msg_id_base);
359 rmp->
proto = reass->key.proto;
360 rmp->
frag_id = ntohl (reass->key.frag_id);
361 rmp->
frag_n = reass->frag_n;
392 s =
format (0,
"SCRIPT: nat_reass_dump");
405 vl_api_nat44_add_del_address_range_reply_t *rmp;
407 u32 start_host_order, end_host_order;
415 rv = VNET_API_ERROR_FEATURE_DISABLED;
420 start_host_order = clib_host_to_net_u32 (tmp[0]);
422 end_host_order = clib_host_to_net_u32 (tmp[0]);
424 count = (end_host_order - start_host_order) + 1;
426 vrf_id = clib_host_to_net_u32 (mp->
vrf_id);
435 for (i = 0; i <
count; i++)
449 REPLY_MACRO (VL_API_NAT44_ADD_DEL_ADDRESS_RANGE_REPLY);
457 s =
format (0,
"SCRIPT: nat44_add_address_range ");
476 memset (rmp, 0,
sizeof (*rmp));
477 rmp->_vl_msg_id = ntohs (VL_API_NAT44_ADDRESS_DETAILS + sm->
msg_id_base);
517 s =
format (0,
"SCRIPT: nat44_address_dump ");
527 vl_api_nat44_interface_add_del_feature_reply_t *rmp;
538 REPLY_MACRO (VL_API_NAT44_INTERFACE_ADD_DEL_FEATURE_REPLY);
546 s =
format (0,
"SCRIPT: nat44_interface_add_del_feature ");
547 s =
format (s,
"sw_if_index %d %s %s",
562 memset (rmp, 0,
sizeof (*rmp));
563 rmp->_vl_msg_id = ntohs (VL_API_NAT44_INTERFACE_DETAILS + sm->
msg_id_base);
587 send_nat44_interface_details(i, q, mp->context);
598 s =
format (0,
"SCRIPT: nat44_interface_dump ");
608 vl_api_nat44_interface_add_del_output_feature_reply_t *rmp;
620 REPLY_MACRO (VL_API_NAT44_INTERFACE_ADD_DEL_OUTPUT_FEATURE_REPLY);
628 s =
format (0,
"SCRIPT: nat44_interface_add_del_output_feature ");
629 s =
format (s,
"sw_if_index %d %s %s",
645 memset (rmp, 0,
sizeof (*rmp));
647 ntohs (VL_API_NAT44_INTERFACE_OUTPUT_FEATURE_DETAILS + sm->
msg_id_base);
670 send_nat44_interface_output_feature_details(i, q, mp->context);
680 s =
format (0,
"SCRIPT: nat44_interface_output_feature_dump ");
690 vl_api_nat44_add_del_static_mapping_reply_t *rmp;
692 u16 local_port = 0, external_port = 0;
693 u32 vrf_id, external_sw_if_index;
701 local_port = clib_net_to_host_u16 (mp->
local_port);
704 vrf_id = clib_net_to_host_u32 (mp->
vrf_id);
710 external_sw_if_index, proto, mp->
is_add,
713 REPLY_MACRO (VL_API_NAT44_ADD_DEL_STATIC_MAPPING_REPLY);
721 s =
format (0,
"SCRIPT: nat44_add_del_static_mapping ");
722 s =
format (s,
"protocol %d local_addr %U external_addr %U ",
728 s =
format (s,
"local_port %d external_port %d ",
735 s =
format (s,
"vrf %d", clib_net_to_host_u32 (mp->
vrf_id));
738 s =
format (s,
"external_sw_if_index %d",
752 memset (rmp, 0,
sizeof (*rmp));
754 ntohs (VL_API_NAT44_STATIC_MAPPING_DETAILS + sm->
msg_id_base);
778 memset (rmp, 0,
sizeof (*rmp));
780 ntohs (VL_API_NAT44_STATIC_MAPPING_DETAILS + sm->
msg_id_base);
811 if (!vec_len(m->locals) && (m->local_addr.as_u32 != m->external_addr.as_u32))
812 send_nat44_static_mapping_details (m, q, mp->context);
830 s =
format (0,
"SCRIPT: nat44_static_mapping_dump ");
840 vl_api_nat44_add_del_identity_mapping_reply_t *rmp;
843 u32 vrf_id, sw_if_index;
849 port = clib_net_to_host_u16 (mp->
port);
852 vrf_id = clib_net_to_host_u32 (mp->
vrf_id);
853 sw_if_index = clib_net_to_host_u32 (mp->
sw_if_index);
854 if (sw_if_index != ~0)
862 sw_if_index, proto, mp->
is_add, 0);
864 REPLY_MACRO (VL_API_NAT44_ADD_DEL_IDENTITY_MAPPING_REPLY);
872 s =
format (0,
"SCRIPT: nat44_add_del_identity_mapping ");
881 clib_net_to_host_u16 (mp->
port));
884 s =
format (s,
"vrf %d", clib_net_to_host_u32 (mp->
vrf_id));
898 memset (rmp, 0,
sizeof (*rmp));
900 ntohs (VL_API_NAT44_IDENTITY_MAPPING_DETAILS + sm->
msg_id_base);
921 memset (rmp, 0,
sizeof (*rmp));
923 ntohs (VL_API_NAT44_IDENTITY_MAPPING_DETAILS + sm->
msg_id_base);
951 if (!vec_len(m->locals) && (m->local_addr.as_u32 == m->external_addr.as_u32))
952 send_nat44_identity_mapping_details (m, q, mp->context);
969 s =
format (0,
"SCRIPT: nat44_identity_mapping_dump ");
979 vl_api_nat44_add_del_interface_addr_reply_t *rmp;
990 REPLY_MACRO (VL_API_NAT44_ADD_DEL_INTERFACE_ADDR_REPLY);
998 s =
format (0,
"SCRIPT: nat44_add_del_interface_addr ");
999 s =
format (s,
"sw_if_index %d twice_nat %d %s",
1015 memset (rmp, 0,
sizeof (*rmp));
1017 ntohs (VL_API_NAT44_INTERFACE_ADDR_DETAILS + sm->
msg_id_base);
1051 s =
format (0,
"SCRIPT: nat44_interface_addr_dump ");
1065 memset (rmp, 0,
sizeof (*rmp));
1066 rmp->_vl_msg_id = ntohs (VL_API_NAT44_USER_DETAILS + sm->
msg_id_base);
1102 s =
format (0,
"SCRIPT: nat44_user_dump ");
1115 memset (rmp, 0,
sizeof (*rmp));
1117 ntohs (VL_API_NAT44_USER_SESSION_DETAILS + sm->
msg_id_base);
1121 rmp->
last_heard = clib_host_to_net_u64 ((
u64) s->last_heard);
1122 rmp->
total_bytes = clib_host_to_net_u64 (s->total_bytes);
1129 rmp->
protocol = ntohs (s->in2out.port);
1152 u32 session_index, head_index, elt_index;
1170 if (clib_bihash_search_8_8 (&tsm->user_hash, &key, &value))
1178 elt_index = head->
next;
1180 session_index = elt->
value;
1181 while (session_index != ~0)
1187 elt_index = elt->
next;
1189 session_index = elt->
value;
1199 s =
format (0,
"SCRIPT: nat44_user_session_dump ");
1200 s =
format (s,
"ip_address %U vrf_id %d\n",
1202 clib_net_to_host_u32 (mp->
vrf_id));
1209 u8 addr_port_pair_num)
1215 for (i = 0; i < addr_port_pair_num; i++)
1217 ap = &addr_port_pairs[
i];
1218 memset (&lb_addr_port, 0,
sizeof (lb_addr_port));
1220 lb_addr_port.port = clib_net_to_host_u16 (ap->
port);
1222 vec_add1 (lb_addr_port_pairs, lb_addr_port);
1225 return lb_addr_port_pairs;
1233 vl_api_nat44_add_del_lb_static_mapping_reply_t *rmp;
1246 proto, clib_net_to_host_u32 (mp->
vrf_id),
1251 REPLY_MACRO (VL_API_NAT44_ADD_DEL_LB_STATIC_MAPPING_REPLY);
1259 s =
format (0,
"SCRIPT: nat44_add_del_lb_static_mapping ");
1278 memset (rmp, 0,
sizeof (*rmp));
1280 ntohs (VL_API_NAT44_LB_STATIC_MAPPING_DETAILS + sm->
msg_id_base);
1317 if (vec_len(m->locals))
1318 send_nat44_lb_static_mapping_details (m, q, mp->context);
1328 s =
format (0,
"SCRIPT: nat44_lb_static_mapping_dump ");
1337 vl_api_nat44_del_session_reply_t *rmp;
1345 port = clib_net_to_host_u16 (mp->
port);
1346 vrf_id = clib_net_to_host_u32 (mp->
vrf_id);
1360 s =
format (0,
"SCRIPT: nat44_add_del_static_mapping ");
1361 s =
format (s,
"addr %U port %d protocol %d vrf_id %d is_in %d",
1363 clib_net_to_host_u16 (mp->
port),
1374 vl_api_nat44_forwarding_enable_disable_reply_t *rmp;
1379 REPLY_MACRO (VL_API_NAT44_FORWARDING_ENABLE_DISABLE_REPLY);
1387 s =
format (0,
"SCRIPT: nat44_forwarding_enable_disable ");
1406 memset (rmp, 0,
sizeof (*rmp));
1408 ntohs (VL_API_NAT44_FORWARDING_IS_ENABLED_REPLY + sm->
msg_id_base);
1421 s =
format (0,
"SCRIPT: nat44_forwarding_is_enabled ");
1434 vl_api_nat_det_add_del_map_reply_t *rmp;
1440 rv = VNET_API_ERROR_UNIMPLEMENTED;
1459 s =
format (0,
"SCRIPT: nat_det_add_del_map ");
1460 s =
format (s,
"inside address %U/%d outside address %U/%d\n",
1473 u16 lo_port = 0, hi_port = 0;
1480 rv = VNET_API_ERROR_UNIMPLEMENTED;
1489 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1512 s =
format (0,
"SCRIPT: nat_det_forward");
1532 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1554 s =
format (0,
"SCRIPT: nat_det_reverse");
1555 s =
format (s,
"outside ip address %U outside port %d",
1569 memset (rmp, 0,
sizeof (*rmp));
1570 rmp->_vl_msg_id = ntohs (VL_API_NAT_DET_MAP_DETAILS + sm->
msg_id_base);
1606 s =
format (0,
"SCRIPT: nat_det_map_dump ");
1615 vl_api_nat_det_set_timeouts_reply_t *rmp;
1632 s =
format (0,
"SCRIPT: nat_det_set_timeouts ");
1633 s =
format (s,
"udp %d tcp_established %d tcp_transitory %d icmp %d\n",
1665 s =
format (0,
"SCRIPT: nat_det_get_timeouts");
1675 vl_api_nat_det_close_session_out_reply_t *rmp;
1688 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1698 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1704 REPLY_MACRO (VL_API_NAT_DET_CLOSE_SESSION_OUT_REPLY);
1713 s =
format (0,
"SCRIPT: nat_det_close_session_out ");
1714 s =
format (s,
"out_addr %U out_port %d " 1715 "ext_addr %U ext_port %d\n",
1727 vl_api_nat_det_close_session_in_reply_t *rmp;
1736 rv = VNET_API_ERROR_UNIMPLEMENTED;
1746 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1754 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1760 REPLY_MACRO (VL_API_NAT_DET_CLOSE_SESSION_OUT_REPLY);
1768 s =
format (0,
"SCRIPT: nat_det_close_session_in ");
1769 s =
format (s,
"in_addr %U in_port %d ext_addr %U ext_port %d\n",
1784 memset (rmp, 0,
sizeof (*rmp));
1785 rmp->_vl_msg_id = ntohs (VL_API_NAT_DET_SESSION_DETAILS + sm->
msg_id_base);
1813 memset (&empty_ses, 0,
sizeof (empty_ses));
1834 s =
format (0,
"SCRIPT: nat_det_session_dump ");
1848 vl_api_nat64_add_del_pool_addr_range_reply_t *rmp;
1852 u32 start_host_order, end_host_order;
1858 start_host_order = clib_host_to_net_u32 (tmp[0]);
1860 end_host_order = clib_host_to_net_u32 (tmp[0]);
1862 count = (end_host_order - start_host_order) + 1;
1864 vrf_id = clib_host_to_net_u32 (mp->
vrf_id);
1868 for (i = 0; i <
count; i++)
1877 REPLY_MACRO (VL_API_NAT64_ADD_DEL_POOL_ADDR_RANGE_REPLY);
1885 s =
format (0,
"SCRIPT: nat64_add_del_pool_addr_range ");
1886 s =
format (s,
"%U - %U vrf_id %u %s\n",
1909 memset (rmp, 0,
sizeof (*rmp));
1910 rmp->_vl_msg_id = ntohs (VL_API_NAT64_POOL_ADDR_DETAILS + sm->
msg_id_base);
1951 s =
format (0,
"SCRIPT: nat64_pool_addr_dump\n");
1961 vl_api_nat64_add_del_interface_reply_t *rmp;
1972 REPLY_MACRO (VL_API_NAT64_ADD_DEL_INTERFACE_REPLY);
1981 s =
format (0,
"SCRIPT: nat64_add_del_interface ");
1982 s =
format (s,
"sw_if_index %d %s %s",
1997 memset (rmp, 0,
sizeof (*rmp));
1998 rmp->_vl_msg_id = ntohs (VL_API_NAT64_INTERFACE_DETAILS + sm->
msg_id_base);
2033 s =
format (0,
"SCRIPT: snat_interface_dump ");
2043 vl_api_nat64_add_del_static_bib_reply_t *rmp;
2053 clib_net_to_host_u16 (mp->
i_port),
2054 clib_net_to_host_u16 (mp->
o_port),
2056 clib_net_to_host_u32 (mp->
vrf_id),
2059 REPLY_MACRO (VL_API_NAT64_ADD_DEL_STATIC_BIB_REPLY);
2067 s =
format (0,
"SCRIPT: nat64_add_del_static_bib ");
2068 s =
format (s,
"protocol %d i_addr %U o_addr %U ",
2073 s =
format (s,
"vrf %d", clib_net_to_host_u32 (mp->
vrf_id));
2091 memset (rmp, 0,
sizeof (*rmp));
2092 rmp->_vl_msg_id = ntohs (VL_API_NAT64_BIB_DETAILS + sm->
msg_id_base);
2096 rmp->
i_port = bibe->in_port;
2097 rmp->
o_port = bibe->out_port;
2099 rmp->
proto = bibe->proto;
2101 rmp->
ses_num = ntohl (bibe->ses_num);
2135 s =
format (0,
"SCRIPT: snat_bib_dump protocol %d", mp->
proto);
2144 vl_api_nat64_set_timeouts_reply_t *rmp;
2166 s =
format (0,
"SCRIPT: nat64_set_timeouts ");
2169 "udp %d icmp %d, tcp_trans %d, tcp_est %d, tcp_incoming_syn %d\n",
2200 s =
format (0,
"SCRIPT: nat64_get_timeouts");
2211 nat64_db_bib_entry_t *bibe;
2223 memset (rmp, 0,
sizeof (*rmp));
2224 rmp->_vl_msg_id = ntohs (VL_API_NAT64_ST_DETAILS + sm->
msg_id_base);
2229 rmp->
ol_port = bibe->out_port;
2234 rmp->
proto = ste->proto;
2271 s =
format (0,
"SCRIPT: snat_st_dump protocol %d", mp->
proto);
2279 vl_api_nat64_add_del_prefix_reply_t *rmp;
2298 s =
format (0,
"SCRIPT: nat64_add_del_prefix %U/%u vrf_id %u %s\n",
2313 memset (rmp, 0,
sizeof (*rmp));
2314 rmp->_vl_msg_id = ntohs (VL_API_NAT64_PREFIX_DETAILS + sm->
msg_id_base);
2348 s =
format (0,
"SCRIPT: nat64_prefix_dump\n");
2358 vl_api_nat64_add_del_interface_addr_reply_t *rmp;
2368 REPLY_MACRO (VL_API_NAT64_ADD_DEL_INTERFACE_ADDR_REPLY);
2376 s =
format (0,
"SCRIPT: nat64_add_del_interface_addr ");
2377 s =
format (s,
"sw_if_index %d %s",
2379 mp->
is_add ?
"" :
"del");
2391 vl_api_dslite_set_aftr_addr_reply_t *rmp;
2410 s =
format (0,
"SCRIPT: dslite_set_aftr_addr ");
2411 s =
format (s,
"ip6_addr %U ip4_addr %U\n",
2422 vl_api_dslite_add_del_pool_addr_range_reply_t *rmp;
2427 u32 start_host_order, end_host_order;
2432 start_host_order = clib_host_to_net_u32 (tmp[0]);
2434 end_host_order = clib_host_to_net_u32 (tmp[0]);
2436 count = (end_host_order - start_host_order) + 1;
2439 for (i = 0; i <
count; i++)
2448 REPLY_MACRO (VL_API_DSLITE_ADD_DEL_POOL_ADDR_RANGE_REPLY);
2456 s =
format (0,
"SCRIPT: dslite_add_del_pool_addr_range ");
2457 s =
format (s,
"%U - %U\n",
2466 #define foreach_snat_plugin_api_msg \ 2467 _(NAT_CONTROL_PING, nat_control_ping) \ 2468 _(NAT_SHOW_CONFIG, nat_show_config) \ 2469 _(NAT_SET_WORKERS, nat_set_workers) \ 2470 _(NAT_WORKER_DUMP, nat_worker_dump) \ 2471 _(NAT_IPFIX_ENABLE_DISABLE, nat_ipfix_enable_disable) \ 2472 _(NAT_SET_REASS, nat_set_reass) \ 2473 _(NAT_GET_REASS, nat_get_reass) \ 2474 _(NAT_REASS_DUMP, nat_reass_dump) \ 2475 _(NAT44_ADD_DEL_ADDRESS_RANGE, nat44_add_del_address_range) \ 2476 _(NAT44_INTERFACE_ADD_DEL_FEATURE, nat44_interface_add_del_feature) \ 2477 _(NAT44_ADD_DEL_STATIC_MAPPING, nat44_add_del_static_mapping) \ 2478 _(NAT44_ADD_DEL_IDENTITY_MAPPING, nat44_add_del_identity_mapping) \ 2479 _(NAT44_STATIC_MAPPING_DUMP, nat44_static_mapping_dump) \ 2480 _(NAT44_IDENTITY_MAPPING_DUMP, nat44_identity_mapping_dump) \ 2481 _(NAT44_ADDRESS_DUMP, nat44_address_dump) \ 2482 _(NAT44_INTERFACE_DUMP, nat44_interface_dump) \ 2483 _(NAT44_ADD_DEL_INTERFACE_ADDR, nat44_add_del_interface_addr) \ 2484 _(NAT44_INTERFACE_ADDR_DUMP, nat44_interface_addr_dump) \ 2485 _(NAT44_USER_DUMP, nat44_user_dump) \ 2486 _(NAT44_USER_SESSION_DUMP, nat44_user_session_dump) \ 2487 _(NAT44_INTERFACE_ADD_DEL_OUTPUT_FEATURE, \ 2488 nat44_interface_add_del_output_feature) \ 2489 _(NAT44_INTERFACE_OUTPUT_FEATURE_DUMP, \ 2490 nat44_interface_output_feature_dump) \ 2491 _(NAT44_ADD_DEL_LB_STATIC_MAPPING, nat44_add_del_lb_static_mapping) \ 2492 _(NAT44_LB_STATIC_MAPPING_DUMP, nat44_lb_static_mapping_dump) \ 2493 _(NAT44_DEL_SESSION, nat44_del_session) \ 2494 _(NAT44_FORWARDING_ENABLE_DISABLE, nat44_forwarding_enable_disable) \ 2495 _(NAT44_FORWARDING_IS_ENABLED, nat44_forwarding_is_enabled) \ 2496 _(NAT_DET_ADD_DEL_MAP, nat_det_add_del_map) \ 2497 _(NAT_DET_FORWARD, nat_det_forward) \ 2498 _(NAT_DET_REVERSE, nat_det_reverse) \ 2499 _(NAT_DET_MAP_DUMP, nat_det_map_dump) \ 2500 _(NAT_DET_SET_TIMEOUTS, nat_det_set_timeouts) \ 2501 _(NAT_DET_GET_TIMEOUTS, nat_det_get_timeouts) \ 2502 _(NAT_DET_CLOSE_SESSION_OUT, nat_det_close_session_out) \ 2503 _(NAT_DET_CLOSE_SESSION_IN, nat_det_close_session_in) \ 2504 _(NAT_DET_SESSION_DUMP, nat_det_session_dump) \ 2505 _(NAT64_ADD_DEL_POOL_ADDR_RANGE, nat64_add_del_pool_addr_range) \ 2506 _(NAT64_POOL_ADDR_DUMP, nat64_pool_addr_dump) \ 2507 _(NAT64_ADD_DEL_INTERFACE, nat64_add_del_interface) \ 2508 _(NAT64_INTERFACE_DUMP, nat64_interface_dump) \ 2509 _(NAT64_ADD_DEL_STATIC_BIB, nat64_add_del_static_bib) \ 2510 _(NAT64_BIB_DUMP, nat64_bib_dump) \ 2511 _(NAT64_SET_TIMEOUTS, nat64_set_timeouts) \ 2512 _(NAT64_GET_TIMEOUTS, nat64_get_timeouts) \ 2513 _(NAT64_ST_DUMP, nat64_st_dump) \ 2514 _(NAT64_ADD_DEL_PREFIX, nat64_add_del_prefix) \ 2515 _(NAT64_PREFIX_DUMP, nat64_prefix_dump) \ 2516 _(NAT64_ADD_DEL_INTERFACE_ADDR, nat64_add_del_interface_addr) \ 2517 _(DSLITE_ADD_DEL_POOL_ADDR_RANGE, dslite_add_del_pool_addr_range) \ 2518 _(DSLITE_SET_AFTR_ADDR, dslite_set_aftr_addr) 2526 vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \ 2528 vl_api_##n##_t_handler, \ 2530 vl_api_##n##_t_endian, \ 2531 vl_api_##n##_t_print, \ 2532 sizeof(vl_api_##n##_t), 1); 2539 #define vl_msg_name_crc_list 2541 #undef vl_msg_name_crc_list 2546 #define _(id,n,crc) \ 2547 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + sm->msg_id_base); 2548 foreach_vl_msg_name_crc_nat;
2555 #define _(n,f) sm->api_main->msg_print_handlers \ 2556 [VL_API_##n + sm->msg_id_base] \ 2557 = (void *) vl_api_##f##_t_print; 2568 name =
format (0,
"nat_%08x%c", api_version, 0);
ip4_address_t external_addr
u32 nat64_get_icmp_timeout(void)
Get ICMP session timeout.
static void send_nat_worker_details(u32 worker_index, unix_shared_memory_queue_t *q, u32 context)
NAT64 interface details response.
nat64_db_t * db
BIB and session DB per thread.
u32 nat_reass_get_timeout(u8 is_ip6)
Get reassembly timeout.
NAT virtual fragmentation reassemblies response.
u32 sessions_per_user_list_head_index
u16 vl_msg_api_get_msg_ids(const char *name, int n)
sll srl srl sll sra u16x4 i
static void send_nat44_identity_mapping_details(snat_static_mapping_t *m, unix_shared_memory_queue_t *q, u32 context)
int snat_del_address(snat_main_t *sm, ip4_address_t addr, u8 delete_sm, u8 twice_nat)
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)
static int nat64_api_pool_walk(snat_address_t *a, void *arg)
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_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 send_nat44_identity_map_resolve_details(snat_static_map_resolve_t *m, unix_shared_memory_queue_t *q, u32 context)
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_nat44_del_session_t_print(vl_api_nat44_del_session_t *mp, void *handle)
NAT44 identity mapping details response.
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.
static void vl_api_nat44_lb_static_mapping_dump_t_handler(vl_api_nat44_lb_static_mapping_dump_t *mp)
static void vl_api_nat_reass_dump_t_handler(vl_api_nat_reass_dump_t *mp)
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)
int nat64_add_del_pool_addr(ip4_address_t *addr, u32 vrf_id, u8 is_add)
Add/delete address to NAT64 pool.
Set NAT virtual fragmentation reassembly.
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).
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 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_nat64_add_del_static_bib_t_print(vl_api_nat64_add_del_static_bib_t *mp, void *handle)
static void * vl_api_nat64_pool_addr_dump_t_print(vl_api_nat64_pool_addr_dump_t *mp, void *handle)
Response to check if forwarding is enabled or disabled.
static void send_nat44_static_map_resolve_details(snat_static_map_resolve_t *m, unix_shared_memory_queue_t *q, u32 context)
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)
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.
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)
#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.
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)
nat44_lb_addr_port_t * locals
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)
#define nat_interface_is_outside(i)
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)
static void * vl_api_nat44_identity_mapping_dump_t_print(vl_api_nat44_identity_mapping_dump_t *mp, void *handle)
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)
Check if forwarding is enabled or disabled.
#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)
ip4_address_t ext_host_addr
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) ...
int nat64_set_icmp_timeout(u32 timeout)
Set ICMP session timeout.
struct nat64_api_walk_ctx_t_ nat64_api_walk_ctx_t
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.
unix_shared_memory_queue_t * q
static void vl_api_nat64_get_timeouts_t_handler(vl_api_nat64_get_timeouts_t *mp)
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)
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)
void * vl_msg_api_alloc(int nbytes)
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)
Get values of timeouts for NAT64 (seconds)
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.
u32 * auto_add_sw_if_indices_twice_nat
u32 max_translations_per_user
static u32 snat_det_user_ses_offset(ip4_address_t *addr, u8 plen)
vlib_worker_thread_t * vlib_worker_threads
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Control ping from the client to the server response.
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_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.
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 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.
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 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_nat64_set_timeouts_t_handler(vl_api_nat64_set_timeouts_t *mp)
static void * vl_api_dslite_set_aftr_addr_t_print(vl_api_dslite_set_aftr_addr_t *mp, void *handle)
static void vl_api_nat64_pool_addr_dump_t_handler(vl_api_nat64_pool_addr_dump_t *mp)
#define nat_interface_is_inside(i)
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)
Dump NAT44 identity mappings.
u32 translation_memory_size
int dslite_add_del_pool_addr(dslite_main_t *dm, ip4_address_t *addr, u8 is_add)
static void vl_api_nat44_add_del_identity_mapping_t_handler(vl_api_nat44_add_del_identity_mapping_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)
static void vl_api_dslite_set_aftr_addr_t_handler(vl_api_dslite_set_aftr_addr_t *mp)
u8 static_mapping_connection_tracking
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)
snat_interface_t * output_feature_interfaces
u16 nat_reass_get_max_reass(u8 is_ip6)
Get maximum number of concurrent reassemblies.
#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)
static void vl_api_nat64_add_del_interface_addr_t_handler(vl_api_nat64_add_del_interface_addr_t *mp)
Dump interfaces with NAT44 feature.
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 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)
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).
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.
static void vl_api_nat44_interface_addr_dump_t_handler(vl_api_nat44_interface_addr_dump_t *mp)
#define clib_warning(format, args...)
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_nat64_add_del_prefix_t_handler(vl_api_nat64_add_del_prefix_t *mp)
dslite_main_t dslite_main
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
u32 tcp_transitory_timeout
static void send_nat44_static_mapping_details(snat_static_mapping_t *m, unix_shared_memory_queue_t *q, u32 context)
static void vl_api_nat_det_close_session_out_t_handler(vl_api_nat_det_close_session_out_t *mp)
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)
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)
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)
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]
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)
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_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)
static void send_nat44_user_session_details(snat_session_t *s, unix_shared_memory_queue_t *q, u32 context)
Dump NAT64 prefix details response.
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)
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.
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)
int nat44_del_session(snat_main_t *sm, ip4_address_t *addr, u16 port, snat_protocol_t proto, u32 vrf_id, int is_in)
snat_address_t * twice_nat_addresses
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.
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, u8 twice_nat)
Add static mapping.
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, u8 twice_nat)
void nat64_interfaces_walk(nat64_interface_walk_fn_t fn, void *ctx)
Walk NAT64 interfaces.
static void * vl_api_nat_det_get_timeouts_t_print(vl_api_nat_det_get_timeouts_t *mp, void *handle)
NAT64 global declarations.
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.
Show NAT plugin startup config reply.
void snat_add_address(snat_main_t *sm, ip4_address_t *addr, u32 vrf_id, u8 twice_nat)
unix_shared_memory_queue_t * q
Get outside address and port range from inside address.
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.
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
void nat_ip6_reass_walk(nat_ip6_reass_walk_fn_t fn, void *ctx)
Walk IPv6 reassemblies.
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.
int snat_add_interface_address(snat_main_t *sm, u32 sw_if_index, int is_del, u8 twice_nat)
static void * vl_api_nat64_add_del_interface_t_print(vl_api_nat64_add_del_interface_t *mp, void *handle)
static void * vl_api_nat64_set_timeouts_t_print(vl_api_nat64_set_timeouts_t *mp, void *handle)
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 send_nat44_interface_addr_details(u32 sw_if_index, unix_shared_memory_queue_t *q, u32 context, u8 twice_nat)
#define SNAT_SESSION_FLAG_STATIC_MAPPING
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)
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)
Set values of timeouts for NAT64 (seconds, 0 = default)
static void send_nat44_address_details(snat_address_t *a, unix_shared_memory_queue_t *q, u32 context, u8 twice_nat)
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_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.
Get values of timeouts for deterministic NAT reply.
static void * vl_api_nat_reass_dump_t_print(vl_api_nat_reass_dump_t *mp, void *handle)
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.
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)
static void vl_api_nat_set_reass_t_handler(vl_api_nat_set_reass_t *mp)
snat_interface_t * interfaces
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_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_nat64_add_del_interface_t_handler(vl_api_nat64_add_del_interface_t *mp)
u32 tcp_established_timeout
struct nat_api_walk_ctx_t_ nat_api_walk_ctx_t