From ff3fa71574881d7e6e29937af52b62c24c867294 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 17 Jun 2007 02:55:19 +0000 Subject: tunDevice can now be open and closed tunDevice write seems to work now tunDevice read seems not to work yet --- tunDevice.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'tunDevice.h') diff --git a/tunDevice.h b/tunDevice.h index 487167a..b18d233 100644 --- a/tunDevice.h +++ b/tunDevice.h @@ -31,20 +31,30 @@ #ifndef _TUNDEVICE_H_ #define _TUNDEVICE_H_ +#include "buffer.h" + class TunDevice { public: - TunDevice(const char* dev); + TunDevice(const char* dev, const char* ifcfg_lp, const char* ifcfg_rnmp); ~TunDevice(); - int read(uint8_t *buf, int len); - int write(uint8_t *buf, int len); + void open(); + void close(); + bool isOpen(); + + int read(Buffer& buf); + int write(Buffer& buf); + + char* getActualName(); private: void operator=(const TunDevice &src); TunDevice(const TunDevice &src); struct tuntap *dev_; + char *dev_name_; + bool is_open_; }; #endif -- cgit v1.2.3