25 #define VAT_TAB_WIDTH 2 37 u8 *
a = va_arg (*args,
u8 *);
38 return format (s,
"%d.%d.%d.%d", a[0], a[1], a[2], a[3]);
45 ip6_address_t *
a = va_arg (*args, ip6_address_t *);
46 u32 i, i_max_n_zero, max_n_zeros, i_first_zero, n_zeros, last_double_colon;
50 i_first_zero = i_max_n_zero;
52 for (i = 0; i <
ARRAY_LEN (a->as_u16); i++)
54 u32 is_zero = a->as_u16[
i] == 0;
55 if (is_zero && i_first_zero >= ARRAY_LEN (a->as_u16))
61 if ((!is_zero && n_zeros > max_n_zeros)
62 || (i + 1 >=
ARRAY_LEN (a->as_u16) && n_zeros > max_n_zeros))
64 i_max_n_zero = i_first_zero;
65 max_n_zeros = n_zeros;
71 last_double_colon = 0;
72 for (i = 0; i <
ARRAY_LEN (a->as_u16); i++)
74 if (i == i_max_n_zero && max_n_zeros > 1)
78 last_double_colon = 1;
83 (last_double_colon || i == 0) ?
"" :
":",
84 clib_net_to_host_u16 (a->as_u16[i]));
85 last_double_colon = 0;
130 #define P(fmt,...) fformat(ctx->ofp, fmt, ##__VA_ARGS__) 131 #define PL(fmt,...) fformat(ctx->ofp, fmt"\n", ##__VA_ARGS__) 132 #define PPL(fmt,...) vat_json_indent_line(ctx, fmt"\n", ##__VA_ARGS__) 133 #define PP(fmt,...) vat_json_indent_line(ctx, fmt, ##__VA_ARGS__) 134 #define INCR (ctx->indent++) 135 #define DECR (ctx->indent--) 155 for (i = 0; i <
count; i++)
158 PP (
"\"%s\": ", pair->
name);
184 for (i = 0; i <
count; i++)
218 P (
"%d", node->
sint);
221 P (
"%" PRIu64, node->
uint);
224 P (
"%f", node->
real);
272 if (NULL != node->
pairs)
282 if (NULL != node->
array)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
description fragment has unexpected format
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
vlib_main_t vlib_node_runtime_t * node
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_foreach(var, vec)
Vector iterator.
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".