69 return format (s,
"polling");
72 return format (s,
"interrupt");
75 return format (s,
"adaptive");
77 return format (s,
"unknown");
83 u32 link_speed = va_arg (*args,
u32);
86 return format (s,
"unknown");
88 if (link_speed >= 1000000)
89 return format (s,
"%f Gbps", (
f64) link_speed / 1000000);
91 if (link_speed >= 1000)
92 return format (s,
"%f Mbps", (
f64) link_speed / 1000);
94 return format (s,
"%u Kbps", link_speed);
105 int verbose = va_arg (*args,
int);
109 return format (s,
"%=32s%=6s%=8s%s",
"Name",
"Idx",
"Link",
"Hardware");
116 s =
format (s,
"%=8s",
"slave");
127 s =
format (s,
"Slave-Idx:");
129 format (s,
" %d", hw_idx));
131 else if (dev_class->format_device_name)
141 if (hw_class->format_device)
144 hw_class->format_device, hi->
hw_if_index, verbose);
151 format (s,
" address %U", hw_class->format_address,
155 if (dev_class->format_device)
195 return format (s,
"DELETED");
204 u32 hw_if_index = va_arg (*args,
u32);
210 return format (s,
"DELETED");
219 u32 indent, n_printed;
222 int json_need_comma_nl = 0;
238 for (j = 0; j < n_counters; j++)
256 if (json_need_comma_nl)
261 s =
format (s,
"%s%s_packets%s: %s%Ld%s,\n", x, cm->
name, x, x,
263 s =
format (s,
"%s%s_bytes%s: %s%Ld%s", x, cm->
name, x, x,
265 json_need_comma_nl = 1;
280 s =
format (s,
"\n%U%-16v%16Ld",
291 for (j = 0; j < n_counters; j++)
306 if (json_need_comma_nl)
311 s =
format (s,
"%s%s%s: %s%Ld%s", x, cm->
name, x, x, vtotal, x);
312 json_need_comma_nl = 1;
321 s =
format (s,
"%-16s%16Ld", cm->
name, vtotal);
346 return format (s,
"%=32s%=5s%=10s%=21s%=16s%=16s",
347 "Name",
"Idx",
"State",
"MTU (L3/IP4/IP6/MPLS)",
"Counter",
350 s =
format (s,
"%-32U%=5d%=10U%=21U",
371 return format (s,
"%=32s%=5s%=16s%=16s%=16s",
372 "Name",
"Idx",
"State",
"Counter",
"Count");
374 s =
format (s,
"%-32v%=5d%=16U",
388 #define _(a,b,c,v) if (buf->flags & VNET_BUFFER_F_##b) s = format (s, "%s ", c); 411 "sw_if_index[VLIB_RX]: %d, sw_if_index[VLIB_TX]: %d",
416 "L2 offset %d, L3 offset %d, L4 offset %d, feature arc index %d",
423 "ip.adj_index[VLIB_RX]: %d, ip.adj_index[VLIB_TX]: %d",
424 (
u32) (o->
ip.adj_index[0]), (
u32) (o->
ip.adj_index[1]));
428 "ip.flow_hash: 0x%x, ip.save_protocol: 0x%x, ip.fib_index: %d",
429 o->
ip.flow_hash, o->
ip.save_protocol, o->
ip.fib_index);
433 "ip.save_rewrite_length: %d, ip.rpf_id: %d",
434 o->
ip.save_rewrite_length, o->
ip.rpf_id);
438 "ip.icmp.type: %d ip.icmp.code: %d, ip.icmp.data: 0x%x",
439 (
u32) (o->
ip.icmp.type),
440 (
u32) (o->
ip.icmp.code), o->
ip.icmp.data);
444 "ip.reass.next_index: %d, ip.reass.estimated_mtu: %d",
445 o->
ip.reass.next_index, (
u32) (o->
ip.reass.estimated_mtu));
449 "ip.reass.fragment_first: %d ip.reass.fragment_last: %d",
450 (
u32) (o->
ip.reass.fragment_first),
451 (
u32) (o->
ip.reass.fragment_last));
455 "ip.reass.range_first: %d ip.reass.range_last: %d",
456 (
u32) (o->
ip.reass.range_first),
457 (
u32) (o->
ip.reass.range_last));
461 "ip.reass.next_range_bi: 0x%x, ip.reass.ip6_frag_hdr_offset: %d",
462 o->
ip.reass.next_range_bi,
463 (
u32) (o->
ip.reass.ip6_frag_hdr_offset));
467 "mpls.ttl: %d, mpls.exp: %d, mpls.first: %d, " 468 "mpls.save_rewrite_length: %d, mpls.bier.n_bytes: %d",
470 o->
mpls.save_rewrite_length, (
u32) (o->
mpls.bier.n_bytes));
474 "l2.feature_bitmap: %08x, l2.bd_index: %d, l2.l2_len: %d, " 475 "l2.shg: %d, l2.l2fib_sn: %d, l2.bd_age: %d",
476 o->
l2.feature_bitmap, (
u32) (o->
l2.bd_index),
478 (
u32) (o->
l2.bd_age));
482 "l2.feature_bitmap_input: %U, L2.feature_bitmap_output: %U",
488 "l2t.next_index: %d, l2t.session_index: %d",
489 (
u32) (o->
l2t.next_index), o->
l2t.session_index);
493 "l2_classify.table_index: %d, l2_classify.opaque_index: %d, " 494 "l2_classify.hash: 0x%llx",
502 s =
format (s,
"ipsec.sad_index: %d", o->
ipsec.sad_index);
509 "map_t.v6.saddr: 0x%x, map_t.v6.daddr: 0x%x, " 510 "map_t.v6.frag_offset: %d, map_t.v6.l4_offset: %d",
517 "map_t.v6.l4_protocol: %d, map_t.checksum_offset: %d, " 524 "ip_frag.mtu: %d, ip_frag.next_index: %d, ip_frag.flags: 0x%x",
529 s =
format (s,
"cop.current_config_index: %d", o->
cop.current_config_index);
532 s =
format (s,
"lisp.overlay_afi: %d", (
u32) (o->
lisp.overlay_afi));
536 (s,
"tcp.connection_index: %d, tcp.seq_number: %d, tcp.seq_end: %d, " 537 "tcp.ack_number: %d, tcp.hdr_offset: %d, tcp.data_offset: %d",
538 o->
tcp.connection_index,
546 "tcp.data_len: %d, tcp.flags: 0x%x",
550 s =
format (s,
"snat.flags: 0x%x", o->
snat.flags);
553 for (i = 0; i <
vec_len (im->buffer_opaque_format_helpers); i++)
555 helper_fp = im->buffer_opaque_format_helpers[
i];
556 s = (*helper_fp) (b, s);
578 s =
format (s,
"qos.bits: %x, qos.source: %x",
584 s =
format (s,
"gbp.flags: %x, gbp.sclass: %d",
591 for (i = 0; i <
vec_len (im->buffer_opaque2_format_helpers); i++)
593 helper_fp = im->buffer_opaque2_format_helpers[
i];
594 s = (*helper_fp) (b, s);
619 u32 *hw_if_index = va_arg (*args,
u32 *);
626 if (c->unformat_device_name
627 &&
unformat_user (input, c->unformat_device_name, hw_if_index))
639 u32 *result = va_arg (*args,
u32 *);
641 u32 hw_if_index,
id, id_specified;
647 if (
unformat (input,
"%_%v.%d%_", &if_name, &
id)
682 u32 *result = va_arg (*args,
u32 *);
691 else if (
unformat (input,
"enable"))
703 u32 *result = va_arg (*args,
u32 *);
struct vnet_buffer_opaque_t::@60::@67 ipsec
vnet_main_t * vnet_get_main(void)
u8 * format_l2_output_features(u8 *s, va_list *args)
vnet_interface_main_t interface_main
struct vnet_buffer_opaque_t::@60::@69 map_t
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Combined counter to hold both packets and byte differences.
struct vnet_buffer_opaque_t::@60::@74 snat
struct vnet_buffer_opaque_t::@60::@71 cop
uword * sub_interface_sw_if_index_by_id
struct _vnet_device_class vnet_device_class_t
struct vnet_buffer_opaque_t::@60::opaque_l2 l2
static counter_t vlib_get_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
Get the value of a simple counter Scrapes the entire set of per-thread counters.
vnet_hw_interface_rx_mode
vl_api_interface_index_t sw_if_index
static vnet_device_class_t * vnet_get_device_class(vnet_main_t *vnm, u32 dev_class_index)
struct vnet_buffer_opaque_t::@60::@68 map
vlib_combined_counter_main_t * combined_sw_if_counters
struct vnet_buffer_opaque_t::@60::@63 mpls
struct vnet_buffer_opaque_t::@60::@62 ip
vnet_hw_interface_flags_t flags
static vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
A collection of simple counters.
char * name
The counter collection's name.
uword * hw_interface_by_name
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
counter_t packets
packet counter
struct vnet_buffer_opaque_t::@60::@66 policer
vnet_buffer_opquae_formatter_t * buffer_opaque_format_helpers
vnet_sw_interface_flags_t flags
vlib_simple_counter_main_t * sw_if_counters
unformat_function_t unformat_hash_vec_string
#define VNET_HW_INTERFACE_BOND_INFO_SLAVE
struct vnet_buffer_opaque2_t::@94 gbp
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
struct vnet_buffer_opaque_t::@60::@70 ip_frag
#define vec_free(V)
Free vector's memory (no header).
u32 sw_if_index[VLIB_N_RX_TX]
struct vnet_buffer_opaque_t::@60::@64 l2t
vl_api_vxlan_gbp_api_tunnel_mode_t mode
static vnet_hw_interface_class_t * vnet_get_hw_interface_class(vnet_main_t *vnm, u32 hw_class_index)
Bitmaps built as vectors of machine words.
vnet_buffer_opquae_formatter_t * buffer_opaque2_format_helpers
counter_t bytes
byte counter
struct _vnet_hw_interface_class vnet_hw_interface_class_t
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
VLIB buffer representation.
char * name
The counter collection's name.
A collection of combined counters.
vnet_sw_interface_type_t type
#define vec_foreach(var, vec)
Vector iterator.
u8 *(* vnet_buffer_opquae_formatter_t)(const vlib_buffer_t *b, u8 *s)
vnet_device_class_t * device_classes
struct vnet_buffer_opaque_t::@60::@73 tcp
struct vnet_buffer_opaque_t::@60::@72 lisp
static vnet_sw_interface_t * vnet_get_sw_interface_or_null(vnet_main_t *vnm, u32 sw_if_index)
u32 opaque[10]
Opaque data used by sub-graphs for their own purposes.
struct vnet_buffer_opaque_t::@60::@65 l2_classify
static uword vnet_sw_interface_is_api_visible(vnet_main_t *vnm, u32 sw_if_index)
struct vnet_buffer_opaque2_t::@93 qos
QoS marking data that needs to persist from the recording nodes (nominally in the ingress path) to th...