prophet::ProphetTLV Class Reference

#include <ProphetTLV.h>

List of all members.

Classes

struct  ProphetHeader
 Header Definition p. More...

Public Types

enum  header_result_t {
  UnknownResult = 0x0, NoSuccessAck = 0x1, AckAll = 0x2, Success = 0x3,
  Failure = 0x4, ReturnReceipt = 0x5
}
 Legal values for ProphetHeader.result field p. More...
typedef std::list< BaseTLV * > List
typedef std::list< BaseTLV * >
::iterator 
iterator
typedef std::list< BaseTLV * >
::const_iterator 
const_iterator

Public Member Functions

 ProphetTLV (const std::string &src, const std::string &dst, header_result_t result, u_int16_t local_instance, u_int16_t remote_instance, u_int32_t tid)
 Constructor.
 ProphetTLV (const ProphetTLV &tlv)
 Copy constructor.
virtual ~ProphetTLV ()
 Destructor.
size_t serialize (u_char *bp, size_t len) const
 Write ProphetTLV out to no more than len bytes of buffer; return bytes written.
bool add_tlv (BaseTLV *tlv)
 Place TLV on list for serialization into next outbound ProphetTLV.
BaseTLVget_tlv ()
 Remove next TLV from list.
const std::string & source () const
 Accessors.
const std::string & destination () const
 Accessors.
header_result_t result () const
 Accessors.
u_int16_t sender_instance () const
 Accessors.
u_int16_t receiver_instance () const
 Accessors.
u_int32_t transaction_id () const
 Accessors.
u_int16_t length () const
 Accessors.
size_t size () const
 Accessors.
const Listlist () const
 Accessors.

Static Public Member Functions

static const char * result_to_str (header_result_t hr)
 Pretty print function for header_result_t.
static ProphetTLVdeserialize (const std::string &src, const std::string &dst, const u_char *bp, size_t len)
 Read ProphetTLV in from no more than len bytes of buffer; return bytes read.

Public Attributes

struct
prophet::ProphetTLV::ProphetHeader 
packed
 Header Definition p.

Static Public Attributes

static const size_t ProphetHeaderSize = sizeof(struct ProphetHeader)

Protected Member Functions

 ProphetTLV ()

Protected Attributes

std::string src_
 destination id for TLV source (from Bundle metadata)
