dtn::ProphetTLV Class Reference

#include <ProphetTLV.h>

Inheritance diagram for dtn::ProphetTLV:

oasys::Logger List of all members.

Detailed Description

Helper class for serializing/deserializing Prophet control messages to/from Bundles.

Definition at line 286 of file ProphetTLV.h.

Public Types

typedef std::list< BaseTLV * > List
typedef List::iterator iterator
typedef List::const_iterator const_iterator

Public Member Functions

 ProphetTLV (Prophet::header_result_t result, u_int16_t local_instance, u_int16_t remote_instance, u_int32_t tid, const char *logpath=LOGPATH)
virtual ~ProphetTLV ()
bool create_bundle (Bundle *bundle, const EndpointID &local, const EndpointID &remote) const
Prophet::header_result_t result ()
u_int16_t sender_instance ()
u_int16_t receiver_instance ()
u_int32_t transaction_id ()
u_int16_t length ()
size_t num_tlv ()
BaseTLVget_tlv ()
void add_tlv (BaseTLV *tlv)
const Listlist () const
void dump (oasys::StringBuffer *buf)

Static Public Member Functions

static ProphetTLVdeserialize (Bundle *b, EndpointID *local=NULL, EndpointID *remote=NULL, const char *logpath=LOGPATH)

Protected Member Functions

 ProphetTLV (const char *logpath=LOGPATH)
bool deserialize (u_char *bp, size_t buflen)
size_t serialize (u_char *, size_t) const

Protected Attributes

Prophet::header_result_t result_
u_int16_t sender_instance_
u_int16_t receiver_instance_
u_int32_t tid_
u_int16_t parsedlen_
List list_


Member Typedef Documentation

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

Definition at line 289 of file ProphetTLV.h.

typedef List::iterator dtn::ProphetTLV::iterator

Definition at line 290 of file ProphetTLV.h.

typedef List::const_iterator dtn::ProphetTLV::const_iterator

Definition at line 291 of file ProphetTLV.h.


Constructor & Destructor Documentation

dtn::ProphetTLV::ProphetTLV ( Prophet::header_result_t  result,
u_int16_t  local_instance,
u_int16_t  remote_instance,
u_int32_t  tid,
const char *  logpath = LOGPATH 
)

Definition at line 480 of file ProphetTLV.cc.

References list_.

Referenced by deserialize().

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

Definition at line 496 of file ProphetTLV.cc.

References dtn::Prophet::BUNDLE_TLV, dtn::Prophet::HELLO_TLV, list_, dtn::Prophet::RIB_TLV, dtn::Prophet::RIBD_TLV, and dtn::Prophet::UNKNOWN_TLV.

dtn::ProphetTLV::ProphetTLV ( const char *  logpath = LOGPATH  )  [protected]

Definition at line 469 of file ProphetTLV.cc.

References list_.


Member Function Documentation

bool dtn::ProphetTLV::create_bundle ( Bundle bundle,
const EndpointID local,
const EndpointID remote 
) const

Definition at line 667 of file ProphetTLV.cc.

References dtn::EndpointID::append_service_tag(), ASSERT, dtn::EndpointID::assign(), oasys::ScratchBuffer< _memory_t, _static_size >::buf(), dtn::Bundle::custodian_, dtn::Bundle::dest_, dtn::Bundle::expiration_, dtn::EndpointID::NULL_EID(), parsedlen_, dtn::Bundle::payload_, dtn::Bundle::replyto_, serialize(), dtn::BundlePayload::set_data(), dtn::Bundle::source_, and src.

Referenced by dtn::ProphetEncounter::send_prophet_tlv().

ProphetTLV * dtn::ProphetTLV::deserialize ( Bundle b,
EndpointID local = NULL,
EndpointID remote = NULL,
const char *  logpath = LOGPATH 
) [static]

Definition at line 543 of file ProphetTLV.cc.

References dtn::EndpointID::assign(), oasys::ScratchBuffer< _memory_t, _static_size >::buf(), deserialize(), dtn::Bundle::dest_, dtn::BundlePayload::length(), dtn::Bundle::payload_, ProphetTLV(), dtn::BundlePayload::read_data(), and dtn::Bundle::source_.

Referenced by deserialize(), and dtn::ProphetController::handle_bundle_received().

Prophet::header_result_t dtn::ProphetTLV::result (  )  [inline]

Definition at line 312 of file ProphetTLV.h.

References result_.

Referenced by dtn::ProphetEncounter::handle_prophet_tlv(), and dtn::ProphetEncounter::outbound_tlv().

u_int16_t dtn::ProphetTLV::sender_instance (  )  [inline]

Definition at line 313 of file ProphetTLV.h.

References sender_instance_.

Referenced by dtn::ProphetEncounter::handle_hello_tlv().

u_int16_t dtn::ProphetTLV::receiver_instance (  )  [inline]

Definition at line 314 of file ProphetTLV.h.

References receiver_instance_.

Referenced by dtn::ProphetEncounter::handle_hello_tlv().

