75 u32 hw_if_index, *hw_if_indices = 0;
83 vec_add1 (hw_if_indices, hw_if_index);
86 else if (
unformat (input,
"%u", &hw_if_index))
87 vec_add1 (hw_if_indices, hw_if_index);
89 else if (
unformat (input,
"verbose"))
114 if (
vec_len (hw_if_indices) == 0)
127 for (i = 0; i <
vec_len (hw_if_indices); i++)
144 shi = vnet_get_hw_interface(vnm, hw_idx);
145 vlib_cli_output (vm,
"%U\n",
146 format_vnet_hw_interface, vnm, shi, verbose);
154 for (i = 0; i <
vec_len (hw_if_indices); i++)
161 if (dc->clear_counters)
244 .path =
"show hardware-interfaces",
245 .short_help =
"show hardware-interfaces [brief|verbose|detail] [bond] " 246 "[<interface> [<interface> [..]]] [<sw_idx> [<sw_idx> [..]]]",
265 .path =
"clear hardware-interfaces",
266 .short_help =
"clear hardware-interfaces " 267 "[<interface> [<interface> [..]]] [<sw_idx> [<sw_idx> [..]]]",
292 u8 show_addresses = 0;
293 u8 show_features = 0;
321 else if (
unformat (linput,
"verbose"))
333 if (show_features || show_tag || show_vtr)
335 if (sw_if_index == ~(
u32) 0)
369 tag ? (
char *) tag :
"(none)");
380 u32 push_dot1q = 0, tag1 = 0, tag2 = 0;
383 &vtr_op, &push_dot1q, &tag1, &tag2) != 0)
403 _vec_len (sorted_sis) = 0;
407 int visible = vnet_swif_is_api_visible (si);
409 vec_add1 (sorted_sis, si[0]);}
425 u32 fib_index4 = 0, fib_index6 = 0;
440 (vm,
"%U (%s): \n unnumbered, use %U",
458 l2_input->
bvi ?
"bvi" :
" ");
470 ip4_address_t *r4 = ip_interface_address_get_address (lm4, ia);
472 vlib_cli_output (vm,
" L3 %U/%d ip4 table-id %d fib-idx %d",
473 format_ip4_address, r4, ia->address_length,
475 ip4_fib_index_from_table_id (fib4->table_id));
477 vlib_cli_output (vm,
" L3 %U/%d",
478 format_ip4_address, r4, ia->address_length);
487 ip6_address_t *r6 = ip_interface_address_get_address (lm6, ia);
489 vlib_cli_output (vm,
" L3 %U/%d ip6 table-id %d fib-idx %d",
490 format_ip6_address, r6, ia->address_length,
492 ip6_fib_index_from_table_id (fib6->table_id));
494 vlib_cli_output (vm,
" L3 %U/%d",
495 format_ip6_address, r6, ia->address_length);
515 .path =
"show interface",
516 .short_help =
"show interface [address|addr|features|feat|vtr] [<interface> [<interface> [..]]] [verbose]",
526 .short_help =
"Interface commands",
532 .path =
"set interface",
533 .short_help =
"Interface commands",
549 for (j = 0; j < n_counters; j++)
558 for (j = 0; j < n_counters; j++)
578 .path =
"clear interfaces",
579 .short_help =
"clear interfaces",
651 u32 inner_vlan, outer_vlan;
653 if (
unformat (input,
"any inner-dot1q any"))
655 template->sub.eth.
flags.two_tags = 1;
656 template->sub.eth.flags.outer_vlan_id_any = 1;
657 template->sub.eth.flags.inner_vlan_id_any = 1;
661 template->sub.eth.flags.one_tag = 1;
662 template->sub.eth.flags.outer_vlan_id_any = 1;
664 else if (
unformat (input,
"%d inner-dot1q any", &outer_vlan))
666 template->sub.eth.flags.two_tags = 1;
667 template->sub.eth.flags.inner_vlan_id_any = 1;
668 template->sub.eth.outer_vlan_id = outer_vlan;
670 else if (
unformat (input,
"%d inner-dot1q %d", &outer_vlan, &inner_vlan))
672 template->sub.eth.flags.two_tags = 1;
673 template->sub.eth.outer_vlan_id = outer_vlan;
674 template->sub.eth.inner_vlan_id = inner_vlan;
676 else if (
unformat (input,
"%d", &outer_vlan))
678 template->sub.eth.flags.one_tag = 1;
679 template->sub.eth.outer_vlan_id = outer_vlan;
690 if (
unformat (input,
"exact-match"))
692 template->sub.eth.flags.exact_match = 1;
708 u32 id, id_min, id_max;
720 template.sub.eth.raw_flags = 0;
722 if (
unformat (input,
"%d default", &id_min))
725 template.sub.eth.flags.default_sub = 1;
727 else if (
unformat (input,
"%d untagged", &id_min))
730 template.sub.eth.flags.no_tags = 1;
731 template.sub.eth.flags.exact_match = 1;
733 else if (
unformat (input,
"%d dot1q", &id_min))
741 else if (
unformat (input,
"%d dot1ad", &id_min))
745 template.sub.eth.flags.dot1ad = 1;
750 else if (
unformat (input,
"%d-%d", &id_min, &id_max))
752 template.sub.eth.flags.one_tag = 1;
753 template.sub.eth.flags.exact_match = 1;
757 else if (
unformat (input,
"%d", &id_min))
760 template.sub.eth.flags.one_tag = 1;
761 template.sub.eth.outer_vlan_id = id_min;
762 template.sub.eth.flags.exact_match = 1;
778 "not allowed as %v belong to a BondEthernet interface",
783 for (
id = id_min;
id <= id_max;
id++)
794 clib_warning (
"sup sw_if_index %d, sub id %d already exists\n",
802 template.sub.id =
id;
804 template.sub.eth.outer_vlan_id =
id;
811 *kp = sup_and_sub_key;
909 .path =
"create sub-interfaces",
910 .short_help =
"create sub-interfaces <interface> " 911 "{<subId> [default|untagged]} | " 912 "{<subId>-<subId>} | " 913 "{<subId> dot1q|dot1ad <vlanId>|any [inner-dot1q <vlanId>|any] [exact-match]}",
966 .path =
"set interface state",
967 .short_help =
"set interface state <interface> [up|down|punt|enable]",
977 u32 unnumbered_sw_if_index = ~0;
978 u32 inherit_from_sw_if_index = ~0;
987 &unnumbered_sw_if_index))
993 if (~0 == unnumbered_sw_if_index)
995 if (enable && ~0 == inherit_from_sw_if_index)
997 " IP enabled interface that it uses");
1000 inherit_from_sw_if_index, enable);
1007 .path =
"set interface unnumbered",
1008 .short_help =
"set interface unnumbered [<interface> use <interface> | del <interface>]",
1022 u32 hw_if_index, hw_class_index;
1050 .path =
"set interface hw-class",
1051 .short_help =
"Set interface hardware class",
1070 u32 new_dev_instance;
1078 if (!
unformat (input,
"%d", &new_dev_instance))
1100 .path =
"renumber interface",
1101 .short_help =
"renumber interface <interface> <new-dev-instance>",
1119 else if (
unformat (input,
"off %U",
1136 .path =
"set interface promiscuous",
1137 .short_help =
"set interface promiscuous [on|off] <interface>",
1150 if (
unformat (input,
"%d %U", &mtu,
1163 if (mtu < hi->min_supported_packet_bytes)
1165 "must be >= min pkt bytes (%d)", mtu,
1175 else if (
unformat (input,
"packet %d %U", &mtu,
1179 else if (
unformat (input,
"ip4 %d %U", &mtu,
1182 else if (
unformat (input,
"ip6 %d %U", &mtu,
1185 else if (
unformat (input,
"mpls %d %U", &mtu,
1200 .path =
"set interface mtu",
1201 .short_help =
"set interface mtu [packet|ip4|ip6|mpls] <value> <interface>",
1223 if (
vec_len (sorted_sis) == 0)
1227 _vec_len (sorted_sis) = 0;
1231 int visible = vnet_swif_is_api_visible (si);
1233 vec_add1 (sorted_sis, si[0]);}
1278 .path =
"show interface secondary-mac-address",
1279 .short_help =
"show interface secondary-mac-address [<interface>]",
1295 is_add = is_del = 0;
1320 if (is_add == is_del)
1352 .path =
"set interface secondary-mac-address",
1353 .short_help =
"set interface secondary-mac-address <interface> <mac-address> [(add|del)]",
1402 .path =
"set interface mac address",
1403 .short_help =
"set interface mac address <interface> <mac-address>",
1416 vnm, &sw_if_index, &tag))
1427 .path =
"set interface tag",
1428 .short_help =
"set interface tag <interface> <tag>",
1451 .path =
"clear interface tag",
1452 .short_help =
"clear interface tag <interface>",
1466 else if (
unformat (input,
"enable"))
1468 else if (
unformat (input,
"disable"))
1474 if (~0 == sw_if_index)
1491 .path =
"set interface ip directed-broadcast",
1492 .short_help =
"set interface enable <interface> <enable|disable>",
1515 if (old_mode == mode)
1518 case VNET_API_ERROR_INVALID_INTERFACE:
1520 case VNET_API_ERROR_INVALID_QUEUE:
1526 if (dev_class->rx_mode_change_function)
1528 error = dev_class->rx_mode_change_function (vnm, hw_if_index, queue_id,
1539 case VNET_API_ERROR_UNSUPPORTED:
1541 case VNET_API_ERROR_INVALID_INTERFACE:
1543 case VNET_API_ERROR_INVALID_QUEUE:
1554 u8 queue_id_valid,
u32 queue_id,
1563 if (queue_id_valid == 0)
1586 u32 hw_if_index = (
u32) ~ 0;
1587 u32 queue_id = (
u32) ~ 0;
1589 u8 queue_id_valid = 0;
1599 else if (
unformat (line_input,
"queue %d", &queue_id))
1601 else if (
unformat (line_input,
"polling"))
1603 else if (
unformat (line_input,
"interrupt"))
1605 else if (
unformat (line_input,
"adaptive"))
1618 if (hw_if_index == (
u32) ~ 0)
1665 .path =
"set interface rx-mode",
1666 .short_help =
"set interface rx-mode <interface> [queue <n>] [polling | interrupt | adaptive]",
1687 rt = vlib_node_get_runtime_data (this_vlib_main, si);
1689 if (vec_len (rt->devices_and_queues))
1690 s = format (s,
" node %U:\n", format_vlib_node_name, vm, si);
1692 vec_foreach (dq, rt->devices_and_queues)
1694 vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm,
1696 s = format (s,
" %U queue %u (%U)\n",
1697 format_vnet_sw_if_index_name, vnm, hi->sw_if_index,
1699 format_vnet_hw_interface_rx_mode, dq->mode);
1743 .path =
"show interface rx-placement",
1744 .short_help =
"show interface rx-placement",
1751 u32 thread_index,
u8 is_main)
1766 "please specify valid worker thread or main");
1792 u32 hw_if_index = (
u32) ~ 0;
1794 u32 thread_index = (
u32) ~ 0;
1805 else if (
unformat (line_input,
"queue %d", &queue_id))
1807 else if (
unformat (line_input,
"main", &thread_index))
1809 else if (
unformat (line_input,
"worker %d", &thread_index))
1822 if (hw_if_index == (
u32) ~ 0)
1881 .path =
"set interface rx-placement",
1882 .short_help =
"set interface rx-placement <interface> [queue <n>] " 1883 "[worker <n> | main]",
1907 u32 hw_if_index = (
u32) ~ 0;
1919 if (
unformat (line_input,
"list %U", unformat_bitmap_list, &bitmap))
1932 if (hw_if_index == (
u32) ~ 0)
1966 .path =
"set interface rss queues",
1967 .short_help =
"set interface rss queues <interface> <list <queue-list>>",
1976 int type = va_arg (*args,
int);
2002 s =
format (s,
"unknown type %d!", type);
2021 (vm,
"pcap %U dispatch capture enabled: %d of %d pkts...",
2037 return VNET_API_ERROR_INVALID_VALUE;
2042 return VNET_API_ERROR_VALUE_EXIST;
2048 return VNET_API_ERROR_INVALID_VALUE_2;
2054 (set->table_indices == 0 || set->table_indices[0] == ~0))
2055 return VNET_API_ERROR_NO_SUCH_LABEL;
2059 void *save_pcap_data;
2063 return VNET_API_ERROR_INVALID_MEMORY_SIZE;
2074 memset (pm, 0,
sizeof (*pm));
2088 stem =
format (stem,
"rx");
2090 stem =
format (stem,
"tx");
2092 stem =
format (stem,
"drop");
2138 return VNET_API_ERROR_SYSCALL_ERROR_1;
2146 return VNET_API_ERROR_NO_SUCH_ENTRY;
2161 u32 max_bytes_per_pkt = 512;
2165 int preallocate_data = 0;
2166 int drop_enable = 0;
2180 else if (
unformat (line_input,
"tx"))
2182 else if (
unformat (line_input,
"drop"))
2184 else if (
unformat (line_input,
"off"))
2185 rx_enable = tx_enable = drop_enable = 0;
2186 else if (
unformat (line_input,
"max-bytes-per-pkt %u",
2187 &max_bytes_per_pkt))
2189 else if (
unformat (line_input,
"max %d", &max))
2191 else if (
unformat (line_input,
"packets-to-capture %d", &max))
2196 else if (
unformat (line_input,
"status %=", &status, 1))
2198 else if (
unformat (line_input,
"intfc %U",
2201 else if (
unformat (line_input,
"interface %U",
2204 else if (
unformat (line_input,
"preallocate-data %=",
2205 &preallocate_data, 1))
2207 else if (
unformat (line_input,
"free-data %=", &free_data, 1))
2209 else if (
unformat (line_input,
"intfc any")
2210 ||
unformat (line_input,
"interface any"))
2212 else if (
unformat (line_input,
"filter"))
2243 case VNET_API_ERROR_INVALID_VALUE:
2246 case VNET_API_ERROR_VALUE_EXIST:
2249 case VNET_API_ERROR_INVALID_VALUE_2:
2251 (0,
"can't change number of records to capture while tracing...");
2253 case VNET_API_ERROR_SYSCALL_ERROR_1:
2256 case VNET_API_ERROR_NO_SUCH_ENTRY:
2259 case VNET_API_ERROR_INVALID_MEMORY_SIZE:
2261 "Max bytes per pkt must be > 32, < 9000...");
2263 case VNET_API_ERROR_NO_SUCH_LABEL:
2265 (0,
"No classify filter configured, see 'classify filter...'");
2351 .path =
"pcap trace",
2353 "pcap trace [rx] [tx] [drop] [off] [max <nn>] [intfc <interface>|any]\n" 2354 " [file <name>] [status] [max-bytes-per-pkt <nnnn>][filter]\n" 2355 " [preallocate-data][free-data]",
unformat_function_t unformat_vnet_hw_interface
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
static clib_error_t * clear_interface_counters(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
format_function_t format_vnet_sw_interface
static clib_error_t * create_sub_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define hash_set(h, key, value)
char * file_name
File name of pcap output.
static clib_error_t * promiscuous_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * set_hw_class(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
clib_error_t * set_hw_interface_rx_placement(u32 hw_if_index, u32 queue_id, u32 thread_index, u8 is_main)
clib_error_t * set_interface_rss_queues(vlib_main_t *vm, u32 hw_if_index, clib_bitmap_t *bitmap)
static int sw_interface_name_compare(void *a1, void *a2)
void vnet_sw_interface_ip_directed_broadcast(vnet_main_t *vnm, u32 sw_if_index, u8 enable)
static clib_error_t * set_state(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vl_api_wireguard_peer_flags_t flags
uword first_worker_thread_index
u32 n_packets_to_capture
Number of packets to capture.
static ip6_fib_t * ip6_fib_get(fib_node_index_t index)
static clib_error_t * set_interface_mac_address(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
mac_address_t * secondary_addrs
vnet_main_t * vnet_get_main(void)
u8 * format_l2_output_features(u8 *s, va_list *args)
unformat_function_t unformat_hash_string
vnet_interface_main_t interface_main
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
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).
word vnet_sw_interface_compare(vnet_main_t *vnm, uword sw_if_index0, uword sw_if_index1)
int vnet_interface_name_renumber(u32 sw_if_index, u32 new_show_dev_instance)
static void vnet_clear_sw_interface_tag(vnet_main_t *vnm, u32 sw_if_index)
static clib_error_t * set_tag(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * renumber_interface_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define hash_set_mem(h, key, value)
ip_lookup_main_t lookup_main
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
uword * sub_interface_sw_if_index_by_id
u32 * fib_index_by_sw_if_index
Table index indexed by software interface.
unformat_function_t unformat_vnet_sw_interface
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
static clib_error_t * clear_hw_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
struct _vnet_device_class vnet_device_class_t
uword * dq_runtime_index_by_queue
static u8 * format_vnet_pcap(u8 *s, va_list *args)
format_function_t format_vnet_sw_if_index_name
static clib_error_t * interface_add_del_mac_address(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
uword last_worker_thread_index
ethernet_main_t ethernet_main
vnet_hw_interface_rx_mode
format_function_t format_vnet_hw_interface
PCAP main state data structure.
clib_spinlock_t lock
spinlock to protect e.g.
void vlib_clear_combined_counters(vlib_combined_counter_main_t *cm)
Clear a collection of combined counters.
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
static vnet_device_class_t * vnet_get_device_class(vnet_main_t *vnm, u32 dev_class_index)
#define vec_new(T, N)
Create new vector of given type and length (unspecified alignment, no header).
vlib_combined_counter_main_t * combined_sw_if_counters
static clib_error_t * parse_vlan_sub_interfaces(unformat_input_t *input, vnet_sw_interface_t *template)
Parse subinterface names.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
u32 filter_classify_table_index
#define clib_error_return(e, args...)
static clib_error_t * set_unnumbered(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
A collection of simple counters.
u8 * vnet_trace_placeholder
void vnet_sw_interface_set_protocol_mtu(vnet_main_t *vnm, u32 sw_if_index, u32 mtu[])
static clib_error_t * mtu_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void clib_spinlock_init(clib_spinlock_t *p)
u32 max_supported_packet_bytes
vl_api_fib_path_type_t type
vnet_hw_interface_t * hw_interfaces
clib_error_t * pcap_close(pcap_main_t *pm)
Close PCAP file.
vlib_worker_thread_t * vlib_worker_threads
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
l2_output_config_t * l2output_intf_config(u32 sw_if_index)
Get a pointer to the config for the given interface.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
u8 * pcap_data
Vector of pcap data.
int vnet_pcap_dispatch_trace_configure(vnet_pcap_dispatch_trace_args_t *a)
int vnet_hw_interface_get_rx_mode(vnet_main_t *vnm, u32 hw_if_index, u16 queue_id, vnet_hw_interface_rx_mode *mode)
uword * sw_if_index_by_sup_and_sub
vnet_sw_interface_flags_t flags
clib_error_t * set_hw_interface_change_rx_mode(vnet_main_t *vnm, u32 hw_if_index, u8 queue_id_valid, u32 queue_id, vnet_hw_interface_rx_mode mode)
static clib_error_t * show_sw_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vlib_simple_counter_main_t * sw_if_counters
word vnet_hw_interface_compare(vnet_main_t *vnm, uword hw_if_index0, uword hw_if_index1)
static clib_error_t * set_interface_rx_placement(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void vnet_sw_interface_update_unnumbered(u32 unnumbered_sw_if_index, u32 ip_sw_if_index, u8 enable)
#define foreach_vlib_main(body)
static int compare_interface_names(void *a1, void *a2)
uword * hw_interface_class_by_name
vl_api_tunnel_mode_t mode
clib_error_t * vnet_hw_interface_set_rss_queues(vnet_main_t *vnm, vnet_hw_interface_t *hi, clib_bitmap_t *bitmap)
#define VNET_HW_INTERFACE_BOND_INFO_SLAVE
static clib_error_t * set_interface_rss_queues_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * clear_tag(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void vnet_interface_features_show(vlib_main_t *vm, u32 sw_if_index, int verbose)
Display the set of driver features configured on a specific interface Called by "show interface" hand...
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
static ip4_fib_t * ip4_fib_get(u32 index)
Get the FIB at the given index.
#define clib_warning(format, args...)
#define ETHERNET_INTERFACE_FLAG_ACCEPT_ALL
clib_error_t * pcap_write(pcap_main_t *pm)
Write PCAP file.
static clib_error_t * pcap_trace_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 unnumbered_sw_if_index
#define VLIB_CLI_COMMAND(x,...)
struct _vnet_classify_main vnet_classify_main_t
uword unformat_ethernet_address(unformat_input_t *input, va_list *args)
#define PCAP_MAIN_INIT_DONE
void vnet_hw_interface_assign_rx_thread(vnet_main_t *vnm, u32 hw_if_index, u16 queue_id, uword thread_index)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
ip_lookup_main_t lookup_main
static void vnet_set_sw_interface_tag(vnet_main_t *vnm, u8 *tag, u32 sw_if_index)
Bitmaps built as vectors of machine words.
#define clib_error_report(e)
#define clib_bitmap_free(v)
Free a bitmap.
vnet_classify_main_t vnet_classify_main
static u8 * vnet_get_sw_interface_tag(vnet_main_t *vnm, u32 sw_if_index)
static clib_error_t * show_hw_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void * clib_mem_alloc(uword size)
uword unformat_ethernet_interface(unformat_input_t *input, va_list *args)
static vlib_main_t * vlib_get_main(void)
#define vec_elt(v, i)
Get vector value at index i.
static clib_error_t * show_or_clear_hw_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd, int is_show)
static clib_error_t * show_interface_sec_mac_addr_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
pcap_packet_type_t packet_type
Packet type.
void vnet_hw_interface_set_mtu(vnet_main_t *vnm, u32 hw_if_index, u32 mtu)
ethernet_interface_t * ethernet_get_interface(ethernet_main_t *em, u32 hw_if_index)
static void show_bond(vlib_main_t *vm)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
unformat_function_t unformat_vnet_sw_interface_flags
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
static clib_error_t * vnet_interface_cli_init(vlib_main_t *vm)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
vnet_sw_interface_t * sw_interfaces
static clib_error_t * set_ip_directed_broadcast(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * set_hw_interface_rx_mode(vnet_main_t *vnm, u32 hw_if_index, u32 queue_id, vnet_hw_interface_rx_mode mode)
l2_bridge_domain_t * bd_configs
A collection of combined counters.
#define hash_get_mem(h, key)
int vnet_hw_interface_unassign_rx_thread(vnet_main_t *vnm, u32 hw_if_index, u16 queue_id)
u32 l2vtr_get(vlib_main_t *vlib_main, vnet_main_t *vnet_main, u32 sw_if_index, u32 *vtr_op, u32 *push_dot1q, u32 *vtr_tag1, u32 *vtr_tag2)
Get vtag tag rewrite on the given interface.
u32 min_supported_packet_bytes
void vlib_clear_simple_counters(vlib_simple_counter_main_t *cm)
Clear a collection of simple counters.
ip4_main_t ip4_main
Global ip4 main structure.
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags)
u8 * format_mac_address_t(u8 *s, va_list *args)
#define vec_foreach(var, vec)
Vector iterator.
vnet_hw_interface_rx_mode default_rx_mode
vnet_device_class_t * device_classes
u32 bd_find_index(bd_main_t *bdm, u32 bd_id)
Get a bridge domain.
int vnet_hw_interface_set_rx_mode(vnet_main_t *vnm, u32 hw_if_index, u16 queue_id, vnet_hw_interface_rx_mode mode)
static clib_error_t * set_interface_rx_mode(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
clib_error_t * vnet_hw_interface_add_del_mac_address(vnet_main_t *vnm, u32 hw_if_index, const u8 *mac_address, u8 is_add)
clib_error_t * vnet_hw_interface_change_mac_address(vnet_main_t *vnm, u32 hw_if_index, const u8 *mac_address)
clib_error_t * vnet_create_sw_interface(vnet_main_t *vnm, vnet_sw_interface_t *template, u32 *sw_if_index)
#define CLIB_CACHE_LINE_BYTES
u32 * fib_index_by_sw_if_index
u32 n_packets_captured
Number of packets currently captured.
static clib_error_t * show_interface_rx_placement_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
format_function_t format_vtr
vnet_device_main_t vnet_device_main
vl_api_interface_index_t sw_if_index
u32 ethernet_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
clib_error_t * vnet_hw_interface_set_class(vnet_main_t *vnm, u32 hw_if_index, u32 hw_class_index)
static uword pool_elts(void *v)
Number of active elements in a pool.