IBR-DTNSuite
0.8
|
00001 #ifndef __MUTUAL_SERIALIZER_H__ 00002 #define __MUTUAL_SERIALIZER_H__ 00003 00004 #include "ibrdtn/data/Serializer.h" 00005 #include "ibrdtn/security/SecurityBlock.h" 00006 #include "ibrdtn/data/SDNV.h" 00007 #include <sys/types.h> 00008 00009 namespace dtn 00010 { 00011 namespace security 00012 { 00013 class SecurityBlock; 00014 00023 class MutualSerializer : public dtn::data::DefaultSerializer 00024 { 00025 public: 00029 static const size_t sdnv_size = 8; 00030 00036 MutualSerializer(std::ostream& stream, const dtn::data::Block *ignore = NULL); 00037 00039 virtual ~MutualSerializer(); 00040 00048 virtual Serializer &operator<<(const dtn::data::PrimaryBlock &obj); 00049 00057 virtual Serializer &operator<<(const dtn::data::Block &obj); 00058 00062 virtual size_t getLength(const dtn::data::Bundle &obj); 00063 00069 virtual size_t getLength(const dtn::data::PrimaryBlock &obj) const; 00070 00076 virtual size_t getLength(const dtn::data::Block &obj) const; 00077 00084 virtual Serializer &operator<<(const u_int32_t value); 00085 00092 virtual Serializer &operator<<(const dtn::data::EID& value); 00093 00100 virtual Serializer &operator<<(const dtn::data::SDNV& value); 00101 00107 virtual Serializer &operator<<(const dtn::security::SecurityBlock::TLVList& list); 00108 00109 private: 00110 const dtn::data::Block *_ignore; 00111 bool _ignore_previous_bundles; 00112 }; 00113 } 00114 } 00115 00116 #endif