49 want_enabled = want_enabled != 0;
79 ? VLIB_NODE_STATE_DISABLED
80 : VLIB_NODE_STATE_POLLING));
89 u32 if_index = va_arg (*args,
u32);
109 uword max_rewrite_bytes)
113 if (max_rewrite_bytes <
sizeof (h[0]))
116 h[0] = clib_host_to_net_u16 (l3_type);
117 return sizeof (h[0]);
121 .name =
"Packet generator",
146 pg_dev_class.index, i,
147 pg_interface_class.index, stream_index);
160 u32 i, i0, i1, mask, n_bits_left;
201 if (i1 != 0 && n_bits_left > 0)
209 ASSERT ((v[i] &~ mask) == 0);
211 s[i0] |= v[
i] & mask;
220 while (n_bits_left >= 8)
240 ASSERT ((v[i] &~ mask) == 0);
242 s[i0] |= v[
i] & mask;
253 void * packet_data_mask)
376 "pg stream %d buffer #%d",
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
sll srl srl sll sra u16x4 i
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
static uword pg_set_rewrite(vnet_main_t *vnm, u32 sw_if_index, u32 l3_type, void *dst_address, void *rewrite, uword max_rewrite_bytes)
pg_edit_group_t * edit_groups
u32 pg_interface_find_free(pg_main_t *pg, uword stream_index)
uword * stream_index_by_name
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define hash_set_mem(h, key, value)
#define pool_is_free(P, E)
pg_buffer_index_t * buffer_indices
#define VNET_HW_INTERFACE_FLAG_LINK_UP
pg_edit_type_t packet_size_edit_type
VNET_HW_INTERFACE_CLASS(pg_interface_class, static)
u8 * fixed_packet_data_mask
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
vnet_main_t * vnet_get_main(void)
always_inline pg_edit_group_t * pg_stream_get_group(pg_stream_t *s, u32 group_index)
static u8 * format_pg_interface_name(u8 *s, va_list *args)
u8 * fixed_packet_data_mask
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
always_inline void vlib_node_set_state(vlib_main_t *vm, u32 node_index, vlib_node_state_t new_state)
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V...
void pg_stream_del(pg_main_t *pg, uword index)
u32 vnet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, u32 hw_class_index, u32 hw_instance)
#define PG_STREAM_FLAGS_IS_ENABLED
u32 last_increment_packet_size
#define pool_elt_at_index(p, i)
#define hash_unset_mem(h, key)
pg_edit_t * non_fixed_edits
static u64 pg_edit_get_value(pg_edit_t *e, int hi_or_lo)
#define vec_dup(V)
Return copy of vector (no header, no alignment)
vlib_node_function_t pg_output
always_inline uword * clib_bitmap_set(uword *ai, uword i, uword value)
u32 vlib_buffer_create_free_list(vlib_main_t *vm, u32 n_data_bytes, char *fmt,...)
#define vec_free(V)
Free vector's memory (no header).
#define clib_memcpy(a, b, c)
void pg_edit_group_get_fixed_packet_data(pg_stream_t *s, u32 group_index, void *packet_data, void *packet_data_mask)
always_inline vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
pg_edit_t * non_fixed_edits
u8 ** replay_packet_templates
static void perform_fixed_edits(pg_stream_t *s)
#define VNET_SW_INTERFACE_FLAG_ADMIN_UP
always_inline void pg_stream_free(pg_stream_t *s)
#define vlib_foreach_rx_tx(v)
always_inline int pg_stream_is_enabled(pg_stream_t *s)
void pg_stream_enable_disable(pg_main_t *pg, pg_stream_t *s, int want_enabled)
always_inline void pg_edit_free(pg_edit_t *e)
void pg_stream_add(pg_main_t *pg, pg_stream_t *s_init)
#define clib_fifo_free(f)
always_inline uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
always_inline uword clib_bitmap_is_zero(uword *ai)
static uword pg_edit_n_alloc_bytes(pg_edit_t *e)
u32 sw_if_index[VLIB_N_RX_TX]
#define hash_create_vec(elts, key_bytes, value_bytes)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
VNET_DEVICE_CLASS(pg_dev_class, static)
#define hash_get_mem(h, key)
static void do_edit(pg_stream_t *stream, pg_edit_group_t *g, pg_edit_t *e, uword want_commit)
#define vec_foreach(var, vec)
Vector iterator.
always_inline u32 vlib_buffer_round_size(u32 size)
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
always_inline uword pow2_mask(uword x)
pg_interface_t * interfaces
void vlib_buffer_delete_free_list(vlib_main_t *vm, u32 free_list_index)