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",
490 "ipsec.flags: 0x%x, ipsec.sad_index: %d",
498 "map_t.v6.saddr: 0x%x, map_t.v6.daddr: 0x%x, " 499 "map_t.v6.frag_offset: %d, map_t.v6.l4_offset: %d",
506 "map_t.v6.l4_protocol: %d, map_t.checksum_offset: %d, " 513 "ip_frag.mtu: %d, ip_frag.next_index: %d, ip_frag.flags: 0x%x",
518 s =
format (s,
"cop.current_config_index: %d", o->
cop.current_config_index);
521 s =
format (s,
"lisp.overlay_afi: %d", (
u32) (o->
lisp.overlay_afi));
525 (s,
"tcp.connection_index: %d, tcp.seq_number: %d, tcp.seq_end: %d, " 526 "tcp.ack_number: %d, tcp.hdr_offset: %d, tcp.data_offset: %d",
527 o->
tcp.connection_index,
535 "tcp.data_len: %d, tcp.flags: 0x%x",
540 "sctp.connection_index: %d, sctp.sid: %d, sctp.ssn: %d, " 541 "sctp.tsn: %d, sctp.hdr_offset: %d",
542 o->
sctp.connection_index,
549 (s,
"sctp.data_offset: %d, sctp.data_len: %d, sctp.subconn_idx: %d, " 556 s =
format (s,
"snat.flags: 0x%x", o->
snat.flags);
575 s =
format (s,
"qos.bits: %x, qos.source: %x",
581 s =
format (s,
"gbp.flags: %x, gbp.src_epg: %d",
594 u32 *hw_if_index = va_arg (*args,
u32 *);
601 if (c->unformat_device_name
602 &&
unformat_user (input, c->unformat_device_name, hw_if_index))
614 u32 *result = va_arg (*args,
u32 *);
616 u32 hw_if_index,
id, id_specified;
622 if (
unformat (input,
"%_%v.%d%_", &if_name, &
id)
657 u32 *result = va_arg (*args,
u32 *);
666 else if (
unformat (input,
"enable"))
678 u32 *result = va_arg (*args,
u32 *);
struct vnet_buffer_opaque2_t::@89 gbp
struct vnet_buffer_opaque_t::@56::@64 map
struct vnet_buffer_opaque_t::@56::@61 l2_classify
u8 * format_l2_output_features(u8 *s, va_list *args)
struct vnet_buffer_opaque_t::@56::@71 snat
vnet_interface_main_t interface_main
u32 opaque[10]
Opaque data used by sub-graphs for their own purposes.
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.
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)
struct vnet_buffer_opaque_t::@56::@68 lisp
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
struct vnet_buffer_opaque_t::@56::@60 l2t
struct vnet_buffer_opaque_t::@56::opaque_l2 l2
vnet_sw_interface_flags_t flags
vlib_simple_counter_main_t * sw_if_counters
unformat_function_t unformat_hash_vec_string
struct vnet_buffer_opaque_t::@56::@70 sctp
#define VNET_HW_INTERFACE_BOND_INFO_SLAVE
struct vnet_buffer_opaque_t::@56::@67 cop
struct vnet_buffer_opaque2_t::@88 qos
QoS marking data that needs to persist from the recording nodes (nominally in the ingress path) to th...
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]
static vnet_sw_interface_t * vnet_get_sw_interface_safe(vnet_main_t *vnm, u32 sw_if_index)
struct vnet_buffer_opaque_t::@56::@65 map_t
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::@56::@63 ipsec
counter_t bytes
byte counter
u32 opaque2[12]
More opaque data, see ../vnet/vnet/buffer.h.
struct _vnet_hw_interface_class vnet_hw_interface_class_t
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
char * name
The counter collection's name.
struct vnet_buffer_opaque_t::@56::@69 tcp
A collection of combined counters.
struct vnet_buffer_opaque_t::@56::@62 policer
struct vnet_buffer_opaque_t::@56::@66 ip_frag
vl_api_gbp_vxlan_tunnel_mode_t mode
vnet_sw_interface_type_t type
#define vec_foreach(var, vec)
Vector iterator.
vnet_device_class_t * device_classes
struct vnet_buffer_opaque_t::@56::@59 mpls
struct vnet_buffer_opaque_t::@56::@58 ip
static uword vnet_sw_interface_is_api_visible(vnet_main_t *vnm, u32 sw_if_index)