Skip to content
Tom Barbette edited this page Nov 25, 2022 · 2 revisions

Search Element Documentation

NAME

Search — Click element; Strip the head of the packet up to pattern to be found in the packet content.

SYNOPSIS

Search()

Batching: Batching natively supported
Ports: 1 input, 1-2 outputs
Processing: push

DESCRIPTION

  • PATTERN — The string to search. The packet "data" pointer will be placed after
  • STRIP_AFTER — Go after the pattern instead of before
  • ANNO — An annotation where to place the number of skipped bytes
  • SET_ANNO — Set the above annotation or not.

EXAMPLES

Use this to get rid of all headers up to some pattern, like a HTTP \n\r:

 s :: Search("\n\r\n\r") //Strips to the end of the pattern
 -> Print("HTTP REQUEST PAYLOAD") //So Print will show the content
 -> UntripAnno(); //Go back to where we were

 s[1] -> Print("Malformed HTTP");

SEE ALSO

UnstripAnno

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

Clone this wiki locally