20 #ifndef IPV4_GLOBAL_ROUTING_H
21 #define IPV4_GLOBAL_ROUTING_H
25 #include "ns3/ipv4-address.h"
26 #include "ns3/ipv4-header.h"
29 #include "ns3/ipv4-routing-protocol.h"
30 #include "ns3/random-variable-stream.h"
39 class Ipv4RoutingTableEntry;
40 class Ipv4MulticastRoutingTableEntry;
245 typedef std::list<Ipv4RoutingTableEntry *>::const_iterator
HostRoutesCI;
Ipv4 addresses are stored in host order in this class.
Global routing protocol for IPv4 stacks.
std::list< Ipv4RoutingTableEntry * > HostRoutes
container of Ipv4RoutingTableEntry (routes to hosts)
void AddHostRouteTo(Ipv4Address dest, Ipv4Address nextHop, uint32_t interface)
Add a host route to the global routing table.
std::list< Ipv4RoutingTableEntry * > ASExternalRoutes
container of Ipv4RoutingTableEntry (routes to external AS)
virtual void NotifyInterfaceDown(uint32_t interface)
void AddASExternalRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface)
Add an external route to the global routing table.
Ipv4RoutingTableEntry * GetRoute(uint32_t i) const
Get a route from the global unicast routing table.
virtual 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)
std::list< Ipv4RoutingTableEntry * >::iterator ASExternalRoutesI
iterator of container of Ipv4RoutingTableEntry (routes to external AS)
virtual void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address)
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Ptr< UniformRandomVariable > m_rand
A uniform random number generator for randomly routing packets among ECMP.
void DoDispose(void)
Destructor implementation.
void RemoveRoute(uint32_t i)
Remove a route from the global unicast routing table.
virtual void SetIpv4(Ptr< Ipv4 > ipv4)
std::list< Ipv4RoutingTableEntry * >::iterator HostRoutesI
iterator of container of Ipv4RoutingTableEntry (routes to hosts)
virtual void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address)
std::list< Ipv4RoutingTableEntry * >::iterator NetworkRoutesI
iterator of container of Ipv4RoutingTableEntry (routes to networks)
virtual 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.
Ptr< Ipv4Route > LookupGlobal(Ipv4Address dest, Ptr< NetDevice > oif=0)
Lookup in the forwarding table for destination.
Ipv4GlobalRouting()
Construct an empty Ipv4GlobalRouting routing protocol,.
Ptr< Ipv4 > m_ipv4
associated IPv4 instance
std::list< Ipv4RoutingTableEntry * >::const_iterator NetworkRoutesCI
const iterator of container of Ipv4RoutingTableEntry (routes to networks)
void AddNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface)
Add a network route to the global routing table.
std::list< Ipv4RoutingTableEntry * >::const_iterator ASExternalRoutesCI
const iterator of container of Ipv4RoutingTableEntry (routes to external AS)
std::list< Ipv4RoutingTableEntry * >::const_iterator HostRoutesCI
const iterator of container of Ipv4RoutingTableEntry (routes to hosts)
uint32_t GetNRoutes(void) const
Get the number of individual unicast routes that have been added to the routing table.
std::list< Ipv4RoutingTableEntry * > NetworkRoutes
container of Ipv4RoutingTableEntry (routes to networks)
virtual ~Ipv4GlobalRouting()
ASExternalRoutes m_ASexternalRoutes
External routes imported.
virtual void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
Print the Routing Table entries.
HostRoutes m_hostRoutes
Routes to hosts.
static TypeId GetTypeId(void)
Get the type ID.
bool m_respondToInterfaceEvents
Set to true if this interface should respond to interface events by globallly recomputing routes.
bool m_randomEcmpRouting
Set to true if packets are randomly routed among ECMP; set to false for using only one route consiste...
NetworkRoutes m_networkRoutes
Routes to networks.
virtual void NotifyInterfaceUp(uint32_t interface)
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.
SocketErrno
Enumeration of the possible errors returned by a socket.
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.