25 #define foreach_ipip_input_next \ 26 _(PUNT, "error-punt") \ 27 _(DROP, "error-drop") \ 28 _(IP4_INPUT, "ip4-input") \ 29 _(IP6_INPUT, "ip6-input") 33 #define _(s, n) IPIP_INPUT_NEXT_##s, 66 u32 n_left_from, next_index, *from, *to_next, n_left_to_next;
67 u32 tunnel_sw_if_index = ~0;
75 while (n_left_from > 0)
79 while (n_left_from > 0 && n_left_to_next > 0)
85 u32 next0 = IPIP_INPUT_NEXT_DROP;
91 bi0 = to_next[0] = from[0];
103 if (ip60->
protocol == IP_PROTOCOL_IPV6_FRAGMENTATION)
105 next0 = IPIP_INPUT_NEXT_DROP;
106 b0->
error = node->
errors[IPIP_ERROR_FRAGMENTED_PACKET];
123 next0 = IPIP_INPUT_NEXT_DROP;
124 b0->
error = node->
errors[IPIP_ERROR_FRAGMENTED_PACKET];
150 next0 = IPIP_INPUT_NEXT_DROP;
160 if (inner_protocol0 == IP_PROTOCOL_IPV6)
162 next0 = IPIP_INPUT_NEXT_IP6_INPUT;
164 if (t0->
flags & IPIP_TUNNEL_FLAG_DECAP_COPY_ECN)
174 else if (inner_protocol0 == IP_PROTOCOL_IP_IN_IP)
176 next0 = IPIP_INPUT_NEXT_IP4_INPUT;
177 if (t0->
flags & IPIP_TUNNEL_FLAG_DECAP_COPY_ECN)
196 next0 = IPIP_INPUT_NEXT_DROP;
204 thread_index, tunnel_sw_if_index,
231 n_left_to_next, bi0, next0);
256 #define _(sym,string) string, 263 .name =
"ipip4-input",
265 .vector_size =
sizeof(
u32),
271 #define _(s, n) [IPIP_INPUT_NEXT_##s] = n, 279 .name =
"ipip6-input",
281 .vector_size =
sizeof(
u32),
287 #define _(s, n) [IPIP_INPUT_NEXT_##s] = n, 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 void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
vlib_node_registration_t ipip6_input_node
(constructor) VLIB_REGISTER_NODE (ipip6_input_node)
A representation of a IPIP tunnel.
vnet_interface_main_t interface_main
void ip_set(ip46_address_t *dst, void *src, u8 is_ip4)
#define foreach_ipip_input_next
static char * ipip_error_strings[]
static void ip4_header_set_ecn_w_chksum(ip4_header_t *ip4, ip_ecn_t ecn)
ipip_tunnel_flags_t flags
#define VLIB_NODE_FN(node)
vlib_error_t * errors
Vector of errors for this node.
static_always_inline ip_ecn_t ip6_ecn_network_order(const ip6_header_t *ip6)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
static_always_inline u32 sixrd_get_addr_net(const ipip_tunnel_t *t, u64 dal)
static void ip46_address_reset(ip46_address_t *ip46)
vlib_combined_counter_main_t * combined_sw_if_counters
ipip_transport_t transport
#define foreach_ipip_error
vlib_error_t error
Error code for buffers to be enqueued to error handler.
vlib_node_registration_t ipip4_input_node
(constructor) VLIB_REGISTER_NODE (ipip4_input_node)
ipip_tunnel_t * ipip_tunnel_db_find(ipip_tunnel_key_t *key)
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).
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
format_function_t format_ip46_address
#define IP4_HEADER_FLAG_MORE_FRAGMENTS
ipip_transport_t
IPIP Tunnel key.
#define VLIB_REGISTER_NODE(x,...)
static_always_inline void ip6_set_ecn_network_order(ip6_header_t *ip6, ip_ecn_t ecn)
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.
vlib_main_t vlib_node_runtime_t * node
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 * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static u8 * format_ipip_rx_trace(u8 *s, va_list *args)
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static ip_ecn_t ip4_header_get_ecn(const ip4_header_t *ip4)
static uword ipip_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, bool is_ipv6)
struct ipip_tunnel_t::@338 sixrd
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define ip46_address_initializer