diff options
author | Christian Pointner <equinox@anytun.org> | 2007-06-17 02:55:19 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2007-06-17 02:55:19 +0000 |
commit | ff3fa71574881d7e6e29937af52b62c24c867294 (patch) | |
tree | b592b09d87d78eb208a46a9413d49a417e2291c2 /tunDevice.h | |
parent | added new constructor to buffer (diff) |
tunDevice can now be open and closed
tunDevice write seems to work now
tunDevice read seems not to work yet
Diffstat (limited to 'tunDevice.h')
-rw-r--r-- | tunDevice.h | 16 |
1 files changed, 13 insertions, 3 deletions
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 |