From 28063bacec25253d5c67668932321c2044d1aa02 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Fri, 7 Dec 2007 15:07:11 +0000 Subject: serialisation & makefile fix --- Makefile | 12 ++++++++++++ keyDerivation.cpp | 6 ++++++ keyDerivation.h | 6 ++++++ networkAddress.cpp | 4 +++- seqWindow.cpp | 8 ++++++++ seqWindow.h | 9 +++++++++ 6 files changed, 44 insertions(+), 1 deletion(-) 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 +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] +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 + void serialize(Archive & ar, const unsigned int version); + window_size_t window_size_; Mutex mutex_; SenderMap sender_; -- cgit v1.2.3