fh.wrapped = tp->wrapped;
fh.nitems = clib_host_to_net_u32 (vec_len (tp->traces));
u8 *m = vl_api_serialize_message_table (am, 0);
- clib_warning ("Message table length %d", vec_len (m));
fh.msgtbl_size = clib_host_to_net_u32 (vec_len (m));
if (fwrite (&fh, sizeof (fh), 1, fp) != 1)
int
vl_api_to_api_string (u32 len, const char *buf, vl_api_string_t * str)
{
- clib_memcpy_fast (str->buf, buf, len);
+ if (len)
+ clib_memcpy_fast (str->buf, buf, len);
str->length = htonl (len);
return len + sizeof (u32);
}
return clib_net_to_host_u32 (astr->length);
}
+u8 *
+vl_api_format_string (u8 * s, va_list * args)
+{
+ vl_api_string_t *a = va_arg (*args, vl_api_string_t *);
+ vec_add (s, a->buf, clib_net_to_host_u32 (a->length));
+ return s;
+}
+
/*
* Returns a new vector. Remember to free it after use.
*/