23 #define UDP_PING_EXPORT_RECORD_SIZE 400 30 u32 n_elts,
u32 * stream_index)
33 src_address, collector_port, elts, n_elts,
50 u32 records_this_buffer;
71 src_port <= ip46_flow->udp_data.end_src_port; src_port++)
74 dst_port <= ip46_flow->udp_data.end_dst_port; dst_port++, j++)
87 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
103 next_offset = (
u32) (((
u8 *) (s + 1)) - (
u8 *) tp);
104 records_this_buffer = 0;
120 records_this_buffer++;
126 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
135 next_offset - (
sizeof (*ip) +
140 (
sizeof (*ip) +
sizeof (*udp)));
144 new_l0 = clib_host_to_net_u16 ((
u16) next_offset);
180 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
188 next_offset - (
sizeof (*ip) +
196 new_l0 = clib_host_to_net_u16 ((
u16) next_offset);
249 case VNET_API_ERROR_NO_SUCH_ENTRY:
268 if (
unformat (input,
"export-ipfix"))
270 else if (
unformat (input,
"disable"))
286 .path =
"set udp-ping export-ipfix",
287 .short_help =
"set udp-ping export-ipfix [disable]",
301 .runs_after =
VLIB_INITS (
"flow_report_init"),
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.
vl_api_ip_port_and_mask_t dst_port
u16 start_dst_port
Defines start port of the dest port range.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
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.
udp_ping_flow udp_data
Per flow data.
flow_report_stream_t * streams
static uword ip4_header_checksum_is_valid(ip4_header_t *i)
#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)
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
static __clib_warn_unused_result u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
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)
vl_api_ip_port_and_mask_t src_port
sll srl srl sll sra u16x4 i
#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 vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static u16 ip_csum_fold(ip_csum_t c)
clib_error_t * udp_ping_flow_create(u8 del)
#define UDP_PING_EXPORT_RECORD_SIZE