IBR-DTNSuite  0.12
dtn::data::PrimaryBlock Class Reference

#include <PrimaryBlock.h>

Inheritance diagram for dtn::data::PrimaryBlock:
Inheritance graph
Collaboration diagram for dtn::data::PrimaryBlock:
Collaboration graph

Public Types

enum  PRIORITY { PRIO_LOW = 0, PRIO_MEDIUM = 1, PRIO_HIGH = 2 }
 
enum  FLAGS {
  FRAGMENT = 1 << 0x00, APPDATA_IS_ADMRECORD = 1 << 0x01, DONT_FRAGMENT = 1 << 0x02, CUSTODY_REQUESTED = 1 << 0x03,
  DESTINATION_IS_SINGLETON = 1 << 0x04, ACKOFAPP_REQUESTED = 1 << 0x05, RESERVED_6 = 1 << 0x06, PRIORITY_BIT1 = 1 << 0x07,
  PRIORITY_BIT2 = 1 << 0x08, CLASSOFSERVICE_9 = 1 << 0x09, CLASSOFSERVICE_10 = 1 << 0x0A, CLASSOFSERVICE_11 = 1 << 0x0B,
  CLASSOFSERVICE_12 = 1 << 0x0C, CLASSOFSERVICE_13 = 1 << 0x0D, REQUEST_REPORT_OF_BUNDLE_RECEPTION = 1 << 0x0E, REQUEST_REPORT_OF_CUSTODY_ACCEPTANCE = 1 << 0x0F,
  REQUEST_REPORT_OF_BUNDLE_FORWARDING = 1 << 0x10, REQUEST_REPORT_OF_BUNDLE_DELIVERY = 1 << 0x11, REQUEST_REPORT_OF_BUNDLE_DELETION = 1 << 0x12, STATUS_REPORT_REQUEST_19 = 1 << 0x13,
  STATUS_REPORT_REQUEST_20 = 1 << 0x14, DTNSEC_REQUEST_SIGN = 1 << 0x1A, DTNSEC_REQUEST_ENCRYPT = 1 << 0x1B, DTNSEC_STATUS_VERIFIED = 1 << 0x1C,
  DTNSEC_STATUS_CONFIDENTIAL = 1 << 0x1D, DTNSEC_STATUS_AUTHENTICATED = 1 << 0x1E, IBRDTN_REQUEST_COMPRESSION = 1 << 0x1F
}
 

Public Member Functions

 PrimaryBlock (bool zero_timestamp=false)
 
virtual ~PrimaryBlock ()
 
void set (FLAGS flag, bool value)
 
bool get (FLAGS flag) const
 
PRIORITY getPriority () const
 
void setPriority (PRIORITY p)
 
bool isFragment () const
 
void setFragment (bool val)
 
void relabel (bool zero_timestamp=false)
 
bool operator== (const PrimaryBlock &other) const
 
bool operator!= (const PrimaryBlock &other) const
 
bool operator< (const PrimaryBlock &other) const
 
bool operator> (const PrimaryBlock &other) const
 
- Public Member Functions inherited from dtn::data::BundleID
 BundleID ()
 
virtual ~BundleID ()
 
bool operator!= (const BundleID &other) const
 
bool operator== (const BundleID &other) const
 
bool operator< (const BundleID &other) const
 
bool operator> (const BundleID &other) const
 
 BundleID (const BundleID &id)
 
BundleIDoperator= (const BundleID &id)
 
std::string toString () const
 
virtual dtn::data::Length getPayloadLength () const
 
virtual void setPayloadLength (const dtn::data::Length &value)
 
void addTo (ibrcommon::BloomFilter &bf) const
 
bool isIn (const ibrcommon::BloomFilter &bf) const
 
size_t raw (unsigned char *data, size_t len) const
 

Public Attributes

Bitset< FLAGSprocflags
 
Number lifetime
 
Number appdatalength
 
EID destination
 
EID reportto
 
EID custodian
 
- Public Attributes inherited from dtn::data::BundleID
dtn::data::EID source
 
dtn::data::Timestamp timestamp
 
dtn::data::Number sequencenumber
 
dtn::data::Number fragmentoffset
 

Detailed Description

Definition at line 47 of file PrimaryBlock.h.

