title: x2gosetkeyboard(8)

text:
# x2gosetkeyboard(8)

## NAME
x2gosetkeyboard - Allow server-side Keyboard Setting Updates issued by X2Go Client

## SYNOPSIS

x2gosetkeyboard

## DESCRIPTION
x2gosetkeyboard looks for a 'keyboard' file in the X2Go session directory and introspects the X2Go session keyboard settings requested from the client side.

If no 'keyboard' file is present in the X2Go session directory, nothing happens (i.e. no error will be raised).

## RETURN VALUES
If x2gosetkeyboard successfully sets the session's keyboard parameters an exit code of 0 is returned. Also, if the file ${HOME}/.x2go/C-${X2GO_SESSION}/keyboard is not presented at the expected location, a zero-exitcode is returned.

If the command fails on its way, then the exitcode of the failing command is returned.

## FILES
${HOME}/.x2go/C-${X2GO_SESSION}/keyboard

## AUTHOR
This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).


title: x2goshowblocks(8)

summary: Show X2Go-Mounted Block Devices

text:
# x2goshowblocks(8)

## NAME
x2goshowblocks - Show X2Go-Mounted Block Devices

## SYNOPSIS

x2goshowblocks <username> <session_id>

## DESCRIPTION
x2goshowblocks lists mounted shares for user <username> and X2Go session with ID <session_id>.

The x2goshowblocks must be run with root privileges.

## SEE ALSO
x2gomountdirs(8), x2goumount-session(8)

## AUTHOR
This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).


title: x2gostartagent(8)

summary: Start a New X2Go Session

text:
# x2gostartagent(8)

## NAME
x2gostartagent - Start a New X2Go Session

## SYNOPSIS

x2gostartagent <geometry> \

<link_quality> \

<nx_pack_meth> \

<cache_type+dpi> \

<kblayout> \

<kbtype> \

<setkbd> \

<session_type> \

<command> \

<clipboardmode> \

## DESCRIPTION
x2gostartagent coordinates the startup process of a new X2Go session. It expects quite a list of parameters, all of which are obligatory.

x2gostartagent is run with X2Go user privileges and normally executed by an X2Go client application.

## ARGUMENTS
<geometry>

Session window size on screen (allowed values: <width>x<height> or fullscreen).

<link_quality>

Any value out of: modem, isdn, adsl, wan or lan.

<nx_pack_method>

NX compression method (see below for possible values).

<cache_type+dpi>

Cache type and color depth for X2Go session window. The most common value is: unix-kde-depth_24 where ,,24'' is the color depth in bit.

<kblayout>

Keyboard layout (e.g. us, de, etc.).

<kbtype>

Keyboard type/model (e.g. pc105/us).

<setkbd>

Force setting keyboard layout and type within the X2Go session on startup. Values: 0 or 1.

<session_type>

Allowed values for <session_type> are: D (desktop), R (rootless) or S (shadow session, X2Go desktop sharing).

<command>

The command given by the <command> argument is only used to create the session ID for this new X2Go session. The actual execution of a command is handled by x2goruncommand.

<clipboardmode>

The session's clipboard mode. Possible values: both, server, client, none. Allows one to configure clipboard security per session via the connecting X2Go client. If the clipboard parameter is set server-side in /etc/x2go/x2goagent.options, then that value will override client-side settings.

## RETURN VALUES
A list of session attributes is returned after successful session startup. Session attributes will be presented on a line-by-line basis:

field 01: <X_display_number>

field 02: <session_cookie_hash>

field 03: <agent_pid>

field 04: <session_id>

field 05: <graphics_port>

field 06: <sound_port>

field 07: <sshfs_port>

field 08: <tekictrl_port> (if Telekinesis is available/enabled)

field 09: <tekidata_port> (if Telekinesis is available/enabled)

## NX COMPRESSION METHODS
As NX compression methods (<link-quality> argument) the following values are possible. The % character must be replaced by a digit 0-9.

nopack, 8, 64, 256, 512, 4k, 32k, 64k, 256k, 2m, 16m 256-rdp, 256-rdp-compressed, 32k-rdp, 32k-rdp-compressed, 64k-rdp 64k-rdp-compressed, 16m-rdp, 16m-rdp-compressed rfb-hextile, rfb-tight, rfb-tight-compressed 8-tight, 64-tight, 256-tight, 512-tight, 4k-tight, 32k-tight 64k-tight, 256k-tight, 2m-tight, 16m-tight 8-jpeg-%, 64-jpeg, 256-jpeg, 512-jpeg, 4k-jpeg, 32k-jpeg 64k-jpeg, 256k-jpeg, 2m-jpeg, 16m-jpeg-% 8-png-jpeg-%, 64-png-jpeg, 256-png-jpeg, 512-png-jpeg, 4k-png-jpeg 32k-png-jpeg, 64k-png-jpeg, 256k-png-jpeg, 2m-png-jpeg, 16m-png-jpeg-% 8-png-%, 64-png, 256-png, 512-png, 4k-png 32k-png, 64k-png, 256k-png, 2m-png, 16m-png-% 16m-rgb-%, 16m-rle-%

## SEE ALSO
x2goruncommand(8), x2goresume-session(8), x2gosuspend-session(8), x2goterminate-session(8)

## AUTHOR
This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).


title: x2gosuspend-desktopsharing(8)

text:
# x2gosuspend-desktopsharing(8)

## NAME
x2gosuspend-desktopsharing - Suspend Desktop Sharing for a given X2Go Session

## SYNOPSIS

x2gosuspend-desktopsharing <session_id>

## DESCRIPTION
x2gosuspend-desktopsharing executes x2goterminate-desktopsharing and places a reminder file

,,resume-desktopsharing''

into

$HOME/.x2go/C-<session_id>/

so that x2godesktopsharing can be resumed on session resume.

x2gosuspend-desktopsharing is run with normal user privileges and it is used from within X2Go Server. There normally is no need to execute this command manually.

## RETURN VALUES
As exitcode x2gosuspend-desktopsharing always returns 0.

## SEE ALSO
x2godesktopsharing(1), x2gosuspend-session(8), x2goterminate-desktopsharing(8), x2goresume-desktopsharing(8)

## AUTHOR
This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).


title: x2gosuspend-session(8)

summary: Suspend an X2Go Session

text:
# x2gosuspend-session(8)

## NAME
x2gosuspend-session - Suspend an X2Go Session

## SYNOPSIS

x2gosuspend-session <session_id>

## DESCRIPTION
x2gosuspend-session suspends the running session with session ID <session_id>.

This command is normally issued by an X2Go client application with X2Go user privileges.

## RETURN VALUES
x2gosuspend-session reports to stderr if resuming of session <session_id> failed. This very probably means that the session's X agent has died, so the session <session_id> will be marked as finished in the X2Go session database.

As exitcode x2gosuspend-session always returns 0.

## SEE ALSO
x2gostartagent(8), x2goruncommand(8), x2goresume-session(8), x2goterminate-session(8)

## AUTHOR
This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).


title: x2goterminate-desktopsharing(8)

text:
# x2goterminate-desktopsharing(8)

## NAME
x2goterminate-desktopsharing - Cleanly Terminate Desktop Sharing for a given X2Go Session

## SYNOPSIS

x2goterminate-desktopsharing <session_id>

## DESCRIPTION
x2goterminate-desktopsharing allows one to detect a running and associated x2godesktopsharing applet and to cleanly terminate this applet.

x2goterminate-desktopsharing is run with normal user privileges and it is used from within X2Go Server. There normally is no need to execute this command manually.

## RETURN VALUES
As exitcode x2goterminate-desktopsharing returns 0 if a x2godesktopsharing process could be identified and terminated. If not, the exit code is -1.

## SEE ALSO
x2godesktopsharing(1), x2goteminate-session(8), x2gosuspend-desktopsharing(8), x2goresume-desktopsharing(8)

## AUTHOR
This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).


title: x2goterminate-session(8)

summary: Terminate an X2Go Session

text:
# x2goterminate-session(8)

## NAME
x2goterminate-session - Terminate an X2Go Session

## SYNOPSIS

x2goterminate-session <session_id>

## DESCRIPTION
x2goterminate-session cleanly terminates the running or suspended session with session ID <session_id>.

This command is normally issued by an X2Go client application with X2Go user privileges.

## RETURN VALUES
By x2goterminate-session nothing is reported on stdout or stderr.

As exitcode x2goterminate-session always returns 0.

## SEE ALSO
x2gostartagent(8), x2goruncommand(8), x2goresume-session(8), x2gosuspend-session(8)

## AUTHOR
This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).


title: x2goumount-session(8)

text:
# x2goumount-session(8)

## NAME
x2goumount-session - Unshare mounted Folders from X2Go Session

## SYNOPSIS

x2goumount-session <session_id> [<local_path_on_client>]

## DESCRIPTION
x2goumount-session is used to unshare client folders from X2Go session with session ID <session_id>. Shared folders have been previously mounted into the X2Go session by the x2gomountdirs command.

x2goumount-session is run with X2Go user privileges and normally issued by an X2Go client application.

## ARGUMENTS
<session_id>

Unmount shared folder(s) as registered for X2Go session ID <session_id> in the X2Go session database.

<local_path_on_client>

Optionally, you can name a local path name (path name as found on the client-side) here. If given, only the named folder is unshared from the X2Go session <session_id>.

If this optional argument is omitted, then ALL session folders will be unshared (including spool folders for printing and MIME box).

## RETURN VALUES
By x2goumount-session nothing is reported on stdout or stderr.

As exitcode x2goumount-session return 0 on successful an umount action. If there is a failure during unmounting a shared folder a non-zero exit code is returned.

## SEE ALSO
x2gomountdirs(8)

## AUTHOR
This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).


title: x2goumount_session(8)

text:
# x2goumount_session(8)

## NAME
x2goumount-session - Unshare mounted Folders from X2Go Session

## SYNOPSIS

x2goumount-session <session_id> [<local_path_on_client>]

## DESCRIPTION
x2goumount-session is used to unshare client folders from X2Go session with session ID <session_id>. Shared folders have been previously mounted into the X2Go session by the x2gomountdirs command.

x2goumount-session is run with X2Go user privileges and normally issued by an X2Go client application.

## ARGUMENTS
<session_id>

