40 #ifndef included_vlib_pg_h 41 #define included_vlib_pg_h 76 u32 * buffers,
u32 n_buffers);
104 #define PG_STREAM_FLAGS_IS_ENABLED (1 << 0) 105 #define PG_STREAM_FLAGS_DISABLE_BUFFER_RECYCLE (1 << 1) 236 n_edits = n_edit_bytes /
sizeof (
pg_edit_t);
252 n_edits = n_edit_bytes /
sizeof (
pg_edit_t);
284 memset (g, 0,
sizeof (g[0]));
354 return pg->
nodes + node_index;
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
static int pg_stream_is_enabled(pg_stream_t *s)
uword( vlib_node_function_t)(struct vlib_main_t *vm, struct vlib_node_runtime_t *node, struct vlib_frame_t *frame)
void pg_stream_add(pg_main_t *pg, pg_stream_t *s_init)
sll srl srl sll sra u16x4 i
static void * pg_get_edit_group(pg_stream_t *s, u32 group_index)
pg_edit_group_t * edit_groups
PCAP utility definitions.
void(* edit_function)(struct pg_main_t *pg, struct pg_stream_t *s, struct pg_edit_group_t *g, u32 *buffers, u32 n_buffers)
uword * stream_index_by_name
struct _vlib_node_registration vlib_node_registration_t
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
pg_buffer_index_t * buffer_indices
struct _vnet_device_class vnet_device_class_t
pg_edit_type_t packet_size_edit_type
void pg_stream_del(pg_main_t *pg, uword index)
u8 * fixed_packet_data_mask
static pg_edit_group_t * pg_stream_get_group(pg_stream_t *s, u32 group_index)
static pg_node_t * pg_get_node(uword node_index)
PCAP main state data structure.
static void * pg_add_edits(pg_stream_t *s, int n_edit_bytes, int n_packet_bytes, u32 group_index)
u8 * fixed_packet_data_mask
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V...
#define vec_end(v)
End (last data address) of vector.
static void * pg_create_edit_group(pg_stream_t *s, int n_edit_bytes, int n_packet_bytes, u32 *group_index)
#define PG_STREAM_FLAGS_IS_ENABLED
uword * if_index_by_if_id
clib_error_t * pg_capture(pg_capture_args_t *a)
void pg_edit_group_get_fixed_packet_data(pg_stream_t *s, u32 group_index, void *fixed_packet_data, void *fixed_packet_data_mask)
u32 last_increment_packet_size
u32 current_replay_packet_index
pg_edit_t * non_fixed_edits
static void pg_stream_free(pg_stream_t *s)
vlib_node_registration_t pg_input_node
(constructor) VLIB_REGISTER_NODE (pg_input_node)
vlib_node_function_t pg_output
u32 pg_interface_add_or_get(pg_main_t *pg, uword stream_index)
#define vec_free(V)
Free vector's memory (no header).
static uword pg_edit_group_n_bytes(pg_stream_t *s, u32 group_index)
struct pg_stream_t pg_stream_t
unformat_function_t * unformat_edit
vlib_node_function_t pg_input
pg_edit_t * non_fixed_edits
u8 ** replay_packet_templates
static void pg_free_edit_group(pg_stream_t *s)
void pg_stream_enable_disable(pg_main_t *pg, pg_stream_t *s, int is_enable)
uword edit_function_opaque
#define clib_fifo_free(f)
static void pg_buffer_index_free(pg_buffer_index_t *bi)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
struct pg_edit_group_t pg_edit_group_t
f64 rate_packets_per_second
#define vec_foreach(var, vec)
Vector iterator.
static void pg_edit_free(pg_edit_t *e)
vnet_device_class_t pg_dev_class
struct pg_main_t pg_main_t
pg_interface_t * interfaces
static void pg_edit_group_free(pg_edit_group_t *g)
void pg_enable_disable(u32 stream_index, int is_enable)