53 s =
format (s,
"bond-slave");
71 return format (s,
"polling");
74 return format (s,
"interrupt");
77 return format (s,
"adaptive");
79 return format (s,
"unknown");
85 u32 link_speed = va_arg (*args,
u32);
88 return format (s,
"unknown");
90 if (link_speed >= 1000000)
91 return format (s,
"%f Gbps", (
f64) link_speed / 1000000);
93 if (link_speed >= 1000)
94 return format (s,
"%f Mbps", (
f64) link_speed / 1000);
96 return format (s,
"%u Kbps", link_speed);
107 int verbose = va_arg (*args,
int);
111 return format (s,
"%=32s%=6s%=8s%s",
"Name",
"Idx",
"Link",
"Hardware");
118 s =
format (s,
"%=8s",
"slave");
129 s =
format (s,
"Slave-Idx:");
131 format (s,
" %d", hw_idx));
133 else if (dev_class->format_device_name)
143 if (hw_class->format_device)
146 hw_class->format_device, hi->
hw_if_index, verbose);
153 format (s,
" address %U", hw_class->format_address,
157 if (dev_class->format_device)
197 return format (s,
"DELETED");
206 u32 hw_if_index = va_arg (*args,
u32);
212 return format (s,
"DELETED");
221 u32 indent, n_printed;
222 int i, j, n_counters;
241 if (vec_len (my_vnet_mains) == 0)
248 for (j = 0; j < n_counters; j++)
253 for (i = 0; i <
vec_len (my_vnet_mains); i++)
277 s =
format (s,
"\n%U%-16v%16Ld",
289 for (j = 0; j < n_counters; j++)
293 for (i = 0; i <
vec_len (my_vnet_mains); i++)
310 s =
format (s,
"%-16s%16Ld", cm->
name, vtotal);
335 return format (s,
"%=32s%=5s%=10s%=21s%=16s%=16s",
336 "Name",
"Idx",
"State",
"MTU (L3/IP4/IP6/MPLS)",
"Counter",
339 s =
format (s,
"%-32U%=5d%=10U%=21U",
360 return format (s,
"%=32s%=5s%=16s%=16s%=16s",
361 "Name",
"Idx",
"State",
"Counter",
"Count");
363 s =
format (s,
"%-32v%=5d%=16U",
377 #define _(a,b,c,v) if (buf->flags & VNET_BUFFER_F_##b) s = format (s, "%s ", c); 398 "sw_if_index[VLIB_RX]: %d, sw_if_index[VLIB_TX]: %d",
403 "L2 offset %d, L3 offset %d, L4 offset %d, feature arc index %d",
410 "ip.adj_index[VLIB_RX]: %d, ip.adj_index[VLIB_TX]: %d",
411 (
u32) (o->
ip.adj_index[0]), (
u32) (o->
ip.adj_index[1]));
415 "ip.flow_hash: 0x%x, ip.save_protocol: 0x%x, ip.fib_index: %d",
416 o->
ip.flow_hash, o->
ip.save_protocol, o->
ip.fib_index);
420 "ip.save_rewrite_length: %d, ip.rpf_id: %d",
421 o->
ip.save_rewrite_length, o->
ip.rpf_id);
425 "ip.icmp.type: %d ip.icmp.code: %d, ip.icmp.data: 0x%x",
426 (
u32) (o->
ip.icmp.type),
427 (
u32) (o->
ip.icmp.code), o->
ip.icmp.data);
431 "ip.reass.next_index: %d, ip.reass.estimated_mtu: %d",
432 o->
ip.reass.next_index, (
u32) (o->
ip.reass.estimated_mtu));
436 "ip.reass.fragment_first: %d ip.reass.fragment_last: %d",
437 (
u32) (o->
ip.reass.fragment_first),
438 (
u32) (o->
ip.reass.fragment_last));
442 "ip.reass.range_first: %d ip.reass.range_last: %d",
443 (
u32) (o->
ip.reass.range_first),
444 (
u32) (o->
ip.reass.range_last));
448 "ip.reass.next_range_bi: 0x%x, ip.reass.ip6_frag_hdr_offset: %d",
449 o->
ip.reass.next_range_bi,
450 (
u32) (o->
ip.reass.ip6_frag_hdr_offset));
454 "mpls.ttl: %d, mpls.exp: %d, mpls.first: %d, " 455 "mpls.save_rewrite_length: %d, mpls.bier.n_bytes: %d",
457 o->
mpls.save_rewrite_length, (
u32) (o->
mpls.bier.n_bytes));
461 "l2.feature_bitmap: %08x, l2.bd_index: %d, l2.l2_len: %d, " 462 "l2.shg: %d, l2.l2fib_sn: %d, l2.bd_age: %d",
463 o->
l2.feature_bitmap, (
u32) (o->
l2.bd_index),
465 (
u32) (o->
l2.bd_age));
469 "l2.feature_bitmap_input: %U, L2.feature_bitmap_output: %U",
475 "l2t.next_index: %d, l2t.session_index: %d",
476 (
u32) (o->
l2t.next_index), o->
l2t.session_index);
480 "l2_classify.table_index: %d, l2_classify.opaque_index: %d, " 481 "l2_classify.hash: 0x%llx",
489 s =
format (s,
"ipsec.sad_index: %d", o->
ipsec.sad_index);
496 "map_t.v6.saddr: 0x%x, map_t.v6.daddr: 0x%x, " 497 "map_t.v6.frag_offset: %d, map_t.v6.l4_offset: %d",
504 "map_t.v6.l4_protocol: %d, map_t.checksum_offset: %d, " 511 "ip_frag.mtu: %d, ip_frag.next_index: %d, ip_frag.flags: 0x%x",
516 s =
format (s,
"cop.current_config_index: %d", o->
cop.current_config_index);
519 s =
format (s,
"lisp.overlay_afi: %d", (
u32) (o->
lisp.overlay_afi));
523 (s,
"tcp.connection_index: %d, tcp.seq_number: %d, tcp.seq_end: %d, " 524 "tcp.ack_number: %d, tcp.hdr_offset: %d, tcp.data_offset: %d",
525 o->
tcp.connection_index,
533 "tcp.data_len: %d, tcp.flags: 0x%x",
538 "sctp.connection_index: %d, sctp.sid: %d, sctp.ssn: %d, " 539 "sctp.tsn: %d, sctp.hdr_offset: %d",
540 o->
sctp.connection_index,
547 (s,
"sctp.data_offset: %d, sctp.data_len: %d, sctp.subconn_idx: %d, " 554 s =
format (s,
"snat.flags: 0x%x", o->
snat.flags);
573 s =
format (s,
"qos.bits: %x, qos.source: %x",
579 s =
format (s,
"gbp.flags: %x, gbp.sclass: %d",
592 u32 *hw_if_index = va_arg (*args,
u32 *);
599 if (c->unformat_device_name
600 &&
unformat_user (input, c->unformat_device_name, hw_if_index))
612 u32 *result = va_arg (*args,
u32 *);
614 u32 hw_if_index,
id, id_specified;
620 if (
unformat (input,
"%_%v.%d%_", &if_name, &
id)
655 u32 *result = va_arg (*args,
u32 *);
664 else if (
unformat (input,
"enable"))
676 u32 *result = va_arg (*args,
u32 *);
struct vnet_buffer_opaque2_t::@90 qos
QoS marking data that needs to persist from the recording nodes (nominally in the ingress path) to th...
u8 * format_l2_output_features(u8 *s, va_list *args)
vnet_interface_main_t interface_main
struct vnet_buffer_opaque_t::@58::@63 l2_classify
vnet_main_t ** vnet_mains
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_device_class vnet_device_class_t
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
struct vnet_buffer_opaque_t::@58::opaque_l2 l2
struct vnet_buffer_opaque_t::@58::@66 map
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
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.
struct vnet_buffer_opaque2_t::@91 gbp
struct vnet_buffer_opaque_t::@58::@69 cop
char * name
The counter collection's name.
uword * hw_interface_by_name
struct vnet_buffer_opaque_t::@58::@70 lisp
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
counter_t packets
packet counter
vnet_sw_interface_flags_t flags
vlib_simple_counter_main_t * sw_if_counters
struct vnet_buffer_opaque_t::@58::@67 map_t
unformat_function_t unformat_hash_vec_string
struct vnet_buffer_opaque_t::@58::@64 policer
#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...
struct vnet_buffer_opaque_t::@58::@62 l2t
struct vnet_buffer_opaque_t::@58::@71 tcp
#define vec_free(V)
Free vector's memory (no header).
u32 sw_if_index[VLIB_N_RX_TX]
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.
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.
struct vnet_buffer_opaque_t::@58::@73 snat
char * name
The counter collection's name.
struct vnet_buffer_opaque_t::@58::@68 ip_frag
A collection of combined counters.
struct vnet_buffer_opaque_t::@58::@61 mpls
vnet_sw_interface_type_t type
struct vnet_buffer_opaque_t::@58::@65 ipsec
#define vec_foreach(var, vec)
Vector iterator.
vnet_device_class_t * device_classes
struct vnet_buffer_opaque_t::@58::@60 ip
struct vnet_buffer_opaque_t::@58::@72 sctp
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)