27 #define ESP_NODE "dpdk-esp-decrypt" 29 #define ESP_NODE "esp-decrypt" 32 #define foreach_ipsec_input_next \ 33 _(DROP, "error-drop") \ 34 _(ESP_DECRYPT, ESP_NODE) 36 #define _(v, s) IPSEC_INPUT_NEXT_##v, 45 #define foreach_ipsec_input_error \ 46 _(RX_PKTS, "IPSEC pkts received") \ 47 _(DECRYPTION_FAILED, "IPSEC decryption failed") 52 #define _(sym,str) IPSEC_INPUT_ERROR_##sym, 59 #define _(sym,string) string, 79 if (t->
spi == 0 && t->
seq == 0)
81 s =
format (s,
"esp: no esp packet");
91 s =
format (s,
"esp: no sa spi %u seq %u", t->
spi, t->
seq);
123 if (da < clib_net_to_host_u32 (p->
laddr.
start.ip4.as_u32))
126 if (da > clib_net_to_host_u32 (p->
laddr.
stop.ip4.as_u32))
129 if (sa < clib_net_to_host_u32 (p->
raddr.
start.ip4.as_u32))
132 if (sa > clib_net_to_host_u32 (p->
raddr.
stop.ip4.as_u32))
197 u32 n_left_from, *from, next_index, *to_next;
205 while (n_left_from > 0)
211 while (n_left_from > 0 && n_left_to_next > 0)
221 bi0 = to_next[0] = from[0];
242 (
"packet received from %U to %U spi %u size %u spd_id %u",
245 clib_net_to_host_u32 (esp0->
spi),
246 clib_net_to_host_u16 (ip0->
length), spd0->
id);
265 next0 = IPSEC_INPUT_NEXT_ESP_DECRYPT;
278 if (ip0->
protocol == IP_PROTOCOL_IPSEC_ESP)
282 tr->
spi = clib_host_to_net_u32 (esp0->
spi);
283 tr->
seq = clib_host_to_net_u32 (esp0->
seq);
288 to_next, n_left_to_next, bi0,
294 IPSEC_INPUT_ERROR_RX_PKTS,
304 .name =
"ipsec-input-ip4",
305 .vector_size =
sizeof (
u32),
314 #define _(s,n) [IPSEC_INPUT_NEXT_##s] = n, 329 u32 n_left_from, *from, next_index, *to_next;
333 n_left_from = from_frame->n_vectors;
335 next_index = node->cached_next_index;
337 while (n_left_from > 0)
343 while (n_left_from > 0 && n_left_to_next > 0)
352 u32 header_size =
sizeof (ip0[0]);
354 bi0 = to_next[0] = from[0];
375 (
"packet received from %U to %U spi %u size %u spd_id %u",
395 next0 = IPSEC_INPUT_NEXT_ESP_DECRYPT;
406 if (ip0->
protocol == IP_PROTOCOL_IPSEC_ESP)
410 tr->
spi = clib_host_to_net_u32 (esp0->
spi);
411 tr->
seq = clib_host_to_net_u32 (esp0->
seq);
416 n_left_to_next, bi0, next0);
421 IPSEC_INPUT_ERROR_RX_PKTS,
422 from_frame->n_vectors);
424 return from_frame->n_vectors;
431 .name =
"ipsec-input-ip6",
432 .vector_size =
sizeof (
u32),
441 #define _(s,n) [IPSEC_INPUT_NEXT_##s] = n,
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.
u32 * ipv6_inbound_protect_policy_indices
u64 packets
packet counter
u32 * ipv4_inbound_protect_policy_indices
sll srl srl sll sra u16x4 i
ip46_address_t tunnel_src_addr
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
static int ip4_header_bytes(ip4_header_t *i)
struct _vlib_node_registration vlib_node_registration_t
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static uword ip6_address_is_equal(ip6_address_t *a, ip6_address_t *b)
#define clib_warning(format, args...)
ipsec_policy_t * policies
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
ip46_address_range_t laddr
#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)
ip46_address_t tunnel_dst_addr
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
ip46_address_range_t raddr
#define VLIB_BUFFER_IS_TRACED
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static_always_inline void * vnet_feature_next_with_data(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0, u32 n_data_bytes)
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
#define VLIB_REGISTER_NODE(x,...)
#define vec_foreach(var, vec)
Vector iterator.
u32 flags
buffer flags: 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.