Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends

dtn::api::Bundle Class Reference

#include <Bundle.h>

Inherited by dtn::api::BLOBBundle, dtn::api::FileBundle, and dtn::api::StringBundle.

Collaboration diagram for dtn::api::Bundle:
Collaboration graph
[legend]

List of all members.

Public Types

enum  BUNDLE_SECURITY { SEC_OFF = 0, SEC_SIGNED = 1, SEC_ENCRYPTED = 2, SEC_ENC_SIGNED = 3 }
enum  BUNDLE_PRIORITY { PRIO_LOW = 0, PRIO_MEDIUM = 1, PRIO_HIGH = 2 }

Public Member Functions

 Bundle ()
 Bundle (dtn::data::EID destination)
virtual ~Bundle ()
void setSecurity (BUNDLE_SECURITY s)
BUNDLE_SECURITY getSecurity ()
void setLifetime (unsigned int lifetime)
unsigned int getLifetime ()
void requestDeliveredReport ()
void requestForwardedReport ()
void requestDeletedReport ()
void requestReceptionReport ()
void setPriority (BUNDLE_PRIORITY p)
BUNDLE_PRIORITY getPriority ()
ibrcommon::BLOB::Reference getData ()
dtn::data::EID getDestination ()
dtn::data::EID getSource ()
void setReportTo (const dtn::data::EID &eid)
bool operator< (const Bundle &other) const
bool operator> (const Bundle &other) const

Protected Member Functions

 Bundle (dtn::data::Bundle &b)

Protected Attributes

dtn::data::Bundle _b
BUNDLE_SECURITY _security
BUNDLE_PRIORITY _priority
unsigned int _lifetime

Friends

class Client
std::ostream & operator<< (std::ostream &stream, const dtn::api::Bundle &b)
std::istream & operator>> (std::istream &stream, dtn::api::Bundle &b)

Detailed Description

This bundle object should be used by the applications to create, send and receive bundles.

Definition at line 30 of file Bundle.h.


Member Enumeration Documentation

Define the Bundle Priorities PRIO_LOW low priority for this bundle PRIO_MEDIUM medium priority for this bundle PRIO_HIGH high priority for this bundle

Enumerator:
PRIO_LOW 
PRIO_MEDIUM 
PRIO_HIGH 

Definition at line 56 of file Bundle.h.

Define the Bundle Security Mode SEC_OFF no security actions will be taken SEC_SIGNED the bundle will be signed before leaving SEC_ENCRYPTED the bundle will be encrypted before leaving SEC_ENC_SIGNED the bundle will be singed and encrypted before leaving

Enumerator:
SEC_OFF 
SEC_SIGNED 
SEC_ENCRYPTED 
SEC_ENC_SIGNED 

Definition at line 42 of file Bundle.h.


Constructor & Destructor Documentation

dtn::api::Bundle::Bundle (  ) 

Constructor for a bundle object without a destination

Definition at line 17 of file Bundle.cpp.

References _b, _security, dtn::data::PrimaryBlock::_source, dtn::api::SecurityManager::getDefault(), PRIO_MEDIUM, and setPriority().

Here is the call graph for this function:

dtn::api::Bundle::Bundle ( dtn::data::EID  destination  ) 

Constructor for a bundle object

Parameters:
destination defines the destination of this bundle.

Definition at line 41 of file Bundle.cpp.

References _b, dtn::data::PrimaryBlock::_destination, _security, dtn::api::SecurityManager::getDefault(), PRIO_MEDIUM, and setPriority().

Here is the call graph for this function:

dtn::api::Bundle::~Bundle (  )  [virtual]

Destructor

Definition at line 49 of file Bundle.cpp.

dtn::api::Bundle::Bundle ( dtn::data::Bundle b  )  [protected]

Constructor for a bundle object.

Parameters:
b include a bundle of the data library in this bundle.

Definition at line 26 of file Bundle.cpp.

References _b, _priority, dtn::data::PrimaryBlock::_procflags, dtn::data::PrimaryBlock::PRIORITY_BIT1, and dtn::data::PrimaryBlock::PRIORITY_BIT2.


Member Function Documentation

ibrcommon::BLOB::Reference dtn::api::Bundle::getData (  ) 

Returns a reference to the data block of this bundle.

Definition at line 131 of file Bundle.cpp.

