43 u32 * v = va_arg (*va,
u32 *);
44 char * fmt = va_arg (*va,
char *);
46 for (i = 0; i <
vec_len (v); i++)
58 char * fmt = va_arg (*va,
char *);
60 for (i = 0; i <
vec_len (v); i++)
72 u8 * v = va_arg (*va,
u8 *);
81 u8 * bytes = va_arg (*va,
u8 *);
82 int n_bytes = va_arg (*va,
int);
86 uword short_form = n_bytes <= 32;
92 for (i = 0; i < n_bytes; i++)
94 if (! short_form && (i % 32) == 0)
95 s =
format (s,
"%08x: ", i);
97 s =
format (s,
"%02x", bytes[i]);
99 if (! short_form && ((i + 1) % 32) == 0 && (i + 1) < n_bytes)
117 u8 * fmt = va_arg (*args,
u8 *);
118 f64 t = va_arg (*args,
f64);
121 const f64 seconds_per_minute = 60;
122 const f64 seconds_per_hour = 60 * seconds_per_minute;
123 const f64 seconds_per_day = 24 * seconds_per_hour;
124 uword days, hours, minutes, secs, msecs, usecs;
126 days = t / seconds_per_day;
127 t -= days * seconds_per_day;
129 hours = t / seconds_per_hour;
130 t -= hours * seconds_per_hour;
132 minutes = t / seconds_per_minute;
133 t -= minutes * seconds_per_minute;
141 for (f = fmt; *f; f++)
144 char * what_fmt =
"%d";
178 s =
format (s, what_fmt, what);
200 u = (
uword) 1 << log_u;
204 s =
format (s,
"%d", size >> log_u);
207 s =
format (s,
"%c",
" kmg"[log_u / 10]);
215 uword amount, shift, c;
218 if (!
unformat (input,
"%wd%_", &amount))
224 case 'k':
case 'K': shift = 10;
break;
225 case 'm':
case 'M': shift = 20;
break;
226 case 'g':
case 'G': shift = 30;
break;
233 *result = amount << shift;
241 u8 *
id = va_arg (*va,
u8 *);
249 for (i = 0;
id[
i] != 0 && i < l; i++)
sll srl srl sll sra u16x4 i
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
always_inline uword clib_mem_is_vec(void *v)
Predicate function, says whether the supplied vector is a clib heap object.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
always_inline uword min_log2(uword x)