|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
35 #define _(sym,string) string,
71 return format (s,
"no reason for slow path");
73 return format (s,
"slow path because lookup failed");
75 return format (s,
"slow path because vrf expired");
77 return format (s,
"slow path because tcp closed");
79 return format (s,
"slow path because session expired");
81 return format (s,
"invalid reason value");
94 "NAT44_OUT2IN_ED_FAST_PATH";
100 s =
format (s,
", session %d, translation result '%U' via %s",
111 s =
format (s,
"\n lookup skipped - cached session index used");
131 rx_fib_index,
ip->protocol);
154 snat_session_t **s_p)
161 snat_session_t *s = 0;
162 u8 is_addr_only, identity_nat;
169 u16 lookup_sport, lookup_dport;
175 &lookup_daddr, &lookup_dport,
178 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_UNSUPPORTED_PROTOCOL];
184 vm, sm,
ip->dst_address, lookup_sport, rx_fib_index,
186 &sm_fib_index, 1, &is_addr_only, 0, 0, 0, &identity_nat, &m))
193 ip->dst_address.as_u32))
195 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_NO_TRANSLATION];
217 ICMP4_echo_request ||
220 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_BAD_ICMP_TYPE];
232 sm,
b, sm_addr, sm_port, sm_fib_index,
ip->dst_address, lookup_sport,
244 if (checksum != 0 && checksum != 0xffff)
276 u16 port_per_thread,
u32 snat_thread_index)
283 #define _(N, j, n, s) \
284 case NAT_PROTOCOL_##N: \
285 if (a->busy_##n##_ports_per_thread[thread_index] < port_per_thread) \
289 portnum = (port_per_thread * \
290 snat_thread_index) + \
291 snat_random_port(0, port_per_thread - 1) + 1024; \
292 if (a->busy_##n##_port_refcounts[portnum]) \
294 --a->busy_##n##_port_refcounts[portnum]; \
295 a->busy_##n##_ports_per_thread[thread_index]++; \
296 a->busy_##n##_ports++; \
298 *port = clib_host_to_net_u16(portnum); \
319 u32 snat_thread_index)
331 #define _(N, j, n, s) \
332 case NAT_PROTOCOL_##N: \
333 if (a->busy_##n##_ports_per_thread[thread_index] < port_per_thread) \
335 if (a->fib_index == fib_index) \
339 portnum = (port_per_thread * snat_thread_index) + \
340 snat_random_port (0, port_per_thread - 1) + 1024; \
341 if (a->busy_##n##_port_refcounts[portnum]) \
343 --a->busy_##n##_port_refcounts[portnum]; \
344 a->busy_##n##_ports_per_thread[thread_index]++; \
345 a->busy_##n##_ports++; \
347 *port = clib_host_to_net_u16 (portnum); \
351 else if (a->fib_index == ~0) \
369 #define _(N, j, n, s) \
370 case NAT_PROTOCOL_##N: \
373 portnum = (port_per_thread * snat_thread_index) + \
374 snat_random_port (0, port_per_thread - 1) + 1024; \
375 if (a->busy_##n##_port_refcounts[portnum]) \
377 ++a->busy_##n##_port_refcounts[portnum]; \
378 a->busy_##n##_ports_per_thread[thread_index]++; \
379 a->busy_##n##_ports++; \
381 *port = clib_host_to_net_u16 (portnum); \
397 static snat_session_t *
412 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_MAX_SESSIONS_EXCEEDED];
420 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_MAX_SESSIONS_EXCEEDED];
427 s->ext_host_addr.as_u32 =
ip->src_address.as_u32;
429 nat_proto == NAT_PROTOCOL_ICMP ? 0 :
vnet_buffer (
b)->ip.reass.l4_src_port;
436 s->out2in.addr = o2i_addr;
437 s->out2in.port = o2i_port;
438 s->out2in.fib_index = o2i_fib_index;
439 s->in2out.addr = i2o_addr;
440 s->in2out.port = i2o_port;
441 s->in2out.fib_index = i2o_fib_index;
442 s->nat_proto = nat_proto;
444 if (NAT_PROTOCOL_ICMP == nat_proto)
447 o2i_addr, o2i_port, o2i_fib_index,
ip->protocol);
453 s->ext_host_port, o2i_addr, o2i_port,
454 o2i_fib_index,
ip->protocol);
462 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_HASH_ADD_FAILED];
469 ip->src_address.as_u32 == i2o_addr.
as_u32))
493 &s->ext_host_nat_addr,
494 &s->ext_host_nat_port,
509 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_OUT_OF_PORTS];
516 s->ext_host_nat_port, s->nat_proto);
524 if (NAT_PROTOCOL_ICMP == nat_proto)
536 s->ext_host_nat_addr, s->ext_host_nat_port,
537 i2o_fib_index,
ip->protocol);
539 if (NAT_PROTOCOL_ICMP == nat_proto)
550 if (NAT_PROTOCOL_ICMP == nat_proto)
553 s->ext_host_addr, i2o_port, i2o_fib_index,
559 s->ext_host_addr, s->ext_host_port,
560 i2o_fib_index,
ip->protocol);
565 if (NAT_PROTOCOL_ICMP == nat_proto)
586 s->in2out.addr.as_u32,
587 s->out2in.addr.as_u32,
590 s->out2in.port, s->in2out.fib_index);
593 s->in2out.port, &s->ext_host_nat_addr,
594 s->ext_host_nat_port, &s->out2in.addr, s->out2in.port,
595 &s->ext_host_addr, s->ext_host_port, s->nat_proto,
611 u16 lookup_sport, lookup_dport;
615 if (
ip->protocol == IP_PROTOCOL_ICMP)
618 &lookup_sport, &lookup_saddr,
619 &lookup_dport, &lookup_protocol))
624 if (
ip->protocol == IP_PROTOCOL_UDP ||
ip->protocol == IP_PROTOCOL_TCP)
634 lookup_saddr.
as_u32 =
ip->dst_address.as_u32;
635 lookup_daddr.
as_u32 =
ip->src_address.as_u32;
636 lookup_protocol =
ip->protocol;
639 init_ed_k (&kv, lookup_saddr, lookup_sport, lookup_daddr, lookup_dport,
640 rx_fib_index, lookup_protocol);
649 else if (
ip->protocol == IP_PROTOCOL_ICMP &&
673 s->ext_host_addr =
ip->src_address;
674 s->ext_host_port = lookup_dport;
676 s->out2in.addr =
ip->dst_address;
677 s->out2in.port = lookup_sport;
678 s->nat_proto =
proto;
679 if (
proto == NAT_PROTOCOL_OTHER)
682 s->out2in.port =
ip->protocol;
684 s->out2in.fib_index = rx_fib_index;
685 s->in2out.addr = s->out2in.addr;
686 s->in2out.port = s->out2in.port;
687 s->in2out.fib_index = s->out2in.fib_index;
690 ip->src_address, lookup_dport, rx_fib_index,
703 if (
ip->protocol == IP_PROTOCOL_TCP)
707 tcp->ack_number, tcp->seq_number,
717 static snat_session_t *
731 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_MAX_SESSIONS_EXCEEDED];
739 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_NO_TRANSLATION];
749 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_MAX_SESSIONS_EXCEEDED];
754 s->ext_host_addr.as_u32 =
ip->src_address.as_u32;
758 s->out2in.addr.as_u32 =
ip->dst_address.as_u32;
759 s->out2in.fib_index = rx_fib_index;
762 s->in2out.port = s->out2in.port =
ip->protocol;
775 ip->dst_address, 0, rx_fib_index,
ip->protocol);
818 u32 sw_if_index0, rx_fib_index0;
821 snat_session_t *s0 = 0;
827 int lookup_skipped = 0;
856 lookup.fib_index = rx_fib_index0;
862 ICMP4_time_exceeded_ttl_exceeded_in_transit,
873 ICMP4_echo_request &&
879 b0->
error =
node->errors[NAT_OUT2IN_ED_ERROR_BAD_ICMP_TYPE];
902 if (is_multi_worker &&
923 if (clib_bihash_search_16_8 (&sm->
flow_hash, &kv0, &value0))
948 if (s0->tcp_closed_timestamp)
950 if (
now >= s0->tcp_closed_timestamp)
959 b0->
error =
node->errors[NAT_OUT2IN_ED_ERROR_TCP_CLOSED];
966 u64 sess_timeout_time;
969 if (
now >= sess_timeout_time)
995 proto0 == NAT_PROTOCOL_UDP &&
997 clib_host_to_net_u16 (UDP_DST_PORT_dhcp_to_client))))
1004 b0->
error =
node->errors[NAT_OUT2IN_ED_ERROR_NO_TRANSLATION];
1030 sm, b0, ip0,
f, proto0, 0 )))
1038 case NAT_PROTOCOL_TCP:
1043 reass.icmp_type_or_tcp_flags,
1045 reass.tcp_ack_number,
1047 reass.tcp_seq_number,
1050 case NAT_PROTOCOL_UDP:
1054 case NAT_PROTOCOL_ICMP:
1058 case NAT_PROTOCOL_OTHER:
1073 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
1110 return frame->n_vectors;
1135 u32 sw_if_index0, rx_fib_index0;
1139 icmp46_header_t *icmp0;
1140 snat_session_t *s0 = 0;
1164 ICMP4_time_exceeded_ttl_exceeded_in_transit,
1171 icmp0 = (icmp46_header_t *) udp0;
1186 sm, b0, ip0, &s0->o2i, proto0, 0 )))
1199 (sm, b0, ip0, icmp0, sw_if_index0, rx_fib_index0,
node,
1205 sm, b0, ip0, &s0->o2i, proto0, 0 )))
1221 if (!clib_bihash_search_16_8 (&sm->
flow_hash, &kv0, &value0))
1228 if (s0->tcp_closed_timestamp &&
now >= s0->tcp_closed_timestamp)
1243 vnet_buffer (b0)->
ip.reass.l4_dst_port, rx_fib_index0, proto0,
1244 &sm_addr, &sm_port, &sm_fib_index, 1, 0, &twice_nat0, &lb_nat0,
1253 clib_host_to_net_u16
1254 (UDP_DST_PORT_dhcp_to_client))))
1262 node->errors[NAT_OUT2IN_ED_ERROR_NO_TRANSLATION];
1286 if ((proto0 == NAT_PROTOCOL_TCP)
1288 reass.icmp_type_or_tcp_flags))
1290 b0->
error =
node->errors[NAT_OUT2IN_ED_ERROR_NON_SYN];
1301 ip.reass.l4_dst_port,
1302 rx_fib_index0, proto0,
1303 node, rx_fib_index0,
1315 sm, b0, ip0, &s0->o2i, proto0, 0 )))
1327 reass.icmp_type_or_tcp_flags,
1329 reass.tcp_ack_number,
1331 reass.tcp_seq_number,
1349 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
1385 return frame->n_vectors;
1404 .name =
"nat44-ed-out2in",
1405 .vector_size =
sizeof (
u32),
1406 .sibling_of =
"nat-default",
1424 .name =
"nat44-ed-out2in-slowpath",
1425 .vector_size =
sizeof (
u32),
1426 .sibling_of =
"nat-default",
1455 .name =
"nat-pre-out2in",
1456 .vector_size =
sizeof (
u32),
1457 .sibling_of =
"nat-default",
static u32 ed_value_get_thread_index(clib_bihash_kv_16_8_t *value)
static bool tcp_flags_is_init(u8 f)
Check if client initiating TCP connection (received SYN from client)
#define SNAT_SESSION_FLAG_AFFINITY
static void nat_6t_flow_saddr_rewrite_set(nat_6t_flow_t *f, u32 saddr)
nat_translation_error_e translation_error
struct snat_main_s::@736 counters
#define nat_elog_notice(_pm, nat_elog_str)
static u32 ed_value_get_session_index(clib_bihash_kv_16_8_t *value)
snat_static_mapping_t * static_mappings
clib_bihash_kv_16_8_t search_key
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
snat_address_t * twice_nat_addresses
vl_api_ip_port_and_mask_t dst_port
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
#define nat_elog_warn(_pm, nat_elog_str)
struct snat_main_s::@736::@738 slowpath
static uword nat44_ed_out2in_slow_path_node_fn_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define clib_memcpy(d, s, n)
#define is_exact_address(s)
Check if exact pool address should be used.
#define SNAT_SESSION_FLAG_UNKNOWN_PROTO
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
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)
static_always_inline int nat_get_icmp_session_lookup_values(vlib_buffer_t *b, ip4_header_t *ip0, ip4_address_t *lookup_saddr, u16 *lookup_sport, ip4_address_t *lookup_daddr, u16 *lookup_dport, u8 *lookup_protocol)
static u32 nat44_session_get_timeout(snat_main_t *sm, snat_session_t *s)
void snat_free_outside_address_and_port(snat_address_t *addresses, u32 thread_index, ip4_address_t *addr, u16 port, nat_protocol_t protocol)
Free outside address and port pair.
struct _tcp_header tcp_header_t
static_always_inline void nat_6t_o2i_flow_init(snat_main_t *sm, u32 thread_idx, snat_session_t *s, ip4_address_t saddr, u16 sport, ip4_address_t daddr, u16 dport, u32 fib_index, u8 proto)
vlib_get_buffers(vm, from, b, n_left_from)
static nat_protocol_t ip_proto_to_nat_proto(u8 ip_proto)
Common NAT inline functions.
@ VLIB_NODE_TYPE_INTERNAL
static hash_pair_t * lookup(void *v, uword key, enum lookup_opcode op, void *new_value, void *old_value)
vlib_main_t vlib_node_runtime_t * node
nat_slow_path_reason_e slow_path_reason
u32 ip4_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
#define SNAT_SESSION_FLAG_STATIC_MAPPING
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)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static_always_inline u8 nat44_ed_maximum_sessions_exceeded(snat_main_t *sm, u32 fib_index, u32 thread_index)
static void nat_6t_flow_daddr_rewrite_set(nat_6t_flow_t *f, u32 daddr)
int snat_static_mapping_match(vlib_main_t *vm, snat_main_t *sm, 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, twice_nat_type_t *twice_nat, lb_nat_type_t *lb, ip4_address_t *ext_host_addr, u8 *is_identity_nat, snat_static_mapping_t **out)
Match NAT44 static mapping.
vlib_buffer_enqueue_to_next(vm, node, from,(u16 *) nexts, frame->n_vectors)
static_always_inline u8 icmp_type_is_error_message(u8 icmp_type)
clib_bihash_8_8_t static_mapping_by_external
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
nat_translation_error_e nat_6t_flow_buf_translate(snat_main_t *sm, vlib_buffer_t *b, ip4_header_t *ip, nat_6t_flow_t *f, nat_protocol_t proto, int is_output_feature)
#define SNAT_SESSION_FLAG_EXACT_ADDRESS
void nat_ipfix_logging_addresses_exhausted(u32 thread_index, u32 pool_id)
Generate NAT addresses exhausted event.
static_always_inline void nat_6t_i2o_flow_init(snat_main_t *sm, u32 thread_idx, snat_session_t *s, ip4_address_t saddr, u16 sport, ip4_address_t daddr, u16 dport, u32 fib_index, u8 proto)
static snat_session_t * nat44_ed_out2in_slowpath_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)
static_always_inline void per_vrf_sessions_register_session(snat_session_t *s, u32 thread_index)
@ NAT_ED_SP_REASON_NO_REASON
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
#define CLIB_PREFETCH(addr, size, type)
static void vlib_increment_simple_counter(vlib_simple_counter_main_t *cm, u32 thread_index, u32 index, u64 increment)
Increment a simple counter.
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)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void 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)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
snat_main_per_thread_data_t * per_thread_data
#define VLIB_NODE_FN(node)
clib_bihash_16_8_t flow_hash
static int ip4_is_fragment(const ip4_header_t *i)
@ NAT_NEXT_IN2OUT_ED_FAST_PATH
void nat_6t_l3_l4_csum_calc(nat_6t_flow_t *f)
#define VLIB_NODE_FLAG_TRACE
@ NAT_NEXT_OUT2IN_ED_FAST_PATH
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define static_always_inline
static u8 * format_slow_path_reason(u8 *s, va_list *args)
static uword nat44_ed_out2in_fast_path_node_fn_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_multi_worker)
static void init_ed_k(clib_bihash_kv_16_8_t *kv, ip4_address_t l_addr, u16 l_port, ip4_address_t r_addr, u16 r_port, u32 fib_index, u8 proto)
vl_api_ip_port_and_mask_t src_port
@ NAT_ED_SP_REASON_VRF_EXPIRED
sll srl srl sll sra u16x4 i
static_always_inline int nat_alloc_addr_and_port_exact(snat_address_t *a, u32 thread_index, nat_protocol_t proto, ip4_address_t *addr, u16 *port, u16 port_per_thread, u32 snat_thread_index)
static uword nat_pre_node_fn_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u32 def_next)
static void nat_6t_flow_icmp_id_rewrite_set(nat_6t_flow_t *f, u16 id)
struct snat_main_s::@736::@737 fastpath
snat_session_t * sessions
#define CLIB_CACHE_LINE_BYTES
@ NAT_ED_TRNSL_ERR_FLOW_MISMATCH
static void create_bypass_for_fwd(snat_main_t *sm, vlib_buffer_t *b, snat_session_t *s, ip4_header_t *ip, u32 rx_fib_index, u32 thread_index)
struct _vlib_node_registration vlib_node_registration_t
static void nat_ed_session_delete(snat_main_t *sm, snat_session_t *ses, u32 thread_index, int lru_delete)
static_always_inline void icmp4_error_set_vnet_buffer(vlib_buffer_t *b, u8 type, u8 code, u32 data)
static u8 is_interface_addr(snat_main_t *sm, vlib_node_runtime_t *node, u32 sw_if_index0, u32 ip4_addr)
format_function_t format_nat_ed_translation_error
static_always_inline int nat_6t_t_eq(nat_6t_t *t1, nat_6t_t *t2)
#define SNAT_SESSION_FLAG_TWICE_NAT
#define SNAT_SESSION_FLAG_LOAD_BALANCING
static_always_inline snat_session_t * nat_ed_session_alloc(snat_main_t *sm, u32 thread_index, f64 now, u8 proto)
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.
#define nat_elog_info(_pm, nat_elog_str)
static void nat_6t_flow_sport_rewrite_set(nat_6t_flow_t *f, u32 sport)
description fragment has unexpected format
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 u32 icmp_out2in_ed_slow_path(snat_main_t *sm, vlib_buffer_t *b, ip4_header_t *ip, icmp46_header_t *icmp, u32 sw_if_index, u32 rx_fib_index, vlib_node_runtime_t *node, u32 next, f64 now, u32 thread_index, snat_session_t **s_p)
static u8 * format_nat44_ed_out2in_trace(u8 *s, va_list *args)
static void nat44_session_update_counters(snat_session_t *s, f64 now, uword bytes, u32 thread_index)
#define vec_foreach(var, vec)
Vector iterator.
8 octet key, 8 octet key value pair
format_function_t format_ed_session_kvp
@ NAT_NEXT_OUT2IN_ED_SLOW_PATH
format_function_t format_nat_6t_flow
static_always_inline int nat_ed_ses_i2o_flow_hash_add_del(snat_main_t *sm, u32 thread_idx, snat_session_t *s, int is_add)
static_always_inline u8 per_vrf_sessions_is_expired(snat_session_t *s, u32 thread_index)
static_always_inline int nat44_ed_alloc_outside_addr_and_port(snat_address_t *addresses, u32 fib_index, u32 thread_index, nat_protocol_t proto, ip4_address_t *addr, u16 *port, u16 port_per_thread, u32 snat_thread_index)
vlib_node_registration_t nat_pre_out2in_node
(constructor) VLIB_REGISTER_NODE (nat_pre_out2in_node)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
vlib_node_registration_t nat44_ed_out2in_node
(constructor) VLIB_REGISTER_NODE (nat44_ed_out2in_node)
static vlib_main_t * vlib_get_main(void)
#define is_twice_nat_session(s)
Check if NAT session is twice NAT.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static snat_session_t * create_session_for_static_mapping_ed(snat_main_t *sm, vlib_buffer_t *b, 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 nat_proto, 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, snat_static_mapping_t *mapping)
#define foreach_nat_out2in_ed_error
u16 nexts[VLIB_FRAME_SIZE]
static int ip4_header_bytes(const ip4_header_t *i)
static f64 vlib_time_now(vlib_main_t *vm)
#define SNAT_SESSION_FLAG_FWD_BYPASS
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)
#define SNAT_SESSION_FLAG_ENDPOINT_DEPENDENT
@ NAT_ED_SP_REASON_LOOKUP_FAILED
vl_api_interface_index_t sw_if_index
static u8 * format_nat_pre_trace(u8 *s, va_list *args)
static u16 ip_csum_fold(ip_csum_t c)
@ NAT_ED_TRNSL_ERR_SUCCESS
static void nat_6t_flow_dport_rewrite_set(nat_6t_flow_t *f, u32 dport)
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 char * nat_out2in_ed_error_strings[]
vlib_node_registration_t nat44_ed_out2in_slowpath_node
(constructor) VLIB_REGISTER_NODE (nat44_ed_out2in_slowpath_node)
vl_api_fib_path_type_t type
static void nat44_session_update_lru(snat_main_t *sm, snat_session_t *s, u32 thread_index)
Per-user LRU list maintenance.
static_always_inline int nat_ed_ses_o2i_flow_hash_add_del(snat_main_t *sm, u32 thread_idx, snat_session_t *s, int is_add)
static void * ip4_next_header(ip4_header_t *i)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
static void nat_6t_flow_txfib_rewrite_set(nat_6t_flow_t *f, u32 tx_fib_index)
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)