|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
26 #define _(sym,string) string,
36 dslite_session_t *s = 0;
42 u32 new_addr, old_addr;
49 || (
icmp->type != ICMP4_echo_reply))
52 *
error = DSLITE_ERROR_BAD_ICMP_TYPE;
56 key.addr =
ip4->dst_address;
58 key.protocol = NAT_PROTOCOL_ICMP;
62 if (clib_bihash_search_8_8
66 *
error = DSLITE_ERROR_NO_TRANSLATION;
82 old_addr =
ip4->dst_address.as_u32;
83 ip4->dst_address = s->in2out.addr;
84 new_addr =
ip4->dst_address.as_u32;
124 u8 error0 = DSLITE_ERROR_OUT2IN;
132 dslite_session_t *s0 = 0;
134 u32 new_addr0, old_addr0;
135 u16 new_port0, old_port0;
151 error0 = DSLITE_ERROR_UNSUPPORTED_PROTOCOL;
176 if (clib_bihash_search_8_8
180 error0 = DSLITE_ERROR_NO_TRANSLATION;
202 old_port0 = tcp0->dst_port;
203 tcp0->dst_port = s0->in2out.port;
204 new_port0 = tcp0->dst_port;
206 sum0 = tcp0->checksum;
227 clib_host_to_net_u32 ((6 << 28) + (ip40->
tos << 20));
229 ip60->
protocol = IP_PROTOCOL_IP_IN_IP;
233 ip60->
dst_address.as_u64[0] = s0->in2out.softwire_id.as_u64[0];
234 ip60->
dst_address.as_u64[1] = s0->in2out.softwire_id.as_u64[1];
237 s0->last_heard =
now;
244 s0->per_b4_list_head_index, s0->per_b4_index);
247 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
261 n_left_to_next, bi0, next0);
266 return frame->n_vectors;
271 .name =
"dslite-out2in",
272 .vector_size =
sizeof (
u32),
vlib_node_registration_t dslite_out2in_node
(constructor) VLIB_REGISTER_NODE (dslite_out2in_node)
#define foreach_dslite_error
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
dslite_per_thread_data_t * per_thread_data
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.
@ DSLITE_OUT2IN_NEXT_DROP
dslite_session_t * sessions
struct _tcp_header tcp_header_t
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.
ip6_address_t aftr_ip6_addr
static_always_inline u8 icmp_type_is_error_message(u8 icmp_type)
@ DSLITE_OUT2IN_NEXT_IP4_LOOKUP
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
vlib_error_t * errors
Vector of errors for this node.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
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.
u8 * format_dslite_trace(u8 *s, va_list *args)
static void clib_dlist_remove(dlist_elt_t *pool, u32 index)
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.
static u32 dslite_icmp_out2in(dslite_main_t *dm, ip4_header_t *ip4, dslite_session_t **sp, u32 next, u8 *error, u32 thread_index)
vlib_put_next_frame(vm, node, next_index, 0)
u32 dslite_out2in_node_index
8 octet key, 8 octet key value pair
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
#define ip_csum_update(sum, old, new, type, field)
static char * dslite_out2in_error_strings[]
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.
@ DSLITE_OUT2IN_NEXT_IP6_LOOKUP
static void clib_dlist_addtail(dlist_elt_t *pool, u32 head_index, u32 new_index)
dslite_main_t dslite_main
static f64 vlib_time_now(vlib_main_t *vm)
#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 u16 ip_csum_fold(ip_csum_t c)
vl_api_fib_path_type_t type
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,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)