Unmount shared folder(s) as registered for X2Go session ID <session_id> in the X2Go session database.

<local_path_on_client>

Optionally, you can name a local path name (path name as found on the client-side) here. If given, only the named folder is unshared from the X2Go session <session_id>.

If this optional argument is omitted, then ALL session folders will be unshared (including spool folders for printing and MIME box).

## RETURN VALUES
By x2goumount-session nothing is reported on stdout or stderr.

As exitcode x2goumount-session return 0 on successful an umount action. If there is a failure during unmounting a shared folder a non-zero exit code is returned.

## SEE ALSO
x2gomountdirs(8)

## AUTHOR
This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).


title: x2goversion(8)

text:
# x2goversion(8)

## NAME
x2goversion - Retrieve Code Versions of X2Go Server Components

## SYNOPSIS

x2goversion [<x2go-component>]

## DESCRIPTION
x2goversion allows one to retrieve code versions of X2Go server components.

If the [<x2go-component>] parameter is omitted then a list of all available X2Go server component names and versions is listed.

If an X2Go component is specified with the [<x2go-component>] parameter, then only the component's version is printed to stdout.

The x2goversion tool can be used by X2Go client implementations to query server-side versions of X2Go components.

## RETURN VALUES
x2goversion reports X2Go component version information to stdout.

As exitcode x2goversion always returns 0.

## FILES
/usr/share/x2go/versions/VERSION.*

## AUTHOR
This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).


title: x2goresume-desktopsharing(8)

text:
# x2goresume-desktopsharing(8)

## NAME
x2goresume-desktopsharing - Resume Desktop Sharing Applet for a given X2Go Session

## SYNOPSIS

x2goresume-desktopsharing <session_id>

## DESCRIPTION
x2goresume-desktopsharing launches the x2godesktopsharing applet for X2Go session <session_id>.

x2goresume-desktopsharing is run with normal user privileges and it is used from within X2Go Server. There normally is no need to execute this command manually.

## RETURN VALUES
As exitcode x2goresume-desktopsharing always returns 0.

## SEE ALSO
x2godesktopsharing(1), x2goresume-session(8), x2gosuspend-desktopsharing(8), x2goterminate-desktopsharing(8)

## AUTHOR
This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).


title: x2gosuspend-desktopsharing(8)

summary: Suspend Desktop Sharing for a given X2Go Session


title: x2goterminate-desktopsharing(8)

summary: Cleanly Terminate Desktop Sharing for a given X2Go Session


title: x2gofm(8)

text:
# x2gofm(8)

## NAME
x2gofm - X2Go wrapper for Browsing X2Go Shared Folders

## SYNOPSIS

x2gofm <shared-folder>

## DESCRIPTION
x2gofm is a component of the generic file manager bindings for X2Go's shared folders. x2gofm uses XDG (namely x2go-open <dir>) to launch the default file browser on all client-side folders shared via X2Go.

The default file browser is defined by the freedesktop.org specification of the running desktop environment.

## AUTHOR
This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).


title: x2goprint(8)

summary: Process X2Go Print Job

text:
# x2goprint(8)

## NAME
x2goprint - Process X2Go Print Job

## SYNOPSIS

x2goprint <username> <session_id> <pdf_file> <title_file>

## DESCRIPTION
X2Go print jobs are rendered by the cups-x2go backend on your network's (central) CUPS server and then get copied to the X2Go server that the X2Go print job was issued from.

On that X2Go server cups-x2go places two print job files (a PDF file and a title file) into the home directory of the POSIX system user ,,x2goprint'' where they await further processing by x2goprint.

The x2goprint command on the session's X2Go server (executed by cups-x2go backend) then prepares the job files for delivery to the X2Go client-side.

x2goprint must run with root privileges and is executed by cups-x2go.

## ARGUMENTS
<username>

The owner of the incoming print jobs is given as the <username> argument.

<session_id>

The <session_id> is the unique identifier of the X2Go session that the processed print job is coming from.

<pdf_file>

The filename of the PDF file as dropped into ~x2goprint by cups-x2go.

<title_file>

The filename of the title file as dropped into ~x2goprint by cups-x2go.

## PERMISSIONS
X2Go uses the fuse-based SSH filesystem (SSHFS) for transferring print jobs from X2Go server to X2Go client. Users that shall use X2Go printing must be members of the X2Go server's ,,fuse'' POSIX group.

## X2GO CLUSTER MODE
If X2Go server and CUPS server are the same machine, no further setup for X2Go printing is necessary.

However, if X2Go server and CUPS server are hosted on separate machines then a special setup of sudo and SSH is required on X2Go server(s) and the central CUPS server.

Refer to https://wiki.x2go.org/installing_x2go_printing_debian_ubuntu for further information.

## RETURN VALUES
By x2goprint nothing is reported on stdout or stderr.

If x2goprint has run successfully, an exitcode of 0 is returned. If the script has either been called by a non-root user or with the wrong number of command line arguments, a non-zero exitcode is returned.

## AUTHOR
This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).


xauthority-hostname-updater

package: xauthority-hostname-updater

title: xauthority-hostname-updater(8)

text:
# xauthority-hostname-updater(8)

xauthority-hostname-updater

## NAME
xauthority-hostname-updater - Daemon that keeps hostname in the Xauthority files up-to-date

## SYNOPSIS

```
  /usr/bin/xauthority-hostname-updater [OPTION...]
```

## DESCRIPTION
xauthority-hostname-updater watches org.freedesktop.hostname1 for hostname changes, and update hostnames in Xauthority files for all active displays. When hostname is changed, xauthority-hostname-updater performs the following steps:

- Determines display names: uses $DISPLAY as the local display name and filter the /proc/net/tcp records by PORT > 6000 and real UID to identify remote displays

- Changes hostname in Xauthority files ($HOME/.Xauthority and $TMPDIR/xauth-$UID-_$DISPLAY) in records where:

- family of the record matches with the FamilyLocal (means non-network connection, usually UDS)

- hostname of the record matches with the previous hostname (the hostname before it was changed)

- display name of the record is contained in the list of display names generated at the 1st step

•

Remembers the hostname and sleeps for the next signal from the org.freedesktop.hostname1

## OPTIONS
-d

Run as daemon

-h

Show help and exit


xdm

package: xdm

title: xdm(8)

text:
# xdm(8)

## NAME
xdm - X Display Manager with support for XDMCP, host chooser

## SYNOPSIS
xdm [ -config configuration_file ] [ -nodaemon ] [ -debug debug_level ] [ -error error_log_file ] [ -resources resource_file ] [ -server server_entry ] [ -session session_program ]

## DESCRIPTION
Xdm manages a collection of X displays, which may be on the local host or remote servers. The design of xdm was guided by the needs of X terminals as well as The Open Group standard XDMCP, the X Display Manager Control Protocol. Xdm provides services similar to those provided by init, getty and login on character terminals: prompting for login name and password, authenticating the user, and running a ``session.''

A ``session'' is defined by the lifetime of a particular process; in the traditional character-based terminal world, it is the user's login shell. In the xdm context, it is an arbitrary session manager. This is because in a windowing environment, a user's login shell process does not necessarily have any terminal-like interface with which to connect. When a real session manager is not available, a window manager or terminal emulator is typically used as the ``session manager,'' meaning that termination of this process terminates the user's session.

When the session is terminated, xdm resets the X server and (optionally) restarts the whole process.

When xdm receives an Indirect query via XDMCP, it can run a chooser process to perform an XDMCP BroadcastQuery (or an XDMCP Query to specified hosts) on behalf of the display and offer a menu of possible hosts that offer XDMCP display management. This feature is useful with X terminals that do not offer a host menu themselves.

Xdm can be configured to ignore BroadcastQuery messages from selected hosts. This is useful when you don't want the host to appear in menus produced by chooser or X terminals themselves.

Because xdm provides the first interface that users will see, it is designed to be simple to use and easy to customize to the needs of a particular site. Xdm has many options, most of which have reasonable defaults. Browse through the various sections of this manual, picking and choosing the things you want to change. Pay particular attention to the Session Program section, which will describe how to set up the style of session desired.

## OVERVIEW
xdm is highly configurable, and most of its behavior can be controlled by resource files and shell scripts. The names of these files themselves are resources read from the file xdm-config or the file named by the -config option.

xdm offers display management two different ways. It can manage X servers running on the local machine and specified in Xservers, and it can manage remote X servers (typically X terminals) using XDMCP (the XDM Control Protocol) as specified in the Xaccess file.

The resources of the X clients run by xdm outside the user's session, including xdm's own login window, can be affected by setting resources in the Xresources file.

For X terminals that do not offer a menu of hosts to get display management from, xdm can collect willing hosts and run the chooser program to offer the user a menu. For X displays attached to a host, this step is typically not used, as the local host does the display management.

After resetting the X server, xdm runs the Xsetup script to assist in setting up the screen the user sees along with the xlogin widget.

The xlogin widget, which xdm presents, offers the familiar login and password prompts.

After the user logs in, xdm runs the Xstartup script as root.

Then xdm runs the Xsession script as the user. This system session file may do some additional startup and typically runs the .xsession script in the user's home directory. When the Xsession script exits, the session is over.

At the end of the session, the Xreset script is run to clean up, the X server is reset, and the cycle starts over.

The file /var/log/xdm.log will contain error messages from xdm and anything output to stderr by Xsetup, Xstartup, Xsession or Xreset. When you have trouble getting xdm working, check this file to see if xdm has any clues to the trouble.

## OPTIONS
All of these options, except -config itself, specify values that can also be specified in the configuration file as resources.

-config configuration_file

Names the configuration file, which specifies resources to control the behavior of xdm. /etc/X11/xdm/xdm-config is the default. See the section Configuration File.

-nodaemon

Specifies ``false'' as the value for the DisplayManager.daemonMode resource. This suppresses the normal daemon behavior, which is for xdm to close all file descriptors, disassociate itself from the controlling terminal, and put itself in the background when it first starts up.

-debug debug_level

Specifies the numeric value for the DisplayManager.debugLevel resource. A non-zero value causes xdm to print lots of debugging statements to the terminal; it also disables the DisplayManager.daemonMode resource, forcing xdm to run synchronously. To interpret these debugging messages, a copy of the source code for xdm is almost a necessity. No attempt has been made to rationalize or standardize the output.

