prophet::RIBTLV Class Reference

#include <RIBTLV.h>

Inheritance diagram for prophet::RIBTLV:
prophet::BaseTLV

List of all members.

Classes

struct  RIBEntry
 Routing Information Base entry p. More...
struct  RIBTLVHeader
 Routing Information Base TLV
p. More...

Public Types

enum  rib_header_flag_t { RELAY_NODE = 1 << 0, CUSTODY_NODE = 1 << 1, INTERNET_GW_NODE = 1 << 2 }
 

RIB Header Flags p.

More...
typedef RIBNodeList::iterator iterator
typedef RIBNodeList::const_iterator const_iterator

Public Member Functions

 RIBTLV (const RIBNodeList &nodes, bool relay, bool custody, bool internet=false)
 Constructor.
virtual ~RIBTLV ()
 Destructor.
size_t serialize (u_char *bp, size_t len) const
 Virtual from BaseTLV.

const RIBNodeListnodes () const
 Accessors.
bool relay () const
 Accessors.
bool custody () const
 Accessors.
bool internet () const
 Accessors.

Public Attributes

struct
prophet::RIBTLV::RIBTLVHeader 
packed
 Routing Information Base TLV
p.
struct prophet::RIBTLV::RIBEntry packed
 Routing Information Base entry p.

Static Public Attributes

static const size_t RIBTLVHeaderSize = sizeof(struct RIBTLVHeader)
static const size_t RIBEntrySize = sizeof(struct RIBEntry)

Protected Member Functions

 RIBTLV ()
 Constructor.
size_t write_rib_entry (u_int16_t sid, double pvalue, bool relay, bool custody, bool internet, u_char *bp, size_t len) const
 Serialize routing information base entry out to no more than len bytes of buffer, using struct RIBEntry; return bytes written.
size_t read_rib_entry (u_int16_t *sid, double *pvalue, bool *relay, bool *custody, bool *internet, const u_char *bp, size_t len)
 Deserialize RIBEntry struct from transport into memory, reading no more than len bytes from buffer; return bytes read.
bool deserialize (const u_char *bp, size_t len)
 Virtual from BaseTLV.

Static Protected Member Functions

static void decode_flags (u_int8_t flags, bool *relay, bool *custody, bool *internet)
 Utility function for decoding RIB header flags.

Protected Attributes

RIBNodeList nodes_
 List of RIB entries.
bool relay_
 Whether this node accepts bundles for relay to other nodes.
bool custody_
 Whether this node accepts custody transfers.
bool internet_
 Whether this node bridges to the Internet.

Friends

class TLVFactory< RIBTLV >

Detailed Description

Definition at line 27 of file RIBTLV.h.


Member Typedef Documentation

Definition at line 32 of file RIBTLV.h.

Definition at line 31 of file RIBTLV.h.


Member Enumeration Documentation

RIB Header Flags p.

28, 4.4.4

Enumerator:
RELAY_NODE 
CUSTODY_NODE 
INTERNET_GW_NODE 

Definition at line 38 of file RIBTLV.h.


Constructor & Destructor Documentation

prophet::RIBTLV::RIBTLV ( const RIBNodeList nodes,
bool  relay,
bool  custody,
bool  internet = false 
)

Constructor.

Definition at line 25 of file RIBTLV.cc.

References prophet::BaseTLV::length_, nodes_, RIBEntrySize, and RIBTLVHeaderSize.

virtual prophet::RIBTLV::~RIBTLV (  )  [inline, virtual]

Destructor.

Definition at line 124 of file RIBTLV.h.

prophet::RIBTLV::RIBTLV (  )  [protected]

Constructor.

Protected to force access through TLVFactory.

Definition at line 35 of file RIBTLV.cc.


Member Function Documentation

bool prophet::RIBTLV::custody (  )  const [inline]

Accessors.

Definition at line 134 of file RIBTLV.h.

References custody_.

Referenced by deserialize(), and prophet::Encounter::handle_rib_tlv().