References _b, dtn::data::PayloadBlock::getBLOB(), and dtn::data::Bundle::getBlock().

Referenced by main().

Here is the call graph for this function:

dtn::data::EID dtn::api::Bundle::getDestination (  ) 

Definition at line 116 of file Bundle.cpp.

References _b, and dtn::data::PrimaryBlock::_destination.

unsigned int dtn::api::Bundle::getLifetime (  ) 

Returns the lifetime of a bundle

Definition at line 61 of file Bundle.cpp.

References _lifetime.

Referenced by main().

Bundle::BUNDLE_PRIORITY dtn::api::Bundle::getPriority (  ) 

Returns the priority for this bundle.

Definition at line 86 of file Bundle.cpp.

References _priority.

BUNDLE_SECURITY dtn::api::Bundle::getSecurity (  ) 

Returns the security parameters for this bundle.

dtn::data::EID dtn::api::Bundle::getSource (  ) 

Definition at line 126 of file Bundle.cpp.

References _b, and dtn::data::PrimaryBlock::_source.

Referenced by main().

bool dtn::api::Bundle::operator< ( const Bundle other  )  const

Definition at line 141 of file Bundle.cpp.

References _b.

bool dtn::api::Bundle::operator> ( const Bundle other  )  const

Definition at line 146 of file Bundle.cpp.

References _b.

void dtn::api::Bundle::requestDeletedReport (  ) 

Definition at line 76 of file Bundle.cpp.

References _b, dtn::data::PrimaryBlock::REQUEST_REPORT_OF_BUNDLE_DELETION, and dtn::data::PrimaryBlock::set().

Here is the call graph for this function:

void dtn::api::Bundle::requestDeliveredReport (  ) 

Definition at line 66 of file Bundle.cpp.

References _b, dtn::data::PrimaryBlock::REQUEST_REPORT_OF_BUNDLE_DELIVERY, and dtn::data::PrimaryBlock::set().

Here is the call graph for this function:

void dtn::api::Bundle::requestForwardedReport (  ) 

Definition at line 71 of file Bundle.cpp.

References _b, dtn::data::PrimaryBlock::REQUEST_REPORT_OF_BUNDLE_FORWARDING, and dtn::data::PrimaryBlock::set().

Here is the call graph for this function:

void dtn::api::Bundle::requestReceptionReport (  ) 

Definition at line 81 of file Bundle.cpp.

References _b, dtn::data::PrimaryBlock::REQUEST_REPORT_OF_BUNDLE_RECEPTION, and dtn::data::PrimaryBlock::set().

Here is the call graph for this function:

void dtn::api::Bundle::setLifetime ( unsigned int  lifetime  ) 

Set the lifetime of a bundle

Definition at line 53 of file Bundle.cpp.

References _b, dtn::data::PrimaryBlock::_lifetime, and _lifetime.

Referenced by main().

void dtn::api::Bundle::setPriority ( Bundle::BUNDLE_PRIORITY  p  ) 

Set the priority for this bundle.

Definition at line 91 of file Bundle.cpp.

References _b, _priority, dtn::data::PrimaryBlock::_procflags, PRIO_HIGH, PRIO_LOW, and PRIO_MEDIUM.

Referenced by Bundle(), and main().

void dtn::api::Bundle::setReportTo ( const dtn::data::EID eid  ) 

Definition at line 121 of file Bundle.cpp.

References _b, and dtn::data::PrimaryBlock::_reportto.

void dtn::api::Bundle::setSecurity ( BUNDLE_SECURITY  s  ) 

Set the security parameters for this bundle.


Friends And Related Function Documentation

friend class Client [friend]

Definition at line 32 of file Bundle.h.

std::ostream& operator<< ( std::ostream &  stream,
const dtn::api::Bundle b 
) [friend]

Serialize a Bundle into a stream.

Definition at line 117 of file Bundle.h.

std::istream& operator>> ( std::istream &  stream,
dtn::api::Bundle b 
) [friend]

Definition at line 127 of file Bundle.h.


Member Data Documentation

unsigned int dtn::api::Bundle::_lifetime [protected]

Definition at line 170 of file Bundle.h.

Referenced by getLifetime(), and setLifetime().

Definition at line 169 of file Bundle.h.

Referenced by Bundle(), getPriority(), and setPriority().

Definition at line 168 of file Bundle.h.

Referenced by Bundle().


The documentation for this class was generated from the following files: