Capturing with libpcap
 All Classes Files Functions Variables
PcapWrapper Class Reference

This class encapsulates some functions of libpcap. More...

#include <pcapwrapper.h>

Collaboration diagram for PcapWrapper:
Collaboration graph

Public Member Functions

 PcapWrapper (char *=NULL)
 ~PcapWrapper ()
void run (int=0)
void setFilter (char *)

Private Attributes

char * dev
char * filter
char errbuf [PCAP_ERRBUF_SIZE]
bpf_u_int32 mask
bpf_u_int32 net
struct bpf_program fp
pcap_t * handle

Detailed Description

This class encapsulates some functions of libpcap.

This class can be used as an exercise for a simple packet capture.

Constructor & Destructor Documentation

PcapWrapper::PcapWrapper ( char *  filter_ = NULL)
PcapWrapper::~PcapWrapper ( )

Member Function Documentation

void PcapWrapper::run ( int  stoptime_ = 0)
void PcapWrapper::setFilter ( char *  filter_)

Member Data Documentation

char* PcapWrapper::dev
private
char PcapWrapper::errbuf[PCAP_ERRBUF_SIZE]
private
char * PcapWrapper::filter
private
struct bpf_program PcapWrapper::fp
private
pcap_t* PcapWrapper::handle
private
bpf_u_int32 PcapWrapper::mask
private
bpf_u_int32 PcapWrapper::net
private

The documentation for this class was generated from the following files: