xorp

Face Class Reference

An OLSR interface. More...

#include <face.hh>

List of all members.

Public Member Functions

 Face (Olsr &olsr, FaceManager &fm, Neighborhood *nh, MessageDecoder &md, const string &interface, const string &vif, OlsrTypes::FaceID id)
OlsrTypes::FaceID id () const
string interface () const
string vif () const
FaceCounterscounters ()
const FaceCounterscounters () const
uint32_t mtu () const
void set_mtu (const uint32_t mtu)
 Set the MTU of this interface.
uint32_t get_pkt_seqno ()
bool enabled () const
IPv4 all_nodes_addr () const
uint16_t all_nodes_port () const
IPv4 local_addr () const
uint16_t local_port () const
int cost () const
void set_enabled (bool value)
 Set the "administratively up" state of an OLSR interface.
void set_all_nodes_addr (const IPv4 &all_nodes_addr)
 Set the "all nodes" address for this OLSR interface.
void set_all_nodes_port (const uint16_t all_nodes_port)
 Set the "all nodes" UDP port for this OLSR interface.
void set_local_addr (const IPv4 &local_addr)
 Set the local address for this OLSR interface.
void set_local_port (const uint16_t local_port)
 Set the UDP local port for this OLSR interface.
void set_cost (int cost)
 Set the shortest path tree cost for this OLSR interface.
bool transmit (uint8_t *data, const uint32_t &len)
 Transmit a datagram on this Face.
void originate_hello ()
 Originate a HELLO message on this interface.

Private Attributes

Olsr_olsr
FaceManager_fm
Neighborhood_nh
MessageDecoder_md
FaceCounters _counters
 Counters for this Face.
OlsrTypes::FaceID _id
 A unique identifier for this Face.
bool _enabled
 true if this Face is enabled for routing.
string _interface
 The name of the interface with which this Face is associated.
string _vif
 The name of the Vif with which this Face is associated.
uint32_t _mtu
 The MTU for this interface.
IPv4 _local_addr
 Local address to use for transmitting OLSR protocol messages in UDP.
uint16_t _local_port
 Local port to use for transmitting OLSR protocol messages.
IPv4 _all_nodes_addr
 The "all nodes" address to use on this Face for sending protocol messages.
uint16_t _all_nodes_port
 The "all nodes" port to use on this Face for sending protocol messages.
int _cost
 A fixed cost for the interface, used in route calculation.
uint32_t _next_pkt_seqno
 The sequence number of the next packet sent from this Face.

Detailed Description

An OLSR interface.

There is one Face per physical if/vif which OLSR is configured to run on.

Whilst an IPv4 interface may have multiple addresses, OLSR uses IPv4 addresses as primary keys in the protocol. Therefore it is necessary to track the first configured address on each vif, and use that as the Face's address. This happens in the absence of any IPv4 link-scope addresses as the system does not have any concept of such things. This may be considered the same limitation as IGMP has.

The analogue in XORP's OSPF implementation is class Peer. Unlike OSPF, we do not split Face in the same way as Peer/PeerOut are split, as there is no concept of Areas in version 1 of OLSR.

A face is associated with Links to each Neighbor. An instance of Olsr must have at least one Face configured to run Olsr, otherwise, it isn't an Olsr router. If no Faces exist, OLSR is not active. If only one Face exists, only a subset of the full OLSR protocol is used.


Member Function Documentation

IPv4 Face::all_nodes_addr ( ) const [inline]
Returns:
the "all nodes" address configured for this OLSR interface.
uint16_t Face::all_nodes_port ( ) const [inline]
Returns:
the "all nodes" UDP port configured for this OLSR interface.
int Face::cost ( ) const [inline]
Returns:
the default cost of transiting this OLSR interface. Used by the shortest path algorithm.
FaceCounters& Face::counters ( ) [inline]
Returns:
the protocol counters for this OLSR interface.
const FaceCounters& Face::counters ( ) const [inline]
Returns:
the protocol counters for this OLSR interface.
bool Face::enabled ( ) const [inline]
Returns:
true if this OLSR interface is administratively up.
uint32_t Face::get_pkt_seqno ( ) [inline]
Returns:
the next available sequence number for a Packet to be sent from this OLSR interface.
OlsrTypes::FaceID Face::id ( ) const [inline]
Returns:
the internal ID of this OLSR interface.
string Face::interface ( ) const [inline]
Returns:
the name of this OLSR interface as known to the FEA.
IPv4 Face::local_addr ( ) const [inline]
Returns:
the source address configured for this OLSR interface.
uint16_t Face::local_port ( ) const [inline]
Returns:
the UDP source port configured for this OLSR interface.
uint32_t Face::mtu ( ) const [inline]
Returns:
the MTU of this interface.
void Face::originate_hello ( )

Originate a HELLO message on this interface.

The message thus originated will be filled out appropriately, containing the relevant OLSR protocol state as seen from this Face.

TODO: Perform MTU-based message segmentation.

void Face::set_all_nodes_addr ( const IPv4 all_nodes_addr) [inline]

Set the "all nodes" address for this OLSR interface.

Parameters:
all_nodes_addrthe "all nodes" address to set.
void Face::set_all_nodes_port ( const uint16_t  all_nodes_port) [inline]

Set the "all nodes" UDP port for this OLSR interface.

Parameters:
all_nodes_portthe "all nodes" port to set.
void Face::set_cost ( int  cost) [inline]

Set the shortest path tree cost for this OLSR interface.

Parameters:
costthe cost to set.
void Face::set_enabled ( bool  value)

Set the "administratively up" state of an OLSR interface.

Parameters:
valuetrue if this interface is enabled for OLSR, otherwise false.
void Face::set_local_addr ( const IPv4 local_addr) [inline]

Set the local address for this OLSR interface.

Parameters:
local_addrthe local address to set.
void Face::set_local_port ( const uint16_t  local_port) [inline]

Set the UDP local port for this OLSR interface.

Parameters:
local_portthe local port to set.
bool Face::transmit ( uint8_t *  data,
const uint32_t &  len 
)

Transmit a datagram on this Face.

Parameters:
datathe datagram to be sent.
lenthe length of the datagram to be sent.
Returns:
true if the datagram was successfully transmitted.
string Face::vif ( ) const [inline]
Returns:
the name of this OLSR interface's vif as known to the FEA.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations