This is automatically generated documentation. Edit after the "COMMENTS" heading; changes to the main body will be lost.


specializes Classifier code in a Click configuration


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


The click-fastclassifier tool speeds up a Click configuration by creating fast versions of all its Classifier, IPClassifier, and IPFilter elements. It reads a router configuration file in the language language and creates specialized C++ source code for each Classifier-like element. A Classifier is expanded into a series of if statements; for example, the expansion of 'Classifier(0/80, -)' contains something like this function:

inline void
FastClassifier_a_ac::length_unchecked_push(Packet *p)
  const unsigned *data = (const unsigned *)(p->data() - 0);
  if ((data[0] & 255U) == 128U) {

After creating the source code, click-fastclassifier will optionally compile it into dynamically loadable packages. The Classifier elements in the input configuration are changed to use new FastClassifier elements, and the resulting configuration, plus source code and any compiled packages, are combined into an archive and written to the standard output. You can install such an archive into the linuxmodule Linux kernel module with click-install:

  % click-fastclassifier -k CONFIGURATION | click-install

The userdriver user level driver can read the archives directly.

The click-fastclassifier transformation can be reversed with the --reverse option.


If any filename argument is a single dash "-", click-fastclassifier 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
Generate a dynamically loadable package for the linuxmodule Linux kernel module.
-u, --user
Generate a dynamically loadable package for the userdriver user-level driver.
-s, --source
Output only the source code for the FastClassifier elements.
-c, --config
Output only the new configuration (the one that includes FastClassifiers).
-r, --reverse
Reverse the tranformation. That is, remove any existing FastClassifier elements and replace them with equivalent Classifiers.
-q, --quiet
Compile code quietly (without echoing commands or top-level warnings).
Print usage information and exit.
Print the version number and some quickie warranty information and exit.



Eddie Kohler,


docs/click-fastclassifier.txt · Last modified: 2012/01/16 21:23 (external edit)
Recent changes RSS feed Driven by DokuWiki