24 #define UDP_PING_REWRITE_LEN 1000 31 udp_ping->
udp.
src_port = clib_host_to_net_u16 (src_port);
32 udp_ping->
udp.
dst_port = clib_host_to_net_u16 (dst_port);
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);
128 src_port, dst_port, msg_type, ctx);
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,
159 u16 start_src_port,
u16 end_src_port,
160 u16 start_dst_port,
u16 end_dst_port,
193 src_port <= flow->udp_data.end_src_port; src_port++)
196 dst_port <= flow->udp_data.end_dst_port; dst_port++)
208 flow->
src.ip6, flow->
dst.ip6,
264 for (i = 0; i < no_pak; i++)
272 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
294 ioam_trace_option_t *opt = (ioam_trace_option_t *)
314 *to_next = buffers[
i];
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
#define UDP_PING_REWRITE_LEN
ioam_analyser_data_t analyse_data
Analysed data.
static void ip6_hbh_ioam_trace_set_bit(ioam_trace_option_t *trace, u8 trace_bit)
#define UDP_PING_PROBE_MARKER2
#define TRACE_TYPE_IF_TS_APP
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
u16 start_dst_port
Defines start port of the dest port range.
static void ioam_analyse_init_data(ioam_analyser_data_t *data)
#define clib_memcpy_fast(a, b, c)
static f64 vlib_time_now(vlib_main_t *vm)
u16 current_length
Nbytes between current data and the end of this buffer.
u32 pkt_sent
Num of pkts sent for this flow.
static u8 fetch_trace_data_size(u16 trace_type)
void udp_ping_free_flow_data(ip46_udp_ping_flow *flow)
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.
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
u16 interval
Interval for which ping packet to be sent.
udp_ping_flow udp_data
Per flow data.
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 end_src_port
Defines end port of the src port range.
u16 udp_ping_fill_udp_data(udp_ping_t *udp_ping, u16 src_port, u16 dst_port, u8 msg_type, u16 ctx)
f64 next_send_time
Time at which next udp-ping probe has to be sent out.
static void ip6_ioam_analyse_set_paths_down(ioam_analyser_data_t *data)
#define HBH_OPTION_TYPE_IOAM_EDGE_TO_EDGE
void udp_ping_send_ip6_pak(vlib_main_t *vm, ip46_udp_ping_flow *flow)
Create and send ipv6 udp-ping probe packet.
static int ip46_address_cmp(const ip46_address_t *ip46_1, const ip46_address_t *ip46_2)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
u16 start_src_port
Defines start port of the src port range.
u8 * ping_rewrite
UDP ping packet.
void udp_ping_create_rewrite(ip46_udp_ping_flow *flow, u16 ctx)
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
ip46_address_t dst
Remote destination IPv4/6 address to be used.
u32 flow_ctx
This is used by ioam e2e for identifying flow and add seq number.
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)
#define vec_free(V)
Free vector's memory (no header).
static u32 ioam_flow_add(u8 encap, u8 *flow_name)
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
u16 ip6_tcp_udp_icmp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
u16 end_dst_port
Defines end port of the dest port range.
u8 fault_det
To enable fault detection/isolation in network.
ip46_address_t src
Local source IPv4/6 address to be used.
#define HBH_OPTION_TYPE_IOAM_TRACE_DATA_LIST
u16 rewrite_len
Ping packet rewrite string len.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
VLIB buffer representation.
static ip6_hop_by_hop_option_t * ip6_hbh_get_option(ip6_hop_by_hop_header_t *hbh0, u8 option_to_search)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define HBH_OPTION_TYPE_DATA_CHANGE_ENROUTE
u16 retry
Number of times ping response was dropped.
udp_ping_flow_data * stats
Ping statistics.
#define CLIB_CACHE_LINE_BYTES
static u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
#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.