Newer
Older
#include "Layer.hh"
#include "Params.hh"
class PORT;
class PcapLayer : public PORT, public Layer {
Params _params;
pcap_t *_device;
int _pcap_h;
pthread_t _thread_id;
bool _running;
bool _resume;
int _fd[2];
static void * run(void *p_this);
public:
inline PcapLayer() : PORT("PcapLayer"), Layer(), _params(), _device(NULL), _pcap_h(-1), _thread_id(-1), _running(FALSE), _resume(FALSE) { _fd[0] = -1; _fd[1] = -1; };
PcapLayer(const std::string & type, const std::string & param);
virtual ~PcapLayer();
virtual void sendData(const OCTETSTRING& data, const Params& params);
virtual void receiveData(const OCTETSTRING& data, const Params& info);
void Handle_Fd_Event_Readable(int fd);