filter.h File Reference
NAF Core Library Flow Filter API. More...
#include <naf/autoinc.h>
#include <naf/nafcore.h>
#include <naf/lexcore.h>
Go to the source code of this file.
Data Structures | |
| struct | _NAFilter |
| A rangelist-based filter for NAF raw and aggregate flows. More... | |
Defines | |
| #define | naf_filter_active(_filter_) |
| Convenience macro to determine if a filter has any rangelists. | |
Typedefs | |
| typedef _NAFilter | NAFilter |
| A rangelist-based filter for NAF raw and aggregate flows. | |
Functions | |
| void | naf_filter_rl_add (GArray **rl, uint32_t a, uint32_t b) |
| Add a range to a rangelist. | |
| gboolean | naf_filter_rl_contains (GArray *rl, uint32_t v) |
| Determine if a rangelist contains a given value. | |
| gboolean | naf_filter_key (NAFilter *filter, NAFlowKey *key) |
| Determine if a filter matches a given flow key. | |
| gboolean | naf_filter_val (NAFilter *filter, NAFlowVal *val) |
| Determine if a filter matches a given flow value. | |
| void | naf_filter_init (NAFilter *filter) |
| Initialize a filter by setting all its rangelists to empty. | |
| void | naf_filter_reinit (NAFilter *filter) |
| Reinitialize a filter by freeing all its rangelists. | |
| void | naf_filter_rl_print (GArray *rl, GString *str) |
| Append a textual description of an unsigned rangelist to a GString. | |
| void | naf_filter_rl_print_ipaddr (GArray *rl, GString *str) |
| Append a textual description of an IPv4 address rangelist to a GString. | |
| void | naf_filter_print (NAFilter *filter, GString *str) |
| Append a textual description of a filter to a GString. | |
| gboolean | naf_filter_rl_parse_ipaddr (GScanner *scanner, GArray **rl) |
| Parse an IPv4 address rangelist. | |
| gboolean | naf_filter_rl_parse_uint (GScanner *scanner, GArray **rl, uint32_t max) |
| Parse an unsigned rangelist. | |
| gboolean | naf_filter_parse (GScanner *scanner, NAFilter *filter) |
| Parse a filter expression. | |
Detailed Description
NAF Core Library Flow Filter API.Used by nafalize and nafilter. Defines an API for handling rangelist-based filters for flows. The flow filter API also provides a facility for parsing filter expressions from user input.
Define Documentation
|
|
Value: (((_filter_).binrl) || \
((_filter_).siprl) || \
((_filter_).diprl) || \
((_filter_).sprl) || \
((_filter_).dprl) || \
((_filter_).protorl) || \
((_filter_).florl) || \
((_filter_).rflorl) || \
((_filter_).pktrl) || \
((_filter_).rpktrl) || \
((_filter_).octrl) || \
((_filter_).roctrl))
|
Function Documentation
|
|
Initialize a filter by setting all its rangelists to empty. Call this to prepare a new filter for parsing or other construction.
|
|
||||||||||||
|
Determine if a filter matches a given flow key. Filters are evaluated as AND-of-OR; that is, for each rangelist present in a filter, a flow must match one of the ranges in the list to match the filter as a whole.
|
|
||||||||||||
|
Parse a filter expression. Requires a scanner initialized with naf_lex_init() or naf_lex_init_argv(). The scanner should be positioned such that the next token is NAF_SYM_FILTER.
|
|
||||||||||||
|
Append a textual description of a filter to a GString.
|
|
|
Reinitialize a filter by freeing all its rangelists. Call this to prepare a previously constructed filter for parsing or other construction.
|
|
||||||||||||||||
|
Add a range to a rangelist. All rangelist ranges are treated as inclusive.
|
|
||||||||||||
|
Determine if a rangelist contains a given value.
|
|
||||||||||||
|
Parse an IPv4 address rangelist. Requires a scanner initialized with naf_lex_init() or naf_lex_init_argv().
|
|
||||||||||||||||
|
Parse an unsigned rangelist. Requires a scanner initialized with naf_lex_init() or naf_lex_init_argv().
|
|
||||||||||||
|
Append a textual description of an unsigned rangelist to a GString.
|
|
||||||||||||
|
Append a textual description of an IPv4 address rangelist to a GString.
|
|
||||||||||||
|
Determine if a filter matches a given flow value. Filters are evaluated as AND-of-OR; that is, for each rangelist present in a filter, a flow must match one of the ranges in the list to match the filter as a whole.
|


