48 "FLOWPERPKT: sw_if_index %d, tos %0x2, timestamp %lld, size %d",
55 #define foreach_flowperpkt_error \ 56 _(SWAPPED, "Mac swap packets processed") 60 #define _(sym,str) FLOWPERPKT_ERROR_##sym, 67 #define _(sym,string) string, 93 u8 tos,
u64 timestamp,
u16 length,
int do_flush)
176 udp->
src_port = clib_host_to_net_u16 (UDP_DST_PORT_ipfix);
177 udp->
dst_port = clib_host_to_net_u16 (UDP_DST_PORT_ipfix);
190 offset = (
u32) (((
u8 *) (s + 1)) - (
u8 *) tp);
200 u32 egress_interface = clib_host_to_net_u32 (sw_if_index);
202 sizeof (egress_interface));
203 offset +=
sizeof (egress_interface);
206 b0->
data[offset++] = tos;
210 offset +=
sizeof (
f64);
214 u16 pkt_size = clib_host_to_net_u16 (length);
216 offset +=
sizeof (pkt_size);
221 sizeof (
u32) +
sizeof (
u8) +
sizeof (
f64) +
sizeof (
u16);
226 (do_flush || (offset +
sizeof (
u32) +
sizeof (
u8)
237 (sizeof (*ip) +
sizeof (*udp) +
240 (sizeof (*ip) +
sizeof (*udp)));
285 u32 n_left_from, *from, *to_next;
300 while (n_left_from > 0)
306 while (n_left_from >= 4 && n_left_to_next >= 2)
330 to_next[0] = bi0 = from[0];
331 to_next[1] = bi1 = from[1];
357 ip0->
tos, now, len0, 0 );
366 ip1->
tos, now, len1, 0 );
394 to_next, n_left_to_next,
395 bi0, bi1, next0, next1);
398 while (n_left_from > 0 && n_left_to_next > 0)
434 ip0->
tos, now, len0, 0 );
449 to_next, n_left_to_next,
491 .name =
"flowperpkt",
492 .vector_size =
sizeof (
u32),
vnet_config_main_t config_main
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
static void add_to_flow_record(vlib_main_t *vm, flowperpkt_main_t *fm, u32 sw_if_index, u8 tos, u64 timestamp, u16 length, int do_flush)
add an entry to the flow record under construction
u32 current_config_index
Used by feature subgraph arcs to visit enabled feature nodes.
static vlib_main_t * vlib_get_main(void)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
#define VLIB_BUFFER_TRACE_TRAJECTORY_INIT(b)
u64 nanosecond_time_0
Time reference pair.
static f64 vlib_time_now(vlib_main_t *vm)
struct _vlib_node_registration vlib_node_registration_t
ip4_address_t src_address
ip_lookup_main_t lookup_main
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
u16 buffer_size
size of the buffer
ip4_address_t ipfix_collector
vlib_node_registration_t ip4_lookup_node
(constructor) VLIB_REGISTER_NODE (ip4_lookup_node)
static u8 * format_flowperpkt_trace(u8 *s, va_list *args)
flow_report_stream_t * streams
flow-per-packet plugin header file
static void vlib_buffer_init_for_free_list(vlib_buffer_t *_dst, vlib_buffer_free_list_t *fl)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
static char * flowperpkt_error_strings[]
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vlib_buffer_t ** buffers_per_worker
ipfix buffers under construction, per-worker thread
static uword flowperpkt_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
flow_report_main_t flow_report_main
u16 current_length
Nbytes between current data and the end of this buffer.
u64 timestamp
packet timestamp
static void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
vlib_node_registration_t flowperpkt_node
IPFIX flow-per-packet graph node.
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define foreach_flowperpkt_error
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
static u32 version_length(u16 length)
vnet_feature_config_main_t feature_config_mains[VNET_N_IP_FEAT]
rx unicast, multicast, tx interface/feature configuration.
#define CLIB_PREFETCH(addr, size, type)
#define clib_memcpy(a, b, c)
#define VLIB_BUFFER_TOTAL_LENGTH_VALID
#define VLIB_BUFFER_FLOW_REPORT
#define VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX
u16 ip4_tcp_udp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip4_header_t *ip0)
flowperpkt_main_t flowperpkt_main
u16 * next_record_offset_per_worker
next record offset, per worker thread
#define VLIB_NODE_FLAG_TRACE
u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
#define VLIB_BUFFER_IS_TRACED
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static u32 ipfix_set_id_length(u16 set_id, u16 length)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
struct clib_bihash_value offset
template key/value backing page structure
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_REGISTER_NODE(x,...)
ip4_main_t ip4_main
Global ip4 main structure.
u32 sw_if_index
interface handle
static vlib_buffer_free_list_t * vlib_buffer_get_free_list(vlib_main_t *vm, u32 free_list_index)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
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)
vlib_frame_t ** frames_per_worker
frames containing ipfix buffers, per-worker thread
void flowperpkt_flush_callback(void)