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;
278 uint32_t inputInterface,
279 std::vector<uint32_t> outputInterfaces);
359 uint32_t inputInterface);
381 typedef std::list<std::pair <Ipv4RoutingTableEntry *, uint32_t> >
NetworkRoutes;
384 typedef std::list<std::pair <Ipv4RoutingTableEntry *, uint32_t> >::const_iterator
NetworkRoutesCI;
387 typedef std::list<std::pair <Ipv4RoutingTableEntry *, uint32_t> >::iterator
NetworkRoutesI;
void SetDefaultRoute(Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a default route to the static routing table.
static TypeId GetTypeId(void)
The interface Id associated with this class.
a class to represent an Ipv4 address mask
void RemoveRoute(uint32_t i)
Remove a route from the static unicast routing table.
Ipv4RoutingTableEntry GetDefaultRoute(void)
Get the default route with lowest metric from the static routing table.
std::list< std::pair< Ipv4RoutingTableEntry *, uint32_t > >::iterator NetworkRoutesI
Iterator for container for the network routes.
uint32_t GetNRoutes(void) const
Get the number of individual unicast routes that have been added to the routing table.
SocketErrno
Enumeration of the possible errors returned by a socket.
void AddHostRouteTo(Ipv4Address dest, Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a host route to the static routing table.
Ptr< Ipv4Route > LookupStatic(Ipv4Address dest, Ptr< NetDevice > oif=0)
Lookup in the forwarding table for destination.
virtual void NotifyInterfaceDown(uint32_t interface)
A record of an IPv4 routing table entry for Ipv4GlobalRouting and Ipv4StaticRouting.
bool RemoveMulticastRoute(Ipv4Address origin, Ipv4Address group, uint32_t inputInterface)
Remove a route from the static multicast routing table.
Ipv4RoutingTableEntry GetRoute(uint32_t i) const
Get a route from the static unicast routing table.
Unit
The unit to use to interpret a number representing time.
MulticastRoutes m_multicastRoutes
the forwarding table for multicast.
std::list< Ipv4MulticastRoutingTableEntry * >::iterator MulticastRoutesI
Iterator for container for the multicast routes.
virtual void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
Print the Routing Table entries.
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)
Ptr< Ipv4 > m_ipv4
Ipv4 reference.
Ipv4MulticastRoutingTableEntry GetMulticastRoute(uint32_t i) const
Get a route from the static multicast routing table.
std::list< Ipv4MulticastRoutingTableEntry * >::const_iterator MulticastRoutesCI
Const Iterator for container for the multicast routes.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Static routing protocol for IP version 4 stacks.
std::list< std::pair< Ipv4RoutingTableEntry *, uint32_t > >::const_iterator NetworkRoutesCI
Const Iterator for container for the network routes.
virtual ~Ipv4StaticRouting()
A record of an IPv4 multicast route for Ipv4GlobalRouting and Ipv4StaticRouting.
uint32_t GetMetric(uint32_t index) const
Get a metric for route from the static unicast routing table.
void AddNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a network route to the static routing table.
Ipv4 addresses are stored in host order in this class.
uint32_t GetNMulticastRoutes(void) const
Get the number of individual multicast routes that have been added to the routing table...
virtual void DoDispose(void)
Destructor implementation.
std::list< Ipv4MulticastRoutingTableEntry * > MulticastRoutes
Container for the multicast routes.
a class to store IPv4 address information on an interface
virtual void NotifyInterfaceUp(uint32_t interface)
NetworkRoutes m_networkRoutes
the forwarding table for network.
virtual void SetIpv4(Ptr< Ipv4 > ipv4)
virtual void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address)
std::list< std::pair< Ipv4RoutingTableEntry *, uint32_t > > NetworkRoutes
Container for the network routes.
Abstract base class for IPv4 routing protocols.
virtual void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address)
a unique identifier for an interface.
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.
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.