std::string dst_
 destination id for TLV destination (from Bundle ")
header_result_t result_
 Disposition of this Prophet TLV.
u_int16_t sender_instance_
 Local node's index for this encounter.
u_int16_t receiver_instance_
 Peer's index for this encounter.
u_int32_t tid_
 Transaction ID for this TLV.
u_int16_t length_
 Serialized length of this TLV.
List list_
 Linked list of TLVs embedded in this Prophet TLV.


Detailed Description

Definition at line 26 of file ProphetTLV.h.


Member Typedef Documentation

Definition at line 31 of file ProphetTLV.h.

Definition at line 30 of file ProphetTLV.h.

typedef std::list<BaseTLV*> prophet::ProphetTLV::List

Definition at line 29 of file ProphetTLV.h.


Member Enumeration Documentation

Legal values for ProphetHeader.result field p.

22, 4.2

Enumerator:
UnknownResult 
NoSuccessAck 
AckAll 
Success 
Failure 
ReturnReceipt 

Definition at line 158 of file ProphetTLV.h.


Constructor & Destructor Documentation

prophet::ProphetTLV::ProphetTLV ( const std::string &  src,
const std::string &  dst,
header_result_t  result,
u_int16_t  local_instance,
u_int16_t  remote_instance,
u_int32_t  tid 
)

Constructor.

Definition at line 36 of file ProphetTLV.cc.

prophet::ProphetTLV::ProphetTLV ( const ProphetTLV tlv  ) 

Copy constructor.

Definition at line 46 of file ProphetTLV.cc.

References list_.

prophet::ProphetTLV::~ProphetTLV (  )  [virtual]

Destructor.

Definition at line 55 of file ProphetTLV.cc.

References list_.

prophet::ProphetTLV::ProphetTLV (  )  [protected]

Definition at line 30 of file ProphetTLV.cc.

Referenced by deserialize().


Member Function Documentation

bool prophet::ProphetTLV::add_tlv ( BaseTLV tlv  ) 

Place TLV on list for serialization into next outbound ProphetTLV.

ProphetTLV assumes ownership of memory on submitted pointer, on success.

Definition at line 201 of file ProphetTLV.cc.

References prophet::BaseTLV::length(), length_, and list_.

Referenced by deserialize().

ProphetTLV * prophet::ProphetTLV::deserialize ( const std::string &  src,
const std::string &  dst,
const u_char *  bp,
size_t  len 
) [static]

const std::string& prophet::ProphetTLV::destination (  )  const [inline]

Accessors.

Definition at line 234 of file ProphetTLV.h.

References dst_.

BaseTLV * prophet::ProphetTLV::get_tlv (  ) 

Remove next TLV from list.

Caller assumes ownership of memory pointed to by returned pointer (if non-NULL).

Definition at line 191 of file ProphetTLV.cc.

References list_.

u_int16_t prophet::ProphetTLV::length (  )  const [inline]

Accessors.

Definition at line 239 of file ProphetTLV.h.

References length_.

const List& prophet::ProphetTLV::list (  )  const [inline]

Accessors.

Definition at line 241 of file ProphetTLV.h.

References list_.

u_int16_t prophet::ProphetTLV::receiver_instance (  )  const [inline]

Accessors.

Definition at line 237 of file ProphetTLV.h.

References receiver_instance_.

header_result_t prophet::ProphetTLV::result (  )  const [inline]

Accessors.

Definition at line 235 of file ProphetTLV.h.

References result_.

static const char* prophet::ProphetTLV::result_to_str ( header_result_t  hr  )  [inline, static]

Pretty print function for header_result_t.

Definition at line 172 of file ProphetTLV.h.

References AckAll, Failure, NoSuccessAck, ReturnReceipt, Success, and UnknownResult.

u_int16_t prophet::ProphetTLV::sender_instance (  )  const [inline]

Accessors.

Definition at line 236 of file ProphetTLV.h.

References sender_instance_.

size_t prophet::ProphetTLV::serialize ( u_char *  bp,
size_t  len 
) const

size_t prophet::ProphetTLV::size (  )  const [inline]

Accessors.

Definition at line 240 of file ProphetTLV.h.

References list_.

const std::string& prophet::ProphetTLV::source (  )  const [inline]

Accessors.

Definition at line 233 of file ProphetTLV.h.

References src_.

u_int32_t prophet::ProphetTLV::transaction_id (  )  const [inline]

Accessors.

Definition at line 238 of file ProphetTLV.h.

References tid_.


Member Data Documentation

std::string prophet::ProphetTLV::dst_ [protected]

destination id for TLV destination (from Bundle ")

Definition at line 248 of file ProphetTLV.h.

Referenced by deserialize(), and destination().

u_int16_t prophet::ProphetTLV::length_ [mutable, protected]

Serialized length of this TLV.

Definition at line 253 of file ProphetTLV.h.

Referenced by add_tlv(), deserialize(), length(), and serialize().

Linked list of TLVs embedded in this Prophet TLV.

Definition at line 254 of file ProphetTLV.h.

Referenced by add_tlv(), get_tlv(), list(), ProphetTLV(), serialize(), size(), and ~ProphetTLV().

Header Definition p.

21, 4.2

const size_t prophet::ProphetTLV::ProphetHeaderSize = sizeof(struct ProphetHeader) [static]

Definition at line 167 of file ProphetTLV.h.

Referenced by deserialize(), and serialize().

Peer's index for this encounter.

Definition at line 251 of file ProphetTLV.h.

Referenced by deserialize(), receiver_instance(), and serialize().

Disposition of this Prophet TLV.

Definition at line 249 of file ProphetTLV.h.

Referenced by deserialize(), result(), and serialize().

Local node's index for this encounter.

Definition at line 250 of file ProphetTLV.h.

Referenced by deserialize(), sender_instance(), and serialize().

std::string prophet::ProphetTLV::src_ [protected]

destination id for TLV source (from Bundle metadata)

Definition at line 247 of file ProphetTLV.h.

Referenced by deserialize(), and source().

u_int32_t prophet::ProphetTLV::tid_ [protected]

Transaction ID for this TLV.

Definition at line 252 of file ProphetTLV.h.

Referenced by deserialize(), serialize(), and transaction_id().


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

Generated on Fri Jan 30 09:43:16 2009 for DTN Reference Implementation by  doxygen 1.5.8