21 #define UDP_PING_EXPORT_RECORD_SIZE 400 29 src_address, collector_port);
45 u32 records_this_buffer;
52 u16 src_port, dst_port;
58 for (i = 0; i < data_len; i++)
66 src_port <= ip46_flow->udp_data.end_src_port; src_port++)
69 dst_port <= ip46_flow->udp_data.end_dst_port; dst_port++, j++)
82 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
98 next_offset = (
u32) (((
u8 *) (s + 1)) - (
u8 *) tp);
99 records_this_buffer = 0;
115 records_this_buffer++;
121 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
130 next_offset - (
sizeof (*ip) +
135 (
sizeof (*ip) +
sizeof (*udp)));
139 new_l0 = clib_host_to_net_u16 ((
u16) next_offset);
175 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
183 next_offset - (
sizeof (*ip) +
191 new_l0 = clib_host_to_net_u16 ((
u16) next_offset);
231 memset (&args, 0,
sizeof (args));
244 case VNET_API_ERROR_NO_SUCH_ENTRY:
263 if (
unformat (input,
"export-ipfix"))
265 else if (
unformat (input,
"disable"))
281 .path =
"set udp-ping export-ipfix",
282 .short_help =
"set udp-ping export-ipfix [disable]",
ioam_analyser_data_t analyse_data
Analysed data.
ip46_udp_ping_flow * ip46_flow
Vector od udp-ping data.
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)
udp_ping_flow udp_data
Per flow data.
flow_report_stream_t * streams
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
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)
#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.
u16 current_length
Nbytes between current data and the end of this buffer.
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.
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 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
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.
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
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 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)
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