Utility class to format and parse custody signal bundles. More...
#include <CustodySignal.h>
Classes | |
struct | data_t |
Struct to hold the payload data of the custody signal. More... | |
Public Types | |
typedef BundleProtocol::custody_signal_reason_t | reason_t |
The reason codes are defined in the bundle protocol class. | |
Static Public Member Functions | |
static void | create_custody_signal (Bundle *bundle, const Bundle *orig_bundle, const EndpointID &source_eid, bool succeeded, reason_t reason) |
Constructor-like function to create a new custody signal bundle. | |
static bool | parse_custody_signal (data_t *data, const u_char *bp, u_int len) |
Parsing function for custody signal bundles. | |
static const char * | reason_to_str (u_int8_t reason) |
Pretty printer for custody signal reasons. |
Utility class to format and parse custody signal bundles.
Definition at line 28 of file CustodySignal.h.
The reason codes are defined in the bundle protocol class.
Definition at line 33 of file CustodySignal.h.
void dtn::CustodySignal::create_custody_signal | ( | Bundle * | bundle, | |
const Bundle * | orig_bundle, | |||
const EndpointID & | source_eid, | |||
bool | succeeded, | |||
reason_t | reason | |||
) | [static] |
Constructor-like function to create a new custody signal bundle.
Definition at line 29 of file CustodySignal.cc.
References dtn::BundleProtocol::ADMIN_CUSTODY_SIGNAL, dtn::BundleProtocol::ADMIN_IS_FRAGMENT, ASSERT, dtn::EndpointID::assign(), dtn::EndpointID::c_str(), dtn::Bundle::creation_ts(), dtn::Bundle::custodian(), encode(), encoding_len(), dtn::EndpointID::equals(), dtn::Bundle::expiration(), dtn::Bundle::frag_offset(), dtn::BundleTimestamp::get_current_time(), dtn::Bundle::is_fragment(), len, dtn::EndpointID::length(), dtn::Bundle::mutable_custodian(), dtn::Bundle::mutable_dest(), dtn::Bundle::mutable_payload(), dtn::Bundle::mutable_replyto(), dtn::Bundle::mutable_source(), dtn::EndpointID::NULL_EID(), dtn::Bundle::orig_length(), sdnv_encoding_len(), dtn::BundleTimestamp::seconds_, dtn::BundleTimestamp::seqno_, dtn::BundlePayload::set_data(), dtn::Bundle::set_expiration(), dtn::Bundle::set_is_admin(), dtn::BundleProtocol::set_timestamp(), dtn::Bundle::source(), and dtn::BundleProtocol::ts_encoding_len().
bool dtn::CustodySignal::parse_custody_signal | ( | data_t * | data, | |
const u_char * | bp, | |||
u_int | len | |||
) | [static] |
Parsing function for custody signal bundles.
Definition at line 153 of file CustodySignal.cc.
References dtn::BundleProtocol::ADMIN_CUSTODY_SIGNAL, dtn::CustodySignal::data_t::admin_flags_, dtn::BundleProtocol::ADMIN_IS_FRAGMENT, dtn::CustodySignal::data_t::admin_type_, dtn::EndpointID::assign(), dtn::CustodySignal::data_t::custody_signal_tv_, decode(), dtn::BundleProtocol::get_timestamp(), dtn::CustodySignal::data_t::orig_creation_tv_, dtn::CustodySignal::data_t::orig_frag_length_, dtn::CustodySignal::data_t::orig_frag_offset_, dtn::CustodySignal::data_t::orig_source_eid_, dtn::CustodySignal::data_t::reason_, and dtn::CustodySignal::data_t::succeeded_.
Referenced by dtn::AdminRegistration::deliver_bundle().
const char * dtn::CustodySignal::reason_to_str | ( | u_int8_t | reason | ) | [static] |
Pretty printer for custody signal reasons.
Definition at line 221 of file CustodySignal.cc.
References buf, dtn::BundleProtocol::CUSTODY_BLOCK_UNINTELLIGIBLE, dtn::BundleProtocol::CUSTODY_DEPLETED_STORAGE, dtn::BundleProtocol::CUSTODY_ENDPOINT_ID_UNINTELLIGIBLE, dtn::BundleProtocol::CUSTODY_NO_ADDTL_INFO, dtn::BundleProtocol::CUSTODY_NO_ROUTE_TO_DEST, dtn::BundleProtocol::CUSTODY_NO_TIMELY_CONTACT, and dtn::BundleProtocol::CUSTODY_REDUNDANT_RECEPTION.