25 #define foreach_ipsec_input_next \ 26 _(DROP, "error-drop") \ 27 _(ESP_DECRYPT, "esp-decrypt") 29 #define _(v, s) IPSEC_INPUT_NEXT_##v, 37 #define foreach_ipsec_input_error \ 38 _(RX_PKTS, "IPSEC pkts received") \ 39 _(DECRYPTION_FAILED, "IPSEC decryption failed") 43 #define _(sym,str) IPSEC_INPUT_ERROR_##sym, 50 #define _(sym,string) string, 74 s =
format (s,
"esp: no tunnel spi %u seq %u",t->
spi, t->
seq);
106 if (da < clib_net_to_host_u32(p->
laddr.
start.ip4.as_u32))
109 if (da > clib_net_to_host_u32(p->
laddr.
stop.ip4.as_u32))
112 if (sa < clib_net_to_host_u32(p->
raddr.
start.ip4.as_u32))
115 if (sa > clib_net_to_host_u32(p->
raddr.
stop.ip4.as_u32))
183 u32 n_left_from, *from, next_index, *to_next;
191 while (n_left_from > 0)
197 while (n_left_from > 0 && n_left_to_next > 0)
204 u32 tunnel_index0 = ~0;
207 bi0 = to_next[0] = from[0];
216 &next0, sizeof (c0[0]));
226 clib_warning(
"packet received from %U to %U spi %u size %u spd_id %u",
229 clib_net_to_host_u32(esp0->
spi),
230 clib_net_to_host_u16(ip0->
length),
237 clib_net_to_host_u32(esp0->
spi));
244 next0 = IPSEC_INPUT_NEXT_ESP_DECRYPT;
256 tr->
spi = clib_host_to_net_u32(esp0->
spi);
257 tr->
seq = clib_host_to_net_u32(esp0->
seq);
261 to_next, n_left_to_next, bi0, next0);
266 IPSEC_INPUT_ERROR_RX_PKTS,
275 .name =
"ipsec-input-ip4",
276 .vector_size =
sizeof (
u32),
285 #define _(s,n) [IPSEC_INPUT_NEXT_##s] = n, 302 u32 n_left_from, *from, next_index, *to_next;
310 while (n_left_from > 0)
316 while (n_left_from > 0 && n_left_to_next > 0)
323 u32 tunnel_index0 = ~0;
325 u32 header_size =
sizeof(ip0[0]);
327 bi0 = to_next[0] = from[0];
336 &next0, sizeof (c0[0]));
346 clib_warning(
"packet received from %U to %U spi %u size %u spd_id %u",
349 clib_net_to_host_u32(esp0->
spi),
357 clib_net_to_host_u32(esp0->
spi));
365 next0 = IPSEC_INPUT_NEXT_ESP_DECRYPT;
375 tr->
spi = clib_host_to_net_u32(esp0->
spi);
376 tr->
seq = clib_host_to_net_u32(esp0->
seq);
380 n_left_to_next, bi0, next0);
385 IPSEC_INPUT_ERROR_RX_PKTS,
394 .name =
"ipsec-input-ip6",
395 .vector_size =
sizeof (
u32),
404 #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)
u32 * ipv6_inbound_protect_policy_indices
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
ip_config_main_t rx_config_mains[VNET_N_CAST]
struct _vlib_node_registration vlib_node_registration_t
ip_lookup_main_t lookup_main
always_inline void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define clib_warning(format, args...)
always_inline int ip4_header_bytes(ip4_header_t *i)
always_inline void * vlib_frame_vector_args(vlib_frame_t *f)
ipsec_policy_t * policies
#define pool_elt_at_index(p, i)
always_inline void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
ip46_address_range_t laddr
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
ip46_address_t tunnel_dst_addr
always_inline uword ip6_address_is_equal(ip6_address_t *a, ip6_address_t *b)
ip46_address_range_t raddr
ip_lookup_main_t lookup_main
#define VLIB_BUFFER_IS_TRACED
always_inline void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
always_inline void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define VLIB_REGISTER_NODE(x,...)
#define vec_foreach(var, vec)
Vector iterator.
always_inline void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vnet_config_main_t config_main