|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
27 #define foreach_nat44_classify_error \
28 _(NEXT_IN2OUT, "next in2out") \
29 _(NEXT_OUT2IN, "next out2in") \
30 _(FRAG_CACHED, "fragment cached")
34 #define _(sym,str) NAT44_CLASSIFY_ERROR_##sym,
63 s =
format (s,
"nat44-classify: fragment cached");
67 s =
format (s,
"nat44-classify: next %s",
next);
82 u32 next_in2out = 0, next_out2in = 0;
138 if (!clib_bihash_search_8_8
149 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
162 to_next, n_left_to_next,
170 NAT44_CLASSIFY_ERROR_NEXT_IN2OUT, next_in2out);
172 NAT44_CLASSIFY_ERROR_NEXT_OUT2IN, next_out2in);
173 return frame->n_vectors;
185 u32 next_in2out = 0, next_out2in = 0;
202 u32 sw_if_index0, rx_fib_index0;
223 if (ip0->
protocol != IP_PROTOCOL_ICMP)
236 if (!clib_bihash_search_16_8 (&sm->
flow_hash, &ed_kv0,
249 if (i2o_kv.
key[0] == ed_kv0.
key[0] &&
250 i2o_kv.
key[1] == ed_kv0.
key[1])
288 if (!clib_bihash_search_8_8
299 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
312 to_next, n_left_to_next,
320 NAT44_CLASSIFY_ERROR_NEXT_IN2OUT, next_in2out);
322 NAT44_CLASSIFY_ERROR_NEXT_OUT2IN, next_out2in);
323 return frame->n_vectors;
334 .name =
"nat44-ed-classify",
335 .vector_size =
sizeof (
u32),
336 .sibling_of =
"nat-default",
349 .name =
"nat44-handoff-classify",
350 .vector_size =
sizeof (
u32),
351 .sibling_of =
"nat-default",
static u32 ed_value_get_thread_index(clib_bihash_kv_16_8_t *value)
vlib_node_registration_t nat44_ed_classify_node
(constructor) VLIB_REGISTER_NODE (nat44_ed_classify_node)
static u32 ed_value_get_session_index(clib_bihash_kv_16_8_t *value)
snat_static_mapping_t * static_mappings
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static_always_inline void nat_6t_flow_to_ed_k(clib_bihash_kv_16_8_t *kv, nat_6t_flow_t *f)
nat44_ei_hairpin_src_next_t next_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
@ NAT_NEXT_IN2OUT_CLASSIFY
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
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static uword nat44_handoff_classify_node_fn_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static u8 * format_nat44_classify_trace(u8 *s, va_list *args)
snat_address_t * addresses
clib_bihash_8_8_t static_mapping_by_external
@ NAT44_CLASSIFY_NEXT_DROP
snat_main_per_thread_data_t * per_thread_data
#define VLIB_NODE_FN(node)
clib_bihash_16_8_t flow_hash
#define foreach_nat44_classify_error
@ NAT_NEXT_IN2OUT_ED_FAST_PATH
#define VLIB_NODE_FLAG_TRACE
@ NAT_NEXT_OUT2IN_ED_FAST_PATH
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vlib_node_registration_t nat44_handoff_classify_node
(constructor) VLIB_REGISTER_NODE (nat44_handoff_classify_node)
static uword nat44_ed_classify_node_fn_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
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)
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
snat_session_t * sessions
struct _vlib_node_registration vlib_node_registration_t
#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.
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
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.
#define vec_foreach(var, vec)
Vector iterator.
8 octet key, 8 octet key value pair
static uword pool_elts(void *v)
Number of active elements in a pool.
@ NAT44_CLASSIFY_NEXT_IN2OUT
@ NAT_NEXT_OUT2IN_CLASSIFY
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
ip4_address_t external_addr
@ NAT44_CLASSIFY_NEXT_OUT2IN
#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 void init_nat_k(clib_bihash_kv_8_8_t *kv, ip4_address_t addr, u16 port, u32 fib_index, nat_protocol_t proto)
vl_api_fib_path_type_t type
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)