Airframe Application Utilities
libairframe 0.7.2 API documentation

Main Page | Data Structures | File List | Data Fields | Globals

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...

Defines

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

Typedefs

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

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.
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.
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.
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.
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.

Detailed Description

MIO libpcap source initializers.

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


Define Documentation

#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

typedef struct _MIOSourcePCapFileConfig MIOSourcePCapFileConfig
 

libpcap dumpfile source configuration context.

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

typedef struct _MIOSourcePCapLiveConfig MIOSourcePCapLiveConfig
 

libpcap live source configuration context.

Pass as the cfg argument to mio_source_init_pcap_live().


Function Documentation

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:
source pointer to MIOSource to initialize. This MIOSource will be overwritten.
spec input specifier to initialize MIOSource with. Must be the pathname of an accessible directory.
vsp_type requested source pointer type, or MIO_T_ANY for default.
cfg pointer to configuration context. Must be a pointer to an MIOSourcePcapFileConfig structure.
err An error description pointer.
Returns:
TRUE if the MIOSource was successfully initialized.

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:
source pointer to MIOSource to initialize. This MIOSource will be overwritten.
spec input specifier to initialize MIOSource with. Must be a glob expression.
vsp_type requested source pointer type, or MIO_T_ANY for default.
cfg pointer to configuration context. Must be a pointer to an MIOSourcePcapFileConfig structure.
err An error description pointer.
Returns:
TRUE if the MIOSource was successfully initialized.

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:
source pointer to MIOSource to initialize. This MIOSource will be overwritten.
spec input specifier to initialize MIOSource with. Must be a valid libpcap interface name.
vsp_type requested source pointer type, or MIO_T_ANY for default.
cfg pointer to configuration context. Must be a pointer to an MIOSourcePcapLiveConfig structure.
err An error description pointer.
Returns:
TRUE if the MIOSource was successfully initialized.

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:
source pointer to MIOSource to initialize. This MIOSource will be overwritten.
spec input specifier to initialize MIOSource with. Must be a filename.
vsp_type requested source pointer type, or MIO_T_ANY for default.
cfg pointer to configuration context. Must be a pointer to an MIOSourcePcapFileConfig structure.
err An error description pointer.
Returns:
TRUE if the MIOSource was successfully initialized.

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:
source pointer to MIOSource to initialize. This MIOSource will be overwritten.
spec input specifier to initialize MIOSource with. Must be the string "-".
vsp_type requested source pointer type, or MIO_T_ANY for default.
cfg pointer to configuration context. Must be a pointer to an MIOSourcePcapFileConfig structure.
err An error description pointer.
Returns:
TRUE if the MIOSource was successfully initialized.