|
FD.io VPP
v21.10.1-2-g0a485f517
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];
201 if (
next_src_nat (sm,
ip, lookup_sport, lookup_dport, rx_fib_index))
216 ICMP4_echo_request ||
219 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_BAD_ICMP_TYPE];
231 sm,
b, sm_addr, sm_port, sm_fib_index,
ip->dst_address, lookup_sport,
243 if (checksum != 0 && checksum != 0xffff)
275 u16 port_per_thread,
u32 snat_thread_index)
282 #define _(N, j, n, s) \
283 case NAT_PROTOCOL_##N: \
284 if (a->busy_##n##_ports_per_thread[thread_index] < port_per_thread) \
288 portnum = (port_per_thread * \
289 snat_thread_index) + \
290 snat_random_port(0, port_per_thread - 1) + 1024; \
291 if (a->busy_##n##_port_refcounts[portnum]) \
293 --a->busy_##n##_port_refcounts[portnum]; \
294 a->busy_##n##_ports_per_thread[thread_index]++; \
295 a->busy_##n##_ports++; \
297 *port = clib_host_to_net_u16(portnum); \
318 u32 snat_thread_index)
330 #define _(N, j, n, s) \
331 case NAT_PROTOCOL_##N: \
332 if (a->busy_##n##_ports_per_thread[thread_index] < port_per_thread) \
334 if (a->fib_index == fib_index) \
338 portnum = (port_per_thread * snat_thread_index) + \
339 snat_random_port (0, port_per_thread - 1) + 1024; \
340 if (a->busy_##n##_port_refcounts[portnum]) \
342 --a->busy_##n##_port_refcounts[portnum]; \
343 a->busy_##n##_ports_per_thread[thread_index]++; \
344 a->busy_##n##_ports++; \
346 *port = clib_host_to_net_u16 (portnum); \
350 else if (a->fib_index == ~0) \
368 #define _(N, j, n, s) \
369 case NAT_PROTOCOL_##N: \
372 portnum = (port_per_thread * snat_thread_index) + \
373 snat_random_port (0, port_per_thread - 1) + 1024; \
374 if (a->busy_##n##_port_refcounts[portnum]) \
376 ++a->busy_##n##_port_refcounts[portnum]; \
377 a->busy_##n##_ports_per_thread[thread_index]++; \
378 a->busy_##n##_ports++; \
380 *port = clib_host_to_net_u16 (portnum); \
396 static snat_session_t *
411 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_MAX_SESSIONS_EXCEEDED];
419 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_MAX_SESSIONS_EXCEEDED];
426 s->ext_host_addr.as_u32 =
ip->src_address.as_u32;
428 nat_proto == NAT_PROTOCOL_ICMP ? 0 :
vnet_buffer (
b)->ip.reass.l4_src_port;
434 s->out2in.addr = o2i_addr;
435 s->out2in.port = o2i_port;
436 s->out2in.fib_index = o2i_fib_index;
437 s->in2out.addr = i2o_addr;
438 s->in2out.port = i2o_port;
439 s->in2out.fib_index = i2o_fib_index;
440 s->nat_proto = nat_proto;
442 if (NAT_PROTOCOL_ICMP == nat_proto)
445 o2i_addr, o2i_port, o2i_fib_index,
ip->protocol);
451 s->ext_host_port, o2i_addr, o2i_port,
452 o2i_fib_index,
ip->protocol);
460 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_HASH_ADD_FAILED];
467 ip->src_address.as_u32 == i2o_addr.
as_u32))
491 &s->ext_host_nat_addr,
492 &s->ext_host_nat_port,
507 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_OUT_OF_PORTS];
514 s->ext_host_nat_port, s->nat_proto);
522 if (NAT_PROTOCOL_ICMP == nat_proto)
534 s->ext_host_nat_addr, s->ext_host_nat_port,
535 i2o_fib_index,
ip->protocol);
537 if (NAT_PROTOCOL_ICMP == nat_proto)
548 if (NAT_PROTOCOL_ICMP == nat_proto)
551 s->ext_host_addr, i2o_port, i2o_fib_index,
557 s->ext_host_addr, s->ext_host_port,
558 i2o_fib_index,
ip->protocol);
563 if (NAT_PROTOCOL_ICMP == nat_proto)
584 s->in2out.addr.as_u32,
585 s->out2in.addr.as_u32,
588 s->out2in.port, s->in2out.fib_index);
591 s->in2out.port, &s->ext_host_nat_addr,
592 s->ext_host_nat_port, &s->out2in.addr, s->out2in.port,
593 &s->ext_host_addr, s->ext_host_port, s->nat_proto,
609 u16 lookup_sport, lookup_dport;
613 if (
ip->protocol == IP_PROTOCOL_ICMP)
616 &lookup_sport, &lookup_saddr,
617 &lookup_dport, &lookup_protocol))
622 if (
ip->protocol == IP_PROTOCOL_UDP ||
ip->protocol == IP_PROTOCOL_TCP)
632 lookup_saddr.
as_u32 =
ip->dst_address.as_u32;
633 lookup_daddr.
as_u32 =
ip->src_address.as_u32;
634 lookup_protocol =
ip->protocol;
637 init_ed_k (&kv, lookup_saddr, lookup_sport, lookup_daddr, lookup_dport,
638 rx_fib_index, lookup_protocol);
647 else if (
ip->protocol == IP_PROTOCOL_ICMP &&
671 s->ext_host_addr =
ip->src_address;
672 s->ext_host_port = lookup_dport;
674 s->out2in.addr =
ip->dst_address;
675 s->out2in.port = lookup_sport;
676 s->nat_proto =
proto;
677 if (
proto == NAT_PROTOCOL_OTHER)
680 s->out2in.port =
ip->protocol;
682 s->out2in.fib_index = rx_fib_index;
683 s->in2out.addr = s->out2in.addr;
684 s->in2out.port = s->out2in.port;
685 s->in2out.fib_index = s->out2in.fib_index;
688 ip->src_address, lookup_dport, rx_fib_index,
701 if (
ip->protocol == IP_PROTOCOL_TCP)
705 tcp->ack_number, tcp->seq_number,
715 static snat_session_t *
729 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_MAX_SESSIONS_EXCEEDED];
737 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_NO_TRANSLATION];
747 b->
error =
node->errors[NAT_OUT2IN_ED_ERROR_MAX_SESSIONS_EXCEEDED];
752 s->ext_host_addr.as_u32 =
ip->src_address.as_u32;
755 s->out2in.addr.as_u32 =
ip->dst_address.as_u32;
756 s->out2in.fib_index = rx_fib_index;
759 s->in2out.port = s->out2in.port =
ip->protocol;
772 ip->dst_address, 0, rx_fib_index,
ip->protocol);
815 u32 sw_if_index0, rx_fib_index0;
818 snat_session_t *s0 = 0;
824 int lookup_skipped = 0;
853 lookup.fib_index = rx_fib_index0;
859 ICMP4_time_exceeded_ttl_exceeded_in_transit,
870 ICMP4_echo_request &&
876 b0->
error =
node->errors[NAT_OUT2IN_ED_ERROR_BAD_ICMP_TYPE];
899 if (is_multi_worker &&
920 if (clib_bihash_search_16_8 (&sm->
flow_hash, &kv0, &value0))
945 if (s0->tcp_closed_timestamp)
947 if (
now >= s0->tcp_closed_timestamp)
956 b0->
error =
node->errors[NAT_OUT2IN_ED_ERROR_TCP_CLOSED];
963 u64 sess_timeout_time;
966 if (
now >= sess_timeout_time)
992 proto0 == NAT_PROTOCOL_UDP &&
994 clib_host_to_net_u16 (UDP_DST_PORT_dhcp_to_client))))
1001 b0->
error =
node->errors[NAT_OUT2IN_ED_ERROR_NO_TRANSLATION];
1020 b0->
error =
node->errors[NAT_OUT2IN_ED_ERROR_TRNSL_FAILED];
1028 vm, sm, b0, ip0,
f, proto0, 0 )))
1031 b0->
error =
node->errors[NAT_OUT2IN_ED_ERROR_TRNSL_FAILED];
1037 case NAT_PROTOCOL_TCP:
1042 reass.icmp_type_or_tcp_flags,
1044 reass.tcp_ack_number,
1046 reass.tcp_seq_number,
1049 case NAT_PROTOCOL_UDP:
1053 case NAT_PROTOCOL_ICMP:
1057 case NAT_PROTOCOL_OTHER:
1072 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
1109 return frame->n_vectors;
1134 u32 sw_if_index0, rx_fib_index0;
1138 icmp46_header_t *icmp0;
1139 snat_session_t *s0 = 0;
1163 ICMP4_time_exceeded_ttl_exceeded_in_transit,
1170 icmp0 = (icmp46_header_t *) udp0;
1185 vm, sm, b0, ip0, &s0->o2i, proto0,
1189 b0->
error =
node->errors[NAT_OUT2IN_ED_ERROR_TRNSL_FAILED];
1201 (sm, b0, ip0, icmp0, sw_if_index0, rx_fib_index0,
node,
1207 vm, sm, b0, ip0, &s0->o2i, proto0,
1211 b0->
error =
node->errors[NAT_OUT2IN_ED_ERROR_TRNSL_FAILED];
1226 if (!clib_bihash_search_16_8 (&sm->
flow_hash, &kv0, &value0))
1233 if (s0->tcp_closed_timestamp &&
now >= s0->tcp_closed_timestamp)
1248 vnet_buffer (b0)->
ip.reass.l4_dst_port, rx_fib_index0, proto0,
1249 &sm_addr, &sm_port, &sm_fib_index, 1, 0, &twice_nat0, &lb_nat0,
1258 clib_host_to_net_u16
1259 (UDP_DST_PORT_dhcp_to_client))))
1267 node->errors[NAT_OUT2IN_ED_ERROR_NO_TRANSLATION];
1290 if ((proto0 == NAT_PROTOCOL_TCP)
1292 reass.icmp_type_or_tcp_flags))
1294 b0->
error =
node->errors[NAT_OUT2IN_ED_ERROR_NON_SYN];
1305 ip.reass.l4_dst_port,
1306 rx_fib_index0, proto0,
1307 node, rx_fib_index0,
1319 vm, sm, b0, ip0, &s0->o2i, proto0, 0 )))
1331 reass.icmp_type_or_tcp_flags,
1333 reass.tcp_ack_number,
1335 reass.tcp_seq_number,
1353 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
1389 return frame->n_vectors;
1407 .name =
"nat44-ed-out2in",
1408 .vector_size =
sizeof (
u32),
1409 .sibling_of =
"nat-default",
1425 .name =
"nat44-ed-out2in-slowpath",
1426 .vector_size =
sizeof (
u32),
1427 .sibling_of =
"nat-default",
1454 .name =
"nat-pre-out2in",
1455 .vector_size =
sizeof (
u32),
1456 .sibling_of =
"nat-default",
static u32 ed_value_get_thread_index(clib_bihash_kv_16_8_t *value)
static int next_src_nat(snat_main_t *sm, ip4_header_t *ip, u16 src_port, u16 dst_port, u32 rx_fib_index)
struct snat_main_s::@746::@747 fastpath
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
#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)
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 SNAT_SESSION_FLAG_UNKNOWN_PROTO
struct snat_main_s::@746 counters
#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.
static hash_pair_t * lookup(void *v, uword key, enum lookup_opcode op, void *new_value, void *old_value)
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)
struct snat_main_s::@746::@748 slowpath
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
vlib_main_t vlib_node_runtime_t * node
nat_slow_path_reason_e slow_path_reason
nat_translation_error_e nat_6t_flow_buf_translate_o2i(vlib_main_t *vm, 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)
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.
#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.
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
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)
snat_session_t * sessions
@ 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)
static bool nat44_ed_is_twice_nat_session(snat_session_t *s)
Check if NAT session is twice NAT.
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_always_inline void clib_prefetch_load(void *p)
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)
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)
static bool is_sm_exact_address(u32 f)
#define SNAT_SESSION_FLAG_FWD_BYPASS
@ 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,...)