mio_config.h File Reference

Airframe Multiple I/O Configuration Support. More...

#include <airframe/mio.h>

Go to the source code of this file.

Defines

#define MIO_F_CLI_INMASK   0x0000007F
 Mask covering input flag bits; used internally.
#define MIO_F_CLI_FILE_IN   0x00000001
 Enable configuration of file, glob, and standard input.
#define MIO_F_CLI_DIR_IN   0x00000002
 Enable configuration of file input from directory (requires FILE_IN).
#define MIO_F_CLI_UDP_IN   0x00000004
 Enable configuration of UDP passive socket input.
#define MIO_F_CLI_TCP_IN   0x00000008
 Enable configuration of single-thread TCP passive socket input.
#define MIO_F_CLI_PCAP_IN   0x00000040
 Enable configuration of libpcap dump file and live capture input.
#define MIO_F_CLI_DEF_STDIN   0x00000080
 Default to standard input with no input specifier (requires FILE_IN).
#define MIO_F_CLI_OUTMASK   0x00007F00
 Mask covering output flag bits; used internally.
#define MIO_F_CLI_FILE_OUT   0x00000100
 Enable configuration of file output.
#define MIO_F_CLI_DIR_OUT   0x00000200
 Enable configuration of file output to directory.
#define MIO_F_CLI_UDP_OUT   0x00000400
 Enable configuration of UDP active socket output.
#define MIO_F_CLI_TCP_OUT   0x00000800
 Enable configuration of TCP active socket output.
#define MIO_F_CLI_DEF_STDOUT   0x00008000
 Default to standard output with no output specifier with standard input.

Functions

GOptionGroup * mio_option_group (uint32_t flags)
 Return a GOptionGroup appropriate for parsing MIO options consistent with the given CLI flags.
gboolean mio_config_source (MIOSource *source, uint32_t cli_flags, uint32_t *miod_flags, GError **err)
 Configure an MIOSource from mio_config command-line and global application options.
gboolean mio_config_sink (MIOSource *source, MIOSink *sink, char *basepat, uint32_t cli_flags, uint32_t *miod_flags, GError **err)
 Configure an MIOSink from mio_config command-line and global application options.
gboolean mio_config_multisink_file (MIOSource *source, MIOSink *sink, char *basepat, uint32_t count, char **labels, uint32_t cli_flags, uint32_t *miod_flags, GError **err)
 Configure a multiple MIOSink array of file sinks of from mio_config command-line and global application options, as well as a set of application-defined labels.

Variables

char * mio_ov_in
 Input specifier (--in argument).
char * mio_ov_out
 Output specifier (--out argument).
char * mio_ov_nextdir
 Next directory for file source (--nextdir argument), empty for delete, NULL for no routing.
char * mio_ov_faildir
 Fail directory for file source (--faildir argument), empty for delete, NULL for no routing.
int mio_ov_poll
 Polling delay (--poll argument).
gboolean mio_ov_lock
 Lock option flag (TRUE if --lock present).
gboolean mio_ov_live
 Live capture option flag (TRUE if --live present).
char * mio_ov_bpf
 BPF expression for pcap filter (--bpf argument).
uint32_t mio_ov_pcaplen
 Live capture length in octets.
uint32_t mio_ov_pcapto
 Live capture timeout in milliseconds.
char * mio_ov_port
 UDP/TCP source and sink default application service; string naming a service to be passed to getaddrinfo(3)/getservbyname(3), or a string containing an integer port number.
MIOType mio_ov_filetype
 MIOType of the FILE_IN sources and FILE_OUT sinks; valid values are MIO_T_NULL, MIO_T_FD, and MIO_T_FP.


Detailed Description

Airframe Multiple I/O Configuration Support.

Supplies command-line processing and configuration of MIOSource and MIOSink instances for MIO-based applications.

Applications use mio_config by describing the source and sink types they support via a set of flags, passing these flags to mio_option_group to get an option group for GOption-based processing; then, after the command line has been parsed, the application calls mio_config_source() and mio_config_sink() to create an appropriate source and sink, respectively.


Function Documentation

gboolean mio_config_multisink_file MIOSource source,
MIOSink sink,
char *  basepat,
uint32_t  count,
char **  labels,
uint32_t  cli_flags,
uint32_t *  miod_flags,
GError **  err
 

Configure a multiple MIOSink array of file sinks of from mio_config command-line and global application options, as well as a set of application-defined labels.

See mio_sink_multi.h and mio_sink_file.h for more. Call this after calling mio_option_group() and g_option_context_parse() on a GOptionContext containing the returned MIO GOptionGroup.

Parameters:
source Pointer to a configured MIOSource (generally from mio_config_source()); used for determining whether to default to standard output (pipe-filter mode). May pass NULL if your application is sourceless.
sink Pointer to MIOSink to configure. This MIOSink will be overwritten.
basepat Base pattern describing output filenames. See mio_sink_init_file_pattern() for pattern substitution rules; user-specified directory and application-specified labels will be prepended to this pattern.
count Number of file sinks to create in the multiple sink; also defines the size of the labels array.
labels Array of labels to attach to each output file in the multiple file sink.
cli_flags MIO_F_CLI_* flags describing application I/O capabilities. Must be identical to or a subset of the flags argument to mio_option_group(); applications may decide based on other command-line options that certain source types are no longer acceptable, for example.
miod_flags Pointer to an mio_dispatch() flags word. mio_config_multisink_file() may set or unset any MIO_F_OPT_* flags in this word as appropriate.
err An error description pointer; will contain error if mio_config_sink() was unable to configure a sink.
Returns:
TRUE if the MIOSink was configured successfully.

gboolean mio_config_sink MIOSource source,
MIOSink sink,
char *  basepat,
uint32_t  cli_flags,
uint32_t *  miod_flags,
GError **  err
 

Configure an MIOSink from mio_config command-line and global application options.

Call this after calling mio_option_group() and g_option_context_parse() on a GOptionContext containing the returned MIO GOptionGroup.

Parameters:
source Pointer to a configured MIOSource (generally from mio_config_source()); used for determining whether to default to standard output (pipe-filter mode). May pass NULL if your application is sourceless.
sink Pointer to MIOSink to configure. This MIOSink will be overwritten.
basepat Base pattern describing output filenames for FILE_OUT or DIR_OUT modes. See mio_sink_init_file_pattern() for pattern substitution rules; user-specified directory may be prepended to this pattern if supplied.
cli_flags MIO_F_CLI_* flags describing application I/O capabilities. Must be identical to or a subset of the flags argument to mio_option_group(); applications may decide based on other command-line options that certain source types are no longer acceptable, for example.
miod_flags Pointer to an mio_dispatch() flags word. mio_config_sink() may set or unset any MIO_F_OPT_* flags in this word as appropriate.
err An error description pointer; will contain error if mio_config_sink() was unable to configure a sink.
Returns:
TRUE if the MIOSink was configured successfully.

gboolean mio_config_source MIOSource source,
uint32_t  cli_flags,
uint32_t *  miod_flags,
GError **  err
 

Configure an MIOSource from mio_config command-line and global application options.

Call this after calling mio_option_group() and g_option_context_parse() on a GOptionContext containing the returned MIO GOptionGroup.

Parameters:
source Pointer to MIOSource to configure. This MIOSource will be overwritten.
cli_flags MIO_F_CLI_* flags describing application I/O capabilities. Must be identical to or a subset of the flags argument to mio_option_group(); applications may decide based on other command-line options that certain source types are no longer acceptable, for example.
miod_flags Pointer to an mio_dispatch() flags word. mio_config_source() may set or unset any MIO_F_OPT_* flags in this word as appropriate.
err An error description pointer; will contain error if mio_config_source() was unable to configure a source.
Returns:
TRUE if the MIOSource was configured successfully.

GOptionGroup* mio_option_group uint32_t  flags  ) 
 

Return a GOptionGroup appropriate for parsing MIO options consistent with the given CLI flags.

Parameters:
flags MIO_F_CLI_* flags describing application I/O capabilities.
Returns:
a new GOptionGroup


Variable Documentation

char* mio_ov_bpf
 

BPF expression for pcap filter (--bpf argument).

Global; do not modify.

char* mio_ov_faildir
 

Fail directory for file source (--faildir argument), empty for delete, NULL for no routing.

Global; do not modify.

MIOType mio_ov_filetype
 

MIOType of the FILE_IN sources and FILE_OUT sinks; valid values are MIO_T_NULL, MIO_T_FD, and MIO_T_FP.

Default is MIO_T_FP. Global application option; set before calling mio_config_source(), mio_config_sink(), or mio_dispatch().

char* mio_ov_in
 

Input specifier (--in argument).

Global; do not modify.

gboolean mio_ov_live
 

Live capture option flag (TRUE if --live present).

Global; do not modify.

gboolean mio_ov_lock
 

Lock option flag (TRUE if --lock present).

Global; do not modify.

char* mio_ov_nextdir
 

Next directory for file source (--nextdir argument), empty for delete, NULL for no routing.

Global; do not modify.

char* mio_ov_out
 

Output specifier (--out argument).

Global; do not modify.

uint32_t mio_ov_pcaplen
 

Live capture length in octets.

Global application option; set before calling mio_config_source() or mio_dispatch().

uint32_t mio_ov_pcapto
 

Live capture timeout in milliseconds.

Global application option; set before calling mio_config_source() or mio_dispatch().

int mio_ov_poll
 

Polling delay (--poll argument).

Amount of time in seconds mio_dispatch_loop() will sleep when no input is available for file source. Global; do not modify.

char* mio_ov_port
 

UDP/TCP source and sink default application service; string naming a service to be passed to getaddrinfo(3)/getservbyname(3), or a string containing an integer port number.

Global application option; set before calling mio_config_source(), mio_config_sink(), or mio_dispatch().


© 2005-2006 Carnegie Mellon University
Generated Thu Jun 15 10:08:41 2006 for Airframe 0.6.2 by Doxygen 1.4.5.