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(n), IPClassifier(n), and IPFilter(n) elements. It reads a router configuration file in the click(5) 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 click.o(8) Linux kernel module with click-install(1):

  % click-fastclassifier -k CONFIGURATION | click-install
The click(1) 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 click.o(8) Linux kernel module.

-u, --user
Generate a dynamically loadable package for the click(1) 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.


click(1), click-devirtualize(1), click-install(1), click(5), click.o(8), Classifier(n), IPClassifier(n), IPFilter(n)


Eddie Kohler, [email protected]