#include <fixbuf/autoinc.h>
#include <fixbuf/template.h>
Go to the source code of this file.
Defines | |
| #define | FIX_WMSG_SZ 65536 |
| Maximum message size; also defines the size of the internal FixWriter message buffer. | |
| #define | FIX_TID_DEFAULT 0 |
| Pass as d_tid parameter to fix_write() to use the FixWriter's current set template ID as the destination template ID. | |
Typedefs | |
| typedef _FixWriter | FixWriter |
| Opaque FixWriter data structure. | |
| typedef gboolean(* | FixWriterMgtFn )(void *ectx, void **ictx, GError **err) |
| FixWriter low-level output management function. | |
| typedef gboolean(* | FixWriteFn )(void *ectx, void *ictx, uint8_t *buf, uint32_t len, GError **err) |
| FixWriter low-level output function. | |
Functions | |
| FixWriter * | fix_writer_alloc (FixIERegistry *ier, FixWriterMgtFn msgstart, FixWriteFn write, FixWriterMgtFn msgend) |
| Allocate a new FixWriter. | |
| void | fix_write_start (FixWriter *wmsg, void *ectx, uint32_t export_time, uint32_t sequence, uint32_t source, uint16_t mtu) |
| Start writing an IPFIX message with the given header information to an output stream. | |
| gboolean | fix_writer_final_set (FixWriter *wmsg, uint16_t tid, GError **err) |
| Declare a final set on an IPFIX message. | |
| gboolean | fix_write_template (FixWriter *wmsg, uint16_t tid, GError **err) |
| Write a single previously allocated and activated template to an IPFIX message. | |
| gboolean | fix_write_templates (FixWriter *wmsg, GError **err) |
| Write every available currently active, non-private template to an IPFIX message, automatically restarting the message if it is full. | |
| gboolean | fix_writer_revoke_template (FixWriter *wmsg, uint16_t tid, GError **err) |
| Revoke a template by writing a template revocation and removing the template from the session. | |
| gboolean | fix_write (FixWriter *wmsg, uint16_t s_tid, uint16_t d_tid, uint8_t *recbase, uint32_t recsize, GError **err) |
| Write a record to an IPFIX message with transcoding as appropriate. | |
| gboolean | fix_write_autobounce (FixWriter *wmsg, uint16_t s_tid, uint16_t d_tid, uint8_t *recbase, uint32_t recsize, GError **err) |
| Write a record to an IPFIX message, automatically restarting the message if it is full. | |
| gboolean | fix_write_end (FixWriter *wmsg, GError **err) |
| Finish writing a message on a FixWriter. | |
| gboolean | fix_writer_active (FixWriter *wmsg) |
| Determine a writer's active state. | |
| void | fix_writer_free (FixWriter *wmsg) |
| Dispose of a FixWriter. | |
| void | fix_writer_dump_stats (FixWriter *wmsg) |
| Dump writer statistics to standard error. | |
| gboolean | fix_write_fp (void *ectx, void *ictx, uint8_t *buf, uint32_t len, GError **err) |
| Low-level output write function for FILE output. | |
| gboolean | fix_write_fd (void *ectx, void *ictx, uint8_t *buf, uint32_t len, GError **err) |
| Low-level output write function for file descriptor output. | |
A FixWriter is a reusable IPFIX message writer object bound to a fixbuf session context for writing to a specific type of low-level output stream. This interface supplies two low-level output stream interfaces, one to a GIOChannel and one to an ANSI C file pointer.
|
|
FixWriter low-level output function. This type points to the required low-level message data write function passed to fix_writer_alloc(). |
|
|
FixWriter low-level output management function. This type points to the optional low-level message start and low-level message end functions passed to fix_writer_alloc(). |
|
||||||||||||||||||||||||||||
|
Write a record to an IPFIX message with transcoding as appropriate. If the source template contains any variable length information elements, they must be represented in the record by FixVarlen structures.
|
|
||||||||||||||||||||||||||||
|
Write a record to an IPFIX message, automatically restarting the message if it is full. Designed to allow applications to leave message boundaries to the library. Transcodes message as appropriate. If the source template contains any variable length information elements, they must be represented in the record by FixVarlen structures. If autobounce causes a new message to be started, that message will have identical mtu, source, and export time, and its sequence number will be incremented by one. The export time behavior is probably not what you want; this will be fixed in a future release of fixbuf.
|
|
||||||||||||
|
Finish writing a message on a FixWriter. Flushes the internal buffer to low-level output, and resets the FixWriter for reuse by a subsequent fix_write_start() call.
|
|
||||||||||||||||||||||||
|
Low-level output write function for file descriptor output. ectx is assumed to be a file descriptor or socket, opened for writing . Does not require message start or end functions. Pass this to fix_writer_alloc().
|
|
||||||||||||||||||||||||
|
Low-level output write function for FILE output. ectx is assumed to be a pointer to a FILE, opened for writing . Does not require message start or end functions. Pass this to fix_writer_alloc().
|
|
||||||||||||||||||||||||||||
|
Start writing an IPFIX message with the given header information to an output stream. This passes a new stream external context to the low-level output and writes a valid IPFIX message header into the FixWriter's internal buffer.
|
|
||||||||||||||||
|
Write a single previously allocated and activated template to an IPFIX message. Does not honor the template private flag; this may be used to write private templates to an IPFIX message.
|
|
||||||||||||
|
Write every available currently active, non-private template to an IPFIX message, automatically restarting the message if it is full.
|
|
|
Determine a writer's active state. A writer is active if it is presently writing to an IPFIX message; that is, between calls to fix_write_start() and fix_write_end().
|
|
||||||||||||||||||||
|
Allocate a new FixWriter. Creates a new writer using supplied message start, write, and end functions as low-level output, which will use a given IE registry for information element definitions. Since FixWriters are reusable and reasonably expensive to allocate, applications should only allocate one writer per simultaneously open output stream.
|
|
|
Dump writer statistics to standard error.
|
|
||||||||||||||||
|
Declare a final set on an IPFIX message. Starts a new data set for the given TID and writes it as a final set; that is, a set that persists to end of file. Only available on started messages with an MTU of 0.
|
|
|
Dispose of a FixWriter.
|
|
||||||||||||||||
|
Revoke a template by writing a template revocation and removing the template from the session.
|