#include <BundleStatusReport.h>
Definition at line 29 of file BundleStatusReport.h.
Public Types | |
typedef BundleProtocol::status_report_flag_t | flag_t |
The status report flags are defined in the BundleProtocol class. | |
typedef BundleProtocol::status_report_reason_t | reason_t |
The reason codes are defined in the BundleProtocol class. | |
Static Public Member Functions | |
static void | create_status_report (Bundle *bundle, const Bundle *orig_bundle, const EndpointID &source, flag_t status_flag, reason_t reason) |
Constructor-like function that fills in the bundle payload buffer with the appropriate status report format. | |
static bool | parse_status_report (data_t *data, const u_char *bp, u_int len) |
Parse a byte stream containing a Status Report Payload and store the fields in the given struct. | |
static bool | parse_status_report (data_t *data, const Bundle *bundle) |
Parse the payload of the given bundle into the given struct. | |
static const char * | reason_to_str (u_int8_t reason) |
Return a string version of the reason code. | |
Classes | |
struct | data_t |
Specification of the contents of a Bundle Status Report. More... |
The status report flags are defined in the BundleProtocol class.
Definition at line 34 of file BundleStatusReport.h.
The reason codes are defined in the BundleProtocol class.
Definition at line 39 of file BundleStatusReport.h.
void dtn::BundleStatusReport::create_status_report | ( | Bundle * | bundle, | |
const Bundle * | orig_bundle, | |||
const EndpointID & | source, | |||
flag_t | status_flag, | |||
reason_t | reason | |||
) | [static] |
Constructor-like function that fills in the bundle payload buffer with the appropriate status report format.
Although the spec allows for multiple timestamps to be set in a single status report, this implementation only supports creating a single timestamp per report, hence there is only support for a single flag to be passed in the parameters.
Definition at line 27 of file BundleStatusReport.cc.
References dtn::BundleProtocol::ADMIN_IS_FRAGMENT, dtn::BundleProtocol::ADMIN_STATUS_REPORT, ASSERT, dtn::EndpointID::assign(), oasys::ScratchBuffer< _memory_t, _static_size >::buf(), dtn::EndpointID::c_str(), dtn::Bundle::creation_ts_, dtn::Bundle::custodian_, dtn::Bundle::dest_, encode(), encoding_len(), dtn::EndpointID::equals(), dtn::Bundle::expiration_, dtn::Bundle::frag_offset_, dtn::BundleTimestamp::get_current_time(), dtn::Bundle::is_admin_, dtn::Bundle::is_fragment_, dtn::EndpointID::length(), dtn::EndpointID::NULL_EID(), dtn::Bundle::orig_length_, dtn::Bundle::payload_, dtn::Bundle::replyto_, sdnv_encoding_len(), dtn::BundleTimestamp::seconds_, dtn::BundleTimestamp::seqno_, dtn::BundlePayload::set_data(), dtn::BundleProtocol::set_timestamp(), and dtn::Bundle::source_.
Referenced by dtn::BundleDaemon::generate_status_report().
bool dtn::BundleStatusReport::parse_status_report | ( | data_t * | data, | |
const u_char * | bp, | |||
u_int | len | |||
) | [static] |
Parse a byte stream containing a Status Report Payload and store the fields in the given struct.
Returns false if parsing failed.
Definition at line 155 of file BundleStatusReport.cc.
References dtn::BundleStatusReport::data_t::acknowledgement_tv_, dtn::BundleStatusReport::data_t::admin_flags_, dtn::BundleProtocol::ADMIN_IS_FRAGMENT, dtn::BundleProtocol::ADMIN_STATUS_REPORT, dtn::BundleStatusReport::data_t::admin_type_, dtn::EndpointID::assign(), dtn::BundleStatusReport::data_t::custody_tv_, decode(), dtn::BundleStatusReport::data_t::deletion_tv_, dtn::BundleStatusReport::data_t::delivery_tv_, dtn::BundleStatusReport::data_t::forwarding_tv_, dtn::BundleProtocol::get_timestamp(), dtn::BundleStatusReport::data_t::orig_creation_tv_, dtn::BundleStatusReport::data_t::orig_frag_length_, dtn::BundleStatusReport::data_t::orig_frag_offset_, dtn::BundleStatusReport::data_t::orig_source_eid_, dtn::BundleStatusReport::data_t::reason_code_, dtn::BundleStatusReport::data_t::receipt_tv_, dtn::BundleProtocol::STATUS_ACKED_BY_APP, dtn::BundleProtocol::STATUS_CUSTODY_ACCEPTED, dtn::BundleProtocol::STATUS_DELETED, dtn::BundleProtocol::STATUS_DELIVERED, dtn::BundleStatusReport::data_t::status_flags_, dtn::BundleProtocol::STATUS_FORWARDED, and dtn::BundleProtocol::STATUS_RECEIVED.
Referenced by dtn::APIClient::handle_recv(), dtn::TclRegistration::parse_bundle_data(), and parse_status_report().
Parse the payload of the given bundle into the given struct.
Returns false if the bundle is not a well formed status report.
Definition at line 262 of file BundleStatusReport.cc.
References dtn::BundleProtocol::ADMIN_STATUS_REPORT, oasys::ScratchBuffer< _memory_t, _static_size >::buf(), dtn::BundleProtocol::get_admin_type(), dtn::BundlePayload::length(), log_err_p, parse_status_report(), dtn::Bundle::payload_, dtn::BundlePayload::read_data(), and oasys::ScratchBuffer< _memory_t, _static_size >::reserve().
const char * dtn::BundleStatusReport::reason_to_str | ( | u_int8_t | reason | ) | [static] |
Return a string version of the reason code.
Definition at line 290 of file BundleStatusReport.cc.
References dtn::BundleProtocol::REASON_BLOCK_UNINTELLIGIBLE, dtn::BundleProtocol::REASON_DEPLETED_STORAGE, dtn::BundleProtocol::REASON_ENDPOINT_ID_UNINTELLIGIBLE, dtn::BundleProtocol::REASON_FORWARDED_UNIDIR_LINK, dtn::BundleProtocol::REASON_LIFETIME_EXPIRED, dtn::BundleProtocol::REASON_NO_ADDTL_INFO, dtn::BundleProtocol::REASON_NO_ROUTE_TO_DEST, dtn::BundleProtocol::REASON_NO_TIMELY_CONTACT, and dtn::BundleProtocol::REASON_TRANSMISSION_CANCELLED.
Referenced by dtn::BundleDaemon::handle_bundle_accept(), dtn::APIClient::handle_send(), and dtn::TclRegistration::parse_bundle_data().