21 #ifndef IPV4_STATIC_ROUTING_H
22 #define IPV4_STATIC_ROUTING_H
28 #include "ns3/ipv4-address.h"
30 #include "ns3/socket.h"
44 class Ipv4RoutingTableEntry;
45 class Ipv4MulticastRoutingTableEntry;
116 uint32_t metric = 0);
132 uint32_t metric = 0);
148 uint32_t metric = 0);
224 uint32_t
GetMetric(uint32_t index)
const;
266 uint32_t inputInterface,
267 std::vector<uint32_t> outputInterfaces);
367 typedef std::list<std::pair<Ipv4RoutingTableEntry*, uint32_t>>
NetworkRoutes;
370 typedef std::list<std::pair<Ipv4RoutingTableEntry*, uint32_t>>::const_iterator
NetworkRoutesCI;
373 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.
std::list< std::pair< Ipv4RoutingTableEntry *, uint32_t > >::iterator NetworkRoutesI
Iterator for container for the network routes.
void SetIpv4(Ptr< Ipv4 > ipv4) override
void NotifyInterfaceUp(uint32_t interface) override
void DoDispose() override
Destructor implementation.
Ipv4RoutingTableEntry GetDefaultRoute()
Get the default route with lowest metric from the static routing table.
void RemoveRoute(uint32_t i)
Remove a route from the static unicast routing table.
~Ipv4StaticRouting() override
bool LookupRoute(const Ipv4RoutingTableEntry &route, uint32_t metric)
Checks if a route is already present in the forwarding table.
std::list< std::pair< Ipv4RoutingTableEntry *, uint32_t > >::const_iterator NetworkRoutesCI
Const Iterator for container for the network routes.
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.
void SetDefaultMulticastRoute(uint32_t outputInterface)
Add a default multicast route to the static routing table.
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.
std::list< Ipv4MulticastRoutingTableEntry * >::const_iterator MulticastRoutesCI
Const Iterator for container for the multicast routes.
void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address) override
uint32_t GetMetric(uint32_t index) const
Get a metric for route from the static unicast routing table.
NetworkRoutes m_networkRoutes
the forwarding table for network.
Ptr< Ipv4Route > LookupStatic(Ipv4Address dest, Ptr< NetDevice > oif=nullptr)
Lookup in the forwarding table for destination.
void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const override
Print the Routing Table entries.
void AddNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a network route to the static routing table.
uint32_t GetNMulticastRoutes() const
Get the number of individual multicast routes that have been added to the routing table.
Ipv4RoutingTableEntry GetRoute(uint32_t i) const
Get a route from the static unicast routing table.
std::list< std::pair< Ipv4RoutingTableEntry *, uint32_t > > NetworkRoutes
Container for the network routes.
void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address) override
void NotifyInterfaceDown(uint32_t interface) override
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)
static TypeId GetTypeId()
The interface Id associated with this class.
std::list< Ipv4MulticastRoutingTableEntry * > MulticastRoutes
Container for the multicast routes.
Ptr< Ipv4 > m_ipv4
Ipv4 reference.
Ipv4MulticastRoutingTableEntry GetMulticastRoute(uint32_t i) const
Get a route from the static multicast routing table.
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.
std::list< Ipv4MulticastRoutingTableEntry * >::iterator MulticastRoutesI
Iterator for container for the multicast routes.
uint32_t GetNRoutes() const
Get the number of individual unicast routes that have been added to the 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.