22 #ifndef IPV4_STATIC_ROUTING_H
23 #define IPV4_STATIC_ROUTING_H
28 #include "ns3/ipv4-address.h"
29 #include "ns3/ipv4-header.h"
30 #include "ns3/socket.h"
33 #include "ns3/ipv4-routing-protocol.h"
42 class Ipv4RoutingTableEntry;
43 class Ipv4MulticastRoutingTableEntry;
106 uint32_t metric = 0);
122 uint32_t metric = 0);
138 uint32_t metric = 0);
151 uint32_t metric = 0);
173 uint32_t metric = 0);
217 uint32_t
GetMetric (uint32_t index)
const;
259 uint32_t inputInterface,
260 std::vector<uint32_t> outputInterfaces);
340 uint32_t inputInterface);
362 typedef std::list<std::pair <Ipv4RoutingTableEntry *, uint32_t> >
NetworkRoutes;
365 typedef std::list<std::pair <Ipv4RoutingTableEntry *, uint32_t> >::const_iterator
NetworkRoutesCI;
368 typedef std::list<std::pair <Ipv4RoutingTableEntry *, uint32_t> >::iterator
NetworkRoutesI;
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
A record of an IPv4 multicast route for Ipv4GlobalRouting and Ipv4StaticRouting.
Abstract base class for IPv4 routing protocols.
A record of an IPv4 routing table entry for Ipv4GlobalRouting and Ipv4StaticRouting.
Static routing protocol for IP version 4 stacks.
virtual ~Ipv4StaticRouting()
virtual void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
Print the Routing Table entries.
virtual void NotifyInterfaceDown(uint32_t interface)
void RemoveRoute(uint32_t i)
Remove a route from the static unicast routing table.
virtual void NotifyInterfaceUp(uint32_t interface)
bool LookupRoute(const Ipv4RoutingTableEntry &route, uint32_t metric)
Checks if a route is already present in the forwarding table.
virtual void SetIpv4(Ptr< Ipv4 > ipv4)
std::list< std::pair< Ipv4RoutingTableEntry *, uint32_t > >::iterator NetworkRoutesI
Iterator for container for the network routes.
Ipv4RoutingTableEntry GetDefaultRoute(void)
Get the default route with lowest metric from the static routing table.
uint32_t GetNRoutes(void) const
Get the number of individual unicast routes that have been added to the routing table.
void SetDefaultMulticastRoute(uint32_t outputInterface)
Add a default multicast route to the static routing table.
virtual void DoDispose(void)
Destructor implementation.
void AddMulticastRoute(Ipv4Address origin, Ipv4Address group, uint32_t inputInterface, std::vector< uint32_t > outputInterfaces)
Add a multicast route to the static routing table.
MulticastRoutes m_multicastRoutes
the forwarding table for multicast.
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)
uint32_t GetMetric(uint32_t index) const
Get a metric for route from the static unicast routing table.
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.
NetworkRoutes m_networkRoutes
the forwarding table for network.
void AddNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a network route to the static routing table.
std::list< Ipv4MulticastRoutingTableEntry * > MulticastRoutes
Container for the multicast routes.
std::list< Ipv4MulticastRoutingTableEntry * >::const_iterator MulticastRoutesCI
Const Iterator for container for the multicast routes.
Ipv4RoutingTableEntry GetRoute(uint32_t i) const
Get a route from the static unicast routing table.
uint32_t GetNMulticastRoutes(void) const
Get the number of individual multicast routes that have been added to the routing table.
Ptr< Ipv4Route > LookupStatic(Ipv4Address dest, Ptr< NetDevice > oif=0)
Lookup in the forwarding table for destination.
std::list< std::pair< Ipv4RoutingTableEntry *, uint32_t > >::const_iterator NetworkRoutesCI
Const Iterator for container for the network routes.
std::list< std::pair< Ipv4RoutingTableEntry *, uint32_t > > NetworkRoutes
Container for the network routes.
virtual void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address)
std::list< Ipv4MulticastRoutingTableEntry * >::iterator MulticastRoutesI
Iterator for container for the multicast routes.
virtual void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address)
Ptr< Ipv4 > m_ipv4
Ipv4 reference.
Ipv4MulticastRoutingTableEntry GetMulticastRoute(uint32_t i) const
Get a route from the static multicast routing table.
static TypeId GetTypeId(void)
The interface Id associated with this class.
void AddHostRouteTo(Ipv4Address dest, Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a host route to the static routing table.
void SetDefaultRoute(Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a default route to the static routing table.
bool RemoveMulticastRoute(Ipv4Address origin, Ipv4Address group, uint32_t inputInterface)
Remove a route from the static multicast routing table.
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.