|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
24 #define UDP_PING_REWRITE_LEN 1000
62 ip6_address_t
src, ip6_address_t
dst,
68 u16 hbh_len = 0, rnd_size = 0, ip0_len = 0, udp_len = 0;
69 u16 trace_len = 0, trace_data_size = 0;
72 ioam_trace_option_t *trace_option;
73 ioam_e2e_option_t *e2e;
78 clib_host_to_net_u32 (0x6 << 28);
80 ip0->
protocol = IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS;
92 trace_len =
sizeof (ioam_trace_option_t) +
96 rnd_size = (hbh_len + 7) & ~7;
99 hbh0->
length = (rnd_size >> 3) - 1;
103 current = (
u8 *) (hbh0 + 1);
106 trace_option = (ioam_trace_option_t *) current;
109 trace_option->hdr.length = trace_len;
110 trace_option->trace_hdr.ioam_trace_type =
113 trace_option->trace_hdr.data_list_elts_left = 5 * 2;
119 e2e = (ioam_e2e_option_t *) current;
121 e2e->hdr.length = e2e_len;
124 current = ((
u8 *) hbh0) + ((hbh0->
length + 1) << 3);
131 ip0_len = ((hbh0->
length + 1) << 3) + udp_len;
140 u16 start_src_port,
u16 end_src_port,
141 u16 start_dst_port,
u16 end_dst_port,
146 (
flow->udp_data.start_src_port == start_src_port) &&
147 (
flow->udp_data.end_src_port == end_src_port) &&
148 (
flow->udp_data.start_dst_port == start_dst_port) &&
149 (
flow->udp_data.end_dst_port == end_dst_port))
159 u16 start_src_port,
u16 end_src_port,
160 u16 start_dst_port,
u16 end_dst_port,
165 flow->udp_data.start_src_port = start_src_port;
166 flow->udp_data.end_src_port = end_src_port;
167 flow->udp_data.start_dst_port = start_dst_port;
168 flow->udp_data.end_dst_port = end_dst_port;
170 flow->udp_data.next_send_time = 0;
171 flow->fault_det = fault_det;
184 (
flow->udp_data.end_dst_port -
flow->udp_data.start_dst_port) + 1;
186 ((
flow->udp_data.end_src_port -
flow->udp_data.start_src_port) + 1);
193 src_port <= flow->udp_data.end_src_port;
src_port++)
196 dst_port <= flow->udp_data.end_dst_port;
dst_port++)
202 stats->analyse_data.is_free = 0;
227 stats->ping_rewrite = NULL;
228 stats->rewrite_len = 0;
232 flow->udp_data.stats = NULL;
264 for (
i = 0;
i < no_pak;
i++)
272 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
279 stats->analyse_data.pkt_sent++;
294 ioam_trace_option_t *opt = (ioam_trace_option_t *)
314 *to_next = buffers[
i];
320 flow->udp_data.next_send_time =
int udp_ping_create_ip6_pak(u8 *buf, ip6_address_t src, ip6_address_t dst, u16 src_port, u16 dst_port, u8 msg_type, u16 ctx)
Frame IPv6 udp-ping probe packet.
vl_api_ip_port_and_mask_t dst_port
int udp_ping_compare_flow(ip46_address_t src, ip46_address_t dst, u16 start_src_port, u16 end_src_port, u16 start_dst_port, u16 end_dst_port, ip46_udp_ping_flow *flow)
u16 ip6_tcp_udp_icmp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
#define UDP_PING_PROBE_MARKER1
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static void ip6_ioam_analyse_set_paths_down(ioam_analyser_data_t *data)
static int ip46_address_cmp(const ip46_address_t *ip46_1, const ip46_address_t *ip46_2)
#define UDP_PING_PROBE_MARKER2
#define UDP_PING_REWRITE_LEN
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vl_api_ikev2_sa_stats_t stats
static u32 ioam_flow_add(u8 encap, u8 *flow_name)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
void udp_ping_create_rewrite(ip46_udp_ping_flow *flow, u16 ctx)
static void ip6_hbh_ioam_trace_set_bit(ioam_trace_option_t *trace, u8 trace_bit)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static ip6_hop_by_hop_option_t * ip6_hbh_get_option(ip6_hop_by_hop_header_t *hbh0, u8 option_to_search)
static __clib_warn_unused_result u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
vl_api_ip_port_and_mask_t src_port
sll srl srl sll sra u16x4 i
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define CLIB_CACHE_LINE_BYTES
u16 current_length
Nbytes between current data and the end of this buffer.
#define HBH_OPTION_TYPE_IOAM_EDGE_TO_EDGE
#define vec_free(V)
Free vector's memory (no header).
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
u16 udp_ping_fill_udp_data(udp_ping_t *udp_ping, u16 src_port, u16 dst_port, u8 msg_type, u16 ctx)
#define TRACE_TYPE_IF_TS_APP
#define HBH_OPTION_TYPE_DATA_CHANGE_ENROUTE
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
void udp_ping_populate_flow(ip46_address_t src, ip46_address_t dst, u16 start_src_port, u16 end_src_port, u16 start_dst_port, u16 end_dst_port, u16 interval, u8 fault_det, ip46_udp_ping_flow *flow)
static f64 vlib_time_now(vlib_main_t *vm)
void udp_ping_send_ip6_pak(vlib_main_t *vm, ip46_udp_ping_flow *flow)
Create and send ipv6 udp-ping probe packet.
static u8 fetch_trace_data_size(u16 trace_type)
#define HBH_OPTION_TYPE_IOAM_TRACE_DATA_LIST
void udp_ping_free_flow_data(ip46_udp_ping_flow *flow)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
static void ioam_analyse_init_data(ioam_analyser_data_t *data)