u_int32_t dtn::ProphetTLV::transaction_id (  )  [inline]

Definition at line 315 of file ProphetTLV.h.

References tid_.

Referenced by dtn::ProphetEncounter::handle_bundle_tlv(), dtn::ProphetEncounter::handle_hello_tlv(), dtn::ProphetEncounter::handle_prophet_tlv(), and dtn::ProphetEncounter::outbound_tlv().

u_int16_t dtn::ProphetTLV::length (  )  [inline]

Definition at line 316 of file ProphetTLV.h.

References parsedlen_.

size_t dtn::ProphetTLV::num_tlv (  )  [inline]

Definition at line 317 of file ProphetTLV.h.

References list_.

Referenced by dump(), dtn::ProphetEncounter::handle_prophet_tlv(), and dtn::ProphetEncounter::send_prophet_tlv().

BaseTLV * dtn::ProphetTLV::get_tlv (  ) 

Definition at line 525 of file ProphetTLV.cc.

References list_.

Referenced by dtn::ProphetEncounter::handle_prophet_tlv().

void dtn::ProphetTLV::add_tlv ( BaseTLV tlv  ) 

Definition at line 535 of file ProphetTLV.cc.

References ASSERT, dtn::BaseTLV::length(), list_, and parsedlen_.

Referenced by deserialize(), dtn::ProphetEncounter::enqueue_bundle_tlv(), dtn::ProphetEncounter::enqueue_hello(), dtn::ProphetEncounter::enqueue_rib(), and dtn::ProphetEncounter::enqueue_ribd().

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

Definition at line 326 of file ProphetTLV.h.

References list_.

Referenced by dtn::ProphetEncounter::handle_prophet_tlv().

void dtn::ProphetTLV::dump ( oasys::StringBuffer buf  ) 

Definition at line 83 of file ProphetTLV.cc.

References oasys::StringBuffer::appendf(), dtn::Prophet::BUNDLE_TLV, dtn::BundleTLV::dump(), dtn::RIBTLV::dump(), dtn::RIBDTLV::dump(), dtn::Prophet::HELLO_TLV, list_, num_tlv(), parsedlen_, receiver_instance_, result_, dtn::Prophet::result_to_str(), dtn::Prophet::RIB_TLV, dtn::Prophet::RIBD_TLV, sender_instance_, tid_, and dtn::Prophet::UNKNOWN_TLV.

Referenced by dtn::ProphetEncounter::handle_prophet_tlv(), and dtn::ProphetEncounter::send_prophet_tlv().

bool dtn::ProphetTLV::deserialize ( u_char *  bp,
size_t  buflen 
) [protected]

Definition at line 570 of file ProphetTLV.cc.

References add_tlv(), ASSERT, dtn::Prophet::BUNDLE_TLV, dtn::Prophet::ProphetHeader::code, dtn::Prophet::ProphetHeader::flags, dtn::Prophet::HELLO_TLV, dtn::BaseTLV::length(), dtn::Prophet::ProphetHeader::length, log_err, oasys::Logger::logpath_, parsedlen_, dtn::Prophet::PROPHET_VERSION, dtn::Prophet::ProphetHeaderSize, dtn::Prophet::ProphetHeader::receiver_instance, receiver_instance_, dtn::Prophet::ProphetHeader::result, result_, dtn::Prophet::RIB_TLV, dtn::Prophet::RIBD_TLV, dtn::Prophet::ProphetHeader::sender_instance, sender_instance_, dtn::Prophet::ProphetHeader::submessage_flag, dtn::Prophet::ProphetHeader::submessage_num, tid_, dtn::Prophet::ProphetHeader::transaction_id, dtn::Prophet::UNKNOWN_TLV, and dtn::Prophet::ProphetHeader::version.

size_t dtn::ProphetTLV::serialize ( u_char *  ,
size_t   
) const [protected]

Definition at line 697 of file ProphetTLV.cc.

References list_, parsedlen_, dtn::Prophet::PROPHET_VERSION, dtn::Prophet::ProphetHeaderSize, receiver_instance_, result_, sender_instance_, and tid_.

Referenced by create_bundle().


Member Data Documentation

Prophet::header_result_t dtn::ProphetTLV::result_ [protected]

Definition at line 338 of file ProphetTLV.h.

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

u_int16_t dtn::ProphetTLV::sender_instance_ [protected]

Definition at line 339 of file ProphetTLV.h.

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

u_int16_t dtn::ProphetTLV::receiver_instance_ [protected]

Definition at line 340 of file ProphetTLV.h.

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

u_int32_t dtn::ProphetTLV::tid_ [protected]

Definition at line 341 of file ProphetTLV.h.

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

u_int16_t dtn::ProphetTLV::parsedlen_ [protected]

Definition at line 342 of file ProphetTLV.h.

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

List dtn::ProphetTLV::list_ [protected]

Definition at line 343 of file ProphetTLV.h.

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


The documentation for this class was generated from the following files:
Generated on Thu Jun 7 16:56:58 2007 for DTN Reference Implementation by  doxygen 1.5.1