|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
40 #ifndef included_packet_generator_pg_edit_h
41 #define included_packet_generator_pg_edit_h
76 #define PG_EDIT_PACKET_LENGTH (-1)
98 #define pg_edit_init_bitfield(e,type,field,field_offset,field_n_bits) \
102 ASSERT ((field_offset) < STRUCT_BITS_OF (type, field)); \
105 _bo = STRUCT_OFFSET_OF (type, field); \
108 _bo += ((STRUCT_BITS_OF (type, field) \
109 - (field_offset) - 1) / BITS (u8)); \
111 (e)->lsb_bit_offset = _bo * BITS (u8) + ((field_offset) % BITS (u8)); \
112 (e)->n_bits = (field_n_bits); \
116 #define pg_edit_init(e,type,field) \
117 pg_edit_init_bitfield(e,type,field,0,STRUCT_BITS_OF(type,field))
122 int i0, i1,
n_bytes, n_bits_left;
130 if (n_bits_left > 0 && i1 != 0)
184 for (
i = 0;
i < n;
i++)
uword unformat_pg_payload(unformat_input_t *input, va_list *args)
static void pg_edit_set_fixed(pg_edit_t *e, u64 value)
static void pg_edit_copy_type_and_values(pg_edit_t *dst, pg_edit_t *src)
void pg_edit_set_value(pg_edit_t *e, int hi_or_lo, u64 value)
vnet_hw_if_output_node_runtime_t * r
static uword round_pow2(uword x, uword pow2)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static uword pg_edit_n_alloc_bytes(pg_edit_t *e)
sll srl srl sll sra u16x4 i
static u64 pg_edit_get_value(pg_edit_t *e, int hi_or_lo)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define vec_free(V)
Free vector's memory (no header).
static void pg_edit_alloc_value(pg_edit_t *e, int i)
static uword pg_edit_is_fixed_with_value(pg_edit_t *e, u64 value)
static void pg_edit_free(pg_edit_t *e)
uword unformat_pg_number(unformat_input_t *input, va_list *args)
uword unformat_pg_interface(unformat_input_t *input, va_list *args)
uword unformat_pg_edit(unformat_input_t *input, va_list *args)