summaryrefslogtreecommitdiff
path: root/buffer.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2007-06-17 22:25:20 +0000
committerChristian Pointner <equinox@anytun.org>2007-06-17 22:25:20 +0000
commit261c9067380c5311c98e3576540eee6015be3297 (patch)
treef384eb8edbcc4d35793071090839453bcb4418a4 /buffer.h
parentadded cypher and authalgo (diff)
added [] - operator to Buffer
const Buffers are now possible
Diffstat (limited to 'buffer.h')
-rw-r--r--buffer.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/buffer.h b/buffer.h
index b8841af..aa279d9 100644
--- a/buffer.h
+++ b/buffer.h
@@ -31,6 +31,8 @@
#ifndef _BUFFER_H_
#define _BUFFER_H_
+class TunDevice;
+
class Buffer
{
public:
@@ -44,13 +46,15 @@ public:
u_int32_t resize(u_int32_t new_length);
u_int32_t getLength() const;
u_int8_t* getBuf();
- operator u_int8_t*( );
+ u_int8_t& operator[](u_int32_t index);
+ u_int8_t const& operator[](u_int32_t index) const;
protected:
+ operator u_int8_t*(); // just for write/read tun
+ friend class TunDevice;
u_int8_t *buf_;
u_int32_t length_;
};
-
#endif