-error error_log_file

Specifies the value for the DisplayManager.errorLogFile resource. This file contains errors from xdm as well as anything written to stderr by the various scripts and programs run during the progress of the session.

-resources resource_file

Specifies the value for the DisplayManager*resources resource. This file is loaded using xrdb(1) to specify configuration parameters for the authentication widget.

-server server_entry

Specifies the value for the DisplayManager.servers resource. See the section Local Server Specification for a description of this resource.

-udpPort port_number

Specifies the value for the DisplayManager.requestPort resource. This sets the port-number which xdm will monitor for XDMCP requests. If set to 0, xdm will not listen for XDMCP or Chooser requests. As XDMCP uses the registered well-known UDP port 177, this resource should not be changed to a value other than 0, except for debugging.

-session session_program

Specifies the value for the DisplayManager*session resource. This indicates the program to run as the session after the user has logged in.

-xrm resource_specification

Allows an arbitrary resource to be specified, as in most X Toolkit applications.

## RESOURCES
At many stages the actions of xdm can be controlled through the use of its configuration file, which is in the X resource format. Some resources modify the behavior of xdm on all displays, while others modify its behavior on a single display. Where actions relate to a specific display, the display name is inserted into the resource name between ``DisplayManager'' and the final resource name segment.

For local displays, the resource name and class are as read from the Xservers file.

For remote displays, the resource name is what the network address of the display resolves to. See the removeDomain resource. The name must match exactly; xdm is not aware of all the network aliases that might reach a given display. If the name resolve fails, the address is used. The resource class is as sent by the display in the XDMCP Manage request.

Because the resource manager uses colons to separate the name of the resource from its value and dots to separate resource name parts, xdm substitutes underscores for both dots and colons when generating the resource name. For example, DisplayManager.expo_x_org_0.startup is the name of the resource which defines the startup shell file for the ``expo.x.org:0'' display.

DisplayManager.servers

This resource either specifies a file name full of server entries, one per line (if the value starts with a slash), or a single server entry. See the section Local Server Specification for the details.

DisplayManager.requestPort

This indicates the UDP port number which xdm uses to listen for incoming XDMCP requests. Unless you need to debug the system, leave this with its default value of 177.

DisplayManager.errorLogFile

Error output is normally directed at the system console. To redirect it, set this resource to a file name. A method to send these messages to syslog should be developed for systems which support it; however, the wide variety of interfaces precludes any system-independent implementation. This file also contains any output directed to stderr by the Xsetup, Xstartup, Xsession and Xreset files, so it will contain descriptions of problems in those scripts as well.

DisplayManager.debugLevel

If the integer value of this resource is greater than zero, reams of debugging information will be printed. It also disables daemon mode, which would redirect the information into the bit-bucket, and allows non-root users to run xdm, which would normally not be useful.

DisplayManager.daemonMode

Normally, xdm attempts to make itself into a daemon process unassociated with any terminal. This is accomplished by forking and leaving the parent process to exit, then closing file descriptors and releasing the controlling terminal. In some environments this is not desired (in particular, when debugging). Setting this resource to ``false'' will disable this feature.

DisplayManager.pidFile

The filename specified will be created to contain an ASCII representation of the process-id of the main xdm process. Xdm also uses file locking on this file to attempt to eliminate multiple daemons running on the same machine, which would cause quite a bit of havoc.

DisplayManager.lockPidFile

This is the resource which controls whether xdm uses file locking to keep multiple display managers from running amok. On System V, this uses the lockf library call, while on BSD it uses flock.

DisplayManager.authDir

This names a directory under which xdm stores authorization files while initializing the session. The default value is /var/lib/xdm. Can be overridden for specific displays by DisplayManager.DISPLAY.authFile.

DisplayManager.autoRescan

This boolean controls whether xdm rescans the configuration, servers, access control and authentication keys files after a session terminates and the files have changed. By default it is ``true.'' You can force xdm to reread these files by sending a SIGHUP to the main process.

DisplayManager.removeDomainname

When computing the display name for XDMCP clients, the name resolver will typically create a fully qualified host name for the terminal. As this is sometimes confusing, xdm will remove the domain name portion of the host name if it is the same as the domain name of the local host when this variable is set. By default the value is ``true.''

DisplayManager.keyFile

XDM-AUTHENTICATION-1 style XDMCP authentication requires that a private key be shared between xdm and the terminal. This resource specifies the file containing those values. Each entry in the file consists of a display name and the shared key.

DisplayManager.accessFile

To prevent unauthorized XDMCP service and to allow forwarding of XDMCP IndirectQuery requests, this file contains a database of hostnames which are either allowed direct access to this machine, or have a list of hosts to which queries should be forwarded to. The format of this file is described in the section XDMCP Access Control.

DisplayManager.exportList

A list of additional environment variables, separated by white space, to pass on to the Xsetup, Xstartup, Xsession, and Xreset programs.

DisplayManager.randomFile

A file to checksum to generate the seed of authorization keys. This should be a file that changes frequently. The default is /dev/mem.

DisplayManager.randomDevice

A file to read 8 bytes from to generate the seed of authorization keys. The default is /dev/urandom . If this file cannot be read, or if a read blocks for more than 5 seconds, xdm falls back to using a checksum of DisplayManager.randomFile to generate the seed.

DisplayManager.prngdSocket

DisplayManager.prngPort

