capture

Name

capture -- 

Synopsis



int         capture_start                   (void);
void        capture_stats                   (void);
void        capture_stop                    (void);
void        capture_to_file                 (const char *filename);
int         capture_setup_global_bpf        (char *gbpf);
int         capture_from_device             (char *device,
                                             char *bpf);
int         capture_from_file               (char *filename,
                                             char *bpf);

Description

Details

capture_start ()

int         capture_start                   (void);

Start the capture on previously configured device. This function will not return unless an error occur.

Returns : -1 on error.


capture_stats ()

void        capture_stats                   (void);

Dump packet capture statistic.


capture_stop ()

void        capture_stop                    (void);

Stop packet capture.


capture_to_file ()

void        capture_to_file                 (const char *filename);

filename : 


capture_setup_global_bpf ()

int         capture_setup_global_bpf        (char *gbpf);

This function setup a BPF rule for all interfaces.

gbpf : A Berkeley Packet Filter rule.
Returns : 0 on success, -1 otherwise.


capture_from_device ()

int         capture_from_device             (char *device,
                                             char *bpf);

Initialize the capture on specified device, with an optionnal bpf rule.

device : The device to capture packet from.
bpf : An optionnal Berkeley Packet Filter rule.
Returns : 0 on success, -1 otherwise.


capture_from_file ()

int         capture_from_file               (char *filename,
                                             char *bpf);

Initialize the capture on specified filename, with an optionnal bpf rule.

filename : The filename to read the packet from.
bpf : An optionnal Berkeley Packet Filter rule.
Returns : 0 on success, -1 otherwise.