#define LND_DUMPER_500MB #define LND_DUMPER_1GB #define LND_DUMPER_2GB typedef LND_Dumper; LND_DumperArgs; void libnd_dumper_args_init (LND_DumperArgs *args); LND_Dumper * libnd_dumper_new (pcap_t *pcap, const char *dumper_name, LND_DumperArgs *args); void libnd_dumper_free (LND_Dumper *dumper); gboolean libnd_dumper_write (LND_Dumper *dumper, LND_Packet *packet); void libnd_dumper_delete (LND_Dumper *dumper); guint64 libnd_dumper_get_size (LND_Dumper *dumper); |
typedef struct { pcapnav_dumpmode_t open_mode; guint64 file_limit; guint64 hard_limit; } LND_DumperArgs; |
void libnd_dumper_args_init (LND_DumperArgs *args); |
The function initializes the dumper spec structure to default values. Currently, these are all zeroes.
the argument structure to initialize.
LND_Dumper * libnd_dumper_new (pcap_t *pcap, const char *dumper_name, LND_DumperArgs *args); |
The function returns a new dumper, or NULL on error. args can be NULL, in which case a per-file size limit of 1GB is enforced.
the pcap handle for the new dumper, as used in pcap_dump_open()
.
the file name of the dumper.
the dumper specification.
void libnd_dumper_free (LND_Dumper *dumper); |
The function closes the current output file, if any, and releases all memory resources of the dumper.
dumper to close.
gboolean libnd_dumper_write (LND_Dumper *dumper, LND_Packet *packet); |
void libnd_dumper_delete (LND_Dumper *dumper); |
The function looks for all files the dumper might have created based on its name and deletes them, until one is found that does not exist. So if the dumper name is "foo", it potentially deletes files foo, foo.00001, foo.00002 etc, until a nonexistant file is hit.
the dumper whose files to delete.
guint64 libnd_dumper_get_size (LND_Dumper *dumper); |
The function returns the total size, in bytes, of all packets ever written to this dumper (counting across multiple created files).
dumper to return size of.