summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--connectionList.h4
-rw-r--r--connectionParam.h (renamed from connParam.h)6
-rw-r--r--networkAddress.cpp59
-rw-r--r--networkAddress.h60
5 files changed, 126 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 4dbad5e..7cf27b2 100644
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,7 @@ OBJS = anytun.o \
authAlgo.o \
keyDerivation.o \
connectionList.o \
+ networkAddress.o \
PracticalSocket.o \
signalController.o \
log.o \
diff --git a/connectionList.h b/connectionList.h
index 926a9ba..45dcd7d 100644
--- a/connectionList.h
+++ b/connectionList.h
@@ -36,6 +36,7 @@
#include "threadUtils.hpp"
#include "datatypes.h"
+#include "connectionParam.h"
class ConnectionList
{
@@ -48,7 +49,8 @@ public:
private:
ConnectionList(const ConnectionList &s);
void operator=(const ConnectionList &s);
-
+ typedef std::map<NetworkAddress, connection_param_t> ConnectionMap;
+ ConnectionMap connections_;
Mutex mutex_;
};
diff --git a/connParam.h b/connectionParam.h
index e5fa255..3cd8275 100644
--- a/connParam.h
+++ b/connectionParam.h
@@ -28,10 +28,10 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef _CONNPARAM_H_
-#define _CONNPARAM_H_
+#ifndef _CONNECTIONPARAM_H_
+#define _CONNECTIONPARAM_H_
-struct connParam
+struct connection_param_t
{
Options& opt;
KeyDerivation& kd;
diff --git a/networkAddress.cpp b/networkAddress.cpp
new file mode 100644
index 0000000..b6e4528
--- /dev/null
+++ b/networkAddress.cpp
@@ -0,0 +1,59 @@
+/*
+ * anytun
+ *
+ * The secure anycast tunneling protocol (satp) defines a protocol used
+ * for communication between any combination of unicast and anycast
+ * tunnel endpoints. It has less protocol overhead than IPSec in Tunnel
+ * mode and allows tunneling of every ETHER TYPE protocol (e.g.
+ * ethernet, ip, arp ...). satp directly includes cryptography and
+ * message authentication based on the methodes used by SRTP. It is
+ * intended to deliver a generic, scaleable and secure solution for
+ * tunneling and relaying of packets of any protocol.
+ *
+ *
+ * Copyright (C) 2007 anytun.org <satp@wirdorange.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "threadUtils.hpp"
+#include "datatypes.h"
+
+#include "networkAddress.h"
+
+NetworkAddress::NetworkAddress():address_length_(0)
+{
+}
+
+NetworkAddress::~NetworkAddress()
+{
+}
+
+void NetworkAddress::setNetworkAddress(const network_address_type_t type, const char * address )
+{
+}
+
+void NetworkAddress::getNetworkAddress(const char *)
+{
+}
+
+network_address_type_t NetworkAddress::getNetworkAddressType()
+{
+}
+
+bool NetworkAddress::operator<(const NetworkAddress &right) const
+{
+}
+
diff --git a/networkAddress.h b/networkAddress.h
new file mode 100644
index 0000000..59430e5
--- /dev/null
+++ b/networkAddress.h
@@ -0,0 +1,60 @@
+/*
+ * anytun
+ *
+ * The secure anycast tunneling protocol (satp) defines a protocol used
+ * for communication between any combination of unicast and anycast
+ * tunnel endpoints. It has less protocol overhead than IPSec in Tunnel
+ * mode and allows tunneling of every ETHER TYPE protocol (e.g.
+ * ethernet, ip, arp ...). satp directly includes cryptography and
+ * message authentication based on the methodes used by SRTP. It is
+ * intended to deliver a generic, scaleable and secure solution for
+ * tunneling and relaying of packets of any protocol.
+ *
+ *
+ * Copyright (C) 2007 anytun.org <satp@wirdorange.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _NETWORK_ADDRESS_H
+#define _NETWORK_ADDRESS_H
+
+#include "threadUtils.hpp"
+#include "datatypes.h"
+
+enum network_address_type_t
+{
+ ipv4,
+ ipv6,
+ ethernet
+};
+
+class NetworkAddress
+{
+public:
+ NetworkAddress();
+ ~NetworkAddress();
+ void setNetworkAddress(const network_address_type_t type, const char * address );
+ void getNetworkAddress(const char *);
+ network_address_type_t getNetworkAddressType();
+
+private:
+ bool operator<(const NetworkAddress &s) const;
+ Mutex mutex_;
+ uint8_t address_length_;
+ network_address_type_t network_address_type_;
+};
+
+#endif