25 #ifndef NIX_VECTOR_HELPER_H
26 #define NIX_VECTOR_HELPER_H
28 #include "ns3/ipv4-routing-helper.h"
29 #include "ns3/ipv6-routing-helper.h"
30 #include "ns3/object-factory.h"
51 std::is_same_v<Ipv6RoutingHelper, T>,
55 static constexpr
bool IsIpv4 = std::is_same_v<Ipv4RoutingHelper, T>;
57 using Ip =
typename std::conditional_t<IsIpv4, Ipv4, Ipv6>;
59 using IpAddress =
typename std::conditional_t<IsIpv4, Ipv4Address, Ipv6Address>;
62 typename std::conditional_t<IsIpv4, Ipv4RoutingProtocol, Ipv6RoutingProtocol>;
Helper class that adds Nix-vector routing to nodes.
static void PrintRoute(Ptr< Node > source, IpAddress dest, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
prints the routing path for the source and destination.
NixVectorHelper< T > * Copy() const override
typename std::conditional_t< IsIpv4, Ipv4, Ipv6 > Ip
Alias for Ipv4 and Ipv6 classes.
ObjectFactory m_agentFactory
Object factory.
static constexpr bool IsIpv4
Alias for determining whether the parent is Ipv4RoutingHelper or Ipv6RoutingHelper.
void PrintRoutingPathAt(Time printTime, Ptr< Node > source, IpAddress dest, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
prints the routing path for a source and destination at a particular time.
NixVectorHelper & operator=(const NixVectorHelper &)=delete
NixVectorHelper()
Construct an NixVectorHelper to make life easier while adding Nix-vector routing to nodes.
Ptr< IpRoutingProtocol > Create(Ptr< Node > node) const override
typename std::conditional_t< IsIpv4, Ipv4Address, Ipv6Address > IpAddress
Alias for Ipv4Address and Ipv6Address classes.
typename std::conditional_t< IsIpv4, Ipv4RoutingProtocol, Ipv6RoutingProtocol > IpRoutingProtocol
Alias for Ipv4RoutingProtocol and Ipv6RoutingProtocol classes.
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Unit
The unit to use to interpret a number representing time.
NixVectorHelper< Ipv6RoutingHelper > Ipv6NixVectorHelper
Create the typedef Ipv6NixVectorHelper with T as Ipv6RoutingHelper.
NixVectorHelper< Ipv4RoutingHelper > Ipv4NixVectorHelper
Create the typedef Ipv4NixVectorHelper with T as Ipv4RoutingHelper.
typename std::enable_if< B, T >::type enable_if_t
Every class exported by the ns3 library is enclosed in the ns3 namespace.