IBR-DTNSuite  0.8
dtn::security::MutualSerializer Class Reference

#include <MutualSerializer.h>

Inheritance diagram for dtn::security::MutualSerializer:
Collaboration diagram for dtn::security::MutualSerializer:

List of all members.

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 size_t getLength (const dtn::data::Bundle &obj)
virtual size_t getLength (const dtn::data::PrimaryBlock &obj) const
virtual size_t getLength (const dtn::data::Block &obj) const
virtual Serializer & operator<< (const u_int32_t value)
virtual Serializer & operator<< (const dtn::data::EID &value)
virtual Serializer & operator<< (const dtn::data::SDNV &value)
virtual Serializer & operator<< (const dtn::security::SecurityBlock::TLVList &list)

Static Public Attributes

static const size_t sdnv_size = 8

Detailed Description

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 23 of file MutualSerializer.h.


Constructor & Destructor Documentation

dtn::security::MutualSerializer::MutualSerializer ( std::ostream &  stream,
const dtn::data::Block ignore = NULL 
)

Creates a MutualSerializer which will stream into stream

Parameters:
streamthe stream in which the mutable canonical form will be written into

Definition at line 32 of file MutualSerializer.cpp.

does nothing

Definition at line 37 of file MutualSerializer.cpp.


Member Function Documentation

Not implemented. This is only required by the interface.

Reimplemented from dtn::data::DefaultSerializer.

Definition at line 126 of file MutualSerializer.cpp.

Referenced by operator<<().

Returns the length of the primary block in mutable canonical form.

Parameters:
objthe primary block, of which the length shall be calculated
Returns:
the length of the primary block

Reimplemented from dtn::data::DefaultSerializer.

Definition at line 134 of file MutualSerializer.cpp.

References dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_reportto, dtn::data::PrimaryBlock::_source, dtn::data::EID::getString(), IBRCOMMON_LOGGER_DEBUG_ex, IBRCOMMON_LOGGER_ENDL, ibrcommon::Logger::LOGGER_DEBUG, and sdnv_size.

Here is the call graph for this function:

size_t dtn::security::MutualSerializer::getLength ( const dtn::data::Block obj) const [virtual]

Returns the length of the block in mutable canonical form.

Parameters:
objthe block, of which the length shall be calculated
Returns:
the length of the block

Reimplemented from dtn::data::DefaultSerializer.

Definition at line 162 of file MutualSerializer.cpp.

References dtn::data::Block::_blocktype, dtn::data::Block::_eids, dtn::data::Block::BLOCK_CONTAINS_EIDS, dtn::data::Block::get(), dtn::data::Block::getLength(), dtn::security::SecurityBlock::getLength_mutable(), and sdnv_size.

Here is the call graph for this function:

dtn::data::Serializer & dtn::security::MutualSerializer::operator<< ( const dtn::data::PrimaryBlock obj) [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.

Returns:
a reference to this instance

Reimplemented from dtn::data::DefaultSerializer.

Definition at line 41 of file MutualSerializer.cpp.

References dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_lifetime, dtn::data::PrimaryBlock::_procflags, dtn::data::PrimaryBlock::_reportto, dtn::data::PrimaryBlock::_sequencenumber, dtn::data::PrimaryBlock::_source, dtn::data::DefaultSerializer::_stream, dtn::data::PrimaryBlock::_timestamp, and getLength().

Here is the call graph for this function:

dtn::data::Serializer & dtn::security::MutualSerializer::operator<< ( const dtn::data::Block obj) [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.

Returns:
a reference to this instance

Reimplemented from dtn::data::DefaultSerializer.

Definition at line 71 of file MutualSerializer.cpp.

References dtn::data::Block::_blocktype, dtn::data::Block::_eids, dtn::data::DefaultSerializer::_stream, dtn::data::Block::BLOCK_CONTAINS_EIDS, dtn::data::PayloadBlock::BLOCK_TYPE, dtn::data::Block::get(), dtn::data::Block::getLength(), dtn::security::SecurityBlock::getLength_mutable(), 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().

Here is the call graph for this function:

dtn::data::Serializer & dtn::security::MutualSerializer::operator<< ( const u_int32_t  value) [virtual]

Writes a u_int32_t into stream in network byte order.

Parameters:
streamthe stream in which shall be written
valuethe value to be written in network byte order
Returns:
the stream in which shall be written

Definition at line 196 of file MutualSerializer.cpp.

References dtn::data::DefaultSerializer::_stream.

dtn::data::Serializer & dtn::security::MutualSerializer::operator<< ( const dtn::data::EID value) [virtual]

Writes an EID to a stream in mutable form.

Parameters:
streamthe stream in which shall be written
valuethe EID which shall be written
Returns:
the stream in which shall be written

Definition at line 203 of file MutualSerializer.cpp.

References dtn::data::DefaultSerializer::_stream, and dtn::data::EID::getString().

Here is the call graph for this function:

dtn::data::Serializer & dtn::security::MutualSerializer::operator<< ( const dtn::data::SDNV value) [virtual]

Writes a SDNV to a stream in mutable form.

Parameters:
streamthe stream in which shall be written
valuethe SDNV which shall be written
Returns:
the stream in which shall be written

Definition at line 212 of file MutualSerializer.cpp.

References dtn::data::DefaultSerializer::_stream, dtn::data::SDNV::getValue(), and GUINT64_TO_BE.

Here is the call graph for this function:

dtn::data::Serializer & dtn::security::MutualSerializer::operator<< ( const dtn::security::SecurityBlock::TLVList list) [virtual]

Serialize a list of type-length-value entries.

Parameters:
list
Returns:

Definition at line 221 of file MutualSerializer.cpp.

References dtn::data::DefaultSerializer::_stream, dtn::security::SecurityBlock::TLVList::getLength(), and dtn::security::SecurityBlock::TLVList::toString().

Here is the call graph for this function:


Member Data Documentation

const size_t dtn::security::MutualSerializer::sdnv_size = 8 [static]

The size in bytes of a SDNV in mutable form in the stream

Definition at line 29 of file MutualSerializer.h.

Referenced by getLength(), and dtn::security::SecurityBlock::getLength_mutable().


The documentation for this class was generated from the following files: