IBR-DTNSuite
0.12
|
#include <MutableSerializer.h>
Public Member Functions | |
MutableSerializer (std::ostream &stream, const dtn::data::Block *ignore=NULL) | |
virtual | ~MutableSerializer () |
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) |
Public Member Functions inherited from dtn::data::DefaultSerializer | |
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) |
Public Member Functions inherited from dtn::data::Serializer | |
virtual | ~Serializer () |
Static Public Attributes | |
static const dtn::data::Length | sdnv_size = 8 |
Additional Inherited Members | |
Protected Member Functions inherited from dtn::data::DefaultSerializer | |
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 |
Protected Attributes inherited from dtn::data::DefaultSerializer | |
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 MutableSerializer.h.
dtn::security::MutableSerializer::MutableSerializer | ( | std::ostream & | stream, |
const dtn::data::Block * | ignore = NULL |
||
) |
Creates a MutableSerializer which will stream into stream
stream | the stream in which the mutable canonical form will be written into |
Definition at line 41 of file MutableSerializer.cpp.
|
virtual |
does nothing
Definition at line 46 of file MutableSerializer.cpp.
|
virtual |
Not implemented. This is only required by the interface.
Reimplemented from dtn::data::DefaultSerializer.
Definition at line 137 of file MutableSerializer.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 145 of file MutableSerializer.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::BundleID::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 173 of file MutableSerializer.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 50 of file MutableSerializer.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::BundleID::sequencenumber, dtn::data::BundleID::source, and dtn::data::BundleID::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 80 of file MutableSerializer.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().
|
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 209 of file MutableSerializer.cpp.
References dtn::data::DefaultSerializer::_stream, and GUINT32_TO_BE.
|
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 216 of file MutableSerializer.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 225 of file MutableSerializer.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 233 of file MutableSerializer.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 MutableSerializer.h.
Referenced by getLength(), and dtn::security::SecurityBlock::getLength_mutable().