#include <RIBDTLV.h>
Classes | |
struct | RIBDTLVHeader |
Routing Information Base Dictionary TLV p. More... | |
struct | RoutingAddressString |
Routing Address String (entry in RIBD above) p. More... | |
Public Member Functions | |
RIBDTLV (const Dictionary &ribd) | |
Constructor. | |
virtual | ~RIBDTLV () |
Destructor. | |
size_t | serialize (u_char *bp, size_t len) const |
Virtual from BaseTLV. | |
const Dictionary & | ribd (const std::string &sender, const std::string &receiver) |
Accessor. | |
Public Attributes | |
struct prophet::RIBDTLV::RIBDTLVHeader | packed |
Routing Information Base Dictionary TLV p. | |
struct prophet::RIBDTLV::RoutingAddressString | packed |
Routing Address String (entry in RIBD above) p. | |
Static Public Attributes | |
static const size_t | RIBDTLVHeaderSize = sizeof(struct RIBDTLVHeader) |
static const size_t | RoutingAddressStringSize |
Protected Member Functions | |
RIBDTLV () | |
Constructor. | |
size_t | write_ras_entry (u_int16_t sid, const std::string &dest_id, u_char *bp, size_t len) const |
Serialize destination ID out to buffer bp, size len, using struct RoutingAddressString; return total bytes written. | |
size_t | read_ras_entry (u_int16_t *sid, std::string &dest_id, const u_char *bp, size_t len) |
Deserialize RoutingAddressString struct from transport into memory, setting *sid and dest_id; return total bytes read. | |
bool | deserialize (const u_char *bp, size_t len) |
Virtual from BaseTLV. | |
Protected Attributes | |
Dictionary | ribd_ |
mapping from destination id string to numeric id (sid) | |
Friends | |
class | TLVFactory< RIBDTLV > |
Definition at line 26 of file RIBDTLV.h.
prophet::RIBDTLV::RIBDTLV | ( | const Dictionary & | ribd | ) |
Constructor.
Definition at line 24 of file RIBDTLV.cc.
References prophet::Dictionary::guess_ribd_size(), prophet::BaseTLV::length_, ribd_, RIBDTLVHeaderSize, and RoutingAddressStringSize.
virtual prophet::RIBDTLV::~RIBDTLV | ( | ) | [inline, virtual] |
prophet::RIBDTLV::RIBDTLV | ( | ) | [protected] |
Constructor.
Protected to force access through TLVFactory.
Definition at line 31 of file RIBDTLV.cc.
bool prophet::RIBDTLV::deserialize | ( | const u_char * | bp, | |
size_t | len | |||
) | [protected, virtual] |
Virtual from BaseTLV.
Implements prophet::BaseTLV.
Definition at line 147 of file RIBDTLV.cc.
References prophet::Dictionary::assign(), prophet::Dictionary::clear(), prophet::RIBDTLV::RIBDTLVHeader::entry_count, prophet::RIBDTLV::RIBDTLVHeader::flags, prophet::BaseTLV::flags_, prophet::RIBDTLV::RIBDTLVHeader::length, prophet::BaseTLV::length_, read_ras_entry(), ribd_, prophet::BaseTLV::RIBD_TLV, RIBDTLVHeaderSize, and prophet::RIBDTLV::RIBDTLVHeader::type.
size_t prophet::RIBDTLV::read_ras_entry | ( | u_int16_t * | sid, | |
std::string & | dest_id, | |||
const u_char * | bp, | |||
size_t | len | |||
) | [protected] |
Deserialize RoutingAddressString struct from transport into memory, setting *sid and dest_id; return total bytes read.
Definition at line 115 of file RIBDTLV.cc.
References FOUR_BYTE_ALIGN, prophet::RIBDTLV::RoutingAddressString::length, prophet::RIBDTLV::RoutingAddressString::ra_string, RoutingAddressStringSize, and prophet::RIBDTLV::RoutingAddressString::string_id.
Referenced by deserialize().
const Dictionary & prophet::RIBDTLV::ribd | ( | const std::string & | sender, | |
const std::string & | receiver | |||
) |
Accessor.
Definition at line 197 of file RIBDTLV.cc.
References prophet::Dictionary::assign(), and ribd_.
Referenced by prophet::Encounter::handle_ribd_tlv(), and prophet::Encounter::send_dictionary_rib().
size_t prophet::RIBDTLV::serialize | ( | u_char * | bp, | |
size_t | len | |||
) | const [virtual] |
Virtual from BaseTLV.
Implements prophet::BaseTLV.
Definition at line 66 of file RIBDTLV.cc.
References prophet::Dictionary::begin(), prophet::Dictionary::end(), prophet::RIBDTLV::RIBDTLVHeader::entry_count, prophet::RIBDTLV::RIBDTLVHeader::flags, prophet::Dictionary::guess_ribd_size(), prophet::RIBDTLV::RIBDTLVHeader::length, prophet::BaseTLV::length_, ribd_, prophet::BaseTLV::RIBD_TLV, RIBDTLVHeaderSize, RoutingAddressStringSize, prophet::RIBDTLV::RIBDTLVHeader::type, prophet::BaseTLV::typecode_, and write_ras_entry().
size_t prophet::RIBDTLV::write_ras_entry | ( | u_int16_t | sid, | |
const std::string & | dest_id, | |||
u_char * | bp, | |||
size_t | len | |||
) | const [protected] |
Serialize destination ID out to buffer bp, size len, using struct RoutingAddressString; return total bytes written.
Definition at line 35 of file RIBDTLV.cc.
References FOUR_BYTE_ALIGN, prophet::RIBDTLV::RoutingAddressString::length, prophet::RIBDTLV::RoutingAddressString::ra_string, RoutingAddressStringSize, and prophet::RIBDTLV::RoutingAddressString::string_id.
Referenced by serialize().
friend class TLVFactory< RIBDTLV > [friend] |
Routing Address String (entry in RIBD above) p.
27, 4.4.3
Routing Information Base Dictionary TLV
p.
27, 4.4.3
The Routing Information Base Dictionary includes the list of addresses used in making routing decisions. The referents remain constant for the duration of a session over a link where the instance numbers remain the same and can be used by both the Routing Information Base messages and the bundle offer messages.
Dictionary prophet::RIBDTLV::ribd_ [protected] |
mapping from destination id string to numeric id (sid)
Definition at line 122 of file RIBDTLV.h.
Referenced by deserialize(), ribd(), RIBDTLV(), and serialize().
const size_t prophet::RIBDTLV::RIBDTLVHeaderSize = sizeof(struct RIBDTLVHeader) [static] |
Definition at line 69 of file RIBDTLV.h.
Referenced by deserialize(), RIBDTLV(), and serialize().
const size_t prophet::RIBDTLV::RoutingAddressStringSize [static] |
sizeof(struct RoutingAddressString)
Definition at line 71 of file RIBDTLV.h.
Referenced by read_ras_entry(), RIBDTLV(), serialize(), and write_ras_entry().