IBR-DTNSuite
0.10
|
#include <MutualSerializer.h>
Public Member Functions | |
MutualSerializer (std::ostream &stream, const dtn::data::Block *ignore=NULL) | |
virtual | ~MutualSerializer () |
virtual Serializer & | operator<< (const dtn::data::PrimaryBlock &obj) |
virtual Serializer & | operator<< (const dtn::data::Block &obj) |
virtual dtn::data::Length | getLength (const dtn::data::Bundle &obj) |
virtual dtn::data::Length | getLength (const dtn::data::PrimaryBlock &obj) const |
virtual dtn::data::Length | getLength (const dtn::data::Block &obj) const |
virtual Serializer & | operator<< (const uint32_t value) |
virtual Serializer & | operator<< (const dtn::data::EID &value) |
virtual Serializer & | operator<< (const dtn::data::Number &value) |
virtual Serializer & | operator<< (const dtn::security::SecurityBlock::TLVList &list) |
![]() | |
DefaultSerializer (std::ostream &stream) | |
DefaultSerializer (std::ostream &stream, const Dictionary &d) | |
virtual | ~DefaultSerializer () |
virtual Serializer & | operator<< (const dtn::data::Bundle &obj) |
virtual Serializer & | operator<< (const dtn::data::BundleFragment &obj) |
![]() | |
virtual | ~Serializer () |
Static Public Attributes | |
static const dtn::data::Length | sdnv_size = 8 |
Additional Inherited Members | |
![]() | |
Serializer & | serialize (const dtn::data::PayloadBlock &obj, const Length &clip_offset, const Length &clip_length) |
void | rebuildDictionary (const dtn::data::Bundle &obj) |
bool | isCompressable (const dtn::data::Bundle &obj) const |
![]() | |
std::ostream & | _stream |
Dictionary | _dictionary |
bool | _compressable |
Serializes a bundle in mutable canonical form into a given stream. In mutable canonical form all SDNVs are unpacked to 8 byte values and all EID references are filled with the EID they point to. Every number is written in network byte order. Only payload related blocks are serialized. These are the payload block, the PayloadIntegrityBlock and the PayloadConfidentialBlock.
Definition at line 44 of file MutualSerializer.h.
dtn::security::MutualSerializer::MutualSerializer | ( | std::ostream & | stream, |
const dtn::data::Block * | ignore = NULL |
||
) |
Creates a MutualSerializer which will stream into stream
stream | the stream in which the mutable canonical form will be written into |
Definition at line 58 of file MutualSerializer.cpp.
|
virtual |
does nothing
Definition at line 63 of file MutualSerializer.cpp.
|
virtual |
Not implemented. This is only required by the interface.
Reimplemented from dtn::data::DefaultSerializer.
Definition at line 154 of file MutualSerializer.cpp.
Referenced by operator<<().
|
virtual |
Returns the length of the primary block in mutable canonical form.
obj | the primary block, of which the length shall be calculated |
Reimplemented from dtn::data::DefaultSerializer.
Definition at line 162 of file MutualSerializer.cpp.
References dtn::data::PrimaryBlock::destination, dtn::data::EID::getString(), IBRCOMMON_LOGGER_DEBUG_ex, IBRCOMMON_LOGGER_ENDL, ibrcommon::Logger::LOGGER_DEBUG, dtn::data::PrimaryBlock::reportto, sdnv_size, and dtn::data::PrimaryBlock::source.
|
virtual |
Returns the length of the block in mutable canonical form.
obj | the block, of which the length shall be calculated |
Reimplemented from dtn::data::DefaultSerializer.
Definition at line 190 of file MutualSerializer.cpp.
References dtn::data::Block::BLOCK_CONTAINS_EIDS, dtn::data::Block::get(), dtn::data::Block::getEIDList(), dtn::data::Block::getLength(), dtn::security::SecurityBlock::getLength_mutable(), dtn::data::Block::getType(), and sdnv_size.
|
virtual |
Serializes the primary block in mutable canonical form. The usual rules for mutable canonicalisation (network byte order, unpacked SDNV, full EIDs instead of references) apply here and some bits of the flags are set to zero during this operation.
Reimplemented from dtn::data::DefaultSerializer.
Definition at line 67 of file MutualSerializer.cpp.
References dtn::data::DefaultSerializer::_stream, dtn::data::PrimaryBlock::destination, getLength(), dtn::data::PrimaryBlock::lifetime, dtn::data::PrimaryBlock::procflags, dtn::data::PrimaryBlock::reportto, dtn::data::PrimaryBlock::sequencenumber, dtn::data::PrimaryBlock::source, and dtn::data::PrimaryBlock::timestamp.
|
virtual |
Serializes the block in mutable canonical form. The usual rules for mutable canonicalisation (network byte order, unpacked SDNV, full EIDs instead of references) apply here and some bits of the flags are set to zero during this operation.
Reimplemented from dtn::data::DefaultSerializer.
Definition at line 97 of file MutualSerializer.cpp.
References dtn::data::DefaultSerializer::_stream, dtn::data::Block::BLOCK_CONTAINS_EIDS, dtn::data::PayloadBlock::BLOCK_TYPE, dtn::data::Block::get(), dtn::data::Block::getEIDList(), dtn::data::Block::getLength(), dtn::security::SecurityBlock::getLength_mutable(), dtn::data::Block::getProcessingFlags(), dtn::data::Block::getType(), dtn::security::SecurityBlock::PAYLOAD_CONFIDENTIAL_BLOCK, dtn::security::SecurityBlock::PAYLOAD_INTEGRITY_BLOCK, dtn::data::Block::serialize(), and dtn::security::SecurityBlock::serialize_mutable_without_security_result().
|
virtual |
Writes a uint32_t into stream in network byte order.
stream | the stream in which shall be written |
value | the value to be written in network byte order |
Definition at line 226 of file MutualSerializer.cpp.
References dtn::data::DefaultSerializer::_stream.
|
virtual |
Writes an EID to a stream in mutable form.
stream | the stream in which shall be written |
value | the EID which shall be written |
Definition at line 233 of file MutualSerializer.cpp.
References dtn::data::DefaultSerializer::_stream, and dtn::data::EID::getString().
|
virtual |
Writes a SDNV to a stream in mutable form.
stream | the stream in which shall be written |
value | the SDNV which shall be written |
Definition at line 242 of file MutualSerializer.cpp.
References dtn::data::DefaultSerializer::_stream, dtn::data::SDNV< E >::get(), and GUINT64_TO_BE.
|
virtual |
Serialize a list of type-length-value entries.
list |
Definition at line 251 of file MutualSerializer.cpp.
References dtn::data::DefaultSerializer::_stream, dtn::security::SecurityBlock::TLVList::getLength(), and dtn::security::SecurityBlock::TLVList::toString().
|
static |
The size in bytes of a SDNV in mutable form in the stream
Definition at line 50 of file MutualSerializer.h.
Referenced by getLength(), and dtn::security::SecurityBlock::getLength_mutable().