37 #define _(sym,string) string, 60 "NAT44_OUT2IN_ED_FAST_PATH";
62 s =
format (s,
"%s: sw_if_index %d, next index %d, session %d", tag,
71 u32 sw_if_index0,
u32 rx_fib_index0,
73 u32 thread_index, snat_session_t ** p_s0)
77 next0 =
icmp_out2in (sm, b0, ip0, icmp0, sw_if_index0, rx_fib_index0, node,
78 next0, thread_index, p_s0, 0);
79 snat_session_t *s0 = *p_s0;
85 (vm, b0), thread_index);
92 #ifndef CLIB_MARCH_VARIANT 99 u64 sess_timeout_time;
113 if (ctx->
now >= sess_timeout_time)
115 l_addr = &s->in2out.addr;
116 r_addr = &s->ext_host_addr;
117 fib_index = s->in2out.fib_index;
120 proto = s->in2out.port;
127 l_port = s->in2out.port;
128 r_port = s->ext_host_port;
132 r_addr = &s->ext_host_nat_addr;
133 r_port = s->ext_host_nat_port;
135 make_ed_kv (l_addr, r_addr, proto, fib_index, l_port, r_port, ~0ULL,
137 if (clib_bihash_add_del_16_8 (&tsm->
in2out_ed, &ed_kv, 0))
144 s->in2out.addr.as_u32,
145 s->out2in.addr.as_u32,
149 s->in2out.fib_index);
152 &s->in2out.addr, s->in2out.port,
153 &s->ext_host_nat_addr, s->ext_host_nat_port,
154 &s->out2in.addr, s->out2in.port,
155 &s->ext_host_addr, s->ext_host_port,
158 nat_ha_sdel (&s->out2in.addr, s->out2in.port, &s->ext_host_addr,
159 s->ext_host_port, s->out2in.protocol, s->out2in.fib_index,
167 key.
port = s->ext_host_nat_port;
169 if (a->
addr.
as_u32 == s->ext_host_nat_addr.as_u32)
193 static snat_session_t *
215 b->
error = node->
errors[NAT_OUT2IN_ED_ERROR_MAX_SESSIONS_EXCEEDED];
223 b->
error = node->
errors[NAT_OUT2IN_ED_ERROR_MAX_USER_SESS_EXCEEDED];
241 s->in2out.
protocol = s->out2in.protocol;
249 if (clib_bihash_add_or_overwrite_stale_16_8 (&tsm->
out2in_ed, &kv,
259 thread_index, &eh_key,
263 b->
error = node->
errors[NAT_OUT2IN_ED_ERROR_OUT_OF_PORTS];
265 if (clib_bihash_add_del_16_8 (&tsm->
out2in_ed, &kv, 0))
269 s->ext_host_nat_addr.as_u32 = eh_key.
addr.
as_u32;
270 s->ext_host_nat_port = eh_key.
port;
282 if (clib_bihash_add_or_overwrite_stale_16_8 (&tsm->
in2out_ed, &kv,
288 s->in2out.addr.as_u32,
289 s->out2in.addr.as_u32,
292 s->out2in.port, s->in2out.fib_index);
295 &s->in2out.addr, s->in2out.port,
296 &s->ext_host_nat_addr, s->ext_host_nat_port,
297 &s->out2in.addr, s->out2in.port,
298 &s->ext_host_addr, s->ext_host_port,
301 nat_ha_sadd (&s->in2out.addr, s->in2out.port, &s->out2in.addr,
302 s->out2in.port, &s->ext_host_addr, s->ext_host_port,
303 &s->ext_host_nat_addr, s->ext_host_nat_port,
304 s->in2out.protocol, s->in2out.fib_index, s->flags,
318 rx_fib_index, src_port, dst_port, ~0ULL, &kv);
319 if (!clib_bihash_search_16_8 (&tsm->
in2out_ed, &kv, &value))
327 u32 rx_fib_index,
u32 thread_index)
331 snat_session_t *s = 0;
337 if (ip->
protocol == IP_PROTOCOL_ICMP)
340 (b, ip, rx_fib_index, ~0ULL, 0, &l_port, &r_port, &kv))
357 rx_fib_index, l_port, r_port, ~0ULL, &kv);
360 if (!clib_bihash_search_16_8 (&tsm->
in2out_ed, &kv, &value))
370 (sm, rx_fib_index, thread_index)))
383 s->ext_host_port = r_port;
386 s->out2in.port = l_port;
387 s->out2in.protocol =
proto;
388 if (proto == NAT_PROTOCOL_OTHER)
393 s->out2in.fib_index = 0;
394 s->in2out = s->out2in;
397 if (clib_bihash_add_del_16_8 (&tsm->
in2out_ed, &kv, 1))
401 if (ip->
protocol == IP_PROTOCOL_TCP)
405 (sm, now, s, tcp->flags, tcp->ack_number, tcp->seq_number,
428 #ifndef CLIB_MARCH_VARIANT 433 u8 * p_dont_translate,
void *d,
void *e)
438 snat_session_t *s = 0;
439 u8 dont_translate = 0, is_addr_only, identity_nat;
448 (b, ip, rx_fib_index, ~0ULL, p_proto, &l_port, &r_port, &kv))
450 b->
error = node->
errors[NAT_OUT2IN_ED_ERROR_UNSUPPORTED_PROTOCOL];
455 if (clib_bihash_search_16_8 (&tsm->
out2in_ed, &kv, &value))
463 (sm, e_key, &l_key, 1, &is_addr_only, 0, 0, 0, &identity_nat))
474 b->
error = node->
errors[NAT_OUT2IN_ED_ERROR_NO_TRANSLATION];
482 thread_index, rx_fib_index))
496 (
vnet_buffer (b)->ip.reass.icmp_type_or_tcp_flags !=
498 && (
vnet_buffer (b)->ip.reass.icmp_type_or_tcp_flags !=
499 ICMP4_echo_request || !is_addr_only)))
501 b->
error = node->
errors[NAT_OUT2IN_ED_ERROR_BAD_ICMP_TYPE];
514 rx_fib_index, thread_index, 0,
526 (
vnet_buffer (b)->ip.reass.icmp_type_or_tcp_flags !=
528 &&
vnet_buffer (b)->ip.reass.icmp_type_or_tcp_flags !=
531 reass.icmp_type_or_tcp_flags)))
533 b->
error = node->
errors[NAT_OUT2IN_ED_ERROR_BAD_ICMP_TYPE];
542 *p_value = s->in2out;
543 *p_dont_translate = dont_translate;
545 *(snat_session_t **) d = s;
550 static snat_session_t *
562 u32 old_addr, new_addr;
572 if (!clib_bihash_search_16_8 (&tsm->
out2in_ed, &s_kv, &s_value))
581 (sm, rx_fib_index, thread_index)))
583 b->
error = node->
errors[NAT_OUT2IN_ED_ERROR_MAX_SESSIONS_EXCEEDED];
589 if (clib_bihash_search_8_8
592 b->
error = node->
errors[NAT_OUT2IN_ED_ERROR_NO_TRANSLATION];
604 b->
error = node->
errors[NAT_OUT2IN_ED_ERROR_MAX_USER_SESS_EXCEEDED];
613 s->out2in.addr.as_u32 = old_addr;
614 s->out2in.fib_index = rx_fib_index;
615 s->in2out.addr.as_u32 = new_addr;
617 s->in2out.port = s->out2in.port = ip->
protocol;
621 if (clib_bihash_add_del_16_8 (&tsm->
out2in_ed, &s_kv, 1))
626 if (clib_bihash_add_del_16_8 (&tsm->
in2out_ed, &s_kv, 1))
651 u32 n_left_from, *from, *to_next, pkts_processed = 0, stats_node_index;
657 u32 tcp_packets = 0, udp_packets = 0, icmp_packets = 0, other_packets =
666 while (n_left_from > 0)
672 while (n_left_from > 0 && n_left_to_next > 0)
676 u32 next0, sw_if_index0, rx_fib_index0, proto0, old_addr0,
678 u16 old_port0, new_port0;
682 snat_session_t *s0 = 0;
709 ICMP4_time_exceeded_ttl_exceeded_in_transit,
736 if (clib_bihash_search_16_8 (&tsm->
out2in_ed, &kv0, &value0))
743 if (s0->tcp_closed_timestamp)
745 if (now >= s0->tcp_closed_timestamp)
753 b0->
error = node->
errors[NAT_OUT2IN_ED_ERROR_TCP_CLOSED];
760 u64 sess_timeout_time;
761 sess_timeout_time = s0->last_heard +
763 if (now >= sess_timeout_time)
786 old_port0 =
vnet_buffer (b0)->ip.reass.l4_dst_port;
792 new_port0 = udp0->
dst_port = s0->in2out.port;
793 sum0 = tcp0->checksum;
803 s0->ext_host_nat_addr.as_u32,
811 tcp0->src_port = s0->ext_host_nat_port;
827 new_port0 = udp0->
dst_port = s0->in2out.port;
836 s0->ext_host_nat_addr.as_u32,
843 udp0->
src_port = s0->ext_host_nat_port;
853 new_port0 = udp0->
dst_port = s0->in2out.port;
856 udp0->
src_port = s0->ext_host_nat_port;
872 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
886 pkts_processed += next0 ==
vnet_buffer2 (b0)->nat.arc_next;
889 to_next, n_left_to_next,
897 NAT_OUT2IN_ED_ERROR_OUT2IN_PACKETS,
900 NAT_OUT2IN_ED_ERROR_TCP_PACKETS, tcp_packets);
902 NAT_OUT2IN_ED_ERROR_UDP_PACKETS, udp_packets);
904 NAT_OUT2IN_ED_ERROR_ICMP_PACKETS,
907 NAT_OUT2IN_ED_ERROR_OTHER_PACKETS,
910 NAT_OUT2IN_ED_ERROR_FRAGMENTS, fragments);
919 u32 n_left_from, *from, *to_next, pkts_processed = 0, stats_node_index;
926 u32 tcp_packets = 0, udp_packets = 0, icmp_packets = 0, other_packets =
935 while (n_left_from > 0)
941 while (n_left_from > 0 && n_left_to_next > 0)
945 u32 next0, sw_if_index0, rx_fib_index0, proto0, old_addr0,
947 u16 old_port0, new_port0;
951 icmp46_header_t *icmp0;
952 snat_session_t *s0 = 0;
983 ICMP4_time_exceeded_ttl_exceeded_in_transit,
991 icmp0 = (icmp46_header_t *) udp0;
998 thread_index, now, vm, node);
1011 (sm, b0, ip0, icmp0, sw_if_index0, rx_fib_index0, node,
1012 next0, now, thread_index, &s0);
1023 if (!clib_bihash_search_16_8 (&tsm->
out2in_ed, &kv0, &value0))
1027 if (s0->tcp_closed_timestamp && now >= s0->tcp_closed_timestamp)
1045 &twice_nat0, &lb_nat0,
1055 reass.l4_dst_port ==
1056 clib_host_to_net_u16
1057 (UDP_DST_PORT_dhcp_to_client))))
1065 node->
errors[NAT_OUT2IN_ED_ERROR_NO_TRANSLATION];
1073 thread_index, rx_fib_index0))
1091 if ((proto0 == NAT_PROTOCOL_TCP)
1093 reass.icmp_type_or_tcp_flags))
1095 b0->
error = node->
errors[NAT_OUT2IN_ED_ERROR_NON_SYN];
1127 old_port0 =
vnet_buffer (b0)->ip.reass.l4_dst_port;
1133 new_port0 = udp0->
dst_port = s0->in2out.port;
1134 sum0 = tcp0->checksum;
1144 s0->ext_host_nat_addr.as_u32,
1152 tcp0->src_port = s0->ext_host_nat_port;
1168 new_port0 = udp0->
dst_port = s0->in2out.port;
1177 s0->ext_host_nat_addr.as_u32,
1184 udp0->
src_port = s0->ext_host_nat_port;
1194 new_port0 = udp0->
dst_port = s0->in2out.port;
1197 udp0->
src_port = s0->ext_host_nat_port;
1213 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
1227 pkts_processed += next0 ==
vnet_buffer2 (b0)->nat.arc_next;
1230 to_next, n_left_to_next,
1238 NAT_OUT2IN_ED_ERROR_OUT2IN_PACKETS,
1241 NAT_OUT2IN_ED_ERROR_TCP_PACKETS, tcp_packets);
1243 NAT_OUT2IN_ED_ERROR_UDP_PACKETS, udp_packets);
1245 NAT_OUT2IN_ED_ERROR_ICMP_PACKETS,
1248 NAT_OUT2IN_ED_ERROR_OTHER_PACKETS,
1251 NAT_OUT2IN_ED_ERROR_FRAGMENTS, fragments);
1264 .name =
"nat44-ed-out2in",
1265 .vector_size =
sizeof (
u32),
1266 .sibling_of =
"nat-default",
1284 .name =
"nat44-ed-out2in-slowpath",
1285 .vector_size =
sizeof (
u32),
1286 .sibling_of =
"nat-default",
1315 .name =
"nat-pre-out2in",
1316 .vector_size =
sizeof (
u32),
1317 .sibling_of =
"nat-default",
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
#define snat_is_session_static(s)
Check if SNAT session is created from static mapping.
static uword nat44_ed_out2in_fast_path_node_fn_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u32 icmp_out2in(snat_main_t *sm, 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, void *d, void *e)
static u32 nat44_session_get_timeout(snat_main_t *sm, snat_session_t *s)
#define nat_elog_notice(nat_elog_str)
void nat_syslog_nat44_sadd(u32 ssubix, u32 sfibix, ip4_address_t *isaddr, u16 isport, ip4_address_t *idaddr, u16 idport, ip4_address_t *xsaddr, u16 xsport, ip4_address_t *xdaddr, u16 xdport, nat_protocol_t proto, u8 is_twicenat)
static f64 vlib_time_now(vlib_main_t *vm)
u32 fib_table_get_index_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the index of the FIB bound to the interface.
static void make_sm_kv(clib_bihash_kv_8_8_t *kv, ip4_address_t *addr, u8 proto, u32 fib_index, u16 port)
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 address port)
u32 ed_out2in_slowpath_node_index
#define nat_elog_warn(nat_elog_str)
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.
vlib_node_registration_t nat44_ed_out2in_node
(constructor) VLIB_REGISTER_NODE (nat44_ed_out2in_node)
#define VLIB_NODE_FN(node)
static void nat_ed_session_delete(snat_main_t *sm, snat_session_t *ses, u32 thread_index, int lru_delete)
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.
void snat_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 vrf_id)
Generate NAT44 session create event.
struct _tcp_header tcp_header_t
#define snat_is_unk_proto_session(s)
Check if SNAT session for unknown protocol.
static u32 icmp_out2in_ed_slow_path(snat_main_t *sm, 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, snat_session_t **p_s0)
u32 ip4_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
static char * nat_out2in_ed_error_strings[]
static nat_protocol_t ip_proto_to_nat_proto(u8 ip_proto)
Common NAT inline functions.
vl_api_interface_index_t sw_if_index
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static_always_inline u8 icmp_type_is_error_message(u8 icmp_type)
static void * ip4_next_header(ip4_header_t *i)
int snat_static_mapping_match(snat_main_t *sm, snat_session_key_t match, snat_session_key_t *mapping, u8 by_external, u8 *is_addr_only, twice_nat_type_t *twice_nat, lb_nat_type_t *lb, ip4_address_t *ext_host_addr, u8 *is_identity_nat)
Match NAT44 static mapping.
void snat_free_outside_address_and_port(snat_address_t *addresses, u32 thread_index, snat_session_key_t *k)
Free outside address and port pair.
vl_api_fib_path_type_t type
vlib_error_t error
Error code for buffers to be enqueued to error handler.
int nat44_o2i_ed_is_idle_session_cb(clib_bihash_kv_16_8_t *kv, void *arg)
int snat_alloc_outside_address_and_port(snat_address_t *addresses, u32 fib_index, u32 thread_index, snat_session_key_t *k, u16 port_per_thread, u32 snat_thread_index)
Alloc outside address and port.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define foreach_nat_out2in_ed_error
clib_bihash_16_8_t out2in_ed
snat_static_mapping_t * static_mappings
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vlib_node_registration_t nat_pre_out2in_node
(constructor) VLIB_REGISTER_NODE (nat_pre_out2in_node)
clib_bihash_8_8_t static_mapping_by_external
vl_api_address_union_t src_address
#define SNAT_SESSION_FLAG_UNKNOWN_PROTO
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
static_always_inline snat_session_t * nat_ed_session_alloc(snat_main_t *sm, u32 thread_index, f64 now, u8 proto)
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
static int nat44_set_tcp_session_state_o2i(snat_main_t *sm, f64 now, snat_session_t *ses, u8 tcp_flags, u32 tcp_ack_number, u32 tcp_seq_number, u32 thread_index)
#define VLIB_REGISTER_NODE(x,...)
sll srl srl sll sra u16x4 i
static void nat44_session_update_counters(snat_session_t *s, f64 now, uword bytes, u32 thread_index)
static u8 * format_nat44_ed_out2in_trace(u8 *s, va_list *args)
static u8 * format_nat_pre_trace(u8 *s, va_list *args)
8 octet key, 8 octet key value pair
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
vlib_node_registration_t nat44_ed_out2in_slowpath_node
(constructor) VLIB_REGISTER_NODE (nat44_ed_out2in_slowpath_node)
static uword nat_pre_node_fn_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u32 def_next)
The NAT inline functions.
vlib_main_t vlib_node_runtime_t * node
static snat_session_t * nat44_ed_out2in_unknown_proto(snat_main_t *sm, vlib_buffer_t *b, ip4_header_t *ip, u32 rx_fib_index, u32 thread_index, f64 now, vlib_main_t *vm, vlib_node_runtime_t *node)
void nat_syslog_nat44_sdel(u32 ssubix, u32 sfibix, ip4_address_t *isaddr, u16 isport, ip4_address_t *idaddr, u16 idport, ip4_address_t *xsaddr, u16 xsport, ip4_address_t *xdaddr, u16 xdport, nat_protocol_t proto, u8 is_twicenat)
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
#define SNAT_SESSION_FLAG_TWICE_NAT
static void nat44_session_update_lru(snat_main_t *sm, snat_session_t *s, u32 thread_index)
Per-user LRU list maintenance.
#define SNAT_SESSION_FLAG_ENDPOINT_DEPENDENT
void snat_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 vrf_id)
Generate NAT44 session delete event.
snat_address_t * twice_nat_addresses
static_always_inline u8 nat44_ed_maximum_sessions_exceeded(snat_main_t *sm, u32 fib_index, u32 thread_index)
static vlib_main_t * vlib_get_main(void)
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 thread_index)
Create session delete HA event.
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static snat_session_t * create_session_for_static_mapping_ed(snat_main_t *sm, vlib_buffer_t *b, snat_session_key_t l_key, snat_session_key_t e_key, vlib_node_runtime_t *node, u32 rx_fib_index, u32 thread_index, twice_nat_type_t twice_nat, lb_nat_type_t lb_nat, f64 now)
#define SNAT_SESSION_FLAG_FWD_BYPASS
int nat44_i2o_ed_is_idle_session_cb(clib_bihash_kv_16_8_t *kv, void *arg)
u32 icmp_match_out2in_ed(snat_main_t *sm, vlib_node_runtime_t *node, u32 thread_index, vlib_buffer_t *b, ip4_header_t *ip, u8 *p_proto, snat_session_key_t *p_value, u8 *p_dont_translate, void *d, void *e)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define SNAT_SESSION_FLAG_AFFINITY
static_always_inline u8 nat_proto_to_ip_proto(nat_protocol_t nat_proto)
VLIB buffer representation.
snat_main_per_thread_data_t * per_thread_data
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)
static u8 is_interface_addr(snat_main_t *sm, vlib_node_runtime_t *node, u32 sw_if_index0, u32 ip4_addr)
static void create_bypass_for_fwd(snat_main_t *sm, vlib_buffer_t *b, ip4_header_t *ip, u32 rx_fib_index, u32 thread_index)
snat_address_t * addresses
static_always_inline int get_icmp_o2i_ed_key(vlib_buffer_t *b, ip4_header_t *ip0, u32 rx_fib_index, u64 value, u8 *nat_proto, u16 *l_port, u16 *r_port, clib_bihash_kv_16_8_t *kv)
snat_get_worker_in2out_function_t * worker_in2out_cb
#define SNAT_SESSION_FLAG_STATIC_MAPPING
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static void create_bypass_for_fwd_worker(snat_main_t *sm, vlib_buffer_t *b, ip4_header_t *ip, u32 rx_fib_index)
u16 flags
Copy of main node flags.
#define is_twice_nat_session(s)
Check if NAT session is twice NAT.
clib_bihash_16_8_t in2out_ed
static uword nat44_ed_out2in_slow_path_node_fn_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define VLIB_NODE_FLAG_TRACE
static int next_src_nat(snat_main_t *sm, ip4_header_t *ip, u16 src_port, u16 dst_port, u32 thread_index, u32 rx_fib_index)
snat_session_t * sessions
static_always_inline void icmp4_error_set_vnet_buffer(vlib_buffer_t *b, u8 type, u8 code, u32 data)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define SNAT_SESSION_FLAG_LOAD_BALANCING
static void make_ed_kv(ip4_address_t *l_addr, ip4_address_t *r_addr, u8 proto, u32 fib_index, u16 l_port, u16 r_port, u64 value, clib_bihash_kv_16_8_t *kv)
static u16 ip_csum_fold(ip_csum_t c)
static bool tcp_flags_is_init(u8 f)
Check if client initiating TCP connection (received SYN from client)