26 #include "ns3/ipv4-routing-protocol.h"
27 #include "ns3/ipv4-interface.h"
28 #include "ns3/inet-socket-address.h"
29 #include "ns3/ipv4-l3-protocol.h"
30 #include "ns3/ipv4-routing-table-entry.h"
31 #include "ns3/random-variable-stream.h"
32 #include "ns3/rip-header.h"
268 typedef std::list<std::pair <RipRoutingTableEntry *, EventId> >
Routes;
271 typedef std::list<std::pair <RipRoutingTableEntry *, EventId> >::const_iterator
RoutesCI;
274 typedef std::list<std::pair <RipRoutingTableEntry *, EventId> >::iterator
RoutesI;
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.
virtual void NotifyInterfaceDown(uint32_t interface)
std::list< std::pair< RipRoutingTableEntry *, EventId > >::const_iterator RoutesCI
Const Iterator for container for the network routes.
SplitHorizonType_e m_splitHorizonStrategy
Split Horizon strategy.
Time m_startupDelay
Random delay before protocol startup.
std::map< uint32_t, uint8_t > m_interfaceMetrics
Map of interface metrics.
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.
bool RouteInput(Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb)
Route an input packet (to be forwarded or locally delivered)
void DeleteRoute(RipRoutingTableEntry *route)
Delete a route.
void InvalidateRoute(RipRoutingTableEntry *route)
Invalidate a route.
void Receive(Ptr< Socket > socket)
Receive RIP packets.
Ptr< Ipv4Route > Lookup(Ipv4Address dest, bool setSource, Ptr< NetDevice >=0)
Lookup in the forwarding table for destination.
void RecvMulticastRip(Ptr< Socket > socket)
Receive and process multicast packet.
virtual void DoDispose()
Dispose this object.
virtual void NotifyInterfaceUp(uint32_t interface)
EventId m_nextUnsolicitedUpdate
Next Unsolicited Update event.
Ptr< Ipv4Route > RouteOutput(Ptr< Packet > p, const Ipv4Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr)
Query routing cache for an existing route, for an outbound packet.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
void DoInitialize()
Start protocol operation.
virtual void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address)
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.
std::list< std::pair< RipRoutingTableEntry *, EventId > > Routes
Container for the network routes - pair RipRoutingTableEntry *, EventId (update event)
void RecvUnicastRip(Ptr< Socket > socket)
Receive and process unicast packet.
void SendRouteRequest()
Send Routing Request on all interfaces.
std::list< std::pair< RipRoutingTableEntry *, EventId > >::iterator RoutesI
Iterator for container for the network routes.
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.
virtual void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address)
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::set< uint32_t > GetInterfaceExclusions() const
Get the set of interface excluded from the protocol.
virtual void SetIpv4(Ptr< Ipv4 > ipv4)
virtual void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
Print the Routing Table entries.
uint8_t GetInterfaceMetric(uint32_t interface) const
Get the metric for an interface.
static TypeId GetTypeId(void)
Get the type ID.
SocketList m_unicastSocketList
list of sockets for unicast messages (socket, interface index)
Time m_garbageCollectionDelay
Delay before deleting an INVALID route.
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.
void SendUnsolicitedRouteUpdate(void)
Send Unsolicited Routing Updates on all interfaces.
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 HandleResponses(RipHeader hdr, Ipv4Address senderAddress, uint32_t incomingInterface, uint8_t hopLimit)
Handle RIP responses.
std::map< Ptr< Socket >, uint32_t > SocketList
Socket list type.
Ptr< UniformRandomVariable > m_rng
Rng stream.
void SetRouteMetric(uint8_t routeMetric)
Set the route metric.
Status_e m_status
route status
uint8_t GetRouteMetric(void) const
Get the route metric.
bool m_changed
route has been updated
void SetRouteStatus(Status_e status)
Set the route status.
bool IsRouteChanged(void) const
Get the route changed status.
void SetRouteTag(uint16_t routeTag)
Set the route tag.
uint16_t GetRouteTag(void) const
Get the route tag.
void SetRouteChanged(bool changed)
Set the route as changed.
Status_e GetRouteStatus(void) const
Get the route status.
uint8_t m_metric
route metric
RipRoutingTableEntry(void)
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)