#include <PrimaryBlockProcessor.h>
Inheritance diagram for dtn::PrimaryBlockProcessor:
Definition at line 30 of file PrimaryBlockProcessor.h.
class | BundleProtocol |
Helper functions to parse/format the primary block. | |
static size_t | get_primary_len (const Bundle *bundle, DictionaryVector *dict, size_t *dictionary_len, size_t *primary_var_len) |
Helper functions to parse/format the primary block. | |
static size_t | get_primary_len (const Bundle *bundle) |
Helper functions to parse/format the primary block. | |
static void | add_to_dictionary (const EndpointID &eid, DictionaryVector *dict, size_t *dictlen) |
Helper functions to parse/format the primary block. | |
static void | get_dictionary_offsets (DictionaryVector *dict, const EndpointID &eid, u_int16_t *scheme_offset, u_int16_t *ssp_offset) |
Helper functions to parse/format the primary block. | |
static bool | extract_dictionary_eid (EndpointID *eid, const char *what, u_int16_t *scheme_offsetp, u_int16_t *ssp_offsetp, u_char *dictionary, u_int32_t dictionary_len) |
Helper functions to parse/format the primary block. | |
static void | debug_dump_dictionary (const char *bp, size_t len, PrimaryBlock2 *primary2) |
Helper functions to parse/format the primary block. | |
static u_int8_t | format_bundle_flags (const Bundle *bundle) |
Helper functions to parse/format the primary block. | |
static void | parse_bundle_flags (Bundle *bundle, u_int8_t flags) |
Helper functions to parse/format the primary block. | |
static u_int8_t | format_cos_flags (const Bundle *bundle) |
Helper functions to parse/format the primary block. | |
static void | parse_cos_flags (Bundle *bundle, u_int8_t cos_flags) |
Helper functions to parse/format the primary block. | |
static u_int8_t | format_srr_flags (const Bundle *bundle) |
Helper functions to parse/format the primary block. | |
static void | parse_srr_flags (Bundle *bundle, u_int8_t srr_flags) |
Helper functions to parse/format the primary block. | |
Public Member Functions | |
PrimaryBlockProcessor () | |
Constructor. | |
int | consume (Bundle *bundle, BlockInfo *block, u_char *buf, size_t len) |
Virtual from BlockProcessor. | |
void | generate (const Bundle *bundle, Link *link, BlockInfo *block, bool last) |
Virtual from BlockProcessor. | |
Protected Types | |
enum | bundle_processing_flag_t { BUNDLE_IS_FRAGMENT = 1 << 0, BUNDLE_IS_ADMIN = 1 << 1, BUNDLE_DO_NOT_FRAGMENT = 1 << 2, BUNDLE_CUSTODY_XFER_REQUESTED = 1 << 3, BUNDLE_SINGLETON_DESTINATION = 1 << 4 } |
Values for bundle processing flags that appear in the primary block. More... | |
Protected Attributes | |
dtn::PrimaryBlockProcessor::PrimaryBlock1 | packed |
The first fixed-field portion of the primary bundle block preamble structure. | |
dtn::PrimaryBlockProcessor::PrimaryBlock2 | packed |
The remainder of the fixed-length part of the primary bundle block that immediately follows the block length. | |
Classes | |
struct | PrimaryBlock1 |
The first fixed-field portion of the primary bundle block preamble structure. More... | |
struct | PrimaryBlock2 |
The remainder of the fixed-length part of the primary bundle block that immediately follows the block length. More... |
enum dtn::PrimaryBlockProcessor::bundle_processing_flag_t [protected] |
Values for bundle processing flags that appear in the primary block.
BUNDLE_IS_FRAGMENT | |
BUNDLE_IS_ADMIN | |
BUNDLE_DO_NOT_FRAGMENT | |
BUNDLE_CUSTODY_XFER_REQUESTED | |
BUNDLE_SINGLETON_DESTINATION |
Definition at line 46 of file PrimaryBlockProcessor.h.
dtn::PrimaryBlockProcessor::PrimaryBlockProcessor | ( | ) |
int dtn::PrimaryBlockProcessor::consume | ( | Bundle * | bundle, | |
BlockInfo * | block, | |||
u_char * | buf, | |||
size_t | len | |||
) | [virtual] |
Virtual from BlockProcessor.
Reimplemented from dtn::BlockProcessor.
Definition at line 385 of file PrimaryBlockProcessor.cc.
References ASSERT, dtn::PrimaryBlockProcessor::PrimaryBlock1::bundle_processing_flags, dtn::PrimaryBlockProcessor::PrimaryBlock1::class_of_service_flags, dtn::BlockInfo::complete(), dtn::BlockProcessor::consume(), dtn::BlockProcessor::consume_preamble(), dtn::BlockInfo::contents(), dtn::PrimaryBlockProcessor::PrimaryBlock2::creation_ts, dtn::Bundle::creation_ts_, dtn::BundleProtocol::CURRENT_VERSION, dtn::Bundle::custodian_, dtn::PrimaryBlockProcessor::PrimaryBlock2::custodian_scheme_offset, dtn::PrimaryBlockProcessor::PrimaryBlock2::custodian_ssp_offset, dtn::BlockInfo::data_length(), dtn::BlockInfo::data_offset(), debug_dump_dictionary(), decode(), dtn::Bundle::dest_, dtn::PrimaryBlockProcessor::PrimaryBlock2::dest_scheme_offset, dtn::PrimaryBlockProcessor::PrimaryBlock2::dest_ssp_offset, dtn::Bundle::expiration_, extract_dictionary_eid(), dtn::Bundle::frag_offset_, dtn::BlockInfo::full_length(), dtn::BundleProtocol::get_timestamp(), dtn::Bundle::is_fragment_, dtn::PrimaryBlockProcessor::PrimaryBlock2::lifetime, log_debug_p, log_err_p, log_warn_p, dtn::Bundle::orig_length_, parse_bundle_flags(), parse_cos_flags(), parse_srr_flags(), dtn::Bundle::replyto_, dtn::PrimaryBlockProcessor::PrimaryBlock2::replyto_scheme_offset, dtn::PrimaryBlockProcessor::PrimaryBlock2::replyto_ssp_offset, dtn::Bundle::source_, dtn::PrimaryBlockProcessor::PrimaryBlock2::source_scheme_offset, dtn::PrimaryBlockProcessor::PrimaryBlock2::source_ssp_offset, dtn::PrimaryBlockProcessor::PrimaryBlock1::status_report_request_flags, dtn::PrimaryBlockProcessor::PrimaryBlock1::version, and dtn::BlockInfo::writable_contents().
void dtn::PrimaryBlockProcessor::generate | ( | const Bundle * | bundle, | |
Link * | link, | |||
BlockInfo * | block, | |||
bool | last | |||
) | [virtual] |
Virtual from BlockProcessor.
Implements dtn::BlockProcessor.
Definition at line 593 of file PrimaryBlockProcessor.cc.
References ASSERT, dtn::PrimaryBlockProcessor::PrimaryBlock1::block_length, dtn::PrimaryBlockProcessor::PrimaryBlock1::bundle_processing_flags, dtn::PrimaryBlockProcessor::PrimaryBlock1::class_of_service_flags, dtn::PrimaryBlockProcessor::PrimaryBlock2::creation_ts, dtn::Bundle::creation_ts_, dtn::BundleProtocol::CURRENT_VERSION, dtn::Bundle::custodian_, dtn::PrimaryBlockProcessor::PrimaryBlock2::custodian_scheme_offset, dtn::PrimaryBlockProcessor::PrimaryBlock2::custodian_ssp_offset, debug_dump_dictionary(), dtn::Bundle::dest_, dtn::PrimaryBlockProcessor::PrimaryBlock2::dest_scheme_offset, dtn::PrimaryBlockProcessor::PrimaryBlock2::dest_ssp_offset, encode(), encoding_len(), dtn::Bundle::expiration_, format_bundle_flags(), format_cos_flags(), format_srr_flags(), dtn::Bundle::frag_offset_, get_dictionary_offsets(), get_primary_len(), dtn::Bundle::is_fragment_, dtn::PrimaryBlockProcessor::PrimaryBlock2::lifetime, log_debug_p, dtn::Bundle::orig_length_, dtn::Bundle::replyto_, dtn::PrimaryBlockProcessor::PrimaryBlock2::replyto_scheme_offset, dtn::PrimaryBlockProcessor::PrimaryBlock2::replyto_ssp_offset, dtn::BlockInfo::set_data_length(), dtn::BundleProtocol::set_timestamp(), dtn::Bundle::source_, dtn::PrimaryBlockProcessor::PrimaryBlock2::source_scheme_offset, dtn::PrimaryBlockProcessor::PrimaryBlock2::source_ssp_offset, dtn::PrimaryBlockProcessor::PrimaryBlock1::status_report_request_flags, dtn::PrimaryBlockProcessor::PrimaryBlock1::version, and dtn::BlockInfo::writable_contents().
size_t dtn::PrimaryBlockProcessor::get_primary_len | ( | const Bundle * | bundle, | |
DictionaryVector * | dict, | |||
size_t * | dictionary_len, | |||
size_t * | primary_var_len | |||
) | [static, protected] |
Helper functions to parse/format the primary block.
Definition at line 308 of file PrimaryBlockProcessor.cc.
References add_to_dictionary(), dtn::Bundle::bundleid_, dtn::Bundle::custodian_, dtn::Bundle::dest_, encoding_len(), dtn::Bundle::frag_offset_, dtn::Bundle::is_fragment_, log_debug_p, dtn::Bundle::orig_length_, dtn::Bundle::replyto_, and dtn::Bundle::source_.
Referenced by generate(), and get_primary_len().
size_t dtn::PrimaryBlockProcessor::get_primary_len | ( | const Bundle * | bundle | ) | [static, protected] |
Helper functions to parse/format the primary block.
Definition at line 374 of file PrimaryBlockProcessor.cc.
References get_primary_len().
void dtn::PrimaryBlockProcessor::add_to_dictionary | ( | const EndpointID & | eid, | |
DictionaryVector * | dict, | |||
size_t * | dictlen | |||
) | [static, protected] |
Helper functions to parse/format the primary block.
Definition at line 48 of file PrimaryBlockProcessor.cc.
References dtn::EndpointID::scheme_str(), and dtn::EndpointID::ssp().
Referenced by get_primary_len().
void dtn::PrimaryBlockProcessor::get_dictionary_offsets | ( | DictionaryVector * | dict, | |
const EndpointID & | eid, | |||
u_int16_t * | scheme_offset, | |||
u_int16_t * | ssp_offset | |||
) | [static, protected] |
Helper functions to parse/format the primary block.
Definition at line 83 of file PrimaryBlockProcessor.cc.
References dtn::EndpointID::scheme_str(), and dtn::EndpointID::ssp().
Referenced by generate().
bool dtn::PrimaryBlockProcessor::extract_dictionary_eid | ( | EndpointID * | eid, | |
const char * | what, | |||
u_int16_t * | scheme_offsetp, | |||
u_int16_t * | ssp_offsetp, | |||
u_char * | dictionary, | |||
u_int32_t | dictionary_len | |||
) | [static, protected] |
Helper functions to parse/format the primary block.
Definition at line 100 of file PrimaryBlockProcessor.cc.
References dtn::EndpointID::assign(), dtn::EndpointID::c_str(), log_debug_p, log_err_p, dtn::EndpointID::scheme_str(), dtn::EndpointID::ssp(), and dtn::EndpointID::valid().
Referenced by consume().
void dtn::PrimaryBlockProcessor::debug_dump_dictionary | ( | const char * | bp, | |
size_t | len, | |||
PrimaryBlock2 * | primary2 | |||
) | [static, protected] |
Helper functions to parse/format the primary block.
Definition at line 149 of file PrimaryBlockProcessor.cc.
References oasys::StringBuffer::appendf(), ASSERT, oasys::StringBuffer::c_str(), dtn::PrimaryBlockProcessor::PrimaryBlock2::custodian_scheme_offset, dtn::PrimaryBlockProcessor::PrimaryBlock2::custodian_ssp_offset, dtn::PrimaryBlockProcessor::PrimaryBlock2::dest_scheme_offset, dtn::PrimaryBlockProcessor::PrimaryBlock2::dest_ssp_offset, end, log_debug_p, dtn::PrimaryBlockProcessor::PrimaryBlock2::replyto_scheme_offset, dtn::PrimaryBlockProcessor::PrimaryBlock2::replyto_ssp_offset, dtn::PrimaryBlockProcessor::PrimaryBlock2::source_scheme_offset, and dtn::PrimaryBlockProcessor::PrimaryBlock2::source_ssp_offset.
Referenced by consume(), and generate().
u_int8_t dtn::PrimaryBlockProcessor::format_bundle_flags | ( | const Bundle * | bundle | ) | [static, protected] |
Helper functions to parse/format the primary block.
Definition at line 186 of file PrimaryBlockProcessor.cc.
References BUNDLE_CUSTODY_XFER_REQUESTED, BUNDLE_DO_NOT_FRAGMENT, BUNDLE_IS_ADMIN, BUNDLE_IS_FRAGMENT, BUNDLE_SINGLETON_DESTINATION, dtn::Bundle::custody_requested_, dtn::Bundle::do_not_fragment_, dtn::Bundle::is_admin_, dtn::Bundle::is_fragment_, and dtn::Bundle::singleton_dest_.
Referenced by generate().
void dtn::PrimaryBlockProcessor::parse_bundle_flags | ( | Bundle * | bundle, | |
u_int8_t | flags | |||
) | [static, protected] |
Helper functions to parse/format the primary block.
Definition at line 215 of file PrimaryBlockProcessor.cc.
References BUNDLE_CUSTODY_XFER_REQUESTED, BUNDLE_DO_NOT_FRAGMENT, BUNDLE_IS_ADMIN, BUNDLE_IS_FRAGMENT, BUNDLE_SINGLETON_DESTINATION, dtn::Bundle::custody_requested_, dtn::Bundle::do_not_fragment_, dtn::Bundle::is_admin_, dtn::Bundle::is_fragment_, and dtn::Bundle::singleton_dest_.
Referenced by consume().
u_int8_t dtn::PrimaryBlockProcessor::format_cos_flags | ( | const Bundle * | bundle | ) | [static, protected] |
Helper functions to parse/format the primary block.
Definition at line 240 of file PrimaryBlockProcessor.cc.
References dtn::Bundle::priority_.
Referenced by generate().
void dtn::PrimaryBlockProcessor::parse_cos_flags | ( | Bundle * | bundle, | |
u_int8_t | cos_flags | |||
) | [static, protected] |
Helper functions to parse/format the primary block.
Definition at line 251 of file PrimaryBlockProcessor.cc.
References dtn::Bundle::priority_.
Referenced by consume().
u_int8_t dtn::PrimaryBlockProcessor::format_srr_flags | ( | const Bundle * | bundle | ) | [static, protected] |
Helper functions to parse/format the primary block.
Definition at line 258 of file PrimaryBlockProcessor.cc.
References dtn::Bundle::app_acked_rcpt_, dtn::Bundle::custody_rcpt_, dtn::Bundle::deletion_rcpt_, dtn::Bundle::delivery_rcpt_, dtn::Bundle::forward_rcpt_, dtn::Bundle::receive_rcpt_, dtn::BundleProtocol::STATUS_ACKED_BY_APP, dtn::BundleProtocol::STATUS_CUSTODY_ACCEPTED, dtn::BundleProtocol::STATUS_DELETED, dtn::BundleProtocol::STATUS_DELIVERED, dtn::BundleProtocol::STATUS_FORWARDED, and dtn::BundleProtocol::STATUS_RECEIVED.
Referenced by generate().
void dtn::PrimaryBlockProcessor::parse_srr_flags | ( | Bundle * | bundle, | |
u_int8_t | srr_flags | |||
) | [static, protected] |
Helper functions to parse/format the primary block.
Definition at line 285 of file PrimaryBlockProcessor.cc.
References dtn::Bundle::app_acked_rcpt_, dtn::Bundle::custody_rcpt_, dtn::Bundle::deletion_rcpt_, dtn::Bundle::delivery_rcpt_, dtn::Bundle::forward_rcpt_, dtn::Bundle::receive_rcpt_, dtn::BundleProtocol::STATUS_ACKED_BY_APP, dtn::BundleProtocol::STATUS_CUSTODY_ACCEPTED, dtn::BundleProtocol::STATUS_DELETED, dtn::BundleProtocol::STATUS_DELIVERED, dtn::BundleProtocol::STATUS_FORWARDED, and dtn::BundleProtocol::STATUS_RECEIVED.
Referenced by consume().
friend class BundleProtocol [friend] |
Helper functions to parse/format the primary block.
Reimplemented from dtn::BlockProcessor.
Definition at line 87 of file PrimaryBlockProcessor.h.
struct dtn::PrimaryBlockProcessor::PrimaryBlock1 dtn::PrimaryBlockProcessor::packed [protected] |
The first fixed-field portion of the primary bundle block preamble structure.
struct dtn::PrimaryBlockProcessor::PrimaryBlock2 dtn::PrimaryBlockProcessor::packed [protected] |
The remainder of the fixed-length part of the primary bundle block that immediately follows the block length.