Airframe Application Utilities
libairframe 2.12.0 API documentation

Data Structures | Macros | Typedefs | Functions
mio_source_pcap.h File Reference

MIO libpcap source initializers. More...

#include <airframe/mio.h>
#include <airframe/mio_source_file.h>

Go to the source code of this file.

Data Structures

struct  _MIOSourcePCapFileConfig
 libpcap dumpfile source configuration context. More...
 
struct  _MIOSourcePCapLiveConfig
 libpcap live source configuration context. More...
 

Macros

#define mio_pcap(_s_)   ((pcap_t *)(_s_)->vsp)
 Convenience macro to get a source's currently open pcap context. More...
 

Typedefs

typedef struct _MIOSourcePCapFileConfig MIOSourcePCapFileConfig
 libpcap dumpfile source configuration context. More...
 
typedef struct _MIOSourcePCapLiveConfig MIOSourcePCapLiveConfig
 libpcap live source configuration context. More...
 

Functions

gboolean mio_source_init_pcap_dir (MIOSource *source, const char *spec, MIOType vsp_type, void *cfg, GError **err)
 Initialize a pcap source for reading every libpcap dumpfile from a specified directory. More...
 
gboolean mio_source_init_pcap_glob (MIOSource *source, const char *spec, MIOType vsp_type, void *cfg, GError **err)
 Initialize a pcap source for reading every libpcap dumpfile from a specified glob(3) expression. More...
 
gboolean mio_source_init_pcap_single (MIOSource *source, const char *spec, MIOType vsp_type, void *cfg, GError **err)
 Initialize a pcap source for a single libpcap dumpfile. More...
 
gboolean mio_source_init_pcap_stdin (MIOSource *source, const char *spec, MIOType vsp_type, void *cfg, GError **err)
 Initialize a pcap source for a single libpcap dumpfile read from standard input. More...
 
gboolean mio_source_init_pcap_live (MIOSource *source, const char *spec, MIOType vsp_type, void *cfg, GError **err)
 Initialize a pcap source for live capture from an interface using libpcap. More...
 

Detailed Description

MIO libpcap source initializers.

Most applications should use the interface in mio_config.h to access these initializers.

Macro Definition Documentation

◆ mio_pcap

#define mio_pcap (   _s_)    ((pcap_t *)(_s_)->vsp)

Convenience macro to get a source's currently open pcap context.

Only valid if the source's vsp_type is MIO_T_PCAP.

Typedef Documentation

◆ MIOSourcePCapFileConfig

libpcap dumpfile source configuration context.

Pass as the cfg argument to any pcap file source initializer.

◆ MIOSourcePCapLiveConfig

libpcap live source configuration context.

Pass as the cfg argument to mio_source_init_pcap_live().

Function Documentation

◆ mio_source_init_pcap_dir()

gboolean mio_source_init_pcap_dir ( MIOSource source,
const char *  spec,
MIOType  vsp_type,
void *  cfg,
GError **  err 
)

Initialize a pcap source for reading every libpcap dumpfile from a specified directory.

Parameters
sourcepointer to MIOSource to initialize. This MIOSource will be overwritten.
specinput specifier to initialize MIOSource with. Must be the pathname of an accessible directory.
vsp_typerequested source pointer type, or MIO_T_ANY for default.
cfgpointer to configuration context. Must be a pointer to an MIOSourcePcapFileConfig structure.
errAn error description pointer.
Returns
TRUE if the MIOSource was successfully initialized.

◆ mio_source_init_pcap_glob()

gboolean mio_source_init_pcap_glob ( MIOSource source,
const char *  spec,
MIOType  vsp_type,
void *  cfg,
GError **  err 
)

Initialize a pcap source for reading every libpcap dumpfile from a specified glob(3) expression.

Fails over to mio_source_init_pcap_single() if the specifier contains no glob expression characters.

Parameters
sourcepointer to MIOSource to initialize. This MIOSource will be overwritten.
specinput specifier to initialize MIOSource with. Must be a glob expression.
vsp_typerequested source pointer type, or MIO_T_ANY for default.
cfgpointer to configuration context. Must be a pointer to an MIOSourcePcapFileConfig structure.
errAn error description pointer.
Returns
TRUE if the MIOSource was successfully initialized.

◆ mio_source_init_pcap_live()

gboolean mio_source_init_pcap_live ( MIOSource source,
const char *  spec,
MIOType  vsp_type,
void *  cfg,
GError **  err 
)

Initialize a pcap source for live capture from an interface using libpcap.

Depending on the operating system and configuration, this may require special privileges.

Parameters
sourcepointer to MIOSource to initialize. This MIOSource will be overwritten.
specinput specifier to initialize MIOSource with. Must be a valid libpcap interface name.
vsp_typerequested source pointer type, or MIO_T_ANY for default.
cfgpointer to configuration context. Must be a pointer to an MIOSourcePcapLiveConfig structure.
errAn error description pointer.
Returns
TRUE if the MIOSource was successfully initialized.

◆ mio_source_init_pcap_single()

gboolean mio_source_init_pcap_single ( MIOSource source,
const char *  spec,
MIOType  vsp_type,
void *  cfg,
GError **  err 
)

Initialize a pcap source for a single libpcap dumpfile.

Fails over to mio_source_init_pcap_stdin() if specifier is the special string "-".

Parameters
sourcepointer to MIOSource to initialize. This MIOSource will be overwritten.
specinput specifier to initialize MIOSource with. Must be a filename.
vsp_typerequested source pointer type, or MIO_T_ANY for default.
cfgpointer to configuration context. Must be a pointer to an MIOSourcePcapFileConfig structure.
errAn error description pointer.
Returns
TRUE if the MIOSource was successfully initialized.

◆ mio_source_init_pcap_stdin()

gboolean mio_source_init_pcap_stdin ( MIOSource source,
const char *  spec,
MIOType  vsp_type,
void *  cfg,
GError **  err 
)

Initialize a pcap source for a single libpcap dumpfile read from standard input.

Parameters
sourcepointer to MIOSource to initialize. This MIOSource will be overwritten.
specinput specifier to initialize MIOSource with. Must be the string "-".
vsp_typerequested source pointer type, or MIO_T_ANY for default.
cfgpointer to configuration context. Must be a pointer to an MIOSourcePcapFileConfig structure.
errAn error description pointer.
Returns
TRUE if the MIOSource was successfully initialized.