46 int i, j, n_bits_left;
55 if (n_bits_left > 0 && j != 0)
57 v[
i] = (value & 0xff) << j;
58 value >>=
BITS (v[0]) - j;
59 n_bits_left -=
BITS (v[0]) - j;
63 while (n_bits_left > 0)
72 for (j = 0; j <
i; j++)
73 result[j] = v[i - 1 - j];
86 u8 * result = va_arg (*args,
u8 *);
92 if (!
unformat (input,
"0x%X",
sizeof (value), &value)
93 && !
unformat (input,
"%D",
sizeof (value), &value))
133 u32 i, node_index, len, max_len;
138 if (
unformat (input,
"incrementing %d", &len))
141 for (i = 0; i < len; i++)
sll srl srl sll sra u16x4 i
always_inline pg_node_t * pg_get_node(uword node_index)
static void pg_edit_alloc_value(pg_edit_t *e, int i)
uword unformat_pg_edit(unformat_input_t *input, va_list *args)
uword unformat_pg_payload(unformat_input_t *input, va_list *args)
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V...
static void pg_edit_set_value_helper(pg_edit_t *e, u64 value, u8 *result)
void pg_edit_set_value(pg_edit_t *e, int hi_or_lo, u64 value)
always_inline uword pg_edit_group_n_bytes(pg_stream_t *s, u32 group_index)
always_inline void * pg_create_edit_group(pg_stream_t *s, int n_edit_bytes, int n_packet_bytes, u32 *group_index)
unformat_function_t * unformat_edit
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
unformat_function_t unformat_vlib_node
uword unformat_pg_number(unformat_input_t *input, va_list *args)