Skip to content
Tom Barbette edited this page Aug 6, 2018 · 1 revision

click-undead

removes dead code from a Click configuration

Synopsis

click-undead [param=value ...] [options] [router-file]

Description

The click-undead tool speeds up some Click configurations by removing dead code. This includes:

  1. Any Null, StaticSwitch, and StaticPullSwitch elements.

  2. Any elements not reachable from both a source element and a sink element. Click packet source elements include FromDevice and InfiniteSource; packet sink elements include ToDump, ToDevice, and Discard (when it is used as a pull element).

  3. Dead ports on scheduler elements (RoundRobinSched, PrioSched, StrideSched, and so on) are removed. These are ports that no packet could ever enter.

  4. Scheduler elements that have only one attached input are redundant, so they are removed.

  5. Dead ports on tee elements (Tee, PullTee) are removed. These are ports with no packet sink downstream.

  6. Tee elements that have only one attached output are redundant, so they are removed.

click-undead will not remove any information elements. Connections to removed elements are rerouted appropriately.

For example, click-undead will transform this configuration,

   Idle -> Counter -> td1 :: ToDump(a);
   InfiniteSource -> ss :: StaticSwitch(1);
     ss[0] -> ToDump(c);
     ss[1] -> Queue -> rr :: RoundRobinSched;
     Idle -> [1]rr;
     rr -> td2 :: ToDump(b);
into this configuration:
   InfiniteSource -> Queue -> td2 :: ToDump(b);
Note that the resulting configuration is not guaranteed to have the same semantics as the input configuration. Here, for example, the result configuration does not truncate the files ‘a’ and ‘c’.

The resulting configuration is written to the standard output.

Options

If any filename argument is a single dash "-", click-undead will use the standard input or output instead, as appropriate.

  • -f file

  • --file file

    Read the router configuration to transform from file. The default is the standard input.

  • -e expr

  • --expression expr

    Use expr, a string in the Click language, as the router configuration to transform.

  • -o file

  • --output file

    Write the output router configuration to file. The default is the standard output.

  • -k, --kernel

    Check the configuration only for the click.o Linux kernel module driver.

  • -u, --user

    Check the configuration only for the click user-level driver.

  • -c, --config

    Output only the new configuration, not any archived packages.

  • -V, --verbose

    Print debugging information about the transformation—for example, which elements are chosen as sources and sinks.

  • --help

    Print usage information and exit.

  • --version

    Print the version number and some quickie warranty information and exit.

See Also

click, click-install, click, click.o, Discard, FromDevice, InfiniteSource, ToDump, ToDevice

Author

Eddie Kohler, [email protected]
https://github.com/tbarbette/fastclick

Clone this wiki locally