IBR-DTNSuite
0.12
|
#include <Block.h>
Public Types | |
enum | ProcFlags { REPLICATE_IN_EVERY_FRAGMENT = 1, TRANSMIT_STATUSREPORT_IF_NOT_PROCESSED = 1 << 0x01, DELETE_BUNDLE_IF_NOT_PROCESSED = 1 << 0x02, LAST_BLOCK = 1 << 0x03, DISCARD_IF_NOT_PROCESSED = 1 << 0x04, FORWARDED_WITHOUT_PROCESSED = 1 << 0x05, BLOCK_CONTAINS_EIDS = 1 << 0x06 } |
typedef std::list< dtn::data::EID > | eid_list |
Public Member Functions | |
virtual | ~Block () |
Block & | operator= (const Block &block) |
bool | operator== (const block_t &id) const |
virtual void | addEID (const dtn::data::EID &eid) |
virtual void | clearEIDs () |
virtual const eid_list & | getEIDList () const |
const block_t & | getType () const |
void | set (ProcFlags flag, const bool &value) |
bool | get (ProcFlags flag) const |
const Bitset< ProcFlags > & | getProcessingFlags () const |
virtual std::ostream & | serialize (std::ostream &stream, Length &length) const =0 |
virtual std::istream & | deserialize (std::istream &stream, const Length &length)=0 |
virtual Length | getLength () const =0 |
virtual Length | getLength_strict () const |
virtual std::ostream & | serialize_strict (std::ostream &stream, Length &length) const |
Protected Member Functions | |
Block (block_t blocktype) | |
Protected Attributes | |
block_t | _blocktype |
eid_list | _eids |
Friends | |
class | BundleBuilder |
typedef std::list<dtn::data::EID> dtn::data::Block::eid_list |
|
protected |
|
virtual |
Definition at line 56 of file Block.cpp.
References _eids, BLOCK_CONTAINS_EIDS, and dtn::data::Bitset< E >::setBit().
Referenced by dtn::api::PlainDeserializer::operator>>(), dtn::data::DefaultDeserializer::operator>>(), dtn::data::DefaultDeserializer::read(), and dtn::data::SeparateDeserializer::readBlock().
|
virtual |
Definition at line 64 of file Block.cpp.
References _eids, BLOCK_CONTAINS_EIDS, and dtn::data::Bitset< E >::setBit().
Referenced by dtn::security::SecurityBlock::decryptBlock().
|
pure virtual |
Deserialize the derived block payload.
stream | A input stream to deserialize from. |
Implemented in dtn::security::SecurityBlock, dtn::security::PayloadIntegrityBlock, dtn::data::ExtensionBlock, dtn::data::CompressedPayloadBlock, dtn::data::StreamBlock, dtn::data::SchedulingBlock, dtn::data::ScopeControlHopLimitBlock, dtn::data::AgeBlock, dtn::data::PayloadBlock, and dtn::data::TrackingBlock.
Referenced by dtn::api::PlainDeserializer::operator>>(), dtn::data::DefaultDeserializer::operator>>(), dtn::data::DefaultDeserializer::read(), and dtn::data::SeparateDeserializer::readBlock().
bool dtn::data::Block::get | ( | ProcFlags | flag) | const |
Definition at line 82 of file Block.cpp.
References dtn::data::Bitset< E >::getBit().
Referenced by dtn::security::MutableSerializer::getLength(), dtn::data::DefaultSerializer::getLength(), dtn::data::SeparateSerializer::getLength(), dtn::data::BundleBuilder::insert(), dtn::api::PlainSerializer::operator<<(), dtn::security::StrictSerializer::operator<<(), dtn::security::MutableSerializer::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::data::SeparateSerializer::operator<<(), dtn::data::DefaultDeserializer::operator>>(), dtn::data::DefaultDeserializer::read(), dtn::data::SeparateDeserializer::readBlock(), dtn::data::DefaultSerializer::serialize(), and dtn::core::BundleCore::validate().
|
virtual |
Definition at line 72 of file Block.cpp.
References _eids.
Referenced by dtn::data::Dictionary::add(), dtn::security::MutableSerializer::getLength(), dtn::data::DefaultSerializer::getLength(), dtn::data::SeparateSerializer::getLength(), dtn::data::DefaultSerializer::isCompressable(), dtn::api::PlainSerializer::operator<<(), dtn::security::StrictSerializer::operator<<(), dtn::security::MutableSerializer::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::data::SeparateSerializer::operator<<(), and dtn::data::DefaultSerializer::serialize().
|
pure virtual |
Return the length of the payload, if this were an abstract block. It is the length put in the third field, after block type and processing flags.
Implemented in dtn::security::SecurityBlock, dtn::data::ExtensionBlock, dtn::data::CompressedPayloadBlock, dtn::data::StreamBlock, dtn::data::SchedulingBlock, dtn::data::ScopeControlHopLimitBlock, dtn::data::AgeBlock, dtn::data::PayloadBlock, and dtn::data::TrackingBlock.
Referenced by dtn::daemon::Debugger::callbackBundleReceived(), dtn::security::MutableSerializer::getLength(), dtn::data::DefaultSerializer::getLength(), dtn::data::SeparateSerializer::getLength(), getLength_strict(), dtn::api::PlainSerializer::operator<<(), dtn::api::NativeSerializer::operator<<(), dtn::security::MutableSerializer::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::data::SeparateSerializer::operator<<(), dtn::data::DefaultDeserializer::operator>>(), dtn::api::ExtendedApiHandler::run(), and dtn::api::PlainSerializer::writeData().
|
virtual |
Return the length of the payload in strict format
Reimplemented in dtn::data::AgeBlock, and dtn::data::TrackingBlock.
Definition at line 92 of file Block.cpp.
References getLength().
Referenced by dtn::security::StrictSerializer::operator<<().
const Bitset< Block::ProcFlags > & dtn::data::Block::getProcessingFlags | ( | ) | const |
Definition at line 87 of file Block.cpp.
Referenced by dtn::daemon::Debugger::callbackBundleReceived(), dtn::data::DefaultSerializer::getLength(), dtn::data::SeparateSerializer::getLength(), dtn::security::StrictSerializer::operator<<(), dtn::security::MutableSerializer::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::data::SeparateSerializer::operator<<(), and dtn::data::DefaultSerializer::serialize().
|
inline |
Definition at line 73 of file Block.h.
References _blocktype.
Referenced by dtn::daemon::Debugger::callbackBundleReceived(), dtn::security::MutableSerializer::getLength(), dtn::data::DefaultSerializer::getLength(), dtn::data::SeparateSerializer::getLength(), dtn::security::SecurityBlock::isCorrelatorPresent(), dtn::api::PlainSerializer::operator<<(), dtn::security::StrictSerializer::operator<<(), dtn::security::MutableSerializer::operator<<(), dtn::data::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::data::SeparateSerializer::operator<<(), dtn::core::BundleCore::processBlocks(), dtn::data::DefaultSerializer::serialize(), dtn::storage::SQLiteBundleStorage::store(), and dtn::security::SecurityManager::verifyPIB().
assignment operator
Definition at line 41 of file Block.cpp.
References _eids, dtn::data::Bitset< E >::getBit(), LAST_BLOCK, and dtn::data::Bitset< E >::setBit().
bool dtn::data::Block::operator== | ( | const block_t & | id) | const |
allow comparison with the block type only
Definition at line 51 of file Block.cpp.
References _blocktype.
|
pure virtual |
Serialize the derived block payload.
stream | A output stream to serialize into. |
Implemented in dtn::security::SecurityBlock, dtn::data::ExtensionBlock, dtn::data::CompressedPayloadBlock, dtn::data::StreamBlock, dtn::data::SchedulingBlock, dtn::data::ScopeControlHopLimitBlock, dtn::data::AgeBlock, dtn::data::PayloadBlock, and dtn::data::TrackingBlock.
Referenced by dtn::api::PlainSerializer::operator<<(), dtn::api::NativeSerializer::operator<<(), dtn::security::MutableSerializer::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::data::SeparateSerializer::operator<<(), serialize_strict(), and dtn::api::PlainSerializer::writeData().
|
virtual |
Serialize the block in a strict way. Dynamic fields are set to the last deserialized value.
stream | the stream to be written into |
Reimplemented in dtn::security::SecurityBlock, dtn::data::AgeBlock, and dtn::data::TrackingBlock.
Definition at line 97 of file Block.cpp.
References serialize().
Referenced by dtn::security::StrictSerializer::operator<<().
void dtn::data::Block::set | ( | ProcFlags | flag, |
const bool & | value | ||
) |
Definition at line 77 of file Block.cpp.
References dtn::data::Bitset< E >::setBit().
Referenced by dtn::data::AgeBlock::AgeBlock(), dtn::security::BundleAuthenticationBlock::auth(), dtn::data::PayloadBlock::deserialize(), dtn::data::ExtensionBlock::deserialize(), dtn::security::PayloadConfidentialBlock::encrypt(), dtn::data::BundleBuilder::insert(), dtn::api::PlainDeserializer::operator>>(), dtn::api::ExtendedApiHandler::run(), dtn::data::SchedulingBlock::SchedulingBlock(), dtn::data::ScopeControlHopLimitBlock::ScopeControlHopLimitBlock(), dtn::security::SecurityBlock::TLVList::set(), dtn::security::PayloadIntegrityBlock::sign(), dtn::security::SecurityBlock::store_security_references(), and dtn::data::TrackingBlock::TrackingBlock().
|
friend |
|
protected |
Definition at line 119 of file Block.h.
Referenced by dtn::security::SecurityBlock::deserialize(), getType(), operator==(), and dtn::data::ExtensionBlock::setType().
|
protected |
Definition at line 122 of file Block.h.
Referenced by addEID(), clearEIDs(), dtn::security::SecurityBlock::deserialize(), getEIDList(), operator=(), and dtn::security::SecurityBlock::store_security_references().