#include <HelloTLV.h>
Classes | |
struct | HelloTLVHeader |
Hello TLV header p. More... | |
Public Types | |
enum | hello_hf_t { HF_UNKNOWN = 0x0, SYN = 0x1, SYNACK = 0x2, ACK = 0x3, RSTACK = 0x4 } |
Legal values for HelloTLVHeader.HF (hello function) p. More... | |
Public Member Functions | |
HelloTLV (hello_hf_t hf, u_int8_t timer, const std::string &sender) | |
Constructor. | |
virtual | ~HelloTLV () |
Destructor. | |
size_t | serialize (u_char *bp, size_t len) const |
Virtual from BaseTLV. | |
hello_hf_t | hf () const |
Accessors. | |
const char * | hf_str () const |
Accessors. | |
u_int8_t | timer () const |
Accessors. | |
std::string | sender () const |
Accessors. | |
Static Public Member Functions | |
static const char * | hf_to_str (hello_hf_t hf) |
Public Attributes | |
struct prophet::HelloTLV::HelloTLVHeader | packed |
Hello TLV header p. | |
Static Public Attributes | |
static const size_t | HelloTLVHeaderSize = sizeof(struct HelloTLVHeader) |
Protected Member Functions | |
HelloTLV () | |
Constructor. | |
bool | deserialize (const u_char *bp, size_t len) |
Virtual from BaseTLV. | |
Protected Attributes | |
hello_hf_t | hf_ |
Hello function bytecode. | |
u_int8_t | timer_ |
Units of 100ms between Hello messages. | |
std::string | sender_ |
endpoint id of sender | |
Friends | |
class | TLVFactory< HelloTLV > |
Definition at line 26 of file HelloTLV.h.
Legal values for HelloTLVHeader.HF (hello function) p.
25, 4.4.1
Definition at line 94 of file HelloTLV.h.
prophet::HelloTLV::HelloTLV | ( | hello_hf_t | hf, | |
u_int8_t | timer, | |||
const std::string & | sender | |||
) |
virtual prophet::HelloTLV::~HelloTLV | ( | ) | [inline, virtual] |
prophet::HelloTLV::HelloTLV | ( | ) | [protected] |
Constructor.
Protected to force access through TLVFactory.
Definition at line 25 of file HelloTLV.cc.
bool prophet::HelloTLV::deserialize | ( | const u_char * | bp, | |
size_t | len | |||
) | [protected, virtual] |
Virtual from BaseTLV.
Implements prophet::BaseTLV.
Definition at line 42 of file HelloTLV.cc.
References prophet::BaseTLV::HELLO_TLV, HelloTLVHeaderSize, prophet::HelloTLV::HelloTLV::HelloTLVHeader::HF, hf_, prophet::HelloTLV::HelloTLV::HelloTLVHeader::length, prophet::BaseTLV::length_, prophet::HelloTLV::HelloTLV::HelloTLVHeader::name_length, sender_, prophet::HelloTLV::HelloTLV::HelloTLVHeader::sender_name, prophet::HelloTLV::HelloTLV::HelloTLVHeader::timer, timer_, and prophet::HelloTLV::HelloTLV::HelloTLVHeader::type.
hello_hf_t prophet::HelloTLV::hf | ( | ) | const [inline] |
const char* prophet::HelloTLV::hf_str | ( | ) | const [inline] |
static const char* prophet::HelloTLV::hf_to_str | ( | hello_hf_t | hf | ) | [inline, static] |
Definition at line 103 of file HelloTLV.h.
References ACK, HF_UNKNOWN, RSTACK, SYN, and SYNACK.
Referenced by hf_str().
std::string prophet::HelloTLV::sender | ( | ) | const [inline] |
size_t prophet::HelloTLV::serialize | ( | u_char * | bp, | |
size_t | len | |||
) | const [virtual] |
Virtual from BaseTLV.
Implements prophet::BaseTLV.
Definition at line 72 of file HelloTLV.cc.
References FOUR_BYTE_ALIGN, prophet::BaseTLV::HELLO_TLV, HelloTLVHeaderSize, prophet::HelloTLV::HelloTLV::HelloTLVHeader::HF, hf_, prophet::HelloTLV::HelloTLV::HelloTLVHeader::length, prophet::BaseTLV::length_, prophet::HelloTLV::HelloTLV::HelloTLVHeader::name_length, sender_, prophet::HelloTLV::HelloTLV::HelloTLVHeader::sender_name, prophet::HelloTLV::HelloTLV::HelloTLVHeader::timer, timer_, prophet::HelloTLV::HelloTLV::HelloTLVHeader::type, and prophet::BaseTLV::typecode_.
u_int8_t prophet::HelloTLV::timer | ( | ) | const [inline] |
friend class TLVFactory< HelloTLV > [friend] |
Definition at line 140 of file HelloTLV.h.
const size_t prophet::HelloTLV::HelloTLVHeaderSize = sizeof(struct HelloTLVHeader) [static] |
hello_hf_t prophet::HelloTLV::hf_ [protected] |
Hello function bytecode.
Definition at line 152 of file HelloTLV.h.
Referenced by deserialize(), hf(), hf_str(), and serialize().
Hello TLV header
p.
25, 4.4.1
The Hello TLV is used to set up and maintain a link between two PRoPHET nodes. Hello messages with the SYN function are transmitted periodically as beacons. The Hello TLV is the first TLV exchanged between two PRoPHET nodes when they encounter each other. No other TLVs can be exchanged until the first Hello sequenece is completed.
Once a communication link is established between two PRoPHET nodes, the Hello TLV will be sent once for each interval as defined in the interval timer. If a node experiences the lapse of HELLO_DEAD Hello intervals without receiving a Hello TLV on an ESTAB connection (as defined in the state machine in Section 5.2), the connection SHOULD be assumed broken.
std::string prophet::HelloTLV::sender_ [protected] |
endpoint id of sender
Definition at line 154 of file HelloTLV.h.
Referenced by deserialize(), sender(), and serialize().
u_int8_t prophet::HelloTLV::timer_ [protected] |
Units of 100ms between Hello messages.
Definition at line 153 of file HelloTLV.h.
Referenced by deserialize(), serialize(), and timer().