The NetBee library implements a compiler for high level language used to program the NetVM in order to deal with the most common traffic filtering and monitoring applications. This document will present the high level language used by the NetVM compiler giving particular emphasis to the syntax of the language.
The NetPFL high-level language targets applications that want to capture and filter traffic, compute network statistics, and extracts fields from the packet. This language is not a new general purpose language (like C or C++) and it focuses on some of the most common features required by packet processing application. This allows the language to be simple (small number of keywords and syntax rules), intuitive, easy to implement, and suitable for command-line tools.
For more complex applications we leave the programmer the possibility to write its own NetPE source code in NetVM assembly language: this approach gives the programmer the opportunity to write powerful tasks for each NetPE using all the features available within it.
The compactness of the language allows an expression to be typed as an argument of a command-line tool. This is due to the minimal number or syntactical rules required by this language.
The general syntax of this language consist of three blocks (optional): the first represents a filtering expression, the second represents the action to be performed when the expression of the filter is true, the third is a sort of 'stream' associated with the previous items:
[FilteringExpression] [Action] [as StreamID]
The complete NetPFL language specification document can be found at http://nbee.org/download/netpfl-20100315.pdf