#include <BundleStatusReport.h>
Definition at line 29 of file BundleStatusReport.h.
Public Types | |
enum | flag_t { STATUS_RECEIVED = 0x01, STATUS_CUSTODY_ACCEPTED = 0x02, STATUS_FORWARDED = 0x04, STATUS_DELIVERED = 0x08, STATUS_DELETED = 0x10, STATUS_ACKED_BY_APP = 0x20, STATUS_UNUSED = 0x40, STATUS_UNUSED2 = 0x80 } |
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 reason codes are defined in the BundleProtocol class.
Definition at line 45 of file BundleStatusReport.h.
STATUS_RECEIVED | |
STATUS_CUSTODY_ACCEPTED | |
STATUS_FORWARDED | |
STATUS_DELIVERED | |
STATUS_DELETED | |
STATUS_ACKED_BY_APP | |
STATUS_UNUSED | |
STATUS_UNUSED2 |
Definition at line 31 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 30 of file BundleStatusReport.cc.
References dtn::BundleProtocol::ADMIN_IS_FRAGMENT, dtn::BundleProtocol::ADMIN_STATUS_REPORT, ASSERT, dtn::EndpointID::assign(), dtn::Bundle::creation_ts(), encode(), encoding_len(), dtn::EndpointID::equals(), dtn::Bundle::expiration(), dtn::Bundle::frag_offset(), dtn::BundleTimestamp::get_current_time(), dtn::Bundle::is_fragment(), len, 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(), dtn::Bundle::replyto(), 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().
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 166 of file BundleStatusReport.cc.
References dtn::BundleStatusReport::data_t::ack_by_app_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::BundleTimestamp::seconds_, dtn::BundleTimestamp::seqno_, STATUS_ACKED_BY_APP, STATUS_CUSTODY_ACCEPTED, STATUS_DELETED, STATUS_DELIVERED, dtn::BundleStatusReport::data_t::status_flags_, STATUS_FORWARDED, and 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 291 of file BundleStatusReport.cc.
References dtn::BundleProtocol::ADMIN_STATUS_REPORT, buf, dtn::BundleProtocol::get_admin_type(), dtn::BundlePayload::length(), log_err_p, parse_status_report(), dtn::Bundle::payload(), and dtn::BundlePayload::read_data().
const char * dtn::BundleStatusReport::reason_to_str | ( | u_int8_t | reason | ) | [static] |
Return a string version of the reason code.
Definition at line 319 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::BundleDaemon::handle_bundle_delete(), dtn::APIClient::handle_send(), and dtn::TclRegistration::parse_bundle_data().