45 u32 *v = va_arg (*va,
u32 *);
46 char *fmt = va_arg (*va,
char *);
48 for (i = 0; i <
vec_len (v); i++)
61 char *fmt = va_arg (*va,
char *);
63 for (i = 0; i <
vec_len (v); i++)
76 u8 *v = va_arg (*va,
u8 *);
86 u8 *bytes = va_arg (*va,
u8 *);
87 int n_bytes = va_arg (*va,
int);
91 uword short_form = n_bytes <= 32;
97 for (i = 0; i < n_bytes; i++)
99 if (!short_form && (i % 32) == 0)
100 s =
format (s,
"%08x: ", i);
102 s =
format (s,
"%02x", bytes[i]);
104 if (!short_form && ((i + 1) % 32) == 0 && (i + 1) < n_bytes)
114 u8 *bytes = va_arg (*va,
u8 *);
115 int n_bytes = va_arg (*va,
int);
121 for (i = 0; i < n_bytes; i++)
122 s =
format (s,
"%02x", bytes[i]);
131 u32 n = va_arg (*va,
u32);
140 u8 *fmt = va_arg (*args,
u8 *);
141 f64 t = va_arg (*args,
f64);
144 const f64 seconds_per_minute = 60;
145 const f64 seconds_per_hour = 60 * seconds_per_minute;
146 const f64 seconds_per_day = 24 * seconds_per_hour;
147 uword days, hours, minutes, secs, msecs, usecs;
149 days = t / seconds_per_day;
150 t -= days * seconds_per_day;
152 hours = t / seconds_per_hour;
153 t -= hours * seconds_per_hour;
155 minutes = t / seconds_per_minute;
156 t -= minutes * seconds_per_minute;
164 for (f = fmt; *f; f++)
167 char *what_fmt =
"%d";
201 s =
format (s, what_fmt, what);
224 u = (
uword) 1 << log_u;
228 s =
format (s,
"%d", size >> log_u);
231 s =
format (s,
"%c",
" kmg"[log_u / 10]);
243 if (!
unformat (input,
"%wd%_", &amount))
267 *result = amount << shift;
276 u8 *
id = va_arg (*va,
u8 *);
284 for (i = 0;
id[
i] != 0 && i < l; i++)
302 const int line_len = 16;
310 for (i = 0; i <
len; i++)
312 line_hex =
format (line_hex,
"%02x ", data[i]);
313 line_str =
format (line_str,
"%c", isprint (data[i]) ? data[i] :
'.');
314 if (!((i + 1) % line_len))
316 s =
format (s,
"%U%05x: %v[%v]",
318 index, line_hex, line_str);
327 while (i++ % line_len)
328 line_hex =
format (line_hex,
" ");
331 s =
format (s,
"%U%05x: %v[%v]",
333 index, line_hex, line_str);
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static uword min_log2(uword x)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
#define vec_free(V)
Free vector's memory (no header).
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static uword clib_mem_is_vec(void *v)
Predicate function, says whether the supplied vector is a clib heap object.