54 "NAT44_OUT2IN: sw_if_index %d, next index %d, session index %d",
66 s =
format (s,
"NAT44_OUT2IN_FAST: sw_if_index %d, next index %d",
71 #define foreach_nat44_ei_out2in_error \ 72 _ (UNSUPPORTED_PROTOCOL, "unsupported protocol") \ 73 _ (OUT_OF_PORTS, "out of ports") \ 74 _ (BAD_ICMP_TYPE, "unsupported ICMP type") \ 75 _ (NO_TRANSLATION, "no translation") \ 76 _ (MAX_SESSIONS_EXCEEDED, "maximum sessions exceeded") \ 77 _ (CANNOT_CREATE_USER, "cannot create NAT user") 81 #define _(sym, str) NAT44_EI_OUT2IN_ERROR_##sym, 88 #define _(sym,string) string, 101 #ifndef CLIB_MARCH_VARIANT 107 nat44_ei_session_t *s;
108 u64 sess_timeout_time;
120 &nm->
timeouts, s->nat_proto, s->state);
121 if (ctx->
now >= sess_timeout_time)
124 if (clib_bihash_add_del_8_8 (&nm->
in2out, &s_kv, 0))
128 s->in2out.addr.as_u32,
129 s->out2in.addr.as_u32,
133 s->in2out.fib_index);
136 &s->in2out.addr, s->in2out.port,
137 &s->out2in.addr, s->out2in.port, s->nat_proto);
139 nat_ha_sdel (&s->out2in.addr, s->out2in.port, &s->ext_host_addr,
140 s->ext_host_port, s->nat_proto, s->out2in.fib_index,
170 static inline nat44_ei_session_t *
177 nat44_ei_session_t *s;
185 b0->
error = node->
errors[NAT44_EI_OUT2IN_ERROR_MAX_SESSIONS_EXCEEDED];
196 b0->
error = node->
errors[NAT44_EI_OUT2IN_ERROR_CANNOT_CREATE_USER];
212 s->in2out.addr = i2o_addr;
213 s->in2out.port = i2o_port;
214 s->in2out.fib_index = i2o_fib_index;
215 s->out2in.addr = o2i_addr;
216 s->out2in.port = o2i_port;
217 s->out2in.fib_index = o2i_fib_index;
218 s->nat_proto =
proto;
225 if (clib_bihash_add_or_overwrite_stale_8_8 (
231 if (clib_bihash_add_or_overwrite_stale_8_8 (
237 s->in2out.addr.as_u32,
238 s->out2in.addr.as_u32,
241 s->out2in.port, s->in2out.fib_index);
244 &s->in2out.addr, s->in2out.port, &s->out2in.addr,
245 s->out2in.port, s->nat_proto);
247 nat_ha_sadd (&s->in2out.addr, s->in2out.port, &s->out2in.addr,
248 s->out2in.port, &s->ext_host_addr, s->ext_host_port,
249 &s->ext_host_nat_addr, s->ext_host_nat_port,
250 s->nat_proto, s->in2out.fib_index, s->flags, thread_index, 0);
255 #ifndef CLIB_MARCH_VARIANT 260 icmp46_header_t *icmp0;
264 icmp46_header_t *inner_icmp0;
270 (
vnet_buffer (b)->ip.reass.icmp_type_or_tcp_flags))
272 *nat_proto = NAT_PROTOCOL_ICMP;
284 case NAT_PROTOCOL_ICMP:
285 inner_icmp0 = (icmp46_header_t *) l4_header;
289 case NAT_PROTOCOL_UDP:
290 case NAT_PROTOCOL_TCP:
294 return NAT44_EI_OUT2IN_ERROR_UNSUPPORTED_PROTOCOL;
320 nat44_ei_session_t **p_s0,
u8 *dont_translate)
325 nat44_ei_session_t *s0 = 0;
342 b0->
error = node->
errors[NAT44_EI_OUT2IN_ERROR_UNSUPPORTED_PROTOCOL];
349 u32 mapping_fib_index;
351 init_nat_k (&kv0, *addr, *port, *fib_index, *proto);
352 if (clib_bihash_search_8_8 (&nm->
out2in, &kv0, &value0))
357 *addr, *port, *fib_index, *proto, &mapping_addr, &mapping_port,
358 &mapping_fib_index, 1, &is_addr_only, &identity_nat))
370 b0->
error = node->
errors[NAT44_EI_OUT2IN_ERROR_NO_TRANSLATION];
385 ICMP4_echo_request || !is_addr_only)))
387 b0->
error = node->
errors[NAT44_EI_OUT2IN_ERROR_BAD_ICMP_TYPE];
399 nm, b0, mapping_addr, mapping_port, mapping_fib_index, *addr, *port,
416 reass.icmp_type_or_tcp_flags)))
418 b0->
error = node->
errors[NAT44_EI_OUT2IN_ERROR_BAD_ICMP_TYPE];
430 *addr = s0->in2out.addr;
431 *port = s0->in2out.port;
432 *fib_index = s0->in2out.fib_index;
440 #ifndef CLIB_MARCH_VARIANT 445 u16 *mapping_port,
u32 *mapping_fib_index,
447 nat44_ei_session_t **p_s0,
u8 *dont_translate)
470 mapping_addr, mapping_port,
471 mapping_fib_index, 1, &is_addr_only, 0))
480 b0->
error = node->
errors[NAT44_EI_OUT2IN_ERROR_NO_TRANSLATION];
486 (
vnet_buffer (b0)->
ip.reass.icmp_type_or_tcp_flags != ICMP4_echo_reply
488 ICMP4_echo_request || !is_addr_only)
490 reass.icmp_type_or_tcp_flags)))
492 b0->
error = node->
errors[NAT44_EI_OUT2IN_ERROR_BAD_ICMP_TYPE];
503 icmp46_header_t *icmp0,
u32 sw_if_index0,
505 u32 next0,
u32 thread_index,
506 nat44_ei_session_t **p_s0);
508 #ifndef CLIB_MARCH_VARIANT 511 icmp46_header_t *icmp0,
u32 sw_if_index0,
513 u32 thread_index, nat44_ei_session_t **p_s0)
519 icmp46_header_t *inner_icmp0;
521 u32 new_addr0, old_addr0;
522 u16 old_id0, new_id0;
537 node, thread_index, b0, ip0, &addr, &port, &fib_index, &proto, p_s0,
543 node, thread_index, b0, ip0, &addr, &port, &fib_index, &proto, p_s0,
561 if (checksum0 != 0 && checksum0 != 0xffff)
580 if (icmp0->checksum == 0)
581 icmp0->checksum = 0xffff;
592 sum0 = icmp0->checksum;
614 sum0 = icmp0->checksum;
621 case NAT_PROTOCOL_ICMP:
622 inner_icmp0 = (icmp46_header_t *) l4_header;
629 sum0 = icmp0->checksum;
635 case NAT_PROTOCOL_UDP:
636 case NAT_PROTOCOL_TCP:
641 sum0 = icmp0->checksum;
660 u32 sw_if_index0,
u32 rx_fib_index0,
662 u32 thread_index, nat44_ei_session_t **p_s0)
667 node, next0, thread_index, p_s0);
668 nat44_ei_session_t *s0 = *p_s0;
686 u32 old_addr, new_addr;
721 while (n_left_from >= 2)
726 u32 sw_if_index0, sw_if_index1;
729 u32 new_addr0, old_addr0;
730 u16 new_port0, old_port0;
731 u32 new_addr1, old_addr1;
732 u16 new_port1, old_port1;
735 icmp46_header_t *icmp0, *icmp1;
736 u32 rx_fib_index0, rx_fib_index1;
738 nat44_ei_session_t *s0 = 0, *s1 = 0;
740 u8 identity_nat0, identity_nat1;
742 u16 sm_port0, sm_port1;
743 u32 sm_fib_index0, sm_fib_index1;
771 icmp0 = (icmp46_header_t *) udp0;
781 ICMP4_time_exceeded_ttl_exceeded_in_transit,
796 node->errors[NAT44_EI_OUT2IN_ERROR_UNSUPPORTED_PROTOCOL];
801 thread_index, sw_if_index0, 1);
809 nm, b0, ip0, icmp0, sw_if_index0, rx_fib_index0, node, next0, now,
812 thread_index, sw_if_index0, 1);
819 if (clib_bihash_search_8_8 (&nm->
out2in, &kv0, &value0))
825 rx_fib_index0, proto0, &sm_addr0, &sm_port0, &sm_fib_index0, 1,
833 (proto0 == NAT_PROTOCOL_UDP
835 clib_host_to_net_u16 (UDP_DST_PORT_dhcp_to_client))))
844 node->errors[NAT44_EI_OUT2IN_ERROR_NO_TRANSLATION];
855 nm, b0, sm_addr0, sm_port0, sm_fib_index0, ip0->
dst_address,
856 vnet_buffer (b0)->
ip.reass.l4_dst_port, rx_fib_index0, proto0,
857 node, thread_index, now);
882 old_port0 =
vnet_buffer (b0)->ip.reass.l4_dst_port;
883 new_port0 = udp0->
dst_port = s0->in2out.port;
884 sum0 = tcp0->checksum;
895 thread_index, sw_if_index0, 1);
901 old_port0 =
vnet_buffer (b0)->ip.reass.l4_dst_port;
902 new_port0 = udp0->
dst_port = s0->in2out.port;
916 thread_index, sw_if_index0, 1);
927 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
941 thread_index, sw_if_index0, 1);
948 icmp1 = (icmp46_header_t *) udp1;
958 ICMP4_time_exceeded_ttl_exceeded_in_transit,
973 node->errors[NAT44_EI_OUT2IN_ERROR_UNSUPPORTED_PROTOCOL];
978 thread_index, sw_if_index1, 1);
985 nm, b1, ip1, icmp1, sw_if_index1, rx_fib_index1, node, next1, now,
988 thread_index, sw_if_index1, 1);
995 if (clib_bihash_search_8_8 (&nm->
out2in, &kv1, &value1))
1001 rx_fib_index1, proto1, &sm_addr1, &sm_port1, &sm_fib_index1, 1,
1009 (proto1 == NAT_PROTOCOL_UDP
1011 clib_host_to_net_u16 (UDP_DST_PORT_dhcp_to_client))))
1020 node->errors[NAT44_EI_OUT2IN_ERROR_NO_TRANSLATION];
1031 nm, b1, sm_addr1, sm_port1, sm_fib_index1, ip1->
dst_address,
1032 vnet_buffer (b1)->
ip.reass.l4_dst_port, rx_fib_index1, proto1,
1033 node, thread_index, now);
1058 old_port1 =
vnet_buffer (b1)->ip.reass.l4_dst_port;
1059 new_port1 = udp1->
dst_port = s1->in2out.port;
1061 sum1 = tcp1->checksum;
1072 thread_index, sw_if_index1, 1);
1078 old_port1 =
vnet_buffer (b1)->ip.reass.l4_dst_port;
1079 new_port1 = udp1->
dst_port = s1->in2out.port;
1096 thread_index, sw_if_index1, 1);
1107 && (b1->
flags & VLIB_BUFFER_IS_TRACED)))
1121 thread_index, sw_if_index1, 1);
1130 while (n_left_from > 0)
1137 u32 new_addr0, old_addr0;
1138 u16 new_port0, old_port0;
1141 icmp46_header_t *icmp0;
1144 nat44_ei_session_t *s0 = 0;
1159 icmp0 = (icmp46_header_t *) udp0;
1174 node->errors[NAT44_EI_OUT2IN_ERROR_UNSUPPORTED_PROTOCOL];
1179 thread_index, sw_if_index0, 1);
1187 ICMP4_time_exceeded_ttl_exceeded_in_transit,
1196 nm, b0, ip0, icmp0, sw_if_index0, rx_fib_index0, node, next0, now,
1199 thread_index, sw_if_index0, 1);
1207 if (clib_bihash_search_8_8 (&nm->
out2in, &kv0, &value0))
1213 rx_fib_index0, proto0, &sm_addr0, &sm_port0, &sm_fib_index0, 1,
1221 (proto0 == NAT_PROTOCOL_UDP
1223 clib_host_to_net_u16 (UDP_DST_PORT_dhcp_to_client))))
1232 node->errors[NAT44_EI_OUT2IN_ERROR_NO_TRANSLATION];
1243 nm, b0, sm_addr0, sm_port0, sm_fib_index0, ip0->
dst_address,
1244 vnet_buffer (b0)->
ip.reass.l4_dst_port, rx_fib_index0, proto0,
1245 node, thread_index, now);
1270 old_port0 =
vnet_buffer (b0)->ip.reass.l4_dst_port;
1271 new_port0 = udp0->
dst_port = s0->in2out.port;
1273 sum0 = tcp0->checksum;
1284 thread_index, sw_if_index0, 1);
1290 old_port0 =
vnet_buffer (b0)->ip.reass.l4_dst_port;
1291 new_port0 = udp0->
dst_port = s0->in2out.port;
1305 thread_index, sw_if_index0, 1);
1316 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
1330 thread_index, sw_if_index0, 1);
1346 .name =
"nat44-ei-out2in",
1347 .vector_size =
sizeof (
u32),
1374 n_left_from =
frame->n_vectors;
1379 while (n_left_from > 0)
1386 u32 new_addr0, old_addr0;
1387 u16 new_port0, old_port0;
1390 icmp46_header_t *icmp0;
1403 icmp0 = (icmp46_header_t *) udp0;
1414 ICMP4_time_exceeded_ttl_exceeded_in_transit,
1428 rx_fib_index0, node, next0, ~0, 0);
1433 rx_fib_index0, proto0, &sm_addr0,
1434 &sm_port0, &sm_fib_index0, 1, 0, 0))
1436 b0->
error = node->errors[NAT44_EI_OUT2IN_ERROR_NO_TRANSLATION];
1440 new_addr0 = sm_addr0.
as_u32;
1441 new_port0 = sm_port0;
1458 sum0 = tcp0->checksum;
1483 sum0 = tcp0->checksum;
1502 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
1524 return frame->n_vectors;
1529 .name =
"nat44-ei-out2in-fast",
1530 .vector_size =
sizeof (
u32),
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static ip_csum_t ip_incremental_checksum_buffer(vlib_main_t *vm, vlib_buffer_t *first_buffer, u32 first_buffer_offset, u32 n_bytes_to_checksum, ip_csum_t sum)
static void nat44_ei_delete_user_with_no_session(nat44_ei_main_t *nm, nat44_ei_user_t *u, u32 thread_index)
u32 nat44_ei_icmp_out2in(vlib_buffer_t *b0, ip4_header_t *ip0, icmp46_header_t *icmp0, u32 sw_if_index0, u32 rx_fib_index0, vlib_node_runtime_t *node, u32 next0, u32 thread_index, nat44_ei_session_t **p_s0)
static char * nat44_ei_out2in_error_strings[]
struct nat44_ei_main_s::@81::@82 fastpath
vlib_node_registration_t nat44_ei_out2in_fast_node
(constructor) VLIB_REGISTER_NODE (nat44_ei_out2in_fast_node)
u16 nexts[VLIB_FRAME_SIZE]
static f64 vlib_time_now(vlib_main_t *vm)
NAT44 endpoint independent plugin declarations.
nat44_ei_session_t * sessions
static void init_nat_i2o_kv(clib_bihash_kv_8_8_t *kv, nat44_ei_session_t *s, u32 thread_index, u32 session_index)
u32 * fib_index_by_sw_if_index
Table index indexed by software interface.
static void vlib_increment_simple_counter(vlib_simple_counter_main_t *cm, u32 thread_index, u32 index, u64 increment)
Increment a simple counter.
static u32 nat_value_get_thread_index(clib_bihash_kv_8_8_t *value)
static void init_nat_i2o_k(clib_bihash_kv_8_8_t *kv, nat44_ei_session_t *s)
#define VLIB_NODE_FN(node)
vlib_main_t vlib_node_runtime_t * node
vlib_error_t * errors
Vector of errors for this node.
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
struct _tcp_header tcp_header_t
clib_bihash_8_8_t static_mapping_by_external
u32 nat44_ei_icmp_match_out2in_fast(vlib_node_runtime_t *node, u32 thread_index, vlib_buffer_t *b0, ip4_header_t *ip0, ip4_address_t *mapping_addr, u16 *mapping_port, u32 *mapping_fib_index, nat_protocol_t *proto, nat44_ei_session_t **p_s0, u8 *dont_translate)
static_always_inline u8 icmp_type_is_error_message(u8 icmp_type)
nat44_ei_static_mapping_t * static_mappings
static int ip4_is_fragment(const ip4_header_t *i)
static void init_nat_o2i_kv(clib_bihash_kv_8_8_t *kv, nat44_ei_session_t *s, u32 thread_index, u32 session_index)
#define static_always_inline
static void nat44_ei_user_session_increment(nat44_ei_main_t *nm, nat44_ei_user_t *u, u8 is_static)
static uword ip4_header_checksum_is_valid(ip4_header_t *i)
u32 nat44_ei_icmp_match_out2in_slow(vlib_node_runtime_t *node, u32 thread_index, vlib_buffer_t *b0, ip4_header_t *ip0, ip4_address_t *addr, u16 *port, u32 *fib_index, nat_protocol_t *proto, nat44_ei_session_t **p_s0, u8 *dont_translate)
Get address and port values to be used for ICMP packet translation and create session if needed...
static_always_inline u8 nat44_ei_maximum_sessions_exceeded(nat44_ei_main_t *nm, u32 thread_index)
static nat_protocol_t ip_proto_to_nat_proto(u8 ip_proto)
Common NAT inline functions.
void nat_syslog_nat44_apmdel(u32 ssubix, u32 sfibix, ip4_address_t *isaddr, u16 isport, ip4_address_t *xsaddr, u16 xsport, nat_protocol_t proto)
nat44_ei_address_t * addresses
vlib_get_buffers(vm, from, b, n_left_from)
description fragment has unexpected format
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
u32 ip4_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define nat_elog_warn(_pm, nat_elog_str)
static u32 nat_value_get_session_index(clib_bihash_kv_8_8_t *value)
static void * ip4_next_header(ip4_header_t *i)
struct nat44_ei_main_s::@81::@83 slowpath
vlib_buffer_enqueue_to_next(vm, node, from,(u16 *) nexts, frame->n_vectors)
#define nat44_ei_is_session_static(sp)
struct nat44_ei_main_s::@81 counters
static_always_inline u32 nat_session_get_timeout(nat_timeouts_t *timeouts, nat_protocol_t proto, u8 state)
static nat44_ei_session_t * create_session_for_static_mapping(nat44_ei_main_t *nm, vlib_buffer_t *b0, ip4_address_t i2o_addr, u16 i2o_port, u32 i2o_fib_index, ip4_address_t o2i_addr, u16 o2i_port, u32 o2i_fib_index, nat_protocol_t proto, vlib_node_runtime_t *node, u32 thread_index, f64 now)
Create session for static mapping.
static int nat_out2in_sm_unknown_proto(nat44_ei_main_t *nm, vlib_buffer_t *b, ip4_header_t *ip, u32 rx_fib_index)
vl_api_fib_path_type_t type
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define NAT44_EI_SESSION_FLAG_STATIC_MAPPING
void nat_syslog_nat44_apmadd(u32 ssubix, u32 sfibix, ip4_address_t *isaddr, u16 isport, ip4_address_t *xsaddr, u16 xsport, nat_protocol_t proto)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static u32 nat44_ei_icmp_out2in_slow_path(nat44_ei_main_t *nm, vlib_buffer_t *b0, ip4_header_t *ip0, icmp46_header_t *icmp0, u32 sw_if_index0, u32 rx_fib_index0, vlib_node_runtime_t *node, u32 next0, f64 now, u32 thread_index, nat44_ei_session_t **p_s0)
void nat44_ei_free_outside_address_and_port(nat44_ei_address_t *addresses, u32 thread_index, ip4_address_t *addr, u16 port, nat_protocol_t protocol)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vl_api_address_union_t src_address
vl_api_ip_port_and_mask_t src_port
#define VLIB_REGISTER_NODE(x,...)
nat44_ei_main_per_thread_data_t * per_thread_data
int nat44_i2o_is_idle_session_cb(clib_bihash_kv_8_8_t *kv, void *arg)
#define CLIB_PREFETCH(addr, size, type)
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
void nat_ipfix_logging_nat44_ses_create(u32 thread_index, u32 src_ip, u32 nat_src_ip, nat_protocol_t nat_proto, u16 src_port, u16 nat_src_port, u32 fib_index)
Generate NAT44 session create event.
8 octet key, 8 octet key value pair
static u8 nat44_ei_is_interface_addr(ip4_main_t *im, vlib_node_runtime_t *node, u32 sw_if_index0, u32 ip4_addr)
vlib_node_registration_t nat44_ei_out2in_node
(constructor) VLIB_REGISTER_NODE (nat44_ei_out2in_node)
static u8 * format_nat44_ei_out2in_trace(u8 *s, va_list *args)
static vlib_main_t * vlib_get_main(void)
#define vec_elt(v, i)
Get vector value at index i.
void nat44_ei_delete_session(nat44_ei_main_t *nm, nat44_ei_session_t *ses, u32 thread_index)
static void nat44_ei_session_update_counters(nat44_ei_session_t *s, f64 now, uword bytes, u32 thread_index)
void nat_ha_sadd(ip4_address_t *in_addr, u16 in_port, ip4_address_t *out_addr, u16 out_port, ip4_address_t *eh_addr, u16 eh_port, ip4_address_t *ehn_addr, u16 ehn_port, u8 proto, u32 fib_index, u16 flags, u32 thread_index, u8 is_resync)
Create session add HA event.
static void nat44_ei_session_update_lru(nat44_ei_main_t *nm, nat44_ei_session_t *s, u32 thread_index)
Per-user LRU list maintenance.
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define ip_csum_update(sum, old, new, type, field)
nat44_ei_main_t nat44_ei_main
nat44_ei_session_t * nat44_ei_session_alloc_or_recycle(nat44_ei_main_t *nm, nat44_ei_user_t *u, u32 thread_index, f64 now)
static u8 * format_nat44_ei_out2in_fast_trace(u8 *s, va_list *args)
int nat44_o2i_is_idle_session_cb(clib_bihash_kv_8_8_t *kv, void *arg)
NAT port/address allocation lib.
static_always_inline nat44_ei_out2in_error_t icmp_get_key(vlib_buffer_t *b, ip4_header_t *ip0, ip4_address_t *addr, u16 *port, nat_protocol_t *nat_proto)
#define nat_elog_notice(_pm, nat_elog_str)
void nat_ha_sdel(ip4_address_t *out_addr, u16 out_port, ip4_address_t *eh_addr, u16 eh_port, u8 proto, u32 fib_index, u32 session_thread_index)
Create session delete HA event.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static int ip4_header_bytes(const ip4_header_t *i)
#define VLIB_NODE_FLAG_TRACE
#define CLIB_CACHE_LINE_BYTES
int nat44_ei_static_mapping_match(ip4_address_t match_addr, u16 match_port, u32 match_fib_index, nat_protocol_t match_protocol, ip4_address_t *mapping_addr, u16 *mapping_port, u32 *mapping_fib_index, u8 by_external, u8 *is_addr_only, u8 *is_identity_nat)
Match NAT44-EI static mapping.
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
static void init_nat_k(clib_bihash_kv_8_8_t *kv, ip4_address_t addr, u16 port, u32 fib_index, nat_protocol_t proto)
static_always_inline void icmp4_error_set_vnet_buffer(vlib_buffer_t *b, u8 type, u8 code, u32 data)
#define foreach_nat44_ei_out2in_error
static u16 ip_csum_fold(ip_csum_t c)
nat44_ei_user_t * nat44_ei_user_get_or_create(nat44_ei_main_t *nm, ip4_address_t *addr, u32 fib_index, u32 thread_index)
void nat_ipfix_logging_nat44_ses_delete(u32 thread_index, u32 src_ip, u32 nat_src_ip, nat_protocol_t nat_proto, u16 src_port, u16 nat_src_port, u32 fib_index)
Generate NAT44 session delete event.