51 s =
format (s,
"bond-slave");
69 return format (s,
"polling");
72 return format (s,
"interrupt");
75 return format (s,
"adaptive");
77 return format (s,
"unknown");
87 int verbose = va_arg (*args,
int);
91 return format (s,
"%=32s%=6s%=8s%s",
"Name",
"Idx",
"Link",
"Hardware");
98 s =
format (s,
"%=8s",
"slave");
109 s =
format (s,
"Slave-Idx:");
111 format (s,
" %d", hw_idx));
113 else if (dev_class->format_device_name)
120 if (hw_class->format_device)
123 hw_class->format_device, hi->
hw_if_index, verbose);
130 format (s,
" address %U", hw_class->format_address,
134 if (dev_class->format_device)
167 u32 sw_if_index = va_arg (*args,
u32);
174 return format (s,
"DELETED");
183 u32 hw_if_index = va_arg (*args,
u32);
189 return format (s,
"DELETED");
198 u32 indent, n_printed;
199 int i, j, n_counters;
218 if (vec_len (my_vnet_mains) == 0)
225 for (j = 0; j < n_counters; j++)
230 for (i = 0; i <
vec_len (my_vnet_mains); i++)
254 s =
format (s,
"\n%U%-16v%16Ld",
266 for (j = 0; j < n_counters; j++)
270 for (i = 0; i <
vec_len (my_vnet_mains); i++)
287 s =
format (s,
"%-16s%16Ld", cm->
name, vtotal);
312 return format (s,
"%=32s%=5s%=10s%=21s%=16s%=16s",
313 "Name",
"Idx",
"State",
"MTU (L3/IP4/IP6/MPLS)",
"Counter",
316 s =
format (s,
"%-32U%=5d%=10U%=21U",
332 u8 *name = va_arg (*args,
u8 *);
337 return format (s,
"%=32s%=5s%=16s%=16s%=16s",
338 "Name",
"Idx",
"State",
"Counter",
"Count");
340 s =
format (s,
"%-32v%=5d%=16U",
353 u32 *hw_if_index = va_arg (*args,
u32 *);
360 if (c->unformat_device_name
361 &&
unformat_user (input, c->unformat_device_name, hw_if_index))
373 u32 *result = va_arg (*args,
u32 *);
375 u32 hw_if_index, id, id_specified;
381 if (
unformat (input,
"%_%v.%d%_", &if_name, &
id)
406 *result = sw_if_index;
416 u32 *result = va_arg (*args,
u32 *);
425 else if (
unformat (input,
"enable"))
437 u32 *result = va_arg (*args,
u32 *);
vnet_interface_main_t interface_main
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
#define VNET_HW_INTERFACE_FLAG_LINK_UP
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)
vlib_combined_counter_main_t * combined_sw_if_counters
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
#define VNET_SW_INTERFACE_FLAG_BOND_SLAVE
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).
static vnet_sw_interface_t * vnet_get_sw_interface_safe(vnet_main_t *vnm, u32 sw_if_index)
#define VNET_SW_INTERFACE_FLAG_ADMIN_UP
#define VNET_SW_INTERFACE_FLAG_PUNT
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)
#define VNET_SW_INTERFACE_FLAG_ERROR
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.
vnet_device_class_t * device_classes
static uword vnet_sw_interface_is_api_visible(vnet_main_t *vnm, u32 sw_if_index)