ns-3
|
OLSR routing protocol for IPv4. More...
#include <olsr-routing-protocol.h>
Public Member Functions | |
void | SetMainInterface (uint32_t interface) |
Set the OLSR main address to the first address on the indicated interface. | |
void | Dump (void) |
std::vector< RoutingTableEntry > | GetRoutingTableEntries () const |
std::set< uint32_t > | GetInterfaceExclusions () const |
void | SetInterfaceExclusions (std::set< uint32_t > exceptions) |
void | AddHostNetworkAssociation (Ipv4Address networkAddr, Ipv4Mask netmask) |
Inject Association to be sent in HNA message. | |
void | RemoveHostNetworkAssociation (Ipv4Address networkAddr, Ipv4Mask netmask) |
Removes Association sent in HNA message. | |
void | SetRoutingTableAssociation (Ptr< Ipv4StaticRouting > routingTable) |
Inject Associations from an Ipv4StaticRouting instance. |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::olsr::RoutingProtocol. |
Protected Member Functions | |
virtual void | DoStart (void) |
Friends | |
class | OlsrMprTestCase |
Additional Inherited Members | |
![]() | |
typedef Callback< void, Ptr < Ipv4Route >, Ptr< const Packet >, const Ipv4Header & > | UnicastForwardCallback |
typedef Callback< void, Ptr < Ipv4MulticastRoute >, Ptr < const Packet >, const Ipv4Header & > | MulticastForwardCallback |
typedef Callback< void, Ptr < const Packet >, const Ipv4Header &, uint32_t > | LocalDeliverCallback |
typedef Callback< void, Ptr < const Packet >, const Ipv4Header &, Socket::SocketErrno > | ErrorCallback |
OLSR routing protocol for IPv4.
void ns3::olsr::RoutingProtocol::AddHostNetworkAssociation | ( | Ipv4Address | networkAddr, |
Ipv4Mask | netmask | ||
) |
Inject Association to be sent in HNA message.
Injects the specified (networkAddr, netmask) tuple in the list of local HNA associations to be sent by the node via HNA messages. If this tuple already exists, nothing is done.
References NS_LOG_INFO.
Referenced by SetRoutingTableAssociation().
|
protectedvirtual |
This method is called only once by Object::Start. If the user calls Object::Start multiple times, DoStart is called only the first time.
Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject and AggregateObject from within this method.
Reimplemented from ns3::Object.
References ns3::Socket::Bind(), ns3::Socket::BindToNetDevice(), ns3::Socket::CreateSocket(), ns3::Ipv4::GetAddress(), ns3::Ipv4::GetNetDevice(), ns3::Ipv4::GetNInterfaces(), ns3::UdpSocketFactory::GetTypeId(), ns3::olsr::IfaceAssocTuple::ifaceAddr, ns3::olsr::IfaceAssocTuple::mainAddr, ns3::MakeCallback(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, ns3::Socket::SetAllowBroadcast(), and ns3::Socket::SetRecvCallback().
void ns3::olsr::RoutingProtocol::Dump | ( | void | ) |
Dump the neighbor table, two-hop neighbor table, and routing table to logging output (NS_LOG_DEBUG log level). If logging is disabled, this function does nothing.
References ns3::Now(), and NS_LOG_DEBUG.
std::vector< RoutingTableEntry > ns3::olsr::RoutingProtocol::GetRoutingTableEntries | ( | ) | const |
Return the list of routing table entries discovered by OLSR
|
static |
This method returns the TypeId associated to ns3::olsr::RoutingProtocol.
This object is accessible through the following paths with Config::Set and Config::Connect:
Attributes defined for this type:
TraceSources defined for this type:
Reimplemented from ns3::Ipv4RoutingProtocol.
References ns3::MakeTraceSourceAccessor(), ns3::Seconds(), and ns3::TypeId::SetParent().
void ns3::olsr::RoutingProtocol::RemoveHostNetworkAssociation | ( | Ipv4Address | networkAddr, |
Ipv4Mask | netmask | ||
) |
Removes Association sent in HNA message.
Removes the specified (networkAddr, netmask) tuple from the list of local HNA associations to be sent by the node via HNA messages. If this tuple does not exist, nothing is done (see "OlsrState::EraseAssociation()").
References NS_LOG_INFO.
Referenced by SetRoutingTableAssociation().
void ns3::olsr::RoutingProtocol::SetMainInterface | ( | uint32_t | interface | ) |
Set the OLSR main address to the first address on the indicated interface.
interface | IPv4 interface index |
References ns3::Ipv4::GetAddress().
void ns3::olsr::RoutingProtocol::SetRoutingTableAssociation | ( | Ptr< Ipv4StaticRouting > | routingTable | ) |
Inject Associations from an Ipv4StaticRouting instance.
Associates the specified Ipv4StaticRouting routing table to the OLSR routing protocol. Entries from this associated routing table that use non-olsr outgoing interfaces are added to the list of local HNA associations so that they are included in HNA messages sent by the node. If this method is called more than once, entries from the old association are deleted before entries from the new one are added.
routingTable | the Ipv4StaticRouting routing table to be associated. |
References AddHostNetworkAssociation(), ns3::Ipv4RoutingTableEntry::GetDestNetwork(), ns3::Ipv4RoutingTableEntry::GetDestNetworkMask(), ns3::Ipv4StaticRouting::GetNRoutes(), ns3::Ipv4StaticRouting::GetRoute(), NS_LOG_DEBUG, NS_LOG_INFO, and RemoveHostNetworkAssociation().