21 #define UDP_PING_EXPORT_RECORD_SIZE 400 28 u32 n_elts,
u32 * stream_index)
31 src_address, collector_port, elts, n_elts,
48 u32 records_this_buffer;
61 for (i = 0; i < data_len; i++)
69 src_port <= ip46_flow->udp_data.end_src_port; src_port++)
72 dst_port <= ip46_flow->udp_data.end_dst_port; dst_port++, j++)
85 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
101 next_offset = (
u32) (((
u8 *) (s + 1)) - (
u8 *) tp);
102 records_this_buffer = 0;
118 records_this_buffer++;
124 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
133 next_offset - (
sizeof (*ip) +
138 (
sizeof (*ip) +
sizeof (*udp)));
142 new_l0 = clib_host_to_net_u16 ((
u16) next_offset);
178 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
186 next_offset - (
sizeof (*ip) +
194 new_l0 = clib_host_to_net_u16 ((
u16) next_offset);
247 case VNET_API_ERROR_NO_SUCH_ENTRY:
266 if (
unformat (input,
"export-ipfix"))
268 else if (
unformat (input,
"disable"))
284 .path =
"set udp-ping export-ipfix",
285 .short_help =
"set udp-ping export-ipfix [disable]",
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
ioam_analyser_data_t analyse_data
Analysed data.
u8 * ioam_template_rewrite(flow_report_main_t *frm, flow_report_t *fr, ip4_address_t *collector_address, ip4_address_t *src_address, u16 collector_port, ipfix_report_element_t *elts, u32 n_elts, u32 *stream_index)
ip46_udp_ping_flow * ip46_flow
Vector od udp-ping data.
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.
int vnet_flow_report_add_del(flow_report_main_t *frm, vnet_flow_report_add_del_args_t *a, u16 *template_id)
static vlib_frame_t * udp_ping_send_flows(flow_report_main_t *frm, flow_report_t *fr, vlib_frame_t *f, u32 *to_next, u32 node_index)
u16 current_length
Nbytes between current data and the end of this buffer.
clib_memset(h->entries, 0, sizeof(h->entries[0])*entries)
udp_ping_flow udp_data
Per flow data.
flow_report_stream_t * streams
#define VLIB_INIT_FUNCTION(x)
vnet_flow_rewrite_callback_t * rewrite_callback
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
#define clib_error_return(e, args...)
static clib_error_t * set_udp_ping_export_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u16 start_src_port
Defines start port of the src port range.
u16 ioam_analyse_add_ipfix_record(flow_report_t *fr, ioam_analyser_data_t *record, vlib_buffer_t *b0, u16 offset, ip6_address_t *src, ip6_address_t *dst, u16 src_port, u16 dst_port)
#define vlib_call_init_function(vm, x)
flow_report_main_t flow_report_main
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
udp_ping_main_t udp_ping_main
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.
vl_api_address_union_t src_address
static u32 version_length(u16 length)
#define IOAM_FLOW_TEMPLATE_ID
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
#define VLIB_CLI_COMMAND(x,...)
u16 ip4_tcp_udp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip4_header_t *ip0)
static u8 * udp_ping_template_rewrite(flow_report_main_t *frm, flow_report_t *fr, ip4_address_t *collector_address, ip4_address_t *src_address, u16 collector_port, ipfix_report_element_t *elts, u32 n_elts, u32 *stream_index)
static u32 ipfix_set_id_length(u16 set_id, u16 length)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
ipfix_template_packet_t ipfix
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define ip_csum_update(sum, old, new, type, field)
vnet_flow_data_callback_t * flow_data_callback
clib_error_t * udp_ping_flow_report_init(vlib_main_t *vm)
udp_ping_flow_data * stats
Ping statistics.
static u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static u16 ip4_header_checksum(ip4_header_t *i)
static clib_error_t * flow_report_init(vlib_main_t *vm)
static u16 ip_csum_fold(ip_csum_t c)
clib_error_t * udp_ping_flow_create(u8 del)
#define UDP_PING_EXPORT_RECORD_SIZE