Public Member Functions | Static Public Member Functions

ns3::olsr::Agent Class Reference

Class implementing the OLSR state machine. More...

#include <olsr-agent.h>

Inheritance diagram for ns3::olsr::Agent:
Inheritance graph
[legend]
Collaboration diagram for ns3::olsr::Agent:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void SetMainInterface (uint32_t interface)=0
 Sets the main interface to be used by OLSR.
virtual void Start ()=0
 Starts the OLSR protocol operation.

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::olsr::Agent.

Detailed Description

Class implementing the OLSR state machine.

This class represents an instance of the OLSR protocol. It attaches itself to a Node, and its lifecycle is bound to that node. Normally the functions in the ns3::olsr namespace are more simple to use to start OLSR on nodes, but access to the underlying OLSR agent can be useful in order to customize the OLSR parameters. Example:

 Ptr<olsr::Agent> olsr = Agend::CreateDefault ();
 agent->SetMainInterface (2);
 agent->Start ();

Member Function Documentation

static TypeId ns3::olsr::Agent::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::olsr::Agent.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/$ns3olsr::Agent

No Attributes defined for this type.
No TraceSources defined for this type.

Reimplemented from ns3::Object.

virtual void ns3::olsr::Agent::SetMainInterface ( uint32_t  interface  )  [pure virtual]

Sets the main interface to be used by OLSR.

Normally OLSR supports multiple interfaces, but the protocol requires the definition of a "main interface". This interface's IPv4 address provides the identity of the node, and all outgoing OLSR routing messages must have the main interface address, regardless of the actual interface used to transmit the packet. This method allows one to explicitly select an interface as the main interface. It must be called before the agent starts, but calling it is optional; if not called, the agent tries to guess and uses a suitable interface.

virtual void ns3::olsr::Agent::Start (  )  [pure virtual]

Starts the OLSR protocol operation.

Calling this method essentially bootstraps the OLSR protocol, and causes the agent to start broadcasting OLSR messages to neighbors, as well start listening to messages from neighbors.


The documentation for this class was generated from the following files: