29 #define _(sym,string) string, 36 dslite_session_t ** sp,
u32 next,
u8 * error,
39 dslite_session_t *s = 0;
45 u32 new_addr, old_addr;
54 *error = DSLITE_ERROR_BAD_ICMP_TYPE;
64 if (clib_bihash_search_8_8
68 *error = DSLITE_ERROR_NO_TRANSLATION;
101 u32 n_left_from, *from, *to_next;
115 while (n_left_from > 0)
121 while (n_left_from > 0 && n_left_to_next > 0)
126 u8 error0 = DSLITE_ERROR_OUT2IN;
134 dslite_session_t *s0 = 0;
136 u32 new_addr0, old_addr0;
137 u16 new_port0, old_port0;
153 error0 = DSLITE_ERROR_UNSUPPORTED_PROTOCOL;
178 if (clib_bihash_search_8_8
182 error0 = DSLITE_ERROR_NO_TRANSLATION;
204 old_port0 = tcp0->dst_port;
205 tcp0->dst_port = s0->in2out.port;
206 new_port0 = tcp0->dst_port;
208 sum0 = tcp0->checksum;
229 clib_host_to_net_u32 ((6 << 28) + (ip40->
tos << 20));
231 ip60->
protocol = IP_PROTOCOL_IP_IN_IP;
239 s0->last_heard = now;
246 s0->per_b4_list_head_index, s0->per_b4_index);
249 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
263 n_left_to_next, bi0, next0);
274 .name =
"dslite-out2in",
275 .vector_size =
sizeof (
u32),
u8 * format_dslite_trace(u8 *s, va_list *args)
static_always_inline u8 icmp_is_error_message(icmp46_header_t *icmp)
static f64 vlib_time_now(vlib_main_t *vm)
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.
struct _tcp_header tcp_header_t
static void * ip4_next_header(ip4_header_t *i)
static uword dslite_out2in_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void clib_dlist_addtail(dlist_elt_t *pool, u32 head_index, u32 new_index)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#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).
vlib_error_t error
Error code for buffers to be enqueued to error handler.
VLIB_NODE_FUNCTION_MULTIARCH(dslite_out2in_node, dslite_out2in_node_fn)
ip6_address_t aftr_ip6_addr
#define VLIB_REGISTER_NODE(x,...)
static_always_inline uword vlib_get_thread_index(void)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
dslite_main_t dslite_main
8 octet key, 8 octet key value pair
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 char * dslite_out2in_error_strings[]
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static void clib_dlist_remove(dlist_elt_t *pool, u32 index)
dslite_per_thread_data_t * per_thread_data
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
struct _vlib_node_registration vlib_node_registration_t
static u32 ip_proto_to_snat_proto(u8 ip_proto)
The NAT inline functions.
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)
vlib_node_registration_t dslite_out2in_node
(constructor) VLIB_REGISTER_NODE (dslite_out2in_node)
static u32 dslite_icmp_out2in(dslite_main_t *dm, ip4_header_t *ip4, dslite_session_t **sp, u32 next, u8 *error, u32 thread_index)
dslite_session_t * sessions
#define foreach_dslite_error
u16 flags
Copy of main node flags.
#define VLIB_NODE_FLAG_TRACE
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, 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.
static u16 ip_csum_fold(ip_csum_t c)