11#include "ns3/assert.h"
29 : m_dest(
route.m_dest),
30 m_destNetworkMask(
route.m_destNetworkMask),
31 m_gateway(
route.m_gateway),
32 m_interface(
route.m_interface)
38 : m_dest(
route->m_dest),
39 m_destNetworkMask(
route->m_destNetworkMask),
40 m_gateway(
route->m_gateway),
41 m_interface(
route->m_interface)
50 m_destNetworkMask(
Ipv4Mask::GetOnes()),
52 m_interface(interface)
58 m_destNetworkMask(
Ipv4Mask::GetOnes()),
60 m_interface(interface)
71 m_interface(interface)
82 m_interface(interface)
193 if (
route.IsDefault())
196 os <<
"default out=" <<
route.GetInterface() <<
", next hop=" <<
route.GetGateway();
198 else if (
route.IsHost())
200 if (
route.IsGateway())
202 os <<
"host=" <<
route.GetDest() <<
", out=" <<
route.GetInterface()
203 <<
", next hop=" <<
route.GetGateway();
207 os <<
"host=" <<
route.GetDest() <<
", out=" <<
route.GetInterface();
210 else if (
route.IsNetwork())
212 if (
route.IsGateway())
214 os <<
"network=" <<
route.GetDestNetwork() <<
", mask=" <<
route.GetDestNetworkMask()
215 <<
",out=" <<
route.GetInterface() <<
", next hop=" <<
route.GetGateway();
219 os <<
"network=" <<
route.GetDestNetwork() <<
", mask=" <<
route.GetDestNetworkMask()
220 <<
",out=" <<
route.GetInterface();
248 : m_origin(
route.m_origin),
249 m_group(
route.m_group),
250 m_inputInterface(
route.m_inputInterface),
251 m_outputInterfaces(
route.m_outputInterfaces)
258 : m_origin(
route->m_origin),
259 m_group(
route->m_group),
260 m_inputInterface(
route->m_inputInterface),
261 m_outputInterfaces(
route->m_outputInterfaces)
312 "Ipv4MulticastRoutingTableEntry::GetOutputInterface (): index out of bounds");
337 os <<
"origin=" <<
route.GetOrigin() <<
", group=" <<
route.GetGroup()
338 <<
", input interface=" <<
route.GetInputInterface() <<
", output interfaces=";
342 os <<
route.GetOutputInterface(
i) <<
" ";
Ipv4 addresses are stored in host order in this class.
static Ipv4Address GetZero()
a class to represent an Ipv4 address mask
static Ipv4Mask GetOnes()
static Ipv4Mask GetZero()
A record of an IPv4 multicast route for Ipv4GlobalRouting and Ipv4StaticRouting.
Ipv4Address m_origin
source address
Ipv4Address GetGroup() const
Ipv4Address GetOrigin() const
std::vector< uint32_t > m_outputInterfaces
output interfaces
std::vector< uint32_t > GetOutputInterfaces() const
Ipv4Address m_group
destination address
uint32_t GetOutputInterface(uint32_t n) const
Ipv4MulticastRoutingTableEntry()
This constructor does nothing.
static Ipv4MulticastRoutingTableEntry CreateMulticastRoute(Ipv4Address origin, Ipv4Address group, uint32_t inputInterface, std::vector< uint32_t > outputInterfaces)
uint32_t GetNOutputInterfaces() const
uint32_t GetInputInterface() const
uint32_t m_inputInterface
input interface
A record of an IPv4 routing table entry for Ipv4GlobalRouting and Ipv4StaticRouting.
Ipv4Address GetDest() const
Ipv4Address GetGateway() const
static Ipv4RoutingTableEntry CreateDefaultRoute(Ipv4Address nextHop, uint32_t interface)
Ipv4Address m_dest
destination address
Ipv4RoutingTableEntry()
This constructor does nothing.
uint32_t m_interface
output interface
Ipv4Mask m_destNetworkMask
destination network mask
Ipv4Address GetDestNetwork() const
uint32_t GetInterface() const
Ipv4Address m_gateway
gateway
static Ipv4RoutingTableEntry CreateNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface)
static Ipv4RoutingTableEntry CreateHostRouteTo(Ipv4Address dest, Ipv4Address nextHop, uint32_t interface)
Ipv4Mask GetDestNetworkMask() const
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool operator==(const EventId &a, const EventId &b)
std::ostream & operator<<(std::ostream &os, const Angles &a)