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);
161 int verbose = va_arg (*args,
int);
165 return format (s,
"%=32s%=6s%=8s%s",
"Name",
"Idx",
"Link",
"Hardware");
172 s =
format (s,
"%=8s",
"slave");
183 s =
format (s,
"Slave-Idx:");
185 format (s,
" %d", hw_idx));
187 else if (dev_class->format_device_name)
203 if (hw_class->format_device)
206 hw_class->format_device, hi->
hw_if_index, verbose);
213 format (s,
" address %U", hw_class->format_address,
217 if (dev_class->format_device)
257 return format (s,
"DELETED");
266 u32 hw_if_index = va_arg (*args,
u32);
272 return format (s,
"DELETED");
281 u32 indent, n_printed;
284 int json_need_comma_nl = 0;
300 for (j = 0; j < n_counters; j++)
318 if (json_need_comma_nl)
323 s =
format (s,
"%s%s_packets%s: %s%Ld%s,\n", x, cm->
name, x, x,
325 s =
format (s,
"%s%s_bytes%s: %s%Ld%s", x, cm->
name, x, x,
327 json_need_comma_nl = 1;
342 s =
format (s,
"\n%U%-16v%16Ld",
353 for (j = 0; j < n_counters; j++)
368 if (json_need_comma_nl)
373 s =
format (s,
"%s%s%s: %s%Ld%s", x, cm->
name, x, x, vtotal, x);
374 json_need_comma_nl = 1;
383 s =
format (s,
"%-16s%16Ld", cm->
name, vtotal);
408 return format (s,
"%=32s%=5s%=10s%=21s%=16s%=16s",
409 "Name",
"Idx",
"State",
"MTU (L3/IP4/IP6/MPLS)",
"Counter",
412 s =
format (s,
"%-32U%=5d%=10U%=21U",
433 return format (s,
"%=32s%=5s%=16s%=16s%=16s",
434 "Name",
"Idx",
"State",
"Counter",
"Count");
436 s =
format (s,
"%-32v%=5d%=16U",
450 #define _(a,b,c,v) if (buf->flags & VNET_BUFFER_F_##b) s = format (s, "%s ", c); 473 "sw_if_index[VLIB_RX]: %d, sw_if_index[VLIB_TX]: %d",
478 "L2 offset %d, L3 offset %d, L4 offset %d, feature arc index %d",
485 "ip.adj_index[VLIB_RX]: %d, ip.adj_index[VLIB_TX]: %d",
486 (
u32) (o->
ip.adj_index[0]), (
u32) (o->
ip.adj_index[1]));
490 "ip.flow_hash: 0x%x, ip.save_protocol: 0x%x, ip.fib_index: %d",
491 o->
ip.flow_hash, o->
ip.save_protocol, o->
ip.fib_index);
495 "ip.save_rewrite_length: %d, ip.rpf_id: %d",
496 o->
ip.save_rewrite_length, o->
ip.rpf_id);
500 "ip.icmp.type: %d ip.icmp.code: %d, ip.icmp.data: 0x%x",
501 (
u32) (o->
ip.icmp.type),
502 (
u32) (o->
ip.icmp.code), o->
ip.icmp.data);
506 "ip.reass.next_index: %d, ip.reass.estimated_mtu: %d",
507 o->
ip.reass.next_index, (
u32) (o->
ip.reass.estimated_mtu));
510 "ip.reass.error_next_index: %d, ip.reass.owner_thread_index: %d",
511 o->
ip.reass.error_next_index,
512 (
u32) (o->
ip.reass.owner_thread_index));
515 "ip.reass.ip_proto: %d, ip.reass.l4_src_port: %d",
516 o->
ip.reass.ip_proto, (
u32) (o->
ip.reass.l4_src_port));
518 s =
format (s,
"ip.reass.l4_dst_port: %d", o->
ip.reass.l4_dst_port);
522 "ip.reass.fragment_first: %d ip.reass.fragment_last: %d",
523 (
u32) (o->
ip.reass.fragment_first),
524 (
u32) (o->
ip.reass.fragment_last));
528 "ip.reass.range_first: %d ip.reass.range_last: %d",
529 (
u32) (o->
ip.reass.range_first),
530 (
u32) (o->
ip.reass.range_last));
534 "ip.reass.next_range_bi: 0x%x, ip.reass.ip6_frag_hdr_offset: %d",
535 o->
ip.reass.next_range_bi,
536 (
u32) (o->
ip.reass.ip6_frag_hdr_offset));
540 "mpls.ttl: %d, mpls.exp: %d, mpls.first: %d, " 541 "mpls.save_rewrite_length: %d, mpls.bier.n_bytes: %d",
543 o->
mpls.save_rewrite_length, (
u32) (o->
mpls.bier.n_bytes));
545 s =
format (s,
"mpls.mpls_hdr_length: %d", (
u32) (o->
mpls.mpls_hdr_length));
549 "l2.feature_bitmap: %08x, l2.bd_index: %d, l2.l2fib_sn %d, " 550 "l2.l2_len: %d, l2.shg: %d, l2.bd_age: %d",
551 (
u32) (o->
l2.feature_bitmap), (
u32) (o->
l2.bd_index),
552 (
u32) (o->
l2.l2fib_sn),
557 "l2.feature_bitmap_input: %U, L2.feature_bitmap_output: %U",
563 "l2t.next_index: %d, l2t.session_index: %d",
564 (
u32) (o->
l2t.next_index), o->
l2t.session_index);
568 "l2_classify.table_index: %d, l2_classify.opaque_index: %d, " 569 "l2_classify.hash: 0x%llx",
577 s =
format (s,
"ipsec.sad_index: %d, ipsec.protect_index",
585 "map_t.map_domain_index: %d, map_t.v6.saddr: 0x%x, " 586 "map_t.v6.daddr: 0x%x, map_t.v6.frag_offset: %d, " 587 "map_t.v6.l4_offset: %d, map_t.v6.l4_protocol: %d, " 588 "map.t.checksum_offset: %d",
589 o->
map_t.map_domain_index,
598 "map_t.v6.l4_protocol: %d, map_t.checksum_offset: %d, " 605 "ip_frag.mtu: %d, ip_frag.next_index: %d, ip_frag.flags: 0x%x",
610 s =
format (s,
"cop.current_config_index: %d", o->
cop.current_config_index);
613 s =
format (s,
"lisp.overlay_afi: %d", (
u32) (o->
lisp.overlay_afi));
618 "tcp.connection_index: %d, tcp.seq_number: %d, tcp.next_node_opaque: %d " 619 "tcp.seq_end: %d, tcp.ack_number: %d, tcp.hdr_offset: %d, " 620 "tcp.data_offset: %d", o->
tcp.connection_index, o->
tcp.next_node_opaque,
621 o->
tcp.seq_number, o->
tcp.seq_end, o->
tcp.ack_number,
626 "tcp.data_len: %d, tcp.flags: 0x%x",
630 s =
format (s,
"snat.flags: 0x%x", o->
snat.flags);
633 for (i = 0; i <
vec_len (im->buffer_opaque_format_helpers); i++)
635 helper_fp = im->buffer_opaque_format_helpers[
i];
636 s = (*helper_fp) (b, s);
658 s =
format (s,
"qos.bits: %x, qos.source: %x",
664 s =
format (s,
"gbp.flags: %x, gbp.sclass: %d",
668 s =
format (s,
"gso_size: %d, gso_l4_hdr_sz: %d",
675 for (i = 0; i <
vec_len (im->buffer_opaque2_format_helpers); i++)
677 helper_fp = im->buffer_opaque2_format_helpers[
i];
678 s = (*helper_fp) (b, s);
702 u32 *flagp = va_arg (*args,
u32 *);
711 #define _(bit,enum,str,verbose) \ 712 else if (unformat (input, str)) \ 714 flags |= (1 << LOG2_VLIB_BUFFER_FLAG_USER(bit)); \ 731 u32 *hw_if_index = va_arg (*args,
u32 *);
738 if (c->unformat_device_name
739 &&
unformat_user (input, c->unformat_device_name, hw_if_index))
751 u32 *result = va_arg (*args,
u32 *);
753 u32 hw_if_index,
id, id_specified;
759 if (
unformat (input,
"%_%v.%d%_", &if_name, &
id)
794 u32 *result = va_arg (*args,
u32 *);
803 else if (
unformat (input,
"enable"))
815 u32 *result = va_arg (*args,
u32 *);
struct vnet_buffer_opaque_t::@162::opaque_l2 l2
vl_api_wireguard_peer_flags_t flags
vnet_main_t * vnet_get_main(void)
u8 * format_l2_output_features(u8 *s, va_list *args)
vnet_interface_main_t interface_main
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.
uword * sub_interface_sw_if_index_by_id
struct vnet_buffer_opaque_t::@162::@172 ip_frag
struct _vnet_device_class vnet_device_class_t
struct vnet_buffer_opaque_t::@162::@165 mpls
struct vnet_buffer_opaque_t::@162::@170 map
struct vnet_buffer_opaque_t::@162::@175 tcp
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
struct vnet_buffer_opaque_t::@162::@169 ipsec
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.
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
vnet_buffer_opquae_formatter_t * buffer_opaque_format_helpers
vnet_sw_interface_flags_t flags
vlib_simple_counter_main_t * sw_if_counters
struct vnet_buffer_opaque_t::@162::@171 map_t
unformat_function_t unformat_hash_vec_string
vl_api_tunnel_mode_t mode
#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...
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
u32 sw_if_index[VLIB_N_RX_TX]
struct vnet_buffer_opaque_t::@162::@173 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.
struct vnet_buffer_opaque_t::@162::@167 l2_classify
vnet_buffer_opquae_formatter_t * buffer_opaque2_format_helpers
struct vnet_buffer_opaque_t::@162::@176 snat
counter_t bytes
byte counter
struct vnet_buffer_opaque_t::@162::@174 lisp
clib_bitmap_t * rss_queues
struct vnet_buffer_opaque_t::@162::@164 ip
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_opaque2_t::@208 gbp
struct vnet_buffer_opaque_t::@162::@168 policer
static vnet_sw_interface_t * vnet_get_sw_interface_or_null(vnet_main_t *vnm, u32 sw_if_index)
struct vnet_buffer_opaque2_t::@207 qos
QoS marking data that needs to persist from the recording nodes (nominally in the ingress path) to th...
u32 opaque[10]
Opaque data used by sub-graphs for their own purposes.
struct vnet_buffer_opaque_t::@162::@166 l2t
vl_api_interface_index_t sw_if_index
static uword vnet_sw_interface_is_api_visible(vnet_main_t *vnm, u32 sw_if_index)