FD.io VPP  v16.09
Vector Packet Processing
interface_cli.c File Reference

Interface CLI. More...

+ Include dependency graph for interface_cli.c:

Go to the source code of this file.

Functions

static int compare_interface_names (void *a1, void *a2)
 
static clib_error_tshow_or_clear_hw_interfaces (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static int sw_interface_name_compare (void *a1, void *a2)
 
static clib_error_tshow_sw_interfaces (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tclear_interface_counters (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tparse_vlan_sub_interfaces (unformat_input_t *input, vnet_sw_interface_t *template)
 Parse subinterface names. More...
 
static clib_error_tcreate_sub_interfaces (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tset_state (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tset_unnumbered (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tset_hw_class (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tvnet_interface_cli_init (vlib_main_t *vm)
 
static clib_error_trenumber_interface_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tpromiscuous_cmd (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tmtu_cmd (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static vlib_cli_command_t show_hw_interfaces_command
 (constructor) VLIB_CLI_COMMAND (show_hw_interfaces_command) More...
 
static vlib_cli_command_t clear_hw_interface_counters_command
 (constructor) VLIB_CLI_COMMAND (clear_hw_interface_counters_command) More...
 
static vlib_cli_command_t show_sw_interfaces_command
 (constructor) VLIB_CLI_COMMAND (show_sw_interfaces_command) More...
 
static vlib_cli_command_t vnet_cli_interface_command
 (constructor) VLIB_CLI_COMMAND (vnet_cli_interface_command) More...
 
static vlib_cli_command_t vnet_cli_set_interface_command
 (constructor) VLIB_CLI_COMMAND (vnet_cli_set_interface_command) More...
 
static vlib_cli_command_t clear_interface_counters_command
 (constructor) VLIB_CLI_COMMAND (clear_interface_counters_command) More...
 
static vlib_cli_command_t create_sub_interfaces_command
 (constructor) VLIB_CLI_COMMAND (create_sub_interfaces_command) More...
 
static vlib_cli_command_t set_state_command
 (constructor) VLIB_CLI_COMMAND (set_state_command) More...
 
static vlib_cli_command_t set_unnumbered_command
 (constructor) VLIB_CLI_COMMAND (set_unnumbered_command) More...
 
static vlib_cli_command_t set_hw_class_command
 (constructor) VLIB_CLI_COMMAND (set_hw_class_command) More...
 
static vlib_cli_command_t renumber_interface_command
 (constructor) VLIB_CLI_COMMAND (renumber_interface_command) More...
 
static vlib_cli_command_t set_interface_promiscuous_cmd
 (constructor) VLIB_CLI_COMMAND (set_interface_promiscuous_cmd) More...
 
static vlib_cli_command_t set_interface_mtu_cmd
 (constructor) VLIB_CLI_COMMAND (set_interface_mtu_cmd) More...
 

Detailed Description

Interface CLI.

Definition in file interface_cli.c.

Function Documentation

static clib_error_t* clear_interface_counters ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 412 of file interface_cli.c.

+ Here is the call graph for this function:

static int compare_interface_names ( void *  a1,
void *  a2 
)
static

Definition at line 50 of file interface_cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* create_sub_interfaces ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 585 of file interface_cli.c.

+ Here is the call graph for this function:

static clib_error_t* mtu_cmd ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 991 of file interface_cli.c.

+ Here is the call graph for this function:

static clib_error_t* parse_vlan_sub_interfaces ( unformat_input_t input,
vnet_sw_interface_t template 
)
static

Parse subinterface names.

The following subinterface syntax is supported. The first two are for backwards compatability:

<intf-name> <id>

  • a subinterface with the name <intf-name>.<id>. The subinterface is a single dot1q vlan with vlan id <id> and exact-match semantics.

<intf-name> <min_id>-<max_id>

  • a set of the above subinterfaces, repeating for each id in the range <min_id> to <max_id>

In the following, exact-match semantics (i.e. the number of vlan tags on the packet must match the number of tags in the configuration) are used only if the keyword exact-match is present. Non-exact match is the default.

<intf-name> <id> dot1q <outer_id> [exact-match]

  • a subinterface with the name <intf-name>.<id>. The subinterface is a single dot1q vlan with vlan id <outer_id>.

<intf-name> <id> dot1q any [exact-match]

  • a subinterface with the name <intf-name>.<id>. The subinterface is a single dot1q vlan with any vlan id.

<intf-name> <id> dot1q <outer_id> inner-dot1q <inner_id> [exact-match]

  • a subinterface with the name <intf-name>.<id>. The subinterface is a double dot1q vlan with outer vlan id <outer_id> and inner vlan id <inner_id>.

<intf-name> <id> dot1q <outer_id> inner-dot1q any [exact-match]

  • a subinterface with the name <intf-name>.<id>. The subinterface is a double dot1q vlan with outer vlan id <id> and any inner vlan id.

<intf-name> <id> dot1q any inner-dot1q any [exact-match]

- a subinterface with the name <intf-name>.<id>. The subinterface
  is a double dot1q vlan with any outer vlan id and any inner vlan id.

For each of the above CLI, there is a duplicate that uses the keyword "dot1ad" in place of the first "dot1q". These interfaces use ethertype 0x88ad in place of 0x8100 for the outer ethertype. Note that for double- tagged packets the inner ethertype is always 0x8100. Also note that the dot1q and dot1ad naming spaces are independent, so it is legal to have both "Gig3/0/0.1 dot1q 100" and "Gig3/0/0.2 dot1ad 100". For example:

<intf-name> <id> dot1ad <outer_id> inner-dot1q <inner_id> [exact-match]

  • a subinterface with the name <intf-name>.<id>. The subinterface is a double dot1ad vlan with outer vlan id <outer_id> and inner vlan id <inner_id>.

<intf-name> <id> untagged

  • a subinterface with the name <intf-name>.<id>. The subinterface has no vlan tags. Only one can be specified per interface.

<intf-name> <id> default

  • a subinterface with the name <intf-name>.<id>. This is associated with a packet that did not match any other configured subinterface on this interface. Only one can be specified per interface.

Definition at line 531 of file interface_cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* promiscuous_cmd ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 955 of file interface_cli.c.

+ Here is the call graph for this function:

static clib_error_t* renumber_interface_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 913 of file interface_cli.c.

+ Here is the call graph for this function:

static clib_error_t* set_hw_class ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 864 of file interface_cli.c.

+ Here is the call graph for this function:

static clib_error_t* set_state ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 757 of file interface_cli.c.

+ Here is the call graph for this function:

static clib_error_t* set_unnumbered ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 806 of file interface_cli.c.

+ Here is the call graph for this function:

static clib_error_t* show_or_clear_hw_interfaces ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 59 of file interface_cli.c.

+ Here is the call graph for this function:

static clib_error_t* show_sw_interfaces ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 219 of file interface_cli.c.

+ Here is the call graph for this function:

static int sw_interface_name_compare ( void *  a1,
void *  a2 
)
static

Definition at line 209 of file interface_cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* vnet_interface_cli_init ( vlib_main_t vm)
static

Definition at line 905 of file interface_cli.c.

+ Here is the caller graph for this function:

Variable Documentation

vlib_cli_command_t clear_hw_interface_counters_command
static
Initial value:
= {
.path = "clear hardware-interfaces",
.short_help = "Clear hardware interfaces statistics",
}
static clib_error_t * show_or_clear_hw_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: interface_cli.c:59

(constructor) VLIB_CLI_COMMAND (clear_hw_interface_counters_command)

Definition at line 201 of file interface_cli.c.

vlib_cli_command_t clear_interface_counters_command
static
Initial value:
= {
.path = "clear interfaces",
.short_help = "Clear interfaces statistics",
}
static clib_error_t * clear_interface_counters(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (clear_interface_counters_command)

Definition at line 461 of file interface_cli.c.

vlib_cli_command_t create_sub_interfaces_command
static
Initial value:
= {
.path = "create sub-interfaces",
.short_help = "create sub-interfaces <nn>[-<nn>] [dot1q|dot1ad|default|untagged]",
.function = create_sub_interfaces,
}
static clib_error_t * create_sub_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (create_sub_interfaces_command)

Definition at line 749 of file interface_cli.c.

vlib_cli_command_t renumber_interface_command
static
Initial value:
= {
.path = "renumber interface",
.short_help = "renumber interface <if-name> <new-dev-instance>",
}
static clib_error_t * renumber_interface_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (renumber_interface_command)

Definition at line 947 of file interface_cli.c.

vlib_cli_command_t set_hw_class_command
static
Initial value:
= {
.path = "set interface hw-class",
.short_help = "Set interface hardware class",
.function = set_hw_class,
}
static clib_error_t * set_hw_class(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (set_hw_class_command)

Definition at line 897 of file interface_cli.c.

vlib_cli_command_t set_interface_mtu_cmd
static
Initial value:
= {
.path = "set interface mtu",
.short_help = "set interface mtu <value> <intfc>",
.function = mtu_cmd,
}
static clib_error_t * mtu_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (set_interface_mtu_cmd)

Definition at line 1029 of file interface_cli.c.

vlib_cli_command_t set_interface_promiscuous_cmd
static
Initial value:
= {
.path = "set interface promiscuous",
.short_help = "set interface promiscuous [on | off] <intfc>",
.function = promiscuous_cmd,
}
static clib_error_t * promiscuous_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (set_interface_promiscuous_cmd)

Definition at line 983 of file interface_cli.c.

vlib_cli_command_t set_state_command
static
Initial value:
= {
.path = "set interface state",
.short_help = "Set interface state",
.function = set_state,
}
static clib_error_t * set_state(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (set_state_command)

Definition at line 798 of file interface_cli.c.

vlib_cli_command_t set_unnumbered_command
static
Initial value:
= {
.path = "set interface unnumbered",
.short_help = "set interface unnumbered [<intfc> use <intfc>][del <intfc>]",
.function = set_unnumbered,
}
static clib_error_t * set_unnumbered(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (set_unnumbered_command)

Definition at line 854 of file interface_cli.c.

vlib_cli_command_t show_hw_interfaces_command
static
Initial value:
= {
.path = "show hardware-interfaces",
.short_help = "show hardware-interfaces [brief|verbose|detail] [bond] [<if-name1> <if-name2> ...]",
}
static clib_error_t * show_or_clear_hw_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: interface_cli.c:59

(constructor) VLIB_CLI_COMMAND (show_hw_interfaces_command)

Definition at line 193 of file interface_cli.c.

vlib_cli_command_t show_sw_interfaces_command
static
Initial value:
= {
.path = "show interfaces",
.short_help = "show interfaces [address|addr] [<if-name1> <if-name2> ...]",
.function = show_sw_interfaces,
}
static clib_error_t * show_sw_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (show_sw_interfaces_command)

Definition at line 389 of file interface_cli.c.

vlib_cli_command_t vnet_cli_interface_command
static
Initial value:
= {
.path = "interface",
.short_help = "Interface commands",
}

(constructor) VLIB_CLI_COMMAND (vnet_cli_interface_command)

Definition at line 398 of file interface_cli.c.

vlib_cli_command_t vnet_cli_set_interface_command
static
Initial value:
= {
.path = "set interface",
.short_help = "Interface commands",
}

(constructor) VLIB_CLI_COMMAND (vnet_cli_set_interface_command)

Definition at line 405 of file interface_cli.c.