dtn::BundleStatusReport Class Reference

Utility class to create and parse status reports. More...

#include <BundleStatusReport.h>

List of all members.

Classes

struct  data_t
 Specification of the contents of a Bundle Status Report. More...

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.

Detailed Description

Utility class to create and parse status reports.

Definition at line 29 of file BundleStatusReport.h.


Member Typedef Documentation

The reason codes are defined in the BundleProtocol class.

Definition at line 45 of file BundleStatusReport.h.


Member Enumeration Documentation

Enumerator:
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.


Member Function Documentation

void dtn::BundleStatusReport::create_status_report ( Bundle bundle,
const Bundle orig_bundle,
const EndpointID source,
flag_t  status_flag,
reason_t  reason 
) [static]
bool dtn::BundleStatusReport::parse_status_report ( data_t data,
const Bundle bundle 
) [static]

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().

bool dtn::BundleStatusReport::parse_status_report ( data_t data,
const u_char *  bp,
u_int  len 
) [static]
const char * dtn::BundleStatusReport::reason_to_str ( u_int8_t  reason  )  [static]

The documentation for this class was generated from the following files:
Generated on Sun Nov 21 13:21:13 2010 for DTN Reference Implementation by  doxygen 1.6.3