Access to the IPv6 forwarding table, interfaces, and configuration. More...
#include <ipv6.h>
Public Member Functions | |
Ipv6 () | |
Constructor. | |
virtual | ~Ipv6 () |
Destructor. | |
virtual bool | AddAddress (uint32_t interface, Ipv6InterfaceAddress address)=0 |
Add an address on the specified IPv6 interface. | |
virtual uint32_t | AddInterface (Ptr< NetDevice > device)=0 |
Add a NetDevice interface. | |
virtual Ipv6InterfaceAddress | GetAddress (uint32_t interface, uint32_t addressIndex) const =0 |
Get IPv6 address on specified IPv6 interface. | |
virtual int32_t | GetInterfaceForAddress (Ipv6Address address) const =0 |
Return the interface number of the interface that has been assigned the specified IP address. | |
virtual int32_t | GetInterfaceForDevice (Ptr< const NetDevice > device) const =0 |
Get the interface index of the specified NetDevice. | |
virtual int32_t | GetInterfaceForPrefix (Ipv6Address address, Ipv6Prefix mask) const =0 |
Return the interface number of first interface found that has an IPv6 address within the prefix specified by the input address and mask parameters. | |
virtual uint16_t | GetMetric (uint32_t interface) const =0 |
Get metric for the specified IPv6 interface. | |
virtual uint16_t | GetMtu (uint32_t interface) const =0 |
Get MTU for the specified IPv6 interface. | |
virtual uint32_t | GetNAddresses (uint32_t interface) const =0 |
Get number of addresses on specified IPv6 interface. | |
virtual Ptr< NetDevice > | GetNetDevice (uint32_t interface)=0 |
Get the NetDevice of the specified interface number. | |
virtual uint32_t | GetNInterfaces (void) const =0 |
Get number of interfaces. | |
virtual Ptr< Ipv6RoutingProtocol > | GetRoutingProtocol (void) const =0 |
Get the routing protocol to be used by this IPv6 stack. | |
virtual bool | IsForwarding (uint32_t interface) const =0 |
If the specified IPv6 interface has forwarding enabled. | |
virtual bool | IsUp (uint32_t interface) const =0 |
If the specified interface index is in "up" state. | |
virtual void | RegisterExtensions ()=0 |
Register the IPv6 Extensions. | |
virtual void | RegisterOptions ()=0 |
Register the IPv6 Options. | |
virtual bool | RemoveAddress (uint32_t interface, uint32_t addressIndex)=0 |
Remove an address on specified IPv6 interface. | |
virtual void | SetDown (uint32_t interface)=0 |
Set the interface into the "down" state. | |
virtual void | SetForwarding (uint32_t interface, bool val)=0 |
Set forwarding on specified IPv6 interface. | |
virtual void | SetMetric (uint32_t interface, uint16_t metric)=0 |
Set metric on specified Ipv6 interface. | |
virtual void | SetRoutingProtocol (Ptr< Ipv6RoutingProtocol > routingProtocol)=0 |
Register a new routing protocol to be used by this IPv6 stack. | |
virtual void | SetUp (uint32_t interface)=0 |
Set the interface into the "up" state. | |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::Ipv6. |
Static Public Attributes | |
static const uint32_t | IF_ANY = 0xffffffff |
Any interface magic number. |
Private Member Functions | |
virtual bool | GetIpForward (void) const =0 |
Get IPv6 forwarding state. | |
virtual void | SetIpForward (bool forward)=0 |
Set IPv6 forwarding state. |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
virtual void | DoDispose (void) |
virtual void | DoStart (void) |
virtual void | NotifyNewAggregate (void) |
Access to the IPv6 forwarding table, interfaces, and configuration.
This class defines the API to manipulate the following aspects of the IPv6 implementation:
Each NetDevice has conceptually a single IPv6 interface associated with it (the corresponding structure in the Linux IPv6 implementation is struct in_device). Each interface may have one or more IPv6 addresses associated with it. Each IPv6 address may have different subnet mask, scope, etc., so all of this per-address information is stored in an Ipv6InterfaceAddress class (the corresponding structure in Linux is struct in6_ifaddr)
IPv6 attributes such as whether IP forwarding is enabled and disabled are also stored in this class
TO DO: Add API to allow access to the IPv6 neighbor table
|
pure virtual |
Add an address on the specified IPv6 interface.
interface | Interface number of an IPv6 interface |
address | Ipv6InterfaceAddress address to associate with the underlying IPv6 interface |
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::AddSimpleNetDevice(), ns3::TcpTestCase::AddSimpleNetDevice6(), ns3::Ipv6AddressHelper::Assign(), ns3::Ipv6PacketInfoTagTest::DoRun(), ns3::Ipv6FragmentationTest::DoRun(), and ns3::Udp6SocketImplTest::DoRun().
Add a NetDevice interface.
Once a device has been added, it can never be removed: if you want to disable it, you can invoke Ipv6::SetDown which will make sure that it is never used during packet forwarding.
device | device to add to the list of IPv6 interfaces which can be used as output interfaces during packet forwarding. |
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::AddSimpleNetDevice(), ns3::TcpTestCase::AddSimpleNetDevice6(), ns3::Ipv6AddressHelper::Assign(), ns3::Ipv6PacketInfoTagTest::DoRun(), ns3::Ipv6FragmentationTest::DoRun(), and ns3::Udp6SocketImplTest::DoRun().
|
pure virtual |
Get IPv6 address on specified IPv6 interface.
Because addresses can be removed, the addressIndex is not guaranteed to be static across calls to this method.
interface | Interface number of an IPv6 interface |
addressIndex | index of Ipv6InterfaceAddress |
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::Ipv6InterfaceContainer::GetAddress(), ns3::Ipv6StaticRouting::NotifyInterfaceUp(), ns3::Ipv6ListRouting::RouteInput(), ns3::Ipv6StaticRouting::RouteInput(), ns3::Ping6::Send(), ns3::Ipv6InterfaceContainer::SetDefaultRoute(), ns3::Ipv6InterfaceContainer::SetRouter(), and ns3::Ipv6StaticRouting::SourceAddressSelection().
|
pure virtual |
Return the interface number of the interface that has been assigned the specified IP address.
address | The IP address being searched for |
Each IP interface has one or more IP addresses associated with it. This method searches the list of interfaces for one that holds a particular address. This call takes an IP address as a parameter and returns the interface number of the first interface that has been assigned that address, or -1 if not found. There must be an exact match.
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::Icmpv6L4Protocol::HandleRedirection().
|
pure virtual |
Get the interface index of the specified NetDevice.
device | The NetDevice for an Ipv6Interface |
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::Ipv6StaticRoutingHelper::AddMulticastRoute(), ns3::Ipv6AddressHelper::Assign(), ns3::Icmpv6L4Protocol::FunctionDadTimeout(), ns3::Ipv6StaticRouting::LookupStatic(), ns3::Icmpv6L4Protocol::Receive(), ns3::Ipv6ListRouting::RouteInput(), and ns3::Ipv6StaticRouting::RouteInput().
|
pure virtual |
Return the interface number of first interface found that has an IPv6 address within the prefix specified by the input address and mask parameters.
address | The IP address assigned to the interface of interest. |
mask | The IP prefix to use in the mask |
Each IP interface has one or more IP addresses associated with it. This method searches the list of interfaces for the first one found that holds an address that is included within the prefix formed by the input address and mask parameters. The value -1 is returned if no match is found.
Implemented in ns3::Ipv6L3Protocol.
|
privatepure virtual |
Get IPv6 forwarding state.
Referenced by GetTypeId().
|
pure virtual |
Get metric for the specified IPv6 interface.
interface | The interface number of an IPv6 interface |
Implemented in ns3::Ipv6L3Protocol.
|
pure virtual |
Get MTU for the specified IPv6 interface.
interface | Interface number of IPv6 interface |
Implemented in ns3::Ipv6L3Protocol.
|
pure virtual |
Get number of addresses on specified IPv6 interface.
interface | Interface number of an IPv6 interface |
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::Ipv6StaticRouting::NotifyInterfaceUp(), ns3::Ipv6ListRouting::RouteInput(), ns3::Ipv6StaticRouting::RouteInput(), and ns3::Ipv6StaticRouting::SourceAddressSelection().
Get the NetDevice of the specified interface number.
interface | The interface number of an IPv6 interface. |
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::Ipv6StaticRouting::LookupStatic().
|
pure virtual |
Get number of interfaces.
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl(), ns3::PcapHelperForIpv6::EnablePcapIpv6(), ns3::Ipv6ListRouting::RouteInput(), ns3::Ipv6StaticRouting::RouteInput(), and ns3::Ipv6StaticRouting::SetIpv6().
|
pure virtual |
Get the routing protocol to be used by this IPv6 stack.
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::UdpSocketImpl::DoSendTo(), ns3::Ipv6StaticRoutingHelper::GetStaticRouting(), ns3::Icmpv6L4Protocol::HandleRedirection(), ns3::Ipv6RoutingHelper::Print(), and ns3::Ipv6RoutingHelper::PrintEvery().
|
static |
This method returns the TypeId associated to ns3::Ipv6.
Attributes defined for this type:
No TraceSources defined for this type.
Reimplemented from ns3::Object.
Reimplemented in ns3::Ipv6L3Protocol.
Definition at line 34 of file ipv6.cc.
References GetIpForward(), ns3::UdpSocket::GetMtuDiscover(), SetIpForward(), ns3::UdpSocket::SetMtuDiscover(), and ns3::TypeId::SetParent().
|
pure virtual |
If the specified IPv6 interface has forwarding enabled.
interface | Interface number of IPv6 interface |
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::Icmpv6L4Protocol::FunctionDadTimeout(), ns3::Icmpv6L4Protocol::Receive(), ns3::Ipv6ListRouting::RouteInput(), and ns3::Ipv6StaticRouting::RouteInput().
|
pure virtual |
If the specified interface index is in "up" state.
interface | Interface number of IPv6 interface |
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::Ipv6StaticRouting::NotifyAddAddress(), ns3::Ipv6StaticRouting::NotifyRemoveAddress(), and ns3::Ipv6StaticRouting::SetIpv6().
|
pure virtual |
Register the IPv6 Extensions.
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::InternetStackHelper::Install().
|
pure virtual |
Register the IPv6 Options.
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::InternetStackHelper::Install().
|
pure virtual |
Remove an address on specified IPv6 interface.
Remove the address at addressIndex on named interface. The addressIndex for all higher indices will decrement by one after this method is called; so, for example, to remove 5 addresses from an interface i, one could call RemoveAddress (i, 0); 5 times.
interface | Interface number of an IPv6 interface |
addressIndex | index of Ipv6InterfaceAddress to remove |
Implemented in ns3::Ipv6L3Protocol.
|
pure virtual |
Set the interface into the "down" state.
In this state, it is ignored during IPv6 forwarding.
interface | Interface number of IPv6 interface |
Implemented in ns3::Ipv6L3Protocol.
|
pure virtual |
Set forwarding on specified IPv6 interface.
interface | Interface number of IPv6 interface |
val | Value to set the forwarding flag |
If set to true, IPv6 forwarding is enabled for input datagrams on this device
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::Ipv6InterfaceContainer::SetRouter().
|
privatepure virtual |
Set IPv6 forwarding state.
forward | IPv6 forwarding enabled or not |
Referenced by GetTypeId().
|
pure virtual |
Set metric on specified Ipv6 interface.
interface | The interface number of an IPv6 interface |
metric | routing metric (cost) associated to the underlying IPv6 interface |
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::Ipv6AddressHelper::Assign(), and ns3::Ipv6PacketInfoTagTest::DoRun().
|
pure virtual |
Register a new routing protocol to be used by this IPv6 stack.
This call will replace any routing protocol that has been previously registered. If you want to add multiple routing protocols, you must add them to a Ipv6ListRoutingProtocol directly.
routingProtocol | smart pointer to Ipv6RoutingProtocol object |
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::InternetStackHelper::Install().
|
pure virtual |
Set the interface into the "up" state.
In this state, it is considered valid during IPv6 forwarding.
interface | Interface number of IPv6 interface |
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::AddSimpleNetDevice(), ns3::TcpTestCase::AddSimpleNetDevice6(), ns3::Ipv6AddressHelper::Assign(), ns3::Ipv6PacketInfoTagTest::DoRun(), ns3::Ipv6FragmentationTest::DoRun(), and ns3::Udp6SocketImplTest::DoRun().
|
static |
Any interface magic number.
Definition at line 299 of file ipv6.h.
Referenced by ns3::Ipv6StaticRouting::LookupStatic().