|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
23 #define UDP_PING_EXPORT_RECORD_SIZE 400
30 u32 n_elts,
u32 * stream_index)
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;
97 h->export_time = clib_host_to_net_u32 (((
u32) time (NULL)));
102 clib_host_to_net_u32 (
h->sequence_number);
103 next_offset = (
u32) (((
u8 *) (s + 1)) - (
u8 *) tp);
104 records_this_buffer = 0;
108 &
stats->analyse_data,
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"),
flow_report_main_t flow_report_main
vl_api_ip_port_and_mask_t dst_port
ip46_udp_ping_flow * ip46_flow
Vector od udp-ping data.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static uword ip4_header_checksum_is_valid(ip4_header_t *i)
udp_ping_flow_data * stats
Ping statistics.
#define clib_error_return(e, args...)
static vlib_cli_command_t set_udp_ping_export_command
(constructor) VLIB_CLI_COMMAND (set_udp_ping_export_command)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vl_api_ikev2_sa_stats_t stats
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.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
clib_error_t * udp_ping_flow_report_init(vlib_main_t *vm)
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 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)
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.
u16 ip4_tcp_udp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip4_header_t *ip0)
udp_ping_main_t udp_ping_main
vnet_flow_data_callback_t * flow_data_callback
vl_api_ip_port_and_mask_t src_port
sll srl srl sll sra u16x4 i
#define IOAM_FLOW_TEMPLATE_ID
#define VLIB_CLI_COMMAND(x,...)
static u32 version_length(u16 length)
flow_report_stream_t * streams
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)
u16 current_length
Nbytes between current data and the end of this buffer.
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)
udp_ping_flow udp_data
Per flow data.
#define VLIB_INIT_FUNCTION(x)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
#define ip_csum_update(sum, old, new, type, field)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
static u32 ipfix_set_id_length(u16 set_id, u16 length)
int vnet_flow_report_add_del(flow_report_main_t *frm, vnet_flow_report_add_del_args_t *a, u16 *template_id)
vl_api_address_union_t src_address
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 u16 ip_csum_fold(ip_csum_t c)
u16 start_dst_port
Defines start port of the dest port range.
vnet_flow_rewrite_callback_t * rewrite_callback
clib_error_t * udp_ping_flow_create(u8 del)
#define UDP_PING_EXPORT_RECORD_SIZE
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
ipfix_template_packet_t ipfix
static clib_error_t * set_udp_ping_export_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)