summaryrefslogtreecommitdiff
path: root/tunDevice.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2007-06-17 02:55:19 +0000
committerChristian Pointner <equinox@anytun.org>2007-06-17 02:55:19 +0000
commitff3fa71574881d7e6e29937af52b62c24c867294 (patch)
treeb592b09d87d78eb208a46a9413d49a417e2291c2 /tunDevice.h
parentadded 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.h16
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