A UNIX domain socket name or a TCP socket port number on local host on which a Pseudo-Random Number Generator Daemon, like EGD (http://egd.sourceforge.net) is listening, in order to generate the autorization keys. Either a non null port or a valid socket name must be specified. The default is to use the Unix-domain socket /tmp/entropy.

On systems that don't have such a daemon, a fall-back entropy gathering system, based on various log file contents hashed by the MD5 algorithm is used instead.

DisplayManager.greeterLib

On systems that support a dynamically-loadable greeter library, the name of the library. The default is /usr/lib64/X11/xdm/libXdmGreet.so.

DisplayManager.choiceTimeout

Number of seconds to wait for display to respond after user has selected a host from the chooser. If the display sends an XDMCP IndirectQuery within this time, the request is forwarded to the chosen host. Otherwise, it is assumed to be from a new session and the chooser is offered again. Default is 15.

DisplayManager.sourceAddress

Use the numeric IP address of the incoming connection on multihomed hosts instead of the host name. This is to avoid trying to connect on the wrong interface which might be down at this time.

DisplayManager.willing

This specifies a program which is run (as) root when an an XDMCP BroadcastQuery is received and this host is configured to offer XDMCP display management. The output of this program may be displayed on a chooser window. If no program is specified, the string Willing to manage is sent.

DisplayManager.DISPLAY.resources

This resource specifies the name of the file to be loaded by xrdb as the resource database onto the root window of screen 0 of the display. The Xsetup program, the Login widget, and chooser will use the resources set in this file. This resource data base is loaded just before the authentication procedure is started, so it can control the appearance of the login window. See the section Authentication Widget, which describes the various resources that are appropriate to place in this file. There is no default value for this resource, but /etc/X11/xdm/Xresources is the conventional name.

DisplayManager.DISPLAY.chooser

Specifies the program run to offer a host menu for Indirect queries redirected to the special host name CHOOSER. /usr/lib64/X11/xdm/chooser is the default. See the sections XDMCP Access Control and Chooser.

DisplayManager.DISPLAY.xrdb

Specifies the program used to load the resources. By default, xdm uses /usr/bin/xrdb.

DisplayManager.DISPLAY.setup

This specifies a program which is run (as root) before offering the Login window. This may be used to change the appearance of the screen around the Login window or to put up other windows (e.g., you may want to run xconsole here). By default, no program is run. The conventional name for a file used here is Xsetup. See the section Setup Program.

DisplayManager.DISPLAY.startup

This specifies a program which is run (as root) after the authentication process succeeds. By default, no program is run. The conventional name for a file used here is Xstartup. See the section Startup Program.

DisplayManager.DISPLAY.session

This specifies the session to be executed (not running as root). By default, /usr/bin/xterm is run. The conventional name is Xsession. See the section Session Program.

DisplayManager.DISPLAY.reset

This specifies a program which is run (as root) after the session terminates. By default, no program is run. The conventional name is Xreset. See the section Reset Program.

DisplayManager.DISPLAY.openDelay

DisplayManager.DISPLAY.openRepeat

DisplayManager.DISPLAY.openTimeout

DisplayManager.DISPLAY.startAttempts

DisplayManager.DISPLAY.reservAttempts

These numeric resources control the behavior of xdm when attempting to open intransigent servers. openDelay is the length of the pause in seconds between successive attempts, openRepeat is the number of attempts to make, openTimeout is the amount of time to wait while actually attempting the open (i.e., the maximum time spent in the connect(2) system call) and startAttempts is the number of times this entire process is done before giving up on the server. After openRepeat attempts have been made, or if openTimeout seconds elapse in any particular attempt, xdm terminates and restarts the server, attempting to connect again. This process is repeated startAttempts times, at which point the display is declared dead and disabled. Although this behavior may seem arbitrary, it has been empirically developed and works quite well on most systems. The bound reservAttempts is the number of times a successful connect is allowed to be followed by a fatal error. When reached, the display is disabled. The default values are openDelay: 15, openRepeat: 5, openTimeout: 120, startAttempts: 4 and reservAttempts: 2.

DisplayManager.DISPLAY.pingInterval

DisplayManager.DISPLAY.pingTimeout

To discover when remote displays disappear, xdm occasionally pings them, using an X connection and XSync calls. pingInterval specifies the time (in minutes) between each ping attempt, pingTimeout specifies the maximum amount of time (in minutes) to wait for the terminal to respond to the request. If the terminal does not respond, the session is declared dead and terminated. By default, both are set to 5 minutes. If you frequently use X terminals which can become isolated from the managing host, you may wish to increase this value. The only worry is that sessions will continue to exist after the terminal has been accidentally disabled. xdm will not ping local displays. Although it would seem harmless, it is unpleasant when the workstation session is terminated as a result of the server hanging for NFS service and not responding to the ping.

DisplayManager.DISPLAY.terminateServer

This boolean resource specifies whether the X server should be terminated when a session terminates (instead of resetting it). This option can be used when the server tends to grow without bound over time, in order to limit the amount of time the server is run. The default value is ``false.''

DisplayManager.DISPLAY.userPath

Xdm sets the PATH environment variable for the session to this value. It should be a colon separated list of directories; see sh(1) for a full description. The default value is ``/bin:/usr/bin:/usr/local/bin''.

DisplayManager.DISPLAY.systemPath

Xdm sets the PATH environment variable for the startup and reset scripts to the value of this resource. The default for this resource is ``/bin:/usr/bin:/usr/local/bin''. Note the absence of ``.'' from this entry. This is a good practice to follow for root; it avoids many common Trojan Horse system penetration schemes.

DisplayManager.DISPLAY.systemShell

Xdm sets the SHELL environment variable for the startup and reset scripts to the value of this resource. It is /bin/sh by default.

DisplayManager.DISPLAY.failsafeClient

If the default session fails to execute, xdm will fall back to this program. This program is executed with no arguments, but executes using the same environment variables as the session would have had (see the section Session Program). By default, /usr/bin/xterm is used.

DisplayManager.DISPLAY.grabServer

DisplayManager.DISPLAY.grabTimeout

To improve security, xdm grabs the server and keyboard while reading the login name and password. The grabServer resource specifies if the server should be held for the duration of the name/password reading. When ``false,'' the server is ungrabbed after the keyboard grab succeeds, otherwise the server is grabbed until just before the session begins. The default is ``false.'' The grabTimeout resource specifies the maximum time xdm will wait for the grab to succeed. The grab may fail if some other client has the server grabbed, or possibly if the network latencies are very high. This resource has a default value of 3 seconds; you should be cautious when raising it, as a user can be spoofed by a look-alike window on the display. If the grab fails, xdm kills and restarts the server (if possible) and the session.

DisplayManager.DISPLAY.authorize

DisplayManager.DISPLAY.authName

authorize is a boolean resource which controls whether xdm generates and uses authorization for the local server connections. If authorization is used, authName is a list of authorization mechanisms to use, separated by white space. XDMCP connections dynamically specify which authorization mechanisms are supported, so authName is ignored in this case. When authorize is set for a display and authorization is not available, the user is informed by having a different message displayed in the login widget. By default, authorize is ``true,'' authName is ``MIT-MAGIC-COOKIE-1,'' or, if XDM-AUTHORIZATION-1 is available, ``XDM-AUTHORIZATION-1 MIT-MAGIC-COOKIE-1.''

DisplayManager.DISPLAY.authFile

This file is used to communicate the authorization data from xdm to the server, using the -auth server command line option. It should be kept in a directory which is not world-writable as it could easily be removed, disabling the authorization mechanism in the server. If not specified, a name is generated from DisplayManager.authDir and the name of the display.

DisplayManager.DISPLAY.authComplain

If set to ``false,'' disables the use of the unsecureGreeting in the login window. See the section Authentication Widget. The default is ``true.''

DisplayManager.DISPLAY.resetSignal

The number of the signal xdm sends to reset the server. See the section Controlling the Server. The default is 1 (SIGHUP).

DisplayManager.DISPLAY.termSignal

The number of the signal xdm sends to terminate the server. See the section Controlling the Server. The default is 15 (SIGTERM).

DisplayManager.DISPLAY.resetForAuth

The original implementation of authorization in the sample server reread the authorization file at server reset time, instead of when checking the initial connection. As xdm generates the authorization information just before connecting to the display, an old server would not get up-to-date authorization information. This resource causes xdm to send SIGHUP to the server after setting up the file, causing an additional server reset to occur, during which time the new authorization information will be read. The default is ``false,'' which will work for all MIT servers.

DisplayManager.DISPLAY.userAuthDir

When xdm is unable to write to the usual user authorization file ($HOME/.Xauthority), it creates a unique file name in this directory and points the environment variable XAUTHORITY at the created file. It uses /tmp by default.

## CONFIGURATION FILE
First, the xdm configuration file should be set up. Make a directory (usually /etc/X11/xdm) to contain all of the relevant files.

Here is a reasonable configuration file, which could be named xdm-config:

```
DisplayManager.servers:         /etc/X11/xdm/Xservers
DisplayManager.errorLogFile:    /var/log/xdm.log
DisplayManager*resources:       /etc/X11/xdm/Xresources
DisplayManager*startup:         /etc/X11/xdm/Xstartup
DisplayManager*session:         /etc/X11/xdm/Xsession
DisplayManager.pidFile:         /var/run/xdm-pid
DisplayManager._0.authorize:    true
DisplayManager*authorize:       false
```

Note that this file mostly contains references to other files. Note also that some of the resources are specified with ``*'' separating the components. These resources can be made unique for each different display, by replacing the ``*'' with the display-name, but normally this is not very useful. See the Resources section for a complete discussion.

## XDMCP ACCESS CONTROL
The database file specified by the DisplayManager.accessFile provides information which xdm uses to control access from displays requesting XDMCP service. This file contains three types of entries: entries which control the response to Direct and Broadcast queries, entries which control the response to Indirect queries, and macro definitions.

The format of the Direct entries is simple, either a host name or a pattern, which is distinguished from a host name by the inclusion of one or more meta characters (`*' matches any sequence of 0 or more characters, and `?' matches any single character) which are compared against the host name of the display device. If the entry is a host name, all comparisons are done using network addresses, so any name which converts to the correct network address may be used. For patterns, only canonical host names are used in the comparison, so ensure that you do not attempt to match aliases. Preceding either a host name or a pattern with a `!' character causes hosts which match that entry to be excluded.

To only respond to Direct queries for a host or pattern, it can be followed by the optional ``NOBROADCAST'' keyword. This can be used to prevent an xdm server from appearing on menus based on Broadcast queries.

An Indirect entry also contains a host name or pattern, but follows it with a list of host names or macros to which indirect queries should be sent.

A macro definition contains a macro name and a list of host names and other macros that the macro expands to. To distinguish macros from hostnames, macro names start with a `%' character. Macros may be nested.

Indirect entries may also specify to have xdm run chooser to offer a menu of hosts to connect to. See the section Chooser.

When checking access for a particular display host, each entry is scanned in turn and the first matching entry determines the response. Direct and Broadcast entries are ignored when scanning for an Indirect entry and vice-versa.

Blank lines are ignored, `#' is treated as a comment delimiter causing the rest of that line to be ignored, and `\newline' causes the newline to be ignored, allowing indirect host lists to span multiple lines.

Here is an example Xaccess file:

```
#
# Xaccess - XDMCP access control file
#
#
# Direct/Broadcast query entries
#
!xtra.lcs.mit.edu       # disallow direct/broadcast service for xtra
bambi.ogi.edu           # allow access from this particular display
*.lcs.mit.edu           # allow access from any display in LCS
*.deshaw.com    NOBROADCAST     # allow only direct access
*.gw.com                        # allow direct and broadcast
#
# Indirect query entries
#
%HOSTS  expo.lcs.mit.edu xenon.lcs.mit.edu \

        excess.lcs.mit.edu kanga.lcs.mit.edu
extract.lcs.mit.edu     xenon.lcs.mit.edu  #force extract to contact xenon
!xtra.lcs.mit.edu       dummy              #disallow indirect access
*.lcs.mit.edu           %HOSTS             #all others get to choose
```

If compiled with IPv6 support, multicast address groups may also be included in the list of addresses indirect queries are set to. Multicast addresses may be followed by an optional / character and hop count. If no hop count is specified, the multicast hop count defaults to 1, keeping the packet on the local network. For IPv4 multicasting, the hop count is used as the TTL.

Examples:

```
rincewind.sample.net  ff02::1 #IPv6 Multicast to ff02::1

                              #with a hop count of 1
ponder.sample.net     CHOOSER 239.192.1.1/16  #Offer a menu of hosts

                                              #who respond to IPv4 Multicast

                                              #to 239.192.1.1 with a

                                              #TTL of 16
```

## CHOOSER
For X terminals that do not offer a host menu for use with Broadcast or Indirect queries, the chooser program can do this for them. In the Xaccess file, specify ``CHOOSER'' as the first entry in the Indirect host list. Chooser will send a Query request to each of the remaining host names in the list and offer a menu of all the hosts that respond.

The list may consist of the word ``BROADCAST,'' in which case chooser will send a Broadcast instead, again offering a menu of all hosts that respond. Note that on some operating systems, UDP packets cannot be broadcast, so this feature will not work.

Example Xaccess file using chooser:

```
extract.lcs.mit.edu CHOOSER %HOSTS      #offer a menu of these hosts
xtra.lcs.mit.edu    CHOOSER BROADCAST   #offer a menu of all hosts
```

The program to use for chooser is specified by the DisplayManager.DISPLAY.chooser resource. For more flexibility at this step, the chooser could be a shell script. Chooser is the session manager here; it is run instead of a child xdm to manage the display.

Resources for this program can be put into the file named by DisplayManager.DISPLAY.resources.

When the user selects a host, chooser prints the host chosen, which is read by the parent xdm, and exits. xdm closes its connection to the X server, and the server resets and sends another Indirect XDMCP request. xdm remembers the user's choice (for DisplayManager.choiceTimeout seconds) and forwards the request to the chosen host, which starts a session on that display.

## LISTEN
The following configuration directive is also defined for the Xaccess configuration file:

LISTEN interface [list of multicast group addresses]

interface may be a hostname or IP address representing a network interface on this machine, or the wildcard * to represent all available network interfaces.

If one or more LISTEN lines are specified, xdm only listens for XDMCP connections on the specified interfaces. If multicast group addresses are listed on a listen line, xdm joins the multicast groups on the given interface.

If no LISTEN lines are given, the original behavior of listening on all interfaces is preserved for backwards compatibility. Additionally, if no LISTEN is specified, xdm joins the default XDMCP IPv6 multicast group, when compiled with IPv6 support.

To disable listening for XDMCP connections altogther, a line of LISTEN with no addresses may be specified, or the previously supported method of setting DisplayManager.requestPort to 0 may be used.

Examples:

```
LISTEN * ff02::1        # Listen on all interfaces and to the

                        # ff02::1 IPv6 multicast group.
LISTEN 10.11.12.13      # Listen only on this interface, as long

                        # as no other listen directives appear in

                        # file.
```

## IPv6 MULTICAST ADDRESS SPECIFICATION
The Internet Assigned Numbers Authority has has assigned ff0X:0:0:0:0:0:0:12b as the permanently assigned range of multicast addresses for XDMCP. The X in the prefix may be replaced by any valid scope identifier, such as 1 for Interface-Local, 2 for Link-Local, 5 for Site-Local, and so on. (See IETF RFC 4291 or its replacement for further details and scope definitions.) xdm defaults to listening on the Link-Local scope address ff02:0:0:0:0:0:0:12b to most closely match the old IPv4 subnet broadcast behavior.

## LOCAL SERVER SPECIFICATION
The resource DisplayManager.servers gives a server specification or, if the values starts with a slash (/), the name of a file containing server specifications, one per line.

Each specification indicates a display which should constantly be managed and which is not using XDMCP. This method is used typically for local servers only. If the resource or the file named by the resource is empty, xdm will offer XDMCP service only.

Each specification consists of at least three parts: a display name, a display class, a display type, and (for local servers) a command line to start the server. A typical entry for local display number 0 would be:

```
 :0 Digital-QV local /usr/bin/X :0
```

The display types are: local

local display: xdm must run the server

foreign

remote display: xdm opens an X connection to a running server

The display name must be something that can be passed in the -display option to an X program. This string is used to generate the display-specific resource names, so be careful to match the names (e.g., use ``:0 Sun-CG3 local /usr/bin/X :0'' instead of ``localhost:0 Sun-CG3 local /usr/bin/X :0'' if your other resources are specified as ``DisplayManager._0.session''). The display class portion is also used in the display-specific resources, as the class of the resource. This is useful if you have a large collection of similar displays (such as a corral of X terminals) and would like to set resources for groups of them. When using XDMCP, the display is required to specify the display class, so the manual for your particular X terminal should document the display class string for your device. If it doesn't, you can run xdm in debug mode and look at the resource strings which it generates for that device, which will include the class string.

When xdm starts a session, it sets up authorization data for the server. For local servers, xdm passes ``-auth filename'' on the server's command line to point it at its authorization data. For XDMCP servers, xdm passes the authorization data to the server via the Accept XDMCP request.

## RESOURCES FILE
The Xresources file is loaded onto the display as a resource database using xrdb. As the authentication widget reads this database before starting up, it usually contains parameters for that widget:

```
        xlogin*login.translations: #override\

                Ctrl<Key>R: abort-display()\n\

                <Key>F1: set-session-argument(failsafe) finish-field()\n\

                <Key>Return: set-session-argument() finish-field()

        xlogin*borderWidth: 3

        xlogin*greeting: CLIENTHOST

        #ifdef COLOR

        xlogin*greetColor: CadetBlue

        xlogin*failColor: red

        #endif
```

Please note the translations entry; it specifies a few new translations for the widget which allow users to escape from the default session (and avoid troubles that may occur in it). Note that if #override is not specified, the default translations are removed and replaced by the new value, not a very useful result as some of the default translations are quite useful (such as ``<Key>: insert-char ()'' which responds to normal typing).

This file may also contain resources for the setup program and chooser.

## SETUP PROGRAM
The Xsetup file is run after the server is reset, but before the Login window is offered. The file is typically a shell script. It is run as root, so should be careful about security. This is the place to change the root background or bring up other windows that should appear on the screen along with the Login widget.

In addition to any specified by DisplayManager.exportList, the following environment variables are passed:

DISPLAY

the associated display name

PATH

the value of DisplayManager.DISPLAY.systemPath

SHELL

the value of DisplayManager.DISPLAY.systemShell

XAUTHORITY

may be set to an authority file

Note that since xdm grabs the keyboard, any other windows will not be able to receive keyboard input. They will be able to interact with the mouse, however; beware of potential security holes here. If DisplayManager.DISPLAY.grabServer is set, Xsetup will not be able to connect to the display at all. Resources for this program can be put into the file named by DisplayManager.DISPLAY.resources.

Here is a sample Xsetup script:

```
#!/bin/sh
# Xsetup_0 - setup script for one workstation
xcmsdb < /etc/X11/xdm/monitors/alex.0
xconsole -geometry 480x130-0-0 -notify -verbose -exitOnFail &
```

## AUTHENTICATION WIDGET
The authentication widget prompts the user for the username, password, and/or other required authentication data from the keyboard. Nearly every imaginable parameter can be controlled with a resource. Resources for this widget should be put into the file named by DisplayManager.DISPLAY.resources. All of these have reasonable default values, so it is not necessary to specify any of them.

The resource file is loaded with xrdb(1) so it may use the substitutions defined by that program such as CLIENTHOST for the client hostname in the login message, or C pre-processor #ifdef statements to produce different displays depending on color depth or other variables.

Xdm can be compiled with support for the Xft(3) library for font rendering. If this support is present, font faces are specified using the resources with names ending in ``face'' in the fontconfig face format described in the Font Names section of fonts.conf(5). If not, then fonts are specified using the resources with names ending in ``font'' in the traditional X Logical Font Description format described in the Font Names section of X(7).

xlogin.Login.width, xlogin.Login.height, xlogin.Login.x, xlogin.Login.y

The geometry of the Login widget is normally computed automatically. If you wish to position it elsewhere, specify each of these resources.

xlogin.Login.foreground

The color used to display the input typed by the user.

xlogin.Login.face

The face used to display the input typed by the user when built with Xft support. The default is ``Serif-18''.

xlogin.Login.font

The font used to display the input typed by the user when not built with Xft support.

xlogin.Login.greeting

A string which identifies this window. The default is ``X Window System.''

xlogin.Login.unsecureGreeting

When X authorization is requested in the configuration file for this display and none is in use, this greeting replaces the standard greeting. The default is ``This is an unsecure session''

xlogin.Login.greetFace

The face used to display the greeting when built with Xft support. The default is ``Serif-24:italic''.

xlogin.Login.greetFont

The font used to display the greeting when not built with Xft support.

xlogin.Login.greetColor

The color used to display the greeting.

xlogin.Login.namePrompt

The string displayed to prompt for a user name. Xrdb strips trailing white space from resource values, so to add spaces at the end of the prompt (usually a nice thing), add spaces escaped with backslashes. The default is ``Login: ''

xlogin.Login.passwdPrompt

The string displayed to prompt for a password, when not using an authentication system such as PAM that provides its own prompts. The default is ``Password: ''

xlogin.Login.promptFace

The face used to display prompts when built with Xft support. The default is ``Serif-18:bold''.

xlogin.Login.promptFont

The font used to display prompts when not built with Xft support.

xlogin.Login.promptColor

The color used to display prompts.

xlogin.Login.changePasswdMessage

A message which is displayed when the users password has expired. The default is ``Password Change Required''

xlogin.Login.fail

A message which is displayed when the authentication fails, when not using an authentication system such as PAM that provides its own prompts. The default is ``Login incorrect''

xlogin.Login.failFace

The face used to display the failure message when built with Xft support. The default is ``Serif-18:bold''.

xlogin.Login.failFont

The font used to display the failure message when not built with Xft support.

xlogin.Login.failColor

The color used to display the failure message.

xlogin.Login.failTimeout

The number of seconds that the failure message is displayed. The default is 10.

xlogin.Login.logoFileName

Name of an XPM format pixmap to display in the greeter window, if built with XPM support. The default is no pixmap.

xlogin.Login.logoPadding

Number of pixels of space between the logo pixmap and other elements of the greeter window, if the pixmap is displayed. The default is 5.

xlogin.Login.useShape

If set to ``true'', when built with XPM support, attempt to use the X Non-Rectangular Window Shape Extension to set the window shape. The default is ``true''.

xlogin.Login.hiColor, xlogin.Login.shdColor

Raised appearance bezels may be drawn around the greeter frame and text input boxes by setting these resources. hiColor is the highlight color, used on the top and left sides of the frame, and the bottom and right sides of text input areas. shdColor is the shadow color, used on the bottom and right sides of the frame, and the top and left sides of text input areas. The default for both is the foreground color, providing a flat appearance.

xlogin.Login.frameWidth

frameWidth is the width in pixels of the area around the greeter frame drawn in hiColor and shdColor.

xlogin.Login.innerFramesWidth

innerFramesWidth is the width in pixels of the area around text input areas drawn in hiColor and shdColor.

xlogin.Login.sepWidth

sepWidth is the width in pixels of the bezeled line between the greeting and input areas drawn in hiColor and shdColor.

xlogin.Login.allowRootLogin

If set to ``false'', don't allow root (and any other user with uid = 0) to log in directly. The default is ``true''. This setting is only checked by some of the authentication backends at this time.

xlogin.Login.allowNullPasswd

If set to ``true'', allow an otherwise failing password match to succeed if the account does not require a password at all. The default is ``false'', so only users that have passwords assigned can log in.

xlogin.Login.echoPasswd

If set to ``true'', a placeholder character (echoPasswdChar) will be shown for fields normally set to not echo, such as password input. The default is ``false''.

xlogin.Login.echoPasswdChar

Character to display if echoPasswd is true. The default is ``*''. If set to an empty value, the cursor will advance for each character input, but no text will be drawn.

xlogin.Login.translations

This specifies the translations used for the login widget. Refer to the X Toolkit documentation for a complete discussion on translations. The default translation table is: Ctrl<Key>H:

delete-previous-character()

Ctrl<Key>D:

delete-character()

Ctrl<Key>B:

move-backward-character()

Ctrl<Key>F:

move-forward-character()

Ctrl<Key>A:

move-to-begining()

Ctrl<Key>E:

move-to-end()

Ctrl<Key>K:

erase-to-end-of-line()

Ctrl<Key>U:

erase-line()

Ctrl<Key>X:

erase-line()

Ctrl<Key>C:

restart-session()

Ctrl<Key>\\:

abort-session()

<Key>BackSpace:

delete-previous-character()

<Key>Delete:

delete-previous-character()

<Key>Return:

finish-field()

<Key>:

insert-char()

The actions which are supported by the widget are:

delete-previous-character

Erases the character before the cursor.

delete-character

Erases the character after the cursor.

move-backward-character

Moves the cursor backward.

move-forward-character

Moves the cursor forward.

move-to-begining

(Apologies about the spelling error.) Moves the cursor to the beginning of the editable text.

move-to-end

Moves the cursor to the end of the editable text.

erase-to-end-of-line

Erases all text after the cursor.

erase-line

Erases the entire text.

finish-field

If the cursor is in the name field, proceeds to the password field; if the cursor is in the password field, checks the current name/password pair. If the name/password pair is valid, xdm starts the session. Otherwise the failure message is displayed and the user is prompted again.

abort-session

Terminates and restarts the server.

abort-display

Terminates the server, disabling it. This action is not accessible in the default configuration. There are various reasons to stop xdm on a system console, such as when shutting the system down, when using xdmshell, to start another type of server, or to generally access the console. Sending xdm a SIGHUP will restart the display. See the section Controlling XDM.

restart-session

Resets the X server and starts a new session. This can be used when the resources have been changed and you want to test them or when the screen has been overwritten with system messages.

insert-char

Inserts the character typed.

set-session-argument

Specifies a single word argument which is passed to the session at startup. See the section Session Program.

allow-all-access

Disables access control in the server. This can be used when the .Xauthority file cannot be created by xdm. Be very careful using this; it might be better to disconnect the machine from the network before doing this.

On some systems (OpenBSD) the user's shell must be listed in /etc/shells to allow login through xdm. The normal password and account expiration dates are enforced too.

## STARTUP PROGRAM
The Xstartup program is run as root when the user logs in. It is typically a shell script. Since it is run as root, Xstartup should be very careful about security. This is the place to put commands which add entries to utmp or wtmp files, (the sessreg program may be useful here), mount users' home directories from file servers, or abort the session if logins are not allowed.

In addition to any specified by DisplayManager.exportList, the following environment variables are passed:

DISPLAY

the associated display name

HOME

the initial working directory of the user

LOGNAME

the user name

USER

the user name

PATH

the value of DisplayManager.DISPLAY.systemPath

SHELL

the value of DisplayManager.DISPLAY.systemShell

XAUTHORITY

may be set to an authority file

WINDOWPATH

may be set to the "window path" leading to the X server

No arguments are passed to the script. Xdm waits until this script exits before starting the user session. If the exit value of this script is non-zero, xdm discontinues the session and starts another authentication cycle.

The sample Xstartup file shown here prevents login while the file /etc/nologin exists. Thus this is not a complete example, but simply a demonstration of the available functionality.

Here is a sample Xstartup script:

```
#!/bin/sh
#
# Xstartup
#
# This program is run as root after the user is verified
#
if [ -f /etc/nologin ]; then
	xmessage -file /etc/nologin -timeout 30 -center
	exit 1
fi
sessreg -a -l $DISPLAY -x /etc/X11/xdm/Xservers $LOGNAME
/etc/X11/xdm/GiveConsole
exit 0
```

## SESSION PROGRAM
The Xsession program is the command which is run as the user's session. It is run with the permissions of the authorized user.

In addition to any specified by DisplayManager.exportList, the following environment variables are passed:

DISPLAY

the associated display name

HOME

the initial working directory of the user

LOGNAME

the user name

USER

the user name

PATH

the value of DisplayManager.DISPLAY.userPath

SHELL

the user's default shell (from getpwnam)

XAUTHORITY

may be set to a non-standard authority file

KRB5CCNAME

may be set to a Kerberos credentials cache name

WINDOWPATH

may be set to the "window path" leading to the X server

At most installations, Xsession should look in $HOME for a file .xsession, which contains commands that each user would like to use as a session. Xsession should also implement a system default session if no user-specified session exists.

An argument may be passed to this program from the authentication widget using the `set-session-argument' action. This can be used to select different styles of session. One good use of this feature is to allow the user to escape from the ordinary session when it fails. This allows users to repair their own .xsession if it fails, without requiring administrative intervention. The example following demonstrates this feature.

This example recognizes the special ``failsafe'' mode, specified in the translations in the Xresources file, to provide an escape from the ordinary session. It also requires that the .xsession file be executable so we don't have to guess what shell it wants to use.

```
#!/bin/sh
#
# Xsession
#
# This is the program that is run as the client
# for the display manager.
case $# in
1)
	case $1 in
	failsafe)
		exec xterm -geometry 80x24-0-0
		;;
	esac
esac
startup=$HOME/.xsession
resources=$HOME/.Xresources
if [ -f "$startup" ]; then
	exec "$startup"
else
	if [ -f "$resources" ]; then
		xrdb -load "$resources"
	fi
	twm &
	xman -geometry +10-10 &
	exec xterm -geometry 80x24+10+10 -ls
fi
```

The user's .xsession file might look something like this example. Don't forget that the file must have execute permission.

```
      #! /bin/csh
      # no -f in the previous line so .cshrc gets run to set $PATH

        twm &

        xrdb -merge "$HOME/.Xresources"

        emacs -geometry +0+50 &

        xbiff -geometry -430+5 &

        xterm -geometry -0+50 -ls
```

## RESET PROGRAM
Symmetrical with Xstartup, the Xreset script is run after the user session has terminated. Run as root, it should contain commands that undo the effects of commands in Xstartup, updating entries in utmp or wtmp files, or unmounting directories from file servers. The environment variables that were passed to Xstartup are also passed to Xreset.

A sample Xreset script:

```
#!/bin/sh
#
# Xreset
#
# This program is run as root after the session ends
#
sessreg -d -l $DISPLAY -x /etc/X11/xdm/Xservers $LOGNAME
/etc/X11/xdm/TakeConsole
exit 0
```

## CONTROLLING THE SERVER
Xdm controls local servers using POSIX signals. SIGHUP is expected to reset the server, closing all client connections and performing other cleanup duties. SIGTERM is expected to terminate the server. If these signals do not perform the expected actions, the resources DisplayManager.DISPLAY.resetSignal and DisplayManager.DISPLAY.termSignal can specify alternate signals.

To control remote terminals not using XDMCP, xdm searches the window hierarchy on the display and uses the protocol request KillClient in an attempt to clean up the terminal for the next session. This may not actually kill all of the clients, as only those which have created windows will be noticed. XDMCP provides a more sure mechanism; when xdm closes its initial connection, the session is over and the terminal is required to close all other connections.

## CONTROLLING XDM
Xdm responds to two signals: SIGHUP and SIGTERM. When sent a SIGHUP, xdm rereads the configuration file, the access control file, and the servers file. For the servers file, it notices if entries have been added or removed. If a new entry has been added, xdm starts a session on the associated display. Entries which have been removed are disabled immediately, meaning that any session in progress will be terminated without notice and no new session will be started.

When sent a SIGTERM, xdm terminates all sessions in progress and exits. This can be used when shutting down the system.

Xdm attempts to mark its various sub-processes for ps(1) by editing the command line argument list in place. Because xdm can't allocate additional space for this task, it is useful to start xdm with a reasonably long command line (using the full path name should be enough). Each process which is servicing a display is marked -display.

## ADDITIONAL LOCAL DISPLAYS
To add an additional local display, add a line for it to the Xservers file. (See the section Local Server Specification.)

Examine the display-specific resources in xdm-config (e.g., DisplayManager._0.authorize) and consider which of them should be copied for the new display. The default xdm-config has all the appropriate lines for displays :0 and :1.

## OTHER POSSIBILITIES
You can use xdm to run a single session at a time, using the 4.3 init options or other suitable daemon by specifying the server on the command line:

```
xdm -server “:0 SUN-3/60CG4 local /usr/bin/X :0”
```

Or, you might have a file server and a collection of X terminals. The configuration for this is identical to the sample above, except the Xservers file would look like

```
extol:0 VISUAL-19 foreign
exalt:0 NCD-19 foreign
explode:0 NCR-TOWERVIEW3000 foreign
```

This directs xdm to manage sessions on all three of these terminals. See the section Controlling Xdm for a description of using signals to enable and disable these terminals in a manner reminiscent of init(8).

## LIMITATIONS
One thing that xdm isn't very good at doing is coexisting with other window systems. To use multiple window systems on the same hardware, you'll probably be more interested in xinit.

## FILES
/etc/X11/xdm/xdm-config

the default configuration file

$HOME/.Xauthority

user authorization file where xdm stores keys for clients to read

/usr/lib64/X11/xdm/chooser

the default chooser

/usr/bin/xrdb

the default resource database loader

/usr/bin/X

the default server

/usr/bin/xterm

the default session program and failsafe client

/var/lib/xdm/A<display>-<suffix>

the default place for authorization files

/tmp/K5C<display>

Kerberos credentials cache

## SEE ALSO
X(7), xinit(1), xauth(1), xrdb(1), Xsecurity(7), sessreg(1), Xserver(1), xdmshell(8), fonts.conf(5).

X Display Manager Control Protocol

IETF RFC 4291: IP Version 6 Addressing Architecture.

## AUTHOR
Keith Packard, MIT X Consortium


xdmshell

title: xdmshell(8)

summary: shell for starting xdm on login

text:
# xdmshell(8)

## NAME
xdmshell - shell for starting xdm on login

## SYNOPSIS
/usr/bin/xdmshell

## DESCRIPTION
Xdmshell can be used on systems that are configured to start a console in text mode by default, to allow users to start the X display manager by logging in as a special user with the shell set to the xdmshell program.

Many servers set the keyboard to do non-blocking I/O under the assumption that they are the only programs attempting to read from the keyboard. Unfortunately, some versions of getty(8) will immediately see a continuous stream of zero-length reads which they interpret as end-of-file indicators. Eventually, init(8) will disable logins on that line until somebody types the following as root:

On some platforms, one alternative is to disable logins on the console and always run xdm(8) from /etc/inittab.

Another approach is to set up an account whose shell is the xdmshell program found in the xdm distribution. This program is not installed by default so that site administrators will examine it to see if it meets their needs. The xdmshell utility makes sure that it is being run from the appropriate type of terminal, starts xdm, waits for it to finish, and then resets the console if necessary. If the xdm resources file (specified by the DisplayManager*resources entry in the xdm-config file) contains a binding to the abort-display action similar to the following

xlogin*login.translations: #override Ctrl<Key>R: abort-display()

the console can then by restored by pressing the indicated key (Control-R in the above example) in the xdm login window. The xdmshell program is usually installed setuid to root but executable only by members of a special group, of which the only member is the account which has xdmshell as its shell:

```
%  grep xdm /etc/passwd
x::101:51:Account for starting up X:/tmp:/usr/bin/xdmshell
%  grep 51 /etc/group
xdmgrp:*:51:
%  ls -lg /usr/bin/xdmshell
-rws--x---   1 root     xdmgrp     20338 Nov  1 01:32 /usr/bin/xdmshell
```

If the xdm resources have not been configured to have a key bound to the abort-display() action, there will be no way for general users to login to the console directly. Whether or not this is desirable depends on the particular site.

## SEE ALSO
X(7), xdm(8), xinit(1)


xdp-bench

package: xdp-tools

title: xdp-bench(8)

summary: a simple XDP benchmarking tool

text:
# xdp-bench(8)

## NAME
XDP-bench - a simple XDP benchmarking tool

## SYNOPSIS
XDP-bench is a benchmarking utility for exercising the different operation modes of XDP. It is intended to be a simple program demonstrating the various operating modes; these include dropping packets, hairpin forwarding (using the XDP_TX return code), and redirection using the various in-kernel packet redirection facilities.

The drop and TX modes support various options to control whether packet data is touched (read or written) before being dropped or transmitted. The redirection modes support using the simple ifindex-based bpf_redirect helper, the bpf_redirect_map helper using a cpumap as its target, bpf_redirect_map using a devmap as its target, and the devmap's broadcast mode which allows redirecting to multiple devices.

There is more information on the meaning of the output in both default (terse) and extended output mode, in the Output Format Description section below.

### Running xdp-bench
The syntax for running xdp-bench is:

```
Usage: xdp-bench COMMAND [options]
COMMAND can be one of:

       drop           - Drop all packets on an interface

       pass           - Pass all packets to the network stack

       tx             - Transmit packets back out on an interface (hairpin forwarding)

       redirect       - XDP redirect using the bpf_redirect() helper

       redirect-cpu   - XDP CPU redirect using BPF_MAP_TYPE_CPUMAP

       redirect-map   - XDP redirect using BPF_MAP_TYPE_DEVMAP

       redirect-multi - XDP multi-redirect using BPF_MAP_TYPE_DEVMAP and the BPF_F_BROADCAST flag
```

Each command, and its options are explained below. Or use xdp-bench COMMAND --help to see the options for each command.

## The DROP command
In this mode, xdp-bench installs an XDP program on an interface that simply drops all packets. There are options to control what to do with the packet before dropping it (touch the packet data or not), as well as which statistics to gather. This is a basic benchmark for the baseline (best-case) performance of XDP on an interface.

The syntax for the drop command is:

xdp-bench drop [options] <ifname>

Where <ifname> is the name of the interface the XDP program should be installed on.

The supported options are:

### -p, --packet-operation <ACTION>
Specify which operation should be taken on the packet before dropping it. The following actions are available:

```
no-touch		- Drop the packet without touching the packet data
touch		- Read a field in the packet header before dropping
parse-ip		- Parse the IP header field before dropping
swap-macs		- Swap the source and destination MAC addresses before dropping
```

Whether to touch the packet before dropping it can have a significant performance impact as this requires bringing packet data into the CPU cache (and flushing it back out if writing).

The default for this option is no-touch.

### -l, --load-mode <MODE>
Specify which mechanism xdp-bench should use to load the packet data when parsing the IP header (used with -p parse-ip). The following modes are available:

```
dpa		- Use traditional Direct Packet Access from the XDP program
load-bytes		- Use the xdp_load_bytes() helper function to load the data
```

This can be used to benchmark the various packet access modes supported by the kernel.

The default for this option is dpa.

### -r, --rxq-stats
If set, the XDP program will also gather statistics on which receive queue index each packet was received on. This is displayed in the extended output mode along with per-CPU data (which, depending on the hardware configuration may or may not be equivalent).

### -i, --interval <SECONDS>
Set the polling interval for collecting all statistics and displaying them to the output. The unit of interval is in seconds.

### -e, --extended
Start xdp-bench in "extended" output mode. If not set, xdp-bench will start in "terse" mode. The output mode can be switched by hitting C-$ while the program is running. See also the Output Format Description section below.

### -m, --mode
Selects the XDP program mode (native or skb). Note that native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. However, this option is useful if the interface driver lacks native XDP support, or when simply testing the tool.

### -v, --verbose
Enable verbose logging. Supply twice to enable verbose logging from the underlying libxdp and libbpf libraries.

### --version
Show the application version and exit.

### -h, --help
Display a summary of the available options

## The PASS command
In this mode, xdp-bench installs an XDP program on an interface that passes all packets to the network stack after processing them (returning XDP_PASS). There are options to control what to do with the packet before passing it (touch the packet data or not), as well as which statistics to gather. This is a basic benchmark for the overhead of installing an XDP program on an interface while still running the regular network stack.

The syntax for the pass command is:

xdp-bench pass [options] <ifname>

Where <ifname> is the name of the interface the XDP program should be installed on.

The supported options are:

### -p, --packet-operation <ACTION>
Specify which operation should be taken on the packet before passing it. The following actions are available:

```
no-touch		- Pass the packet without touching the packet data
touch		- Read a field in the packet header before passing
parse-ip		- Parse the IP header field before passing
swap-macs		- Swap the source and destination MAC addresses before passing
```

The default for this option is no-touch.

### -l, --load-mode <MODE>
Specify which mechanism xdp-bench should use to load the packet data when parsing the IP header (used with -p parse-ip). The following modes are available:

```
dpa		- Use traditional Direct Packet Access from the XDP program
load-bytes		- Use the xdp_load_bytes() helper function to load the data
```

This can be used to benchmark the various packet access modes supported by the kernel.

The default for this option is dpa.

### -r, --rxq-stats
If set, the XDP program will also gather statistics on which receive queue index each packet was received on. This is displayed in the extended output mode along with per-CPU data (which, depending on the hardware configuration may or may not be equivalent).

### -i, --interval <SECONDS>
Set the polling interval for collecting all statistics and displaying them to the output. The unit of interval is in seconds.

### -e, --extended
Start xdp-bench in "extended" output mode. If not set, xdp-bench will start in "terse" mode. The output mode can be switched by hitting C-$ while the program is running. See also the Output Format Description section below.

### -m, --mode
Selects the XDP program mode (native or skb). Note that native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. However, this option is useful if the interface driver lacks native XDP support, or when simply testing the tool.

### -v, --verbose
Enable verbose logging. Supply twice to enable verbose logging from the underlying libxdp and libbpf libraries.

### --version
Show the application version and exit.

### -h, --help
Display a summary of the available options

## The TX command
In this mode, xdp-bench installs an XDP program on an interface that performs so-called "hairpin forwarding", which means each packet is transmitted back out the same interface (using the XDP_TX return code).. There are options to control what to do with the packet before transmitting it (touch the packet data or not), as well as which statistics to gather.

The syntax for the tx command is:

xdp-bench tx [options] <ifname>

Where <ifname> is the name of the interface the XDP program should be installed on.

The supported options are:

### -p, --packet-operation <ACTION>
Specify which operation should be taken on the packet before transmitting it. The following actions are available:

```
no-touch		- Transmit the packet without touching the packet data
touch		- Read a field in the packet header before transmitting
parse-ip		- Parse the IP header field before transmitting
swap-macs		- Swap the source and destination MAC addresses before transmitting
```

To allow the packet to be successfully transmitted back to the sender, the MAC addresses have to be swapped, so that the source MAC matches the network device. However, there is a performance overhead in doing swapping, so this option allows this function to be turned off.

The default for this option is swap-macs.

### -l, --load-mode <MODE>
Specify which mechanism xdp-bench should use to load the packet data when parsing the IP header (used with -p parse-ip). The following modes are available:

```
dpa		- Use traditional Direct Packet Access from the XDP program
load-bytes		- Use the xdp_load_bytes() helper function to load the data
```

This can be used to benchmark the various packet access modes supported by the kernel.

The default for this option is dpa.

### -r, --rxq-stats
If set, the XDP program will also gather statistics on which receive queue index each packet was received on. This is displayed in the extended output mode along with per-CPU data (which, depending on the hardware configuration may or may not be equivalent).

### -i, --interval <SECONDS>
Set the polling interval for collecting all statistics and displaying them to the output. The unit of interval is in seconds.

### -e, --extended
Start xdp-bench in "extended" output mode. If not set, xdp-bench will start in "terse" mode. The output mode can be switched by hitting C-$ while the program is running. See also the Output Format Description section below.

### -m, --mode
Selects the XDP program mode (native or skb). Note that native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. However, this option is useful if the interface driver lacks native XDP support, or when simply testing the tool.

### -v, --verbose
Enable verbose logging. Supply twice to enable verbose logging from the underlying libxdp and libbpf libraries.

### --version
Show the application version and exit.

### -h, --help
Display a summary of the available options

## The REDIRECT command
In this mode, xdp-bench sets up packet redirection between the two interfaces supplied on the command line using the bpf_redirect BPF helper triggered on packet reception on the ingress interface.

The syntax for the redirect command is:

xdp-bench redirect [options] <ifname_in> <ifname_out>

Where <ifname_in> is the name of the input interface from where packets will be redirect to the output interface <ifname_out>.

The supported options are:

### -i, --interval <SECONDS>
Set the polling interval for collecting all statistics and displaying them to the output. The unit of interval is in seconds.

### -s, --stats
Enable statistics for successful redirection. This option comes with a per packet tracing overhead, for recording all successful redirections.

### -e, --extended
Start xdp-bench in "extended" output mode. If not set, xdp-bench will start in "terse" mode. The output mode can be switched by hitting C-$ while the program is running. See also the Output Format Description section below.

### -m, --mode
Selects the XDP program mode (native or skb). Note that native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. However, this option is useful if the interface driver lacks native XDP support, or when simply testing the tool.

### -v, --verbose
Enable verbose logging. Supply twice to enable verbose logging from the underlying libxdp and libbpf libraries.

### --version
Show the application version and exit.

### -h, --help
Display a summary of the available options

## The REDIRECT-CPU command
In this mode, xdp-bench sets up packet redirection using the bpf_redirect_map BPF helper triggered on packet reception on the ingress interface, using a cpumap as its target. Hence, this tool can be used to redirect packets on an interface from one CPU to another. In addition to this, the tool then supports redirecting the packet to another output device when it is processed on the target CPU.

The syntax for the redirect-cpu command is:

xdp-bench redirect-cpu [options] <ifname> -c 0 ... -c N

Where <ifname> is the name of the input interface from where packets will be redirect to the target CPU list specified using -c.

The supported options are:

### -c, --cpu <CPU>
Specify a possible target CPU index. This option must be passed at least once, and can be passed multiple times to specify a list of CPUs. Which CPU is chosen for a given packet depends on the value of the --program-mode option, described below.

### -p, --program-mode <MODE>
Specify a program that embeds a predefined policy deciding how packets are redirected to different CPUs. The following options are available:

```
no-touch		- Redirect without touching packet data
touch		- Read packet data before redirecting
round-robin	- Cycle between target CPUs in a round-robin fashion (for each packet)
l4-proto		- Choose the target CPU based on the layer-4 protocol of packet
l4-filter		- Like l4-proto, but drop UDP packets with destination port 9 (used by pktgen)
l4-hash		- Use source and destination IP hashing to pick target CPU
l4-sport		- Use modulo of source port to pick target CPU
l4-dport		- Use modulo of destination port to pick target CPU
```

The no-touch and touch modes always redirect packets to the same CPU (the first value supplied to --cpu). The round-robin and l4-hash modes distribute packets between all the CPUs supplied as --cpu arguments, while l4-proto and l4-filter send TCP and unrecognised packets to CPU index 0, UDP packets to CPU index 1 and ICMP packets to CPU index 2 (where the index refers to the order the actual CPUs are given on the command line).

The default for this option is l4-hash.

### -r --remote-action <ACTION>
If this option is set, a separate program is installed into the cpumap, which will be invoked on the remote CPU after the packet is processed there. The action can be either drop or pass which will drop the packet or pass it to the regular networking stack, respectively. Or it can be redirect, which will cause the packet to be redirected to another interface and transmitted out that interface on the remote CPU. If this option is set to redirect the target device must be specified using --redirect-device.

The default for this option is disabled.

### -r, --redirect-device <IFNAME>
Specify the device to redirect the packet to when it is received on the target CPU. Note that this option can only be specified with --remote-action redirect.

### -q, --qsize <PACKETS>
Set the queue size for the per-CPU cpumap ring buffer used for redirecting packets from multiple CPUs to one CPU. The default value is 2048 packets.

### -x, --stress-mode
Stress the cpumap implementation by deallocating and reallocating the cpumap ring buffer on each polling interval.

### -i, --interval <SECONDS>
Set the polling interval for collecting all statistics and displaying them to the output. The unit of interval is in seconds.

### -s, --stats
Enable statistics for successful redirection. This option comes with a per packet tracing overhead, for recording all successful redirections.

### -e, --extended
Start xdp-bench in "extended" output mode. If not set, xdp-bench will start in "terse" mode. The output mode can be switched by hitting C-$ while the program is running. See also the Output Format Description section below.

### -m, --mode
Selects the XDP program mode (native or skb). Note that native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. However, this option is useful if the interface driver lacks native XDP support, or when simply testing the tool.

### -v, --verbose
Enable verbose logging. Supply twice to enable verbose logging from the underlying libxdp and libbpf libraries.

### --version
Show the application version and exit.

### -h, --help
Display a summary of the available options

## The REDIRECT-MAP command
In this mode, xdp-bench sets up packet redirection between two interfaces supplied on the command line using the bpf_redirect_map() BPF helper triggered on packet reception on the ingress interface, using a devmap as its target.

The syntax for the redirect-map command is:

xdp-bench redirect-map [options] <ifname_in> <ifname_out>

Where <ifname_in> is the name of the input interface from where packets will be redirect to the output interface <ifname_out>.

The supported options are:

### -X, --load-egress
Load a program in the devmap entry used for redirection, so that it is invoked after the packet is redirected to the target device, before it is transmitted out of the output interface. The remote program will update the packet data so its source MAC address matches the one of the destination interface.

### -i, --interval <SECONDS>
Set the polling interval for collecting all statistics and displaying them to the output. The unit of interval is in seconds.

### -s, --stats
Enable statistics for successful redirection. This option comes with a per packet tracing overhead, for recording all successful redirections.

### -e, --extended
Start xdp-bench in "extended" output mode. If not set, xdp-bench will start in "terse" mode. The output mode can be switched by hitting C-$ while the program is running. See also the Output Format Description section below.

### -m, --mode
Selects the XDP program mode (native or skb). Note that native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. However, this option is useful if the interface driver lacks native XDP support, or when simply testing the tool.

### -v, --verbose
Enable verbose logging. Supply twice to enable verbose logging from the underlying libxdp and libbpf libraries.

### --version
Show the application version and exit.

### -h, --help
Display a summary of the available options

## The REDIRECT-MULTI command
In this mode, xdp-bench sets up one-to-many packet redirection between interfaces supplied on the command line, using the bpf_redirect_map BPF helper triggered on packet reception on the ingress interface, using a devmap as its target. The packet is broadcast to all output interfaces specified on the command line, using devmap's packet broadcast feature.

The syntax for the redirect-multi command is:

xdp-bench redirect-multi [options] <ifname_in> <ifname_out1> ... <ifname_outN>

Where <ifname_in> is the name of the input interface from where packets will be redirect to one or many output interface(s).

The supported options are:

### -X, --load-egress
Load a program in the devmap entry used for redirection, so that it is invoked after the packet is redirected to the target device, before it is transmitted out of the output interface. The remote program will update the packet data so its source MAC address matches the one of the destination interface.

### -i, --interval <SECONDS>
Set the polling interval for collecting all statistics and displaying them to the output. The unit of interval is in seconds.

### -s, --stats
Enable statistics for successful redirection. This option comes with a per packet tracing overhead, for recording all successful redirections.

### -e, --extended
Start xdp-bench in "extended" output mode. If not set, xdp-bench will start in "terse" mode. The output mode can be switched by hitting C-$ while the program is running. See also the Output Format Description section below.

### -m, --mode
Selects the XDP program mode (native or skb). Note that native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. However, this option is useful if the interface driver lacks native XDP support, or when simply testing the tool.

### -v, --verbose
Enable verbose logging. Supply twice to enable verbose logging from the underlying libxdp and libbpf libraries.

### --version
Show the application version and exit.

### -h, --help
Display a summary of the available options

## Output Format Description
By default, redirect success statistics are disabled, use --stats to enable. The terse output mode is default, extended output mode can be activated using the --extended command line option.

SIGQUIT (Ctrl + \) can be used to switch the mode dynamically at runtime.

Terse mode displays at most the following fields:

```
rx/s		Number of packets received per second
redir/s	Number of packets successfully redirected per second
err,drop/s	Aggregated count of errors per second (including dropped packets when not using the drop command)
xmit/s	Number of packets transmitted on the output device per second
```

Extended output mode displays at most the following fields:

```
FIELD		  DESCRIPTION
receive	       Displays the number of packets received and errors encountered

                       Whenever an error or packet drop occurs, details of per CPU error

                       and drop statistics will be expanded inline in terse mode.

                                       pkt/s		- Packets received per second

                                       drop/s		- Packets dropped per second

                                       error/s		- Errors encountered per second

                                       redirect	- Displays the number of packets successfully redirected

                       Errors encountered are expanded under redirect_err field

                       Note that passing -s to enable it has a per packet overhead

                                       redir/s		- Packets redirected successfully per second
redirect_err	  Displays the number of packets that failed redirection

                       The errno is expanded under this field with per CPU count

                       The recognized errors are:

                                       EINVAL:		Invalid redirection

                                       ENETDOWN:	Device being redirected to is down

                                       EMSGSIZE:	Packet length too large for device

                                       EOPNOTSUPP:	Operation not supported

                                       ENOSPC:		No space in ptr_ring of cpumap kthread

                                       error/s		- Packets that failed redirection per second
enqueue to cpu N Displays the number of packets enqueued to bulk queue of CPU N

                       Expands to cpu:FROM->N to display enqueue stats for each CPU enqueuing to CPU N

                       Received packets can be associated with the CPU redirect program is enqueuing

                       packets to.

                                       pkt/s		- Packets enqueued per second from other CPU to CPU N

                                       drop/s		- Packets dropped when trying to enqueue to CPU N

                                       bulk-avg	- Average number of packets processed for each event
kthread	       Displays the number of packets processed in CPUMAP kthread for each CPU

                       Packets consumed from ptr_ring in kthread, and its xdp_stats (after calling

                       CPUMAP bpf prog) are expanded below this. xdp_stats are expanded as a total and

                       then per-CPU to associate it to each CPU's pinned CPUMAP kthread.

                                       pkt/s		- Packets consumed per second from ptr_ring

                                       drop/s		- Packets dropped per second in kthread

                                       sched		- Number of times kthread called schedule()

                       xdp_stats (also expands to per-CPU counts)

                                       pass/s		- XDP_PASS count for CPUMAP program execution

                                       drop/s		- XDP_DROP count for CPUMAP program execution

                                       redir/s		- XDP_REDIRECT count for CPUMAP program execution
xdp_exception	  Displays xdp_exception tracepoint events

                       This can occur due to internal driver errors, unrecognized

                       XDP actions and due to explicit user trigger by use of XDP_ABORTED

                       Each action is expanded below this field with its count

                                       hit/s		- Number of times the tracepoint was hit per second
devmap_xmit      Displays devmap_xmit tracepoint events

                       This tracepoint is invoked for successful transmissions on output

                       device but these statistics are not available for generic XDP mode,

                       hence they will be omitted from the output when using SKB mode

                                       xmit/s		- Number of packets that were transmitted per second

                                       drop/s		- Number of packets that failed transmissions per second

                                       drv_err/s	- Number of internal driver errors per second

                                       bulk-avg	- Average number of packets processed for each event
```

## BUGS
Please report any bugs on Github: https://github.com/xdp-project/xdp-tools/issues

## AUTHOR
Earlier xdp-redirect tools were written by Jesper Dangaard Brouer and John Fastabend. They were then rewritten to support more features by Kumar Kartikeya Dwivedi, who also ported them to xdp-tools together with Toke Høiland-Jørgensen. This man page was written by Kumar Kartikeya Dwivedi and Toke Høiland-Jørgensen.