summaryrefslogtreecommitdiff
path: root/src/networkAddress.h
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2008-12-22 01:38:19 +0000
committerOthmar Gsenger <otti@anytun.org>2008-12-22 01:38:19 +0000
commitdd37bc54dae219e4d1975f014ec36c221ec4db20 (patch)
tree38e7f427b0ae736841f4193935e39aae500a16dd /src/networkAddress.h
parentadded route option to anytun (diff)
new routing system
supports ipv4 and ipv6 routing with subnetting
Diffstat (limited to 'src/networkAddress.h')
-rw-r--r--src/networkAddress.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/networkAddress.h b/src/networkAddress.h
index 3eb0b51..f866cca 100644
--- a/src/networkAddress.h
+++ b/src/networkAddress.h
@@ -39,6 +39,11 @@
#include <string>
#include <boost/asio.hpp>
+#include <boost/array.hpp>
+
+typedef boost::array<unsigned char,6> ethernet_bytes_type;
+typedef boost::asio::ip::address_v4::bytes_type ipv4_bytes_type;
+typedef boost::asio::ip::address_v6::bytes_type ipv6_bytes_type;
enum network_address_type_t
{
@@ -62,6 +67,9 @@ public:
network_address_type_t getNetworkAddressType() const;
std::string toString() const;
bool operator<(const NetworkAddress &s) const;
+ ipv4_bytes_type to_bytes_v4() const;
+ ipv6_bytes_type to_bytes_v6() const;
+ ethernet_bytes_type to_bytes_ethernet() const;
protected:
Mutex mutex_;
boost::asio::ip::address_v4 ipv4_address_;