nafcore.h File Reference
NAF Core Library. More...
#include <naf/autoinc.h>
Go to the source code of this file.
Data Structures | |
| struct | _NAFlowKey |
| An aggregated flow key. More... | |
| struct | _NAFlowVUC |
| Flow Value Unique Counters. More... | |
| struct | _NAFlowVal |
| An aggregated flow value. More... | |
| struct | _NAFlow |
| A full aggregated flow; the unification of a flow key and value. More... | |
| struct | _NAFlowRaw |
| A raw flow record. More... | |
| struct | _NAFlowMask |
| A flow mask. More... | |
Defines | |
| #define | NAF_FM_SRCID 0x00000001 |
| Fieldmask bit for source identifier. | |
| #define | NAF_FM_SIP 0x00000002 |
| Fieldmask bit for source IP address. | |
| #define | NAF_FM_SIPMASK 0x00000004 |
| Fieldmask bit for source IP address CIDR mask length. | |
| #define | NAF_FM_DIP 0x00000008 |
| Fieldmask bit for destination IP address. | |
| #define | NAF_FM_DIPMASK 0x00000010 |
| Fieldmask bit for destination IP address CIDR mask length. | |
| #define | NAF_FM_PROTO 0x00000020 |
| Fieldmask bit for IP protocol. | |
| #define | NAF_FM_SP 0x00000040 |
| Fieldmask bit for source transport port. | |
| #define | NAF_FM_DP 0x00000080 |
| Fieldmask bit for destination transport port and ICMP type/code. | |
| #define | NAF_FM_OCT 0x00000100 |
| Fieldmask bit for forward octet count. | |
| #define | NAF_FM_ROCT 0x00000200 |
| Fieldmask bit for reverse octet count. | |
| #define | NAF_FM_PKT 0x00000400 |
| Fieldmask bit for forward packet count. | |
| #define | NAF_FM_RPKT 0x00000800 |
| Fieldmask bit for reverse packet count. | |
| #define | NAF_FM_FLO 0x00001000 |
| Fieldmask bit for forward flow count. | |
| #define | NAF_FM_RFLO 0x00002000 |
| Fieldmask bit for reverse flow count. | |
| #define | NAF_FM_SHOSTC 0x00004000 |
| Fieldmask bit for source host count. | |
| #define | NAF_FM_DHOSTC 0x00008000 |
| Fieldmask bit for destination host count. | |
| #define | NAF_FM_SPORTC 0x00010000 |
| Fieldmask bit for source port count. | |
| #define | NAF_FM_DPORTC 0x00020000 |
| Fieldmask bit for destination port count. | |
| #define | NAF_FM_REVSORT 0x10000000 |
| Internal fieldmask pseudofield bit for reverse (descending) sort. | |
| #define | NAF_FM_MTOTAL 0x20000000 |
| Internal fieldmask pseudofield bit for totaling counts. | |
| #define | NAF_FM_VPAD 0x40000000 |
| Internal fieldmask pseudofield bit for in-memory padding. | |
| #define | NAF_FM_VSTIME 0x80000000 |
| Internal fieldmask pseudofield bit for bin. | |
| #define | NAF_FM_MASKF 0x0003FFFF |
| Mask for real field bits. | |
| #define | NAF_FM_MASKINT 0xF0000000 |
| Mask for pseudofield bits. | |
| #define | NAF_BA_NONE 0x00000000 |
| Binning algorithm number for no binning algorithm selected. | |
| #define | NAF_BA_UNIFORM 0x00000001 |
| Binning algorithm number for uniform binning. | |
| #define | NAF_BA_START 0x00000002 |
| Binning algorithm number for start-time binning. | |
| #define | NAF_BA_END 0x00000003 |
| Binning algorithm number for end-time binning. | |
| #define | NAF_IP_ICMP 1 |
| Convenience macro for ICMP IP protocol number. | |
| #define | NAF_IP_TCP 6 |
| Convenience macro for TCP IP protocol number. | |
| #define | NAF_IP_UDP 17 |
| Convenience macro for UDP IP protocol number. | |
| #define | NAF_ERROR_DOMAIN (g_quark_from_string("certNAFError")) |
| GError domain for NAF errors. | |
| #define | NAF_ERROR_HEADER 1 |
| A NAF file header was malformed. | |
| #define | NAF_ERROR_ARGUMENT 2 |
| Illegal argument error. | |
| #define | NAF_ERROR_IO 3 |
| General I/O error. | |
| #define | NAF_ERROR_HORIZON 4 |
| Horizon violation. | |
| #define | NAF_ERROR_MULTIPLE 5 |
| Multiple errors were encountered and logged. | |
| #define | NAF_ERROR_EOF 6 |
| End of file on read from driver layer. | |
Typedefs | |
| typedef uint32_t | NAFTimeSec |
| A time in epoch seconds, or a bin number. | |
| typedef _NAFlowKey | NAFlowKey |
| An aggregated flow key. | |
| typedef _NAFlowVUC | NAFlowVUC |
| Flow Value Unique Counters. | |
| typedef _NAFlowVal | NAFlowVal |
| An aggregated flow value. | |
| typedef _NAFlow | NAFlow |
| A full aggregated flow; the unification of a flow key and value. | |
| typedef _NAFlowRaw | NAFlowRaw |
| A raw flow record. | |
| typedef _NAFlowMask | NAFlowMask |
| A flow mask. | |
Functions | |
| fbInfoModel_t * | nfInfoModel () |
| Get the NAF application global IPFIX information model, initializing it if necessary. | |
| fBuf_t * | nfReaderForFP (fBuf_t *fbuf, FILE *fp, NAFlowMask *mask, GError **err) |
| Begin reading a NAF file. | |
| gboolean | nfRead (fBuf_t *fbuf, NAFlowMask *mask, NAFlowKey *key, NAFlowVal *val, GError **err) |
| Read a single NAF record from a NAF file. | |
| fBuf_t * | nfWriterForFP (fBuf_t *fbuf, FILE *fp, uint32_t domain, NAFlowMask *mask, GError **err) |
| Begin writing NAF data to an open file. | |
| gboolean | nfWrite (fBuf_t *fbuf, NAFlowMask *mask, NAFlowKey *key, NAFlowVal *val, GError **err) |
| Write a single NAF record to an IPFIX message buffer returned by nfWriterForFP(). | |
| gboolean | nfWriterClose (fBuf_t *fbuf, GError **err) |
| Finish writing a NAF file. | |
| void | nfDumpFlow (NAFlowKey *key, NAFlowVal *val, const char *inf) |
| Internal debugging routine to dump a flow to standard error. | |
Detailed Description
NAF Core Library.Defines API for reading and writing NAF files, and the aggregated flow data structures.
Define Documentation
|
|
GError domain for NAF errors. All NAF tool errors belong to this domain, not just those returned by the NAF Core Library. In addition, NAF core library routines can return libfixbuf errors if reading or writing fails. |
|
|
End of file on read from driver layer. Driver-mediated raw flow input must set this error on read EOF. |
|
|
A NAF file header was malformed. The file is probably not a NAF file. |
|
|
Horizon violation. A flow was dropped because its bin was flushed. |
Typedef Documentation
|
|
A full aggregated flow; the unification of a flow key and value. This is convenient for postprocessing and sorting, as in nafilter. |
|
|
An aggregated flow key. NAF flows are stored and handled internally as a split data structure - a key which identifies the aggregated flow, and a value which counts octets, packets, flows, and hosts associated with it. |
|
|
A flow mask. Flow masks are used to describe aggregation operations, as well as which values are present in a NAF file. |
|
|
A raw flow record. This is the interface between the various NAF aggregation input facilities and the NAF aggregation core. |
|
|
An aggregated flow value. Together with an aggregated flow key, stores an aggregated flow. |
|
|
Flow Value Unique Counters. Used internally by nafalize to count unique hosts during aggregation. You shouldn't need this structure outside nafalize. |
Function Documentation
|
||||||||||||||||
|
Internal debugging routine to dump a flow to standard error.
|
|
|
Get the NAF application global IPFIX information model, initializing it if necessary.
|
|
||||||||||||||||||||||||
|
Read a single NAF record from a NAF file. Takes a libfixbuf message reader previously opened with naf_read_start(), and copies flow key and value into supplied buffers.
|
|
||||||||||||||||||||
|
Begin reading a NAF file. Reads the file header and returns a flow mask describing the fields available in the file, and returns a libfixbuf message reader for reading NAF records from the file with naf_read().
|
|
||||||||||||||||||||||||
|
Write a single NAF record to an IPFIX message buffer returned by nfWriterForFP(). Copies and encodes flow key and value into the buffer.
|
|
||||||||||||
|
Finish writing a NAF file. The underlying file pointer passed to nfWriterForFP() is not automatically closed by this call.
|
|
||||||||||||||||||||||||
|
Begin writing NAF data to an open file. Writes a file header for a given file mask and prepares an IPFIX message to write to the file with nfWrite().
|