Member Enumeration Documentation

Enumerator
FRAGMENT 
APPDATA_IS_ADMRECORD 
DONT_FRAGMENT 
CUSTODY_REQUESTED 
DESTINATION_IS_SINGLETON 
ACKOFAPP_REQUESTED 
RESERVED_6 
PRIORITY_BIT1 
PRIORITY_BIT2 
CLASSOFSERVICE_9 
CLASSOFSERVICE_10 
CLASSOFSERVICE_11 
CLASSOFSERVICE_12 
CLASSOFSERVICE_13 
REQUEST_REPORT_OF_BUNDLE_RECEPTION 
REQUEST_REPORT_OF_CUSTODY_ACCEPTANCE 
REQUEST_REPORT_OF_BUNDLE_FORWARDING 
REQUEST_REPORT_OF_BUNDLE_DELIVERY 
REQUEST_REPORT_OF_BUNDLE_DELETION 
STATUS_REPORT_REQUEST_19 
STATUS_REPORT_REQUEST_20 
DTNSEC_REQUEST_SIGN 
DTNSEC_REQUEST_ENCRYPT 
DTNSEC_STATUS_VERIFIED 
DTNSEC_STATUS_CONFIDENTIAL 
DTNSEC_STATUS_AUTHENTICATED 
IBRDTN_REQUEST_COMPRESSION 

Definition at line 63 of file PrimaryBlock.h.

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 PrimaryBlock.h.

Constructor & Destructor Documentation

dtn::data::PrimaryBlock::PrimaryBlock ( bool  zero_timestamp = false)

Definition at line 36 of file PrimaryBlock.cpp.

References DESTINATION_IS_SINGLETON, relabel(), and set().

Here is the call graph for this function:

dtn::data::PrimaryBlock::~PrimaryBlock ( )
virtual

Definition at line 45 of file PrimaryBlock.cpp.

Member Function Documentation

PrimaryBlock::PRIORITY dtn::data::PrimaryBlock::getPriority ( ) const

Definition at line 59 of file PrimaryBlock.cpp.

References PRIO_HIGH, PRIO_LOW, PRIO_MEDIUM, PRIORITY_BIT1, and PRIORITY_BIT2.

bool dtn::data::PrimaryBlock::isFragment ( ) const
virtual

Reimplemented from dtn::data::BundleID.

Definition at line 96 of file PrimaryBlock.cpp.

References FRAGMENT.

bool dtn::data::PrimaryBlock::operator!= ( const PrimaryBlock other) const

Definition at line 106 of file PrimaryBlock.cpp.

bool dtn::data::PrimaryBlock::operator< ( const PrimaryBlock other) const

Definition at line 116 of file PrimaryBlock.cpp.

bool dtn::data::PrimaryBlock::operator== ( const PrimaryBlock other) const

Definition at line 111 of file PrimaryBlock.cpp.

bool dtn::data::PrimaryBlock::operator> ( const PrimaryBlock other) const

Definition at line 121 of file PrimaryBlock.cpp.

void dtn::data::PrimaryBlock::relabel ( bool  zero_timestamp = false)

relabel the primary block with a new sequence number and a timestamp

Definition at line 126 of file PrimaryBlock.cpp.

References dtn::utils::Clock::getRating(), dtn::utils::Clock::getTime(), dtn::data::BundleID::sequencenumber, and dtn::data::BundleID::timestamp.

Referenced by dtn::daemon::DTNTPWorker::callbackBundleReceived(), PrimaryBlock(), and dtn::api::Registration::processIncomingBundle().

Here is the call graph for this function:

void dtn::data::PrimaryBlock::setFragment ( bool  val)
virtual

Reimplemented from dtn::data::BundleID.

Definition at line 101 of file PrimaryBlock.cpp.

References FRAGMENT, and set().

Here is the call graph for this function:

void dtn::data::PrimaryBlock::setPriority ( PrimaryBlock::PRIORITY  p)

Definition at line 74 of file PrimaryBlock.cpp.

References PRIO_HIGH, PRIO_LOW, PRIO_MEDIUM, PRIORITY_BIT1, PRIORITY_BIT2, and set().

Referenced by main().

Here is the call graph for this function:

Member Data Documentation


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