49 u32 vtr_op = va_arg (*args,
u32);
50 u32 dot1q = va_arg (*args,
u32);
51 u32 tag1 = va_arg (*args,
u32);
52 u32 tag2 = va_arg (*args,
u32);
58 return format (s,
"push-1 %s %d", dot1q ?
"dot1q" :
"dot1ad", tag1);
60 return format (s,
"push-2 %s %d %d", dot1q ?
"dot1q" :
"dot1ad", tag1,
63 return format (s,
"pop-1");
65 return format (s,
"pop-2");
67 return format (s,
"trans-1-1 %s %d", dot1q ?
"dot1q" :
"dot1ad", tag1);
69 return format (s,
"trans-1-2 %s %d %d", dot1q ?
"dot1q" :
"dot1ad",
72 return format (s,
"trans-2-1 %s %d", dot1q ?
"dot1q" :
"dot1ad", tag1);
74 return format (s,
"trans-2-2 %s %d %d", dot1q ?
"dot1q" :
"dot1ad",
105 return format (s,
"polling");
108 return format (s,
"interrupt");
111 return format (s,
"adaptive");
113 return format (s,
"unknown");
119 u32 link_speed = va_arg (*args,
u32);
122 return format (s,
"unknown");
124 if (link_speed >= 1000000)
125 return format (s,
"%f Gbps", (
f64) link_speed / 1000000);
127 if (link_speed >= 1000)
128 return format (s,
"%f Mbps", (
f64) link_speed / 1000);
130 return format (s,
"%u Kbps", link_speed);
141 int verbose = va_arg (*args,
int);
145 return format (s,
"%=32s%=6s%=8s%s",
"Name",
"Idx",
"Link",
"Hardware");
152 s =
format (s,
"%=8s",
"slave");
163 s =
format (s,
"Slave-Idx:");
165 format (s,
" %d", hw_idx));
167 else if (dev_class->format_device_name)
177 if (hw_class->format_device)
180 hw_class->format_device, hi->
hw_if_index, verbose);
187 format (s,
" address %U", hw_class->format_address,
191 if (dev_class->format_device)
231 return format (s,
"DELETED");
240 u32 hw_if_index = va_arg (*args,
u32);
246 return format (s,
"DELETED");
255 u32 indent, n_printed;
258 int json_need_comma_nl = 0;
274 for (j = 0; j < n_counters; j++)
292 if (json_need_comma_nl)
297 s =
format (s,
"%s%s_packets%s: %s%Ld%s,\n", x, cm->
name, x, x,
299 s =
format (s,
"%s%s_bytes%s: %s%Ld%s", x, cm->
name, x, x,
301 json_need_comma_nl = 1;
316 s =
format (s,
"\n%U%-16v%16Ld",
327 for (j = 0; j < n_counters; j++)
342 if (json_need_comma_nl)
347 s =
format (s,
"%s%s%s: %s%Ld%s", x, cm->
name, x, x, vtotal, x);
348 json_need_comma_nl = 1;
357 s =
format (s,
"%-16s%16Ld", cm->
name, vtotal);
382 return format (s,
"%=32s%=5s%=10s%=21s%=16s%=16s",
383 "Name",
"Idx",
"State",
"MTU (L3/IP4/IP6/MPLS)",
"Counter",
386 s =
format (s,
"%-32U%=5d%=10U%=21U",
407 return format (s,
"%=32s%=5s%=16s%=16s%=16s",
408 "Name",
"Idx",
"State",
"Counter",
"Count");
410 s =
format (s,
"%-32v%=5d%=16U",
424 #define _(a,b,c,v) if (buf->flags & VNET_BUFFER_F_##b) s = format (s, "%s ", c); 447 "sw_if_index[VLIB_RX]: %d, sw_if_index[VLIB_TX]: %d",
452 "L2 offset %d, L3 offset %d, L4 offset %d, feature arc index %d",
459 "ip.adj_index[VLIB_RX]: %d, ip.adj_index[VLIB_TX]: %d",
460 (
u32) (o->
ip.adj_index[0]), (
u32) (o->
ip.adj_index[1]));
464 "ip.flow_hash: 0x%x, ip.save_protocol: 0x%x, ip.fib_index: %d",
465 o->
ip.flow_hash, o->
ip.save_protocol, o->
ip.fib_index);
469 "ip.save_rewrite_length: %d, ip.rpf_id: %d",
470 o->
ip.save_rewrite_length, o->
ip.rpf_id);
474 "ip.icmp.type: %d ip.icmp.code: %d, ip.icmp.data: 0x%x",
475 (
u32) (o->
ip.icmp.type),
476 (
u32) (o->
ip.icmp.code), o->
ip.icmp.data);
480 "ip.reass.next_index: %d, ip.reass.estimated_mtu: %d",
481 o->
ip.reass.next_index, (
u32) (o->
ip.reass.estimated_mtu));
484 "ip.reass.error_next_index: %d, ip.reass.owner_thread_index: %d",
485 o->
ip.reass.error_next_index,
486 (
u32) (o->
ip.reass.owner_thread_index));
489 "ip.reass.ip_proto: %d, ip.reass.l4_src_port: %d",
490 o->
ip.reass.ip_proto, (
u32) (o->
ip.reass.l4_src_port));
492 s =
format (s,
"ip.reass.l4_dst_port: %d", o->
ip.reass.l4_dst_port);
496 "ip.reass.fragment_first: %d ip.reass.fragment_last: %d",
497 (
u32) (o->
ip.reass.fragment_first),
498 (
u32) (o->
ip.reass.fragment_last));
502 "ip.reass.range_first: %d ip.reass.range_last: %d",
503 (
u32) (o->
ip.reass.range_first),
504 (
u32) (o->
ip.reass.range_last));
508 "ip.reass.next_range_bi: 0x%x, ip.reass.ip6_frag_hdr_offset: %d",
509 o->
ip.reass.next_range_bi,
510 (
u32) (o->
ip.reass.ip6_frag_hdr_offset));
514 "mpls.ttl: %d, mpls.exp: %d, mpls.first: %d, " 515 "mpls.save_rewrite_length: %d, mpls.bier.n_bytes: %d",
517 o->
mpls.save_rewrite_length, (
u32) (o->
mpls.bier.n_bytes));
519 s =
format (s,
"mpls.mpls_hdr_length: %d", (
u32) (o->
mpls.mpls_hdr_length));
523 "l2.feature_bitmap: %08x, l2.bd_index: %d, l2.l2fib_sn %d, " 524 "l2.l2_len: %d, l2.shg: %d, l2.bd_age: %d",
525 (
u32) (o->
l2.feature_bitmap), (
u32) (o->
l2.bd_index),
526 (
u32) (o->
l2.l2fib_sn),
531 "l2.feature_bitmap_input: %U, L2.feature_bitmap_output: %U",
537 "l2t.next_index: %d, l2t.session_index: %d",
538 (
u32) (o->
l2t.next_index), o->
l2t.session_index);
542 "l2_classify.table_index: %d, l2_classify.opaque_index: %d, " 543 "l2_classify.hash: 0x%llx",
551 s =
format (s,
"ipsec.sad_index: %d, ipsec.protect_index",
559 "map_t.map_domain_index: %d, map_t.v6.saddr: 0x%x, " 560 "map_t.v6.daddr: 0x%x, map_t.v6.frag_offset: %d, " 561 "map_t.v6.l4_offset: %d, map_t.v6.l4_protocol: %d, " 562 "map.t.checksum_offset: %d",
563 o->
map_t.map_domain_index,
572 "map_t.v6.l4_protocol: %d, map_t.checksum_offset: %d, " 579 "ip_frag.mtu: %d, ip_frag.next_index: %d, ip_frag.flags: 0x%x",
584 s =
format (s,
"cop.current_config_index: %d", o->
cop.current_config_index);
587 s =
format (s,
"lisp.overlay_afi: %d", (
u32) (o->
lisp.overlay_afi));
592 "tcp.connection_index: %d, tcp.seq_number: %d, tcp.next_node_opaque: %d " 593 "tcp.seq_end: %d, tcp.ack_number: %d, tcp.hdr_offset: %d, " 594 "tcp.data_offset: %d", o->
tcp.connection_index, o->
tcp.next_node_opaque,
595 o->
tcp.seq_number, o->
tcp.seq_end, o->
tcp.ack_number,
600 "tcp.data_len: %d, tcp.flags: 0x%x",
604 s =
format (s,
"snat.flags: 0x%x", o->
snat.flags);
607 for (i = 0; i <
vec_len (im->buffer_opaque_format_helpers); i++)
609 helper_fp = im->buffer_opaque_format_helpers[
i];
610 s = (*helper_fp) (b, s);
632 s =
format (s,
"qos.bits: %x, qos.source: %x",
638 s =
format (s,
"gbp.flags: %x, gbp.sclass: %d",
642 s =
format (s,
"gso_size: %d, gso_l4_hdr_sz: %d",
649 for (i = 0; i <
vec_len (im->buffer_opaque2_format_helpers); i++)
651 helper_fp = im->buffer_opaque2_format_helpers[
i];
652 s = (*helper_fp) (b, s);
677 u32 *hw_if_index = va_arg (*args,
u32 *);
684 if (c->unformat_device_name
685 &&
unformat_user (input, c->unformat_device_name, hw_if_index))
697 u32 *result = va_arg (*args,
u32 *);
699 u32 hw_if_index,
id, id_specified;
705 if (
unformat (input,
"%_%v.%d%_", &if_name, &
id)
740 u32 *result = va_arg (*args,
u32 *);
749 else if (
unformat (input,
"enable"))
761 u32 *result = va_arg (*args,
u32 *);
struct vnet_buffer_opaque_t::@132::@138 policer
vnet_main_t * vnet_get_main(void)
u8 * format_l2_output_features(u8 *s, va_list *args)
struct vnet_buffer_opaque_t::@132::@146 snat
vnet_interface_main_t interface_main
struct vnet_buffer_opaque_t::@132::@144 lisp
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
struct vnet_buffer_opaque_t::@132::@140 map
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Combined counter to hold both packets and byte differences.
uword * sub_interface_sw_if_index_by_id
struct _vnet_device_class vnet_device_class_t
struct vnet_buffer_opaque_t::@132::@135 mpls
u16 gso_size
The L4 payload size set on input on GSO enabled interfaces when we receive a GSO packet (a chain of b...
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)
vlib_combined_counter_main_t * combined_sw_if_counters
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.
vl_api_gre_tunnel_mode_t mode
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.
struct vnet_buffer_opaque2_t::@177 qos
QoS marking data that needs to persist from the recording nodes (nominally in the ingress path) to th...
counter_t packets
packet counter
struct vnet_buffer_opaque_t::@132::opaque_l2 l2
vnet_buffer_opquae_formatter_t * buffer_opaque_format_helpers
struct vnet_buffer_opaque_t::@132::@136 l2t
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
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...
#define vec_free(V)
Free vector's memory (no header).
u32 sw_if_index[VLIB_N_RX_TX]
struct vnet_buffer_opaque_t::@132::@142 ip_frag
struct vnet_buffer_opaque_t::@132::@141 map_t
struct vnet_buffer_opaque_t::@132::@139 ipsec
struct vnet_buffer_opaque_t::@132::@143 cop
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
struct vnet_buffer_opaque2_t::@178 gbp
struct vnet_buffer_opaque_t::@132::@134 ip
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)
struct vnet_buffer_opaque_t::@132::@137 l2_classify
VLIB buffer representation.
char * name
The counter collection's name.
A collection of combined counters.
vnet_sw_interface_type_t type
struct vnet_buffer_opaque_t::@132::@145 tcp
#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
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.
static uword vnet_sw_interface_is_api_visible(vnet_main_t *vnm, u32 sw_if_index)