|
xorp
|
An OLSR interface. More...
#include <face.hh>
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 |
| FaceCounters & | counters () |
| const FaceCounters & | counters () 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. | |
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.
| IPv4 Face::all_nodes_addr | ( | ) | const [inline] |
| uint16_t Face::all_nodes_port | ( | ) | const [inline] |
| int Face::cost | ( | ) | const [inline] |
| FaceCounters& Face::counters | ( | ) | [inline] |
| const FaceCounters& Face::counters | ( | ) | const [inline] |
| bool Face::enabled | ( | ) | const [inline] |
| uint32_t Face::get_pkt_seqno | ( | ) | [inline] |
| OlsrTypes::FaceID Face::id | ( | ) | const [inline] |
| string Face::interface | ( | ) | const [inline] |
| IPv4 Face::local_addr | ( | ) | const [inline] |
| uint16_t Face::local_port | ( | ) | const [inline] |
| uint32_t Face::mtu | ( | ) | const [inline] |
| void Face::originate_hello | ( | ) |
| void Face::set_all_nodes_addr | ( | const IPv4 & | all_nodes_addr | ) | [inline] |
| void Face::set_all_nodes_port | ( | const uint16_t | all_nodes_port | ) | [inline] |
| void Face::set_cost | ( | int | cost | ) | [inline] |
| void Face::set_enabled | ( | bool | value | ) |
Set the "administratively up" state of an OLSR interface.
| value | true if this interface is enabled for OLSR, otherwise false. |
| void Face::set_local_addr | ( | const IPv4 & | local_addr | ) | [inline] |
| void Face::set_local_port | ( | const uint16_t | local_port | ) | [inline] |
| bool Face::transmit | ( | uint8_t * | data, |
| const uint32_t & | len | ||
| ) |
| string Face::vif | ( | ) | const [inline] |