|
|
LogicalLink is so named because it is mostly independent of the underlying link layer. OLSR uses link-layer broadcasts or multicasts for the purposes of neighbor discovery, and links are created through the exchange of HELLO messages. LogicalLink may be associated with link-layer specific state, e.g. that of an 802.11s mesh portal.
LogicalLink (Neighborhood* tm,
EventLoop& eventloop,
const OlsrTypes::LogicalLinkID id,
const TimeVal& vtime,
const IPv4& remote_addr,
const IPv4& local_addr)
| LogicalLink |
inline OlsrTypes::LogicalLinkID id ()
| id |
[const]
Returns: the ID of this link.
inline OlsrTypes::NeighborID neighbor_id ()
| neighbor_id |
[const]
Returns: the ID of the neighbor at the far end of this link.
inline void set_neighbor_id (OlsrTypes::NeighborID neighborid)
| set_neighbor_id |
Set the ID of the neighbor at the far end of this link.
Parameters:
neighborid | the ID of the neighbor. |
inline Neighbor* destination ()
| destination |
[const]
Returns: the cached Neighbor pointer.
inline void set_destination (Neighbor* n)
| set_destination |
Set the cached neighbor pointer.
Parameters:
n | the Neighbor pointer. |
inline OlsrTypes::FaceID faceid ()
| faceid |
[const]
Returns: the ID of the local interface where this link resides.
inline void set_faceid (OlsrTypes::FaceID faceid)
| set_faceid |
Set the ID of the local interface where this link resides.
Parameters:
faceid | the ID of the local interface. |
inline IPv4 local_addr ()
| local_addr |
[const]
Returns: the protocol address of the local interface.
inline IPv4 remote_addr ()
| remote_addr |
[const]
Returns: the protocol address of the neighbor's interface.
inline double near_etx ()
| near_etx |
[const]
Returns: the near end ETX measurement.
inline double far_etx ()
| far_etx |
[const]
Returns: the far end ETX measurement.
void update_timers (const TimeVal& vtime,
bool saw_self = false,
const LinkCode lc = LinkCode())
| update_timers |
Update the link timers, based on the information present in a HELLO message. Section 7.1.1, 2: HELLO Message Processing.
Parameters:
vtime | The validity time present in the HELLO message. |
saw_self | true if the neighbor advertised our own address. |
lc | the link code with which our address was advertised. |
OlsrTypes::LinkType link_type ()
| link_type |
[const]
Determine the current state of the link. Section 6.2, 1: HELLO Message Generation, Link Type.
Returns: The link type code representing this link's state.
inline bool is_sym ()
| is_sym |
[const]
Returns: true if this link is symmetric.
inline TimeVal sym_time_remaining ()
| sym_time_remaining |
[const]
Returns: the amount of time remaining until the SYM timer fires.
inline TimeVal asym_time_remaining ()
| asym_time_remaining |
[const]
Returns: the amount of time remaining until the ASYM timer fires.
inline TimeVal time_remaining ()
| time_remaining |
[const]
Returns: the amount of time remaining until the DEAD timer fires.
inline bool pending ()
| pending |
[const]
Determine if a link is pending (i.e. not yet established).
Returns: true if the link is pending.
void event_sym_timer ()
| event_sym_timer |
Callback method to: service a LogicalLink's SYM timer.
void event_asym_timer ()
| event_asym_timer |
Callback method to: service a LogicalLink's ASYM timer.
void event_lost_timer ()
| event_lost_timer |
Callback method to: service a LogicalLink's LOST timer.
void event_dead_timer ()
| event_dead_timer |
Callback method to: service a LogicalLink's DEAD timer. This is immediately passed to the parent Neighborhood as the link may be deleted.