|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
44 #define foreach_nat66_in2out_error \
45 _(NO_TRANSLATION, "no translation") \
50 #define _(sym,str) NAT66_IN2OUT_ERROR_##sym,
57 #define _(sym,string) string,
134 u16 l4_offset0, frag_offset0;
137 u32 sw_if_index0, fib_index0;
140 icmp46_header_t *icmp0;
161 b0->
error =
node->errors[NAT66_IN2OUT_ERROR_UNKNOWN];
179 if (l4_protocol0 == IP_PROTOCOL_UDP)
184 else if (l4_protocol0 == IP_PROTOCOL_TCP)
187 checksum0 = &tcp0->checksum;
189 else if (l4_protocol0 == IP_PROTOCOL_ICMP6)
191 icmp0 = (icmp46_header_t *)
u8_ptr_add (ip60, l4_offset0);
192 checksum0 = &icmp0->checksum;
214 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
230 n_left_to_next, bi0, next0);
235 return frame->n_vectors;
240 .name =
"nat66-in2out",
241 .vector_size =
sizeof (
u32),
nat66_static_mapping_t * nat66_static_mapping_get(ip6_address_t *addr, u32 fib_index, u8 is_local)
#define u8_ptr_add(ptr, index)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
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.
struct _tcp_header tcp_header_t
nat44_ei_interface_t * interfaces
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
#define FIB_NODE_INDEX_INVALID
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
fib_node_index_t fib_table_lookup(u32 fib_index, const fib_prefix_t *prefix)
Perfom a longest prefix match in the non-forwarding table.
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
#define nat66_interface_is_outside(i)
#define pool_foreach(VAR, POOL)
Iterate through pool.
static void vlib_increment_simple_counter(vlib_simple_counter_main_t *cm, u32 thread_index, u32 index, u64 increment)
Increment a simple counter.
static_always_inline int ip6_parse(vlib_main_t *vm, vlib_buffer_t *b, const ip6_header_t *ip6, u32 buff_len, u8 *l4_protocol, u16 *l4_offset, u16 *frag_hdr_offset)
Parse some useful information from IPv6 header.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define VLIB_NODE_FN(node)
#define VLIB_NODE_FLAG_TRACE
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vlib_node_registration_t nat66_in2out_node
(constructor) VLIB_REGISTER_NODE (nat66_in2out_node)
u32 fib_node_index_t
A typedef of a node index.
sll srl srl sll sra u16x4 i
IPv6 to IPv4 translation.
u32 fib_entry_get_resolving_interface(fib_node_index_t entry_index)
struct _vlib_node_registration vlib_node_registration_t
u16 current_length
Nbytes between current data and the end of this buffer.
static char * nat66_in2out_error_strings[]
static u8 nat66_not_translate(u32 rx_fib_index, ip6_address_t ip6_addr)
static ip_csum_t ip_csum_sub_even(ip_csum_t c, ip_csum_t x)
#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 foreach_nat66_in2out_error
fib_protocol_t fp_proto
protocol type
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.
@ NAT66_IN2OUT_NEXT_IP6_LOOKUP
NAT66 global declarations.
static ip_csum_t ip_csum_add_even(ip_csum_t c, ip_csum_t x)
vl_api_interface_index_t sw_if_index
#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 u8 * format_nat66_in2out_trace(u8 *s, va_list *args)
static u16 ip_csum_fold(ip_csum_t c)
Aggregate type for a prefix.
vl_api_fib_path_type_t type
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
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,...)