summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2007-12-07 15:07:11 +0000
committerOthmar Gsenger <otti@anytun.org>2007-12-07 15:07:11 +0000
commit28063bacec25253d5c67668932321c2044d1aa02 (patch)
tree951a787537b00877c4533dd19c75206e609853f3
parentserialisation of buffer und connection param (diff)
serialisation & makefile fix
-rw-r--r--Makefile12
-rw-r--r--keyDerivation.cpp6
-rw-r--r--keyDerivation.h6
-rw-r--r--networkAddress.cpp4
-rw-r--r--seqWindow.cpp8
-rw-r--r--seqWindow.h9
6 files changed, 44 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 16a20b6..ae4993f 100644
--- a/Makefile
+++ b/Makefile
@@ -111,6 +111,18 @@ options.o: options.cpp options.h
seqWindow.o: seqWindow.cpp seqWindow.h
$(C++) $(CCFLAGS) $< -c
+connectionList.o: connectionList.cpp connectionList.h
+ $(C++) $(CCFLAGS) $< -c
+
+connectionParam.o: connectionParam.cpp connectionParam.h
+ $(C++) $(CCFLAGS) $< -c
+
+networkAddress.o: networkAddress.cpp networkAddress.h
+ $(C++) $(CCFLAGS) $< -c
+
+router.o: router.cpp router.h
+ $(C++) $(CCFLAGS) $< -c
+
anytun.o: anytun.cpp
$(C++) $(CCFLAGS) $< -c
diff --git a/keyDerivation.cpp b/keyDerivation.cpp
index a171244..5b7b739 100644
--- a/keyDerivation.cpp
+++ b/keyDerivation.cpp
@@ -142,3 +142,9 @@ void KeyDerivation::clear()
gcry_cipher_close( cipher_ );
}
+template<class Archive>
+void KeyDerivation::serialize(Archive & ar, const unsigned int version)
+{
+ ar & ld_kdr_;
+ ar & salt_;
+}
diff --git a/keyDerivation.h b/keyDerivation.h
index a9939a3..7f7fdc2 100644
--- a/keyDerivation.h
+++ b/keyDerivation.h
@@ -47,6 +47,12 @@ typedef enum {
label_satp_salt = 0x02,
} satp_prf_label;
+namespace boost {
+ namespace serialization {
+ class access;
+ }
+}
+
class KeyDerivation
{
public:
diff --git a/networkAddress.cpp b/networkAddress.cpp
index ca132db..cd40d86 100644
--- a/networkAddress.cpp
+++ b/networkAddress.cpp
@@ -62,6 +62,7 @@ void NetworkAddress::getNetworkAddress(const char *)
network_address_type_t NetworkAddress::getNetworkAddressType()
{
+ return network_address_type_;
}
bool NetworkAddress::operator<(const NetworkAddress &right) const
@@ -72,7 +73,7 @@ bool NetworkAddress::operator<(const NetworkAddress &right) const
{
return (ipv4_address_.s_addr < right.ipv4_address_.s_addr);
} else if (network_address_type_==ipv6) {
- for(int i=0;i++;i<4)
+ for(int i=0;i<4;i++)
if (ipv6_address_.s6_addr32[i]<right.ipv6_address_.s6_addr32[i])
return true;
return false;
@@ -81,5 +82,6 @@ bool NetworkAddress::operator<(const NetworkAddress &right) const
} else {
//TODO
}
+ return false;
}
diff --git a/seqWindow.cpp b/seqWindow.cpp
index 28227d9..478efbf 100644
--- a/seqWindow.cpp
+++ b/seqWindow.cpp
@@ -88,3 +88,11 @@ void SeqWindow::clear()
Lock lock(mutex_);
sender_.clear();
}
+
+template<class Archive>
+void SeqWindow::serialize(Archive & ar, const unsigned int version)
+{
+ ar & window_size_;
+ //TODO: Do not sync complete Sender Map!
+ ar & sender_;
+}
diff --git a/seqWindow.h b/seqWindow.h
index 77af418..074ecb5 100644
--- a/seqWindow.h
+++ b/seqWindow.h
@@ -37,6 +37,12 @@
#include "threadUtils.hpp"
#include "datatypes.h"
+namespace boost {
+ namespace serialization {
+ class access;
+ }
+}
+
class SeqWindow
{
public:
@@ -56,6 +62,9 @@ private:
SeqWindow(const SeqWindow &s);
void operator=(const SeqWindow &s);
+ template<class Archive>
+ void serialize(Archive & ar, const unsigned int version);
+
window_size_t window_size_;
Mutex mutex_;
SenderMap sender_;