51 s =
format (s,
"SNAT_OUT2IN: sw_if_index %d, next index %d, session index %d",
62 s =
format (s,
"SNAT_OUT2IN_FAST: sw_if_index %d, next index %d",
75 m = t->
do_handoff ?
"next worker" :
"same worker";
86 #define foreach_snat_out2in_error \ 87 _(UNSUPPORTED_PROTOCOL, "Unsupported protocol") \ 88 _(OUT2IN_PACKETS, "Good out2in packets processed") \ 89 _(BAD_ICMP_TYPE, "unsupported ICMP type") \ 90 _(NO_TRANSLATION, "No translation") 93 #define _(sym,str) SNAT_OUT2IN_ERROR_##sym, 100 #define _(sym,string) string, 126 static inline snat_session_t *
146 if (clib_bihash_search_8_8 (&sm->user_hash, &kv0, &value0))
149 pool_get (sm->per_thread_data[cpu_index].users, u);
150 memset (u, 0,
sizeof (*u));
154 pool_get (sm->per_thread_data[cpu_index].list_pool,
155 per_user_list_head_elt);
158 sm->per_thread_data[cpu_index].list_pool;
163 kv0.
value = u - sm->per_thread_data[cpu_index].users;
166 clib_bihash_add_del_8_8 (&sm->user_hash, &kv0, 1 );
169 kv0.
value = cpu_index;
170 clib_bihash_add_del_8_8 (&sm->worker_by_in, &kv0, 1);
178 pool_get (sm->per_thread_data[cpu_index].sessions, s);
179 memset (s, 0,
sizeof (*s));
181 s->outside_address_index = ~0;
186 pool_get (sm->per_thread_data[cpu_index].list_pool,
187 per_user_translation_list_elt);
189 per_user_translation_list_elt -
190 sm->per_thread_data[cpu_index].list_pool);
192 per_user_translation_list_elt->
value =
193 s - sm->per_thread_data[cpu_index].sessions;
195 per_user_translation_list_elt - sm->per_thread_data[cpu_index].list_pool;
199 s->per_user_list_head_index,
200 per_user_translation_list_elt -
201 sm->per_thread_data[cpu_index].list_pool);
208 kv0.
key = s->in2out.as_u64;
209 kv0.
value = s - sm->per_thread_data[cpu_index].sessions;
210 if (clib_bihash_add_del_8_8 (&sm->in2out, &kv0, 1 ))
213 kv0.
key = s->out2in.as_u64;
214 kv0.
value = s - sm->per_thread_data[cpu_index].sessions;
216 if (clib_bihash_add_del_8_8 (&sm->out2in, &kv0, 1 ))
221 s->out2in.addr.as_u32,
225 s->in2out.fib_index);
233 icmp46_header_t *icmp0;
238 icmp46_header_t *inner_icmp0;
257 case SNAT_PROTOCOL_ICMP:
258 inner_icmp0 = (icmp46_header_t*)l4_header;
262 case SNAT_PROTOCOL_UDP:
263 case SNAT_PROTOCOL_TCP:
267 return SNAT_OUT2IN_ERROR_UNSUPPORTED_PROTOCOL;
316 u8 *p_dont_translate,
void *d)
319 icmp46_header_t *icmp0;
324 snat_session_t *s0 = 0;
325 u8 dont_translate = 0;
339 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_UNSUPPORTED_PROTOCOL];
347 if (clib_bihash_search_8_8 (&sm->out2in, &kv0, &value0))
360 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
366 (icmp0->type != ICMP4_echo_request || !is_addr_only)))
368 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_BAD_ICMP_TYPE];
386 icmp0->type != ICMP4_echo_request &&
389 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_BAD_ICMP_TYPE];
401 *p_value = s0->in2out;
402 *p_dont_translate = dont_translate;
404 *(snat_session_t**)d = s0;
424 u8 *p_dont_translate,
void *d)
427 icmp46_header_t *icmp0;
432 u8 dont_translate = 0;
459 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
465 (icmp0->type != ICMP4_echo_request || !is_addr_only) &&
468 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_BAD_ICMP_TYPE];
477 *p_dont_translate = dont_translate;
484 icmp46_header_t * icmp0,
496 icmp46_header_t *inner_icmp0;
498 u32 new_addr0, old_addr0;
499 u16 old_id0, new_id0;
506 next0_tmp = sm->icmp_match_out2in_cb(sm, node, cpu_index, b0,
507 &key0, &sm0, &dont_translate, d);
516 if (checksum0 != 0 && checksum0 != 0xffff)
540 sum0 = icmp0->checksum;
561 sum0 = icmp0->checksum;
568 case SNAT_PROTOCOL_ICMP:
569 inner_icmp0 = (icmp46_header_t*)l4_header;
576 sum0 = icmp0->checksum;
581 case SNAT_PROTOCOL_UDP:
582 case SNAT_PROTOCOL_TCP:
587 sum0 = icmp0->checksum;
605 icmp46_header_t * icmp0,
611 snat_session_t ** p_s0)
613 next0 =
icmp_out2in(sm, b0, ip0, icmp0, sw_if_index0, rx_fib_index0, node,
614 next0, cpu_index, p_s0);
615 snat_session_t * s0 = *p_s0;
619 s0->last_heard = now;
628 s0->per_user_list_head_index,
640 u32 n_left_from, * from, * to_next;
642 u32 pkts_processed = 0;
651 while (n_left_from > 0)
656 to_next, n_left_to_next);
658 while (n_left_from >= 4 && n_left_to_next >= 2)
664 u32 sw_if_index0, sw_if_index1;
667 u32 new_addr0, old_addr0;
668 u16 new_port0, old_port0;
669 u32 new_addr1, old_addr1;
670 u16 new_port1, old_port1;
673 icmp46_header_t * icmp0, * icmp1;
675 u32 rx_fib_index0, rx_fib_index1;
677 snat_session_t * s0 = 0, * s1 = 0;
695 to_next[0] = bi0 = from[0];
696 to_next[1] = bi1 = from[1];
708 icmp0 = (icmp46_header_t *) udp0;
711 rx_fib_index0 =
vec_elt (sm->ip4_main->fib_index_by_sw_if_index,
718 ICMP4_time_exceeded_ttl_exceeded_in_transit,
732 (sm, b0, ip0, icmp0, sw_if_index0, rx_fib_index0, node,
733 next0, now, cpu_index, &s0);
744 if (clib_bihash_search_8_8 (&sm->out2in, &kv0, &value0))
750 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
755 if (proto0 != SNAT_PROTOCOL_UDP
757 != clib_host_to_net_u16(UDP_DST_PORT_dhcp_to_client)))
767 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
789 old_port0 = tcp0->dst_port;
790 tcp0->dst_port = s0->in2out.port;
791 new_port0 = tcp0->dst_port;
793 sum0 = tcp0->checksum;
811 s0->last_heard = now;
820 s0->per_user_list_head_index,
834 t->
session_index = s0 - sm->per_thread_data[cpu_index].sessions;
843 icmp1 = (icmp46_header_t *) udp1;
846 rx_fib_index1 =
vec_elt (sm->ip4_main->fib_index_by_sw_if_index,
853 ICMP4_time_exceeded_ttl_exceeded_in_transit,
867 (sm, b1, ip1, icmp1, sw_if_index1, rx_fib_index1, node,
868 next1, now, cpu_index, &s1);
879 if (clib_bihash_search_8_8 (&sm->out2in, &kv1, &value1))
885 b1->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
890 if (proto1 != SNAT_PROTOCOL_UDP
892 != clib_host_to_net_u16(UDP_DST_PORT_dhcp_to_client)))
902 b1->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
924 old_port1 = tcp1->dst_port;
925 tcp1->dst_port = s1->in2out.port;
926 new_port1 = tcp1->dst_port;
928 sum1 = tcp1->checksum;
946 s1->last_heard = now;
955 s1->per_user_list_head_index,
969 t->
session_index = s1 - sm->per_thread_data[cpu_index].sessions;
976 to_next, n_left_to_next,
977 bi0, bi1, next0, next1);
980 while (n_left_from > 0 && n_left_to_next > 0)
988 u32 new_addr0, old_addr0;
989 u16 new_port0, old_port0;
992 icmp46_header_t * icmp0;
996 snat_session_t * s0 = 0;
1005 n_left_to_next -= 1;
1012 icmp0 = (icmp46_header_t *) udp0;
1015 rx_fib_index0 =
vec_elt (sm->ip4_main->fib_index_by_sw_if_index,
1027 ICMP4_time_exceeded_ttl_exceeded_in_transit,
1036 (sm, b0, ip0, icmp0, sw_if_index0, rx_fib_index0, node,
1037 next0, now, cpu_index, &s0);
1048 if (clib_bihash_search_8_8 (&sm->out2in, &kv0, &value0))
1054 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
1059 if (proto0 != SNAT_PROTOCOL_UDP
1061 != clib_host_to_net_u16(UDP_DST_PORT_dhcp_to_client)))
1072 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
1094 old_port0 = tcp0->dst_port;
1095 tcp0->dst_port = s0->in2out.port;
1096 new_port0 = tcp0->dst_port;
1098 sum0 = tcp0->checksum;
1116 s0->last_heard = now;
1123 s0->per_user_index);
1125 s0->per_user_list_head_index,
1126 s0->per_user_index);
1139 t->
session_index = s0 - sm->per_thread_data[cpu_index].sessions;
1146 to_next, n_left_to_next,
1154 SNAT_OUT2IN_ERROR_OUT2IN_PACKETS,
1161 .name =
"snat-out2in",
1162 .vector_size =
sizeof (
u32),
1190 u32 n_left_from, * from, * to_next;
1192 u32 pkts_processed = 0;
1199 while (n_left_from > 0)
1204 to_next, n_left_to_next);
1206 while (n_left_from >= 4 && n_left_to_next >= 2)
1212 u32 sw_if_index0, sw_if_index1;
1216 u16 new_port0, old_port0, old_port1, new_port1;
1239 to_next[0] = bi0 = from[0];
1240 to_next[1] = bi1 = from[1];
1244 n_left_to_next -= 2;
1265 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
1270 clib_net_to_host_u16(tcp0->dst), &new_addr0);
1275 clib_warning(
"no match src %U:%d dst %U:%d for user %U",
1277 clib_net_to_host_u16 (tcp0->src),
1279 clib_net_to_host_u16 (tcp0->dst),
1282 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
1302 ses0->
state = SNAT_SESSION_TCP_CLOSE_WAIT;
1303 else if (tcp0->flags &
TCP_FLAG_ACK && ses0->
state == SNAT_SESSION_TCP_LAST_ACK)
1306 old_port0 = tcp0->dst;
1307 tcp0->dst = new_port0;
1309 sum0 = tcp0->checksum;
1360 b1->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
1365 clib_net_to_host_u16(tcp1->dst), &new_addr1);
1370 clib_warning(
"no match src %U:%d dst %U:%d for user %U",
1372 clib_net_to_host_u16 (tcp1->src),
1374 clib_net_to_host_u16 (tcp1->dst),
1377 b1->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
1380 new_port1 = ses1->in_port;
1396 if (tcp1->flags &
TCP_FLAG_FIN && ses1->state == SNAT_SESSION_TCP_ESTABLISHED)
1397 ses1->state = SNAT_SESSION_TCP_CLOSE_WAIT;
1398 else if (tcp1->flags &
TCP_FLAG_ACK && ses1->state == SNAT_SESSION_TCP_LAST_ACK)
1401 old_port1 = tcp1->dst;
1402 tcp1->dst = new_port1;
1404 sum1 = tcp1->checksum;
1439 to_next, n_left_to_next,
1440 bi0, bi1, next0, next1);
1443 while (n_left_from > 0 && n_left_to_next > 0)
1452 u16 new_port0, old_port0;
1466 n_left_to_next -= 1;
1486 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
1491 clib_net_to_host_u16(tcp0->dst), &new_addr0);
1496 clib_warning(
"no match src %U:%d dst %U:%d for user %U",
1498 clib_net_to_host_u16 (tcp0->src),
1500 clib_net_to_host_u16 (tcp0->dst),
1503 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
1523 ses0->
state = SNAT_SESSION_TCP_CLOSE_WAIT;
1524 else if (tcp0->flags &
TCP_FLAG_ACK && ses0->
state == SNAT_SESSION_TCP_LAST_ACK)
1527 old_port0 = tcp0->dst;
1528 tcp0->dst = new_port0;
1530 sum0 = tcp0->checksum;
1565 to_next, n_left_to_next,
1573 SNAT_OUT2IN_ERROR_OUT2IN_PACKETS,
1580 .name =
"snat-det-out2in",
1581 .vector_size =
sizeof (
u32),
1610 u32 n_left_from, *from, *to_next = 0;
1617 u32 n_left_to_next_worker = 0, *to_next_worker = 0;
1618 u32 next_worker_index = 0;
1619 u32 current_worker_index = ~0;
1629 sm->first_worker_index + sm->num_workers - 1,
1636 while (n_left_from > 0)
1656 next_worker_index = sm->worker_out2in_cb(ip0, rx_fib_index0);
1662 if (next_worker_index != current_worker_index)
1669 handoff_queue_elt_by_worker_index);
1673 current_worker_index = next_worker_index;
1677 to_next_worker[0] = bi0;
1679 n_left_to_next_worker--;
1681 if (n_left_to_next_worker == 0)
1685 current_worker_index = ~0;
1686 handoff_queue_elt_by_worker_index[next_worker_index] = 0;
1722 for (i = 0; i <
vec_len (handoff_queue_elt_by_worker_index); i++)
1724 if (handoff_queue_elt_by_worker_index[i])
1726 hf = handoff_queue_elt_by_worker_index[
i];
1734 handoff_queue_elt_by_worker_index[
i] = 0;
1739 congested_handoff_queue_by_worker_index[
i] =
1743 current_worker_index = ~0;
1749 .name =
"snat-out2in-worker-handoff",
1750 .vector_size =
sizeof (
u32),
1768 u32 n_left_from, * from, * to_next;
1770 u32 pkts_processed = 0;
1777 while (n_left_from > 0)
1782 to_next, n_left_to_next);
1784 while (n_left_from > 0 && n_left_to_next > 0)
1792 u32 new_addr0, old_addr0;
1793 u16 new_port0, old_port0;
1796 icmp46_header_t * icmp0;
1807 n_left_to_next -= 1;
1814 icmp0 = (icmp46_header_t *) udp0;
1828 next0 =
icmp_out2in(sm, b0, ip0, icmp0, sw_if_index0,
1829 rx_fib_index0, node, next0, ~0, 0);
1839 b0->
error = node->
errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
1844 new_port0 = sm0.
port;
1859 old_port0 = tcp0->dst_port;
1860 tcp0->dst_port = new_port0;
1862 sum0 = tcp0->checksum;
1883 sum0 = tcp0->checksum;
1907 to_next, n_left_to_next,
1915 SNAT_OUT2IN_ERROR_OUT2IN_PACKETS,
1922 .name =
"snat-out2in-fast",
1923 .vector_size =
sizeof (
u32),
vlib_node_registration_t snat_out2in_fast_node
(constructor) VLIB_REGISTER_NODE (snat_out2in_fast_node)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
VLIB_NODE_FUNCTION_MULTIARCH(snat_out2in_node, snat_out2in_node_fn)
u32 sessions_per_user_list_head_index
sll srl srl sll sra u16x4 i
static void clib_dlist_init(dlist_elt_t *pool, u32 index)
u8 runtime_data[0]
Function dependent node-runtime data.
static u8 * format_snat_out2in_fast_trace(u8 *s, va_list *args)
static int ip4_header_bytes(ip4_header_t *i)
ip4_address_t * ip4_interface_first_address(ip4_main_t *im, u32 sw_if_index, ip_interface_address_t **result_ia)
static f64 vlib_time_now(vlib_main_t *vm)
static void snat_det_reverse(snat_det_map_t *dm, ip4_address_t *out_addr, u16 out_port, ip4_address_t *in_addr)
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.
static_always_inline u8 icmp_is_error_message(icmp46_header_t *icmp)
static snat_det_map_t * snat_det_map_by_out(snat_main_t *sm, ip4_address_t *out_addr)
struct _vlib_node_registration vlib_node_registration_t
static u32 icmp_out2in_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 cpu_index, snat_session_t **p_s0)
u32 buffer_index[VLIB_FRAME_SIZE]
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.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
struct _tcp_header tcp_header_t
u32 ip4_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
#define static_always_inline
static uword ip4_header_checksum_is_valid(ip4_header_t *i)
vlib_node_registration_t snat_det_out2in_node
(constructor) VLIB_REGISTER_NODE (snat_det_out2in_node)
ip_csum_t ip_incremental_checksum(ip_csum_t sum, void *_data, uword n_bytes)
ip4_address_t ext_host_addr
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static void * ip4_next_header(ip4_header_t *i)
#define foreach_snat_out2in_error
static uword snat_out2in_worker_handoff_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u32 icmp_match_out2in_fast(snat_main_t *sm, vlib_node_runtime_t *node, u32 cpu_index, vlib_buffer_t *b0, snat_session_key_t *p_key, snat_session_key_t *p_value, u8 *p_dont_translate, void *d)
Get address and port values to be used for packet SNAT translation.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
deterministic NAT definitions
snat_det_session_t * sessions
static void clib_dlist_addtail(dlist_elt_t *pool, u32 head_index, u32 new_index)
uword os_get_cpu_number(void)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
u32 icmp_match_out2in_slow(snat_main_t *sm, vlib_node_runtime_t *node, u32 cpu_index, vlib_buffer_t *b0, snat_session_key_t *p_key, snat_session_key_t *p_value, u8 *p_dont_translate, void *d)
Get address and port values to be used for packet SNAT translation and create session if needed...
static vlib_frame_queue_elt_t * vlib_get_worker_handoff_queue_elt(u32 frame_queue_index, u32 vlib_worker_index, vlib_frame_queue_elt_t **handoff_queue_elt_by_worker_index)
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
vlib_node_registration_t snat_out2in_node
(constructor) VLIB_REGISTER_NODE (snat_out2in_node)
static_always_inline void vnet_feature_next(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
#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).
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)
Match SNAT static mapping.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define CLIB_PREFETCH(addr, size, type)
void icmp4_error_set_vnet_buffer(vlib_buffer_t *b, u8 type, u8 code, u32 data)
static 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 cpu_index, void *d)
#define clib_warning(format, args...)
#define VLIB_BUFFER_IS_TRACED
8 octet key, 8 octet key value pair
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static snat_protocol_t ip_proto_to_snat_proto(u8 ip_proto)
static uword snat_det_out2in_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define VLIB_NODE_FLAG_TRACE
static void clib_dlist_remove(dlist_elt_t *pool, u32 index)
void snat_ipfix_logging_nat44_ses_create(u32 src_ip, u32 nat_src_ip, snat_protocol_t snat_proto, u16 src_port, u16 nat_src_port, u32 vrf_id)
Generate NAT44 session create event.
static snat_det_session_t * snat_det_get_ses_by_out(snat_det_map_t *dm, ip4_address_t *in_addr, u64 out_key)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define vec_elt(v, i)
Get vector value at index i.
vlib_node_registration_t snat_out2in_worker_handoff_node
(constructor) VLIB_REGISTER_NODE (snat_out2in_worker_handoff_node)
static snat_session_t * create_session_for_static_mapping(snat_main_t *sm, vlib_buffer_t *b0, snat_session_key_t in2out, snat_session_key_t out2in, vlib_node_runtime_t *node, u32 cpu_index)
Create session for static mapping.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static char * snat_out2in_error_strings[]
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_always_inline snat_out2in_error_t icmp_get_key(ip4_header_t *ip0, snat_session_key_t *p_key0)
static u8 * format_snat_out2in_trace(u8 *s, va_list *args)
static void vlib_put_frame_queue_elt(vlib_frame_queue_elt_t *hf)
static uword snat_out2in_fast_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static void snat_det_ses_close(snat_det_map_t *dm, snat_det_session_t *ses)
#define VLIB_REGISTER_NODE(x,...)
static vlib_thread_main_t * vlib_get_thread_main()
static uword snat_out2in_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u16 flags
Copy of main node flags.
#define SNAT_SESSION_FLAG_STATIC_MAPPING
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
static_always_inline u8 is_interface_addr(snat_main_t *sm, vlib_node_runtime_t *node, u32 sw_if_index0, u32 ip4_addr)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define snat_is_session_static(s)
Check if SNAT session is created from static mapping.
static u16 ip_csum_fold(ip_csum_t c)
static u8 * format_snat_out2in_worker_handoff_trace(u8 *s, va_list *args)