void prophet::RIBTLV::decode_flags ( u_int8_t  flags,
bool relay,
bool custody,
bool internet 
) [static, protected]

Utility function for decoding RIB header flags.

Definition at line 91 of file RIBTLV.cc.

References CUSTODY_NODE, INTERNET_GW_NODE, and RELAY_NODE.

Referenced by deserialize(), and read_rib_entry().

bool prophet::RIBTLV::deserialize ( const u_char *  bp,
size_t  len 
) [protected, virtual]
bool prophet::RIBTLV::internet (  )  const [inline]

Accessors.

Definition at line 135 of file RIBTLV.h.

References internet_.

Referenced by deserialize(), and prophet::Encounter::handle_rib_tlv().

const RIBNodeList& prophet::RIBTLV::nodes (  )  const [inline]

Accessors.

Definition at line 132 of file RIBTLV.h.

References nodes_.

Referenced by prophet::Encounter::handle_rib_tlv().

size_t prophet::RIBTLV::read_rib_entry ( u_int16_t *  sid,
double *  pvalue,
bool relay,
bool custody,
bool internet,
const u_char *  bp,
size_t  len 
) [protected]

Deserialize RIBEntry struct from transport into memory, reading no more than len bytes from buffer; return bytes read.

Definition at line 130 of file RIBTLV.cc.

References decode_flags(), prophet::RIBTLV::RIBEntry::flags, prophet::RIBTLV::RIBEntry::pvalue, RIBEntrySize, and prophet::RIBTLV::RIBEntry::string_id.

Referenced by deserialize().

bool prophet::RIBTLV::relay (  )  const [inline]

Accessors.

Definition at line 133 of file RIBTLV.h.

References relay_.

Referenced by deserialize(), and prophet::Encounter::handle_rib_tlv().

size_t prophet::RIBTLV::serialize ( u_char *  bp,
size_t  len 
) const [virtual]
size_t prophet::RIBTLV::write_rib_entry ( u_int16_t  sid,
double  pvalue,
bool  relay,
bool  custody,
bool  internet,
u_char *  bp,
size_t  len 
) const [protected]

Serialize routing information base entry out to no more than len bytes of buffer, using struct RIBEntry; return bytes written.

Definition at line 105 of file RIBTLV.cc.

References CUSTODY_NODE, prophet::RIBTLV::RIBEntry::flags, INTERNET_GW_NODE, prophet::RIBTLV::RIBEntry::pvalue, RELAY_NODE, RIBEntrySize, and prophet::RIBTLV::RIBEntry::string_id.

Referenced by serialize().


Friends And Related Function Documentation

friend class TLVFactory< RIBTLV > [friend]

Definition at line 139 of file RIBTLV.h.


Member Data Documentation

Whether this node accepts custody transfers.

Definition at line 176 of file RIBTLV.h.

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

Whether this node bridges to the Internet.

Definition at line 177 of file RIBTLV.h.

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

List of RIB entries.

Definition at line 173 of file RIBTLV.h.

Referenced by deserialize(), nodes(), RIBTLV(), and serialize().

Routing Information Base entry p.

28, 4.4.4

Routing Information Base TLV
p.

28, 4.4.4

The Routing Information Base lists the destinations a node knows of, and the delivery predictabilities it has associated with them. This information is needed by the PRoPHET algorithm to make decisions on routing and forwarding.

Whether this node accepts bundles for relay to other nodes.

Definition at line 174 of file RIBTLV.h.

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

const size_t prophet::RIBTLV::RIBEntrySize = sizeof(struct RIBEntry) [static]

Definition at line 111 of file RIBTLV.h.

Referenced by deserialize(), read_rib_entry(), RIBTLV(), serialize(), and write_rib_entry().

const size_t prophet::RIBTLV::RIBTLVHeaderSize = sizeof(struct RIBTLVHeader) [static]

Definition at line 109 of file RIBTLV.h.

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


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