-
Notifications
You must be signed in to change notification settings - Fork 321
click undead
removes dead code from a Click configuration
click-undead [param=value ...] [options] [router-file]
The click-undead tool speeds up some Click configurations by removing dead code. This includes:
-
Any Null, StaticSwitch, and StaticPullSwitch elements.
-
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).
-
Dead ports on scheduler elements (RoundRobinSched, PrioSched, StrideSched, and so on) are removed. These are ports that no packet could ever enter.
-
Scheduler elements that have only one attached input are redundant, so they are removed.
-
Dead ports on tee elements (Tee, PullTee) are removed. These are ports with no packet sink downstream.
-
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.
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.
click, click-install, click, click.o, Discard, FromDevice, InfiniteSource, ToDump, ToDevice
Eddie Kohler, [email protected]
http://www.pdos.lcs.mit.edu/click/