Skip to content
Tom Barbette edited this page Nov 25, 2022 · 1 revision

StringClassifier Element Documentation

NAME

StringClassifier — Click element; classifies packets by contents

SYNOPSIS

StringClassifier(STRING_1, ..., STRING_1)

Batching: Batching natively supported
Ports: 1 input, any number of outputs
Processing: push
Drivers: userlevel

DESCRIPTION

Classifies packets according to exect string. The StringClassifier has N outputs, each associated with the corresponding string from the configuration string. The pattern match will be done based on all the Packet's content.

You should assume that the strings are scanned in order, and the packet is sent to the output corresponding to the first matching pattern. Thus more specific patterns should come before less specific ones. If no match is found the packet is discarded.

NOTES

It's better to enclose each string with a pair of "

EXAMPLES

For example,

  StringClassifier("xnet",
                                  "hello",
                                  "ynet");

creates an element with three outputs. The first output will match a packet with the word xnet anywhere in it's content. The second output will match a packet with the word hello anywhere in it's content. The third output will match a packet with the word ynet anywhere in it's content.

ELEMENT HANDLERS

  • pattern0 (read/write) — Returns or sets the element's pattern 0. There are as many pattern handlers as there are output ports.

SEE ALSO

Classifier, IPFilter, CheckIPHeader, MarkIPHeader, CheckIPHeader2, tcpdump

Generated by click-elem2man from ../elements/ids/stringclassifier.hh:7 on 2022/11/25.

Clone this wiki locally