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];
87 u8 *result = va_arg (*args,
u8 *);
93 if (!
unformat (input,
"0x%X",
sizeof (value), &value)
94 && !
unformat (input,
"%D",
sizeof (value), &value))
132 u32 i, node_index, len, max_len;
137 if (
unformat (input,
"incrementing %d", &len))
140 for (i = 0; i < len; i++)
sll srl srl sll sra u16x4 i
static void pg_edit_alloc_value(pg_edit_t *e, int i)
uword unformat_pg_edit(unformat_input_t *input, va_list *args)
static pg_node_t * pg_get_node(uword node_index)
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_create_edit_group(pg_stream_t *s, int n_edit_bytes, int n_packet_bytes, u32 *group_index)
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)
static uword pg_edit_group_n_bytes(pg_stream_t *s, u32 group_index)
unformat_function_t * unformat_edit
static vlib_main_t * vlib_get_main(void)
#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)