#include <Encounter.h>
28 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.
Section 4.4.3, p. 27 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.
Track the state for the Prophet protocol throughout the duration of this encounter between the local node and this remote.
Definition at line 50 of file Encounter.h.
Public Types | |
enum | state_t { UNDEFINED_STATE = 0, WAIT_NB, SYNSENT, SYNRCVD, ESTAB, WAIT_DICT, WAIT_RIB, OFFER, CREATE_DR, SEND_DR, REQUEST, WAIT_INFO } |
Public Member Functions | |
Encounter (const Link *nexthop, Oracle *oracle, u_int16_t instance) | |
Constructor. | |
Encounter (const Encounter &e) | |
Copy constructor. | |
~Encounter () | |
Destructor. | |
void | hello_interval_changed () |
Callback to inform this instance that the hello_interval parameter has changed. | |
bool | receive_tlv (ProphetTLV *tlv) |
Callback for this instance to receive TLVs received from peer by the host bundling system. | |
void | handle_timeout () |
Callback for timeout handler, either due to peer failure or unacceptable delay in messaging. | |
void | handle_bundle_received (const Bundle *b) |
Callback for tracking which Bundle requests are outstanding. | |
bool | operator< (const Encounter &e) const |
Operators. | |
u_int16_t | remote_instance () const |
Accessors. | |
u_int16_t | local_instance () const |
Accessors. | |
const char * | remote_eid () const |
Accessors. | |
const Link * | nexthop () const |
Accessors. | |
state_t | state () const |
Accessors. | |
const char * | state_str () const |
Accessors. | |
bool | neighbor_gone () const |
Accessors. | |
u_int | time_remaining () const |
Accessors. | |
Static Public Member Functions | |
static const char * | state_to_str (state_t st) |
Protected Member Functions | |
bool | dispatch_tlv (BaseTLV *tlv) |
TLV event handlers. | |
bool | handle_hello_tlv (BaseTLV *hello) |
TLV event handlers. | |
bool | handle_ribd_tlv (BaseTLV *ribd) |
TLV event handlers. | |
bool | handle_rib_tlv (BaseTLV *rib) |
TLV event handlers. | |
bool | handle_offer_tlv (BaseTLV *offer) |
TLV event handlers. | |
bool | handle_response_tlv (BaseTLV *response) |
TLV event handlers. | |
bool | send_hello (HelloTLV::hello_hf_t hf, ProphetTLV::header_result_t hr=ProphetTLV::NoSuccessAck, u_int32_t tid=0) |
Outbound message generators. | |
bool | send_dictionary_rib (ProphetTLV::header_result_t hr=ProphetTLV::NoSuccessAck, u_int32_t tid=0) |
Outbound message generators. | |
bool | send_offer (ProphetTLV::header_result_t hr=ProphetTLV::NoSuccessAck, u_int32_t tid=0) |
Outbound message generators. | |
bool | send_response (ProphetTLV::header_result_t hr=ProphetTLV::NoSuccessAck, u_int32_t tid=0) |
Outbound message generators. | |
bool | send_tlv (ProphetTLV *tlv) |
Outbound message generators. | |
Protected Attributes | |
Oracle *const | oracle_ |
collection of Prophet information | |
u_int16_t | local_instance_ |
local's instance for remote | |
u_int16_t | remote_instance_ |
remote's instance for local | |
u_int32_t | tid_ |
transaction id from peer's most recent TLV | |
u_int32_t | next_tid_ |
used to generate TID for outbound TLVs | |
u_int32_t | timeout_ |
most milliseconds expected between TLVs | |
const Link * | next_hop_ |
Link object for this encounter. | |
ProphetTLV * | tlv_ |
most recent message received from peer | |
const bool | synsender_ |
whether active or passive during Hello phase | |
state_t | state_ |
which phase of Prophet protocol for this end | |
bool | synsent_ |
whether hello phase has sent SYN or SYNACK | |
bool | estab_ |
whether hello phase has been completed | |
volatile bool | neighbor_gone_ |
whether session has died | |
Dictionary | local_ribd_ |
16 bit index lookup to translate routes | |
Dictionary | remote_ribd_ |
16 bit index lookup for remote's routes | |
BundleOfferList | remote_offers_ |
in-memory rep of remote's offer | |
BundleResponseList | local_response_ |
Bundle requests sent to peer. | |
Table | remote_nodes_ |
in-memory representation of remote's RIB | |
u_int | hello_rate_ |
simple flow control for Hello messages (ACK, etc) | |
u_int32_t | data_sent_ |
timestamp of last TLV sent | |
u_int32_t | data_rcvd_ |
timestamp of last TLV received | |
Alarm * | alarm_ |
callback registration for timeout handler |
Definition at line 53 of file Encounter.h.
prophet::Encounter::Encounter | ( | const Link * | nexthop, | |
Oracle * | oracle, | |||
u_int16_t | instance | |||
) |
Constructor.
prophet::Encounter::Encounter | ( | const Encounter & | e | ) |
Copy constructor.
prophet::Encounter::~Encounter | ( | ) |
Destructor.
static const char* prophet::Encounter::state_to_str | ( | state_t | st | ) | [inline, static] |
u_int16_t prophet::Encounter::remote_instance | ( | ) | const [inline] |
u_int16_t prophet::Encounter::local_instance | ( | ) | const [inline] |
const char* prophet::Encounter::remote_eid | ( | ) | const [inline] |
Accessors.
Definition at line 111 of file Encounter.h.
References next_hop_, and prophet::Link::remote_eid().
const Link* prophet::Encounter::nexthop | ( | ) | const [inline] |
state_t prophet::Encounter::state | ( | ) | const [inline] |
const char* prophet::Encounter::state_str | ( | ) | const [inline] |
bool prophet::Encounter::neighbor_gone | ( | ) | const [inline] |
u_int prophet::Encounter::time_remaining | ( | ) | const [inline] |
Accessors.
Definition at line 116 of file Encounter.h.
References alarm_, and prophet::Alarm::time_remaining().
void prophet::Encounter::hello_interval_changed | ( | ) |
Callback to inform this instance that the hello_interval parameter has changed.
bool prophet::Encounter::receive_tlv | ( | ProphetTLV * | tlv | ) |
Callback for this instance to receive TLVs received from peer by the host bundling system.
Encounter assumes ownership of memory pointed to by tlv. Return true if message processed successfully. Return false upon fault (peering session died).
void prophet::Encounter::handle_timeout | ( | ) | [virtual] |
Callback for timeout handler, either due to peer failure or unacceptable delay in messaging.
Implements prophet::ExpirationHandler.
void prophet::Encounter::handle_bundle_received | ( | const Bundle * | b | ) |
Callback for tracking which Bundle requests are outstanding.
bool prophet::Encounter::send_hello | ( | HelloTLV::hello_hf_t | hf, | |
ProphetTLV::header_result_t | hr = ProphetTLV::NoSuccessAck , |
|||
u_int32_t | tid = 0 | |||
) | [protected] |
Outbound message generators.
bool prophet::Encounter::send_dictionary_rib | ( | ProphetTLV::header_result_t | hr = ProphetTLV::NoSuccessAck , |
|
u_int32_t | tid = 0 | |||
) | [protected] |
Outbound message generators.
bool prophet::Encounter::send_offer | ( | ProphetTLV::header_result_t | hr = ProphetTLV::NoSuccessAck , |
|
u_int32_t | tid = 0 | |||
) | [protected] |
Outbound message generators.
bool prophet::Encounter::send_response | ( | ProphetTLV::header_result_t | hr = ProphetTLV::NoSuccessAck , |
|
u_int32_t | tid = 0 | |||
) | [protected] |
Outbound message generators.
bool prophet::Encounter::send_tlv | ( | ProphetTLV * | tlv | ) | [protected] |
Outbound message generators.
Oracle* const prophet::Encounter::oracle_ [protected] |
u_int16_t prophet::Encounter::local_instance_ [protected] |
local's instance for remote
Definition at line 171 of file Encounter.h.
Referenced by local_instance().
u_int16_t prophet::Encounter::remote_instance_ [protected] |
remote's instance for local
Definition at line 172 of file Encounter.h.
Referenced by operator<(), and remote_instance().
u_int32_t prophet::Encounter::tid_ [protected] |
u_int32_t prophet::Encounter::next_tid_ [protected] |
u_int32_t prophet::Encounter::timeout_ [protected] |
const Link* prophet::Encounter::next_hop_ [protected] |
Link object for this encounter.
Definition at line 176 of file Encounter.h.
Referenced by nexthop(), and remote_eid().
ProphetTLV* prophet::Encounter::tlv_ [protected] |
const bool prophet::Encounter::synsender_ [protected] |
state_t prophet::Encounter::state_ [protected] |
which phase of Prophet protocol for this end
Definition at line 179 of file Encounter.h.
Referenced by state(), and state_str().
bool prophet::Encounter::synsent_ [protected] |
bool prophet::Encounter::estab_ [protected] |
volatile bool prophet::Encounter::neighbor_gone_ [protected] |
Dictionary prophet::Encounter::local_ribd_ [protected] |
Dictionary prophet::Encounter::remote_ribd_ [protected] |
BundleOfferList prophet::Encounter::remote_offers_ [protected] |
Table prophet::Encounter::remote_nodes_ [protected] |
u_int prophet::Encounter::hello_rate_ [protected] |
u_int32_t prophet::Encounter::data_sent_ [protected] |
u_int32_t prophet::Encounter::data_rcvd_ [protected] |
Alarm* prophet::Encounter::alarm_ [protected] |
callback registration for timeout handler
Definition at line 191 of file Encounter.h.
Referenced by time_remaining().