29 #include "ns3/inet-socket-address.h"
30 #include "ns3/random-variable-stream.h"
278 typedef std::list<std::pair<RipRoutingTableEntry*, EventId>>
Routes;
281 typedef std::list<std::pair<RipRoutingTableEntry*, EventId>>::const_iterator
RoutesCI;
284 typedef std::list<std::pair<RipRoutingTableEntry*, EventId>>::iterator
RoutesI;
305 uint32_t incomingInterface,
318 uint32_t incomingInterface,
An identifier for simulation events.
Ipv4 addresses are stored in host order in this class.
a class to store IPv4 address information on an interface
a class to represent an Ipv4 address mask
Abstract base class for IPv4 routing protocols.
A record of an IPv4 routing table entry for Ipv4GlobalRouting and Ipv4StaticRouting.
Smart pointer class similar to boost::intrusive_ptr.
RIP Routing Protocol, defined in RFC 2453.
std::map< Ptr< Socket >, uint32_t >::iterator SocketListI
Socket list type iterator.
void SetInterfaceMetric(uint32_t interface, uint8_t metric)
Set the metric for an interface.
void DoSendRouteUpdate(bool periodic)
Send Routing Updates on all interfaces.
void DoDispose() override
Dispose this object.
SplitHorizonType_e m_splitHorizonStrategy
Split Horizon strategy.
Ptr< Ipv4Route > Lookup(Ipv4Address dest, bool setSource, Ptr< NetDevice >=nullptr)
Lookup in the forwarding table for destination.
Time m_startupDelay
Random delay before protocol startup.
void NotifyInterfaceDown(uint32_t interface) override
std::map< uint32_t, uint8_t > m_interfaceMetrics
Map of interface metrics.
std::list< std::pair< RipRoutingTableEntry *, EventId > >::const_iterator RoutesCI
Const Iterator for container for the network routes.
std::set< uint32_t > m_interfaceExclusions
Set of excluded interfaces.
uint32_t m_linkDown
Link down value.
void HandleRequests(RipHeader hdr, Ipv4Address senderAddress, uint16_t senderPort, uint32_t incomingInterface, uint8_t hopLimit)
Handle RIP requests.
void DeleteRoute(RipRoutingTableEntry *route)
Delete a route.
bool RouteInput(Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, const UnicastForwardCallback &ucb, const MulticastForwardCallback &mcb, const LocalDeliverCallback &lcb, const ErrorCallback &ecb) override
Route an input packet (to be forwarded or locally delivered)
void InvalidateRoute(RipRoutingTableEntry *route)
Invalidate a route.
void Receive(Ptr< Socket > socket)
Receive RIP packets.
void NotifyInterfaceUp(uint32_t interface) override
void RecvMulticastRip(Ptr< Socket > socket)
Receive and process multicast packet.
EventId m_nextUnsolicitedUpdate
Next Unsolicited Update event.
void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const override
Print the Routing Table entries.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
EventId m_nextTriggeredUpdate
Next Triggered Update event.
std::map< Ptr< Socket >, uint32_t >::const_iterator SocketListCI
Socket list type const iterator.
Ptr< Ipv4 > m_ipv4
IPv4 reference.
void RecvUnicastRip(Ptr< Socket > socket)
Receive and process unicast packet.
void DoInitialize() override
Start protocol operation.
void SendRouteRequest()
Send Routing Request on all interfaces.
Time m_timeoutDelay
Delay before invalidating a route.
void AddNetworkRouteTo(Ipv4Address network, Ipv4Mask networkPrefix, Ipv4Address nextHop, uint32_t interface)
Add route to network.
Ptr< Socket > m_multicastRecvSocket
multicast receive socket
Time m_minTriggeredUpdateDelay
Min cooldown delay after a Triggered Update.
SplitHorizonType_e
Split Horizon strategy type.
@ SPLIT_HORIZON
Split Horizon.
@ NO_SPLIT_HORIZON
No Split Horizon.
@ POISON_REVERSE
Poison Reverse Split Horizon.
Time m_unsolicitedUpdate
time between two Unsolicited Routing Updates
std::map< Ptr< Socket >, uint32_t > SocketList
Socket list type.
std::set< uint32_t > GetInterfaceExclusions() const
Get the set of interface excluded from the protocol.
Ptr< Ipv4Route > RouteOutput(Ptr< Packet > p, const Ipv4Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr) override
Query routing cache for an existing route, for an outbound packet.
uint8_t GetInterfaceMetric(uint32_t interface) const
Get the metric for an interface.
void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address) override
void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address) override
SocketList m_unicastSocketList
list of sockets for unicast messages (socket, interface index)
Time m_garbageCollectionDelay
Delay before deleting an INVALID route.
void SetIpv4(Ptr< Ipv4 > ipv4) override
static TypeId GetTypeId()
Get the type ID.
bool m_initialized
flag to allow socket's late-creation.
void SetInterfaceExclusions(std::set< uint32_t > exceptions)
Set the set of interface excluded from the protocol.
void AddDefaultRouteTo(Ipv4Address nextHop, uint32_t interface)
Add a default route to the router through the nextHop located on interface.
std::list< std::pair< RipRoutingTableEntry *, EventId > >::iterator RoutesI
Iterator for container for the network routes.
Routes m_routes
the forwarding table for network.
Time m_maxTriggeredUpdateDelay
Max cooldown delay after a Triggered Update.
void SendTriggeredRouteUpdate()
Send Triggered Routing Updates on all interfaces.
void SendUnsolicitedRouteUpdate()
Send Unsolicited Routing Updates on all interfaces.
void HandleResponses(RipHeader hdr, Ipv4Address senderAddress, uint32_t incomingInterface, uint8_t hopLimit)
Handle RIP responses.
std::list< std::pair< RipRoutingTableEntry *, EventId > > Routes
Container for the network routes - pair RipRoutingTableEntry *, EventId (update event)
Ptr< UniformRandomVariable > m_rng
Rng stream.
void SetRouteMetric(uint8_t routeMetric)
Set the route metric.
Status_e m_status
route status
bool m_changed
route has been updated
void SetRouteStatus(Status_e status)
Set the route status.
bool IsRouteChanged() const
Get the route changed status.
Status_e GetRouteStatus() const
Get the route status.
uint8_t GetRouteMetric() const
Get the route metric.
void SetRouteTag(uint16_t routeTag)
Set the route tag.
uint16_t GetRouteTag() const
Get the route tag.
void SetRouteChanged(bool changed)
Set the route as changed.
uint8_t m_metric
route metric
virtual ~RipRoutingTableEntry()
SocketErrno
Enumeration of the possible errors returned by a socket.
Simulation virtual time values and global simulation resolution.
Unit
The unit to use to interpret a number representing time.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)