CLICK.O(8)

NAME
click.o - Click kernel module for Linux

DESCRIPTION
The Click modular router can be compiled as a Linux kernel module, called click.o. It can steal packets from network devices before Linux gets a chance to handle them, send packets directly to devices, and send packets to Linux for normal processing.

Install the kernel module with `/sbin/insmod click.o'. Remove it with `/sbin/rmmod click'. The program will also install the kernel module if necessary.

The module uses the /proc filesystem for its API. It creates a number of files under /proc/click, some read-only and some read/write (writable by the superuser). You control the module by writing to these files.

Install a router configuration by writing it to /proc/click/config or /proc/click/hotconfig. The configuration can use most of Click's element classes (see Several element classes control how the module receives and transmits packets: and steal packets from devices before Linux processes them, sends packets directly to devices, and sends packets to Linux for normal processing. Removing the module or installing a null configuration will restore your machine's default networking behavior.

The files under /proc/click include:

/proc/click/config
    Read/write. Contains a Click-language description (see of the most recent router configuration, not including any run-time reconfiguration. Write a Click-language router description to this file to install a new router configuration.

/proc/click/hotconfig
    Write-only. Write a Click-language router description to this file to hot-swap install a new router configuration. The new router is installed only if it initializes correctly; otherwise, error messages will be reported to /proc/click/errors, but the old router will keep working without interruption. If the new router initializes successfully, state from the old router, such as any packets stored in elements, will be moved into the new router before it is installed. This happens on a per-element basis, and it only works if the new element and the old element have the same name. This behavior differs from /proc/click/config, which always throws away the old router.

/proc/click/errors
    Read-only. All errors and messages reported by the Click router since the last reconfiguration (that is, the last write to /proc/click/config). These messages are also printed to the system log.

/proc/click/classes
    Read-only. The primitive element classes supported by the router, listed one per line.

/proc/click/list
    Read-only. The elements in the current router configuration, listed one per line by name. The first line is an integer: the number of elements.

/proc/click/flatconfig
    Read-only. A Click-language description of the current router configuration, including the effects of any run-time reconfiguration. All element declarations come first, then all connections. Compound elements are expanded into their primitive components.

/proc/click/packages
    Read-only. The packages that are currently linked to the Click module, listed one per line.

/proc/click/requirements
    Read-only. The packages required by the current configuration, listed one per line.

/proc/click/cycles, /proc/click/meminfo
    Read-only. Cycle count and memory usage statistics.

/proc/click/threads
    Read-only. The PIDs of any currently running Click kernel threads, listed one per line.

/proc/click/priority
    Read/write. The CPU priority for Click kernel threads. Lower values have higher priority.

/proc/click/version
    Read-only. The kernel module's version number.

  Element directories
Every element in the current router configuration has a directory under /proc/click. You can access the directory by number or element name. The ith element in /proc/click/list has directory `/proc/click/i', and if the element is named n, that directory can be accessed as `/proc/click/n'. This works even if the name contains slashes (click.o creates directories for each name component).

The files in these directories are called handlers. They include:

/proc/click/xxx/class
    Read-only. The element class.

/proc/click/xxx/name
    Read-only. The element's name.

/proc/click/xxx/config
    Read/write if the element supports run-time reconfiguration; otherwise read-only. The element's current configuration. Writing to this file (if it is writable) causes the element to reconfigure itself on the fly. If the reconfiguration fails, the element's old configuration is used instead.

/proc/click/xxx/ports
    Read-only. Describes the element's input and output ports: how many there are, their processing type, and (for pull inputs and push outputs) what they are connected to.

/proc/click/xxx/handlers
    Read-only. Lists the element's handlers, one per line. Each line has the handler name and, after a tab, a permissions word. The permissions word is currently "r" (read-only), "w" (write-only), or "rw" (read/write).

Elements which are also tasks have at least two additional handlers:

/proc/click/xxx/scheduled
    Read-only. A Boolean value: "true" if the element is currently on the task list, "false" if it is not.

/proc/click/xxx/tickets
    Read-only. Returns the element's tickets, an integer that influences task scheduling priority. The more tickets a task has, the more often it will be scheduled relative to other tasks.

Particular elements may add additional handlers to their directories. For example, RED elements (see add read/write min_thresh, max_thresh, and max_p files representing RED parameters, and Counter elements (see provide read-only count and rate files to report packet counts and the recent rate.

The subdirectories and generic files are always created, but element-specific files are created only if the router configuration was initialized successfully.

BUGS
If you get an unaligned access error, try running your configuration through before installing it.

SEE ALSO

AUTHOR
Eddie Kohler, eddietwo@lcs.mit.edu
Robert Morris, rtm@lcs.mit.edu
http://www.pdos.lcs.mit.edu/click/