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