FD.io VPP  v17.10-9-gd594711
Vector Packet Processing
Command line session

exec

Summary/usage

Execute commands from file.

Description

Executes a sequence of CLI commands which are read from a file.

If a command is unrecognised or otherwise invalid then the usual CLI feedback will be generated, however execution of subsequent commands from the file will continue.

Declaration and implementation

Declaration: cli_exec (src/vlib/unix/cli.c line 3015)

Implementation: unix_cli_exec.

history

Summary/usage

Show current session command history.

Description

Displays the command history for the current session, if any.

Declaration and implementation

Declaration: cli_unix_cli_show_history (src/vlib/unix/cli.c line 3130)

Implementation: unix_cli_show_history.

quit

Summary/usage

Exit CLI.

Description

Terminates the current CLI session.

If VPP is running in interactive mode and this is the console session (that is, the session on stdin) then this will also terminate VPP.

Declaration and implementation

Declaration: unix_cli_quit_command (src/vlib/unix/cli.c line 2942)

Implementation: unix_cli_quit.

set terminal ansi

Summary/usage

set terminal ansi [on|off].

Description

Enables or disables the use of ANSI control sequences by this terminal. The default will vary based on terminal detection at the start of the session.

ANSI control sequences are used in a small number of places to provide, for example, color text output and to control the cursor in the pager.

Declaration and implementation

Declaration: cli_unix_cli_set_terminal_ansi (src/vlib/unix/cli.c line 3447)

Implementation: unix_cli_set_terminal_ansi.

set terminal history

Summary/usage

set terminal history [on|off] [limit <lines>].

Description

Enables or disables the command history function of the current terminal. Generally this defaults to enabled.

This command also allows the maximum size of the history buffer for this session to be altered.

Declaration and implementation

Declaration: cli_unix_cli_set_terminal_history (src/vlib/unix/cli.c line 3406)

Implementation: unix_cli_set_terminal_history.

set terminal pager

Summary/usage

set terminal pager [on|off] [limit <lines>].

Description

Enables or disables the terminal pager for this session. Generally this defaults to enabled.

Additionally allows the pager buffer size to be set; though note that this value is set globally and not per session.

Declaration and implementation

Declaration: cli_unix_cli_set_terminal_pager (src/vlib/unix/cli.c line 3340)

Implementation: unix_cli_set_terminal_pager.

show cli-sessions

Summary/usage

Show current CLI sessions.

Description

Displays a summary of all the current CLI sessions.

Typically used to diagnose connection issues with the CLI socket.

Example usage
vpp# show cli-sessions
PNI   FD    Name                 Flags
343   0     unix-cli-stdin       IslpA
344   7     unix-cli-local:20    ISlpA
346   8     unix-cli-local:21    iSLpa

In this example we have the debug console of the running process on stdin/out, we have an interactive socket session and we also have a non-interactive socket session.

Fields:

  • PNI: Process node index.
  • FD: Unix file descriptor.
  • Name: Name of the session.
  • Flags: Various flags that describe the state of the session.

Flags have the following meanings; lower-case typically negates upper-case:

  • I Interactive session.
  • S Connected by socket.
  • s Not a socket, likely stdin.
  • L Line-by-line mode.
  • l Char-by-char mode.
  • P EPIPE detected on connection; it will close soon.
  • A ANSI-capable terminal.

Declaration and implementation

Declaration: cli_unix_cli_show_cli_sessions (src/vlib/unix/cli.c line 3281)

Implementation: unix_cli_show_cli_sessions.

show terminal

Summary/usage

Show current session terminal settings.

Description

Displays various information about the state of the current terminal session.

Example usage
vpp# show terminal
Terminal name:   unix-cli-stdin
Terminal mode:   char-by-char
Terminal width:  123
Terminal height: 48
ANSI capable:    yes
Interactive:     yes
History enabled: yes
History limit:   50
Pager enabled:   yes
Pager limit:     100000
CRLF mode:       LF

Declaration and implementation

Declaration: cli_unix_cli_show_terminal (src/vlib/unix/cli.c line 3200)

Implementation: unix_cli_show_terminal.

show unix-errors

Summary/usage

Show Unix system call error history.

Declaration and implementation

Declaration: cli_unix_show_errors (src/vlib/unix/cli.c line 3091)

Implementation: unix_show_errors.