diff options
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/buffer.c | 15 | ||||
-rw-r--r-- | src/vlib/buffer.h | 2 | ||||
-rw-r--r-- | src/vlib/buffer_funcs.h | 2 |
3 files changed, 15 insertions, 4 deletions
diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c index c4c05bbbcaa..53d60364df8 100644 --- a/src/vlib/buffer.c +++ b/src/vlib/buffer.c @@ -92,7 +92,7 @@ vlib_buffer_length_in_chain_slow_path (vlib_main_t * vm, } u8 * -format_vlib_buffer (u8 * s, va_list * args) +format_vlib_buffer_no_chain (u8 * s, va_list * args) { vlib_buffer_t *b = va_arg (*args, vlib_buffer_t *); u32 indent = format_get_indent (s); @@ -118,9 +118,20 @@ format_vlib_buffer (u8 * s, va_list * args) s = format (s, "\n%U%v", format_white_space, indent, a); vec_free (a); + return s; +} + +u8 * +format_vlib_buffer (u8 * s, va_list * args) +{ + vlib_main_t *vm = vlib_get_main (); + vlib_buffer_t *b = va_arg (*args, vlib_buffer_t *); + u32 indent = format_get_indent (s); + + s = format (s, "%U", format_vlib_buffer_no_chain, b); + while (b->flags & VLIB_BUFFER_NEXT_PRESENT) { - vlib_main_t *vm = vlib_get_main (); u32 next_buffer = b->next_buffer; b = vlib_get_buffer (vm, next_buffer); diff --git a/src/vlib/buffer.h b/src/vlib/buffer.h index c8761af4d20..02b65264724 100644 --- a/src/vlib/buffer.h +++ b/src/vlib/buffer.h @@ -72,7 +72,7 @@ */ #define foreach_vlib_buffer_flag \ _( 0, IS_TRACED, 0) \ - _( 1, NEXT_PRESENT, 0) \ + _( 1, NEXT_PRESENT, "next-present") \ _( 2, TOTAL_LENGTH_VALID, 0) \ _( 3, EXT_HDR_VALID, "ext-hdr-valid") diff --git a/src/vlib/buffer_funcs.h b/src/vlib/buffer_funcs.h index 7480326ee3d..288a36a0c9f 100644 --- a/src/vlib/buffer_funcs.h +++ b/src/vlib/buffer_funcs.h @@ -1314,7 +1314,7 @@ vlib_buffer_chain_append_data_with_alloc (vlib_main_t * vm, void vlib_buffer_chain_validate (vlib_main_t * vm, vlib_buffer_t * first); format_function_t format_vlib_buffer, format_vlib_buffer_and_data, - format_vlib_buffer_contents; + format_vlib_buffer_contents, format_vlib_buffer_no_chain; typedef struct { |