Access to the IPv6 forwarding table, interfaces, and configuration. More...
#include "ipv6.h"
Public Member Functions | |
Ipv6 () | |
Constructor. More... | |
virtual | ~Ipv6 () |
Destructor. More... | |
virtual bool | AddAddress (uint32_t interface, Ipv6InterfaceAddress address, bool addOnLinkRoute=true)=0 |
Add an address on the specified IPv6 interface. More... | |
virtual uint32_t | AddInterface (Ptr< NetDevice > device)=0 |
Add a NetDevice interface. More... | |
virtual Ipv6InterfaceAddress | GetAddress (uint32_t interface, uint32_t addressIndex) const =0 |
Get IPv6 address on specified IPv6 interface. More... | |
virtual int32_t | GetInterfaceForAddress (Ipv6Address address) const =0 |
Return the interface number of the interface that has been assigned the specified IP address. More... | |
virtual int32_t | GetInterfaceForDevice (Ptr< const NetDevice > device) const =0 |
Get the interface index of the specified NetDevice. More... | |
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. More... | |
virtual uint16_t | GetMetric (uint32_t interface) const =0 |
Get metric for the specified IPv6 interface. More... | |
virtual uint16_t | GetMtu (uint32_t interface) const =0 |
Get MTU for the specified IPv6 interface. More... | |
virtual uint32_t | GetNAddresses (uint32_t interface) const =0 |
Get number of addresses on specified IPv6 interface. More... | |
virtual Ptr< NetDevice > | GetNetDevice (uint32_t interface)=0 |
Get the NetDevice of the specified interface number. More... | |
virtual uint32_t | GetNInterfaces (void) const =0 |
Get number of interfaces. More... | |
virtual Ptr< IpL4Protocol > | GetProtocol (int protocolNumber) const =0 |
Get L4 protocol by protocol number. More... | |
virtual Ptr< IpL4Protocol > | GetProtocol (int protocolNumber, int32_t interfaceIndex) const =0 |
Get L4 protocol by protocol number for the specified interface. More... | |
virtual Ptr< Ipv6RoutingProtocol > | GetRoutingProtocol (void) const =0 |
Get the routing protocol to be used by this IPv6 stack. More... | |
virtual void | Insert (Ptr< IpL4Protocol > protocol)=0 |
Add a L4 protocol. More... | |
virtual void | Insert (Ptr< IpL4Protocol > protocol, uint32_t interfaceIndex)=0 |
Add a L4 protocol to a specific interface. More... | |
virtual bool | IsForwarding (uint32_t interface) const =0 |
If the specified IPv6 interface has forwarding enabled. More... | |
virtual bool | IsUp (uint32_t interface) const =0 |
If the specified interface index is in "up" state. More... | |
virtual void | RegisterExtensions ()=0 |
Register the IPv6 Extensions. More... | |
virtual void | RegisterOptions ()=0 |
Register the IPv6 Options. More... | |
virtual void | Remove (Ptr< IpL4Protocol > protocol)=0 |
Remove a L4 protocol. More... | |
virtual void | Remove (Ptr< IpL4Protocol > protocol, uint32_t interfaceIndex)=0 |
Remove a L4 protocol from a specific interface. More... | |
virtual bool | RemoveAddress (uint32_t interface, Ipv6Address address)=0 |
Remove the given address on named Ipv6 interface. More... | |
virtual bool | RemoveAddress (uint32_t interface, uint32_t addressIndex)=0 |
Remove an address on specified IPv6 interface. More... | |
virtual void | Send (Ptr< Packet > packet, Ipv6Address source, Ipv6Address destination, uint8_t protocol, Ptr< Ipv6Route > route)=0 |
Higher-level layers call this method to send a packet down the stack to the MAC and PHY layers. More... | |
virtual void | SetDown (uint32_t interface)=0 |
Set the interface into the "down" state. More... | |
virtual void | SetForwarding (uint32_t interface, bool val)=0 |
Set forwarding on specified IPv6 interface. More... | |
virtual void | SetMetric (uint32_t interface, uint16_t metric)=0 |
Set metric on specified Ipv6 interface. More... | |
virtual void | SetPmtu (Ipv6Address dst, uint32_t pmtu)=0 |
Set the Path MTU for the specified IPv6 destination address. More... | |
virtual void | SetRoutingProtocol (Ptr< Ipv6RoutingProtocol > routingProtocol)=0 |
Register a new routing protocol to be used by this IPv6 stack. More... | |
virtual void | SetUp (uint32_t interface)=0 |
Set the interface into the "up" state. More... | |
virtual Ipv6Address | SourceAddressSelection (uint32_t interface, Ipv6Address dest)=0 |
Choose the source address to use with destination address. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Attributes | |
static const uint32_t | IF_ANY = 0xffffffff |
Any interface magic number. More... | |
Private Member Functions | |
virtual bool | GetIpForward (void) const =0 |
Get IPv6 forwarding state. More... | |
virtual bool | GetMtuDiscover (void) const =0 |
Get IPv6 MTU discover state. More... | |
virtual void | SetIpForward (bool forward)=0 |
Set IPv6 forwarding state. More... | |
virtual void | SetMtuDiscover (bool mtuDiscover)=0 |
Set IPv6 MTU discover state. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Access to the IPv6 forwarding table, interfaces, and configuration.
Introspection did not find any typical Config paths.
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
No TraceSources are defined for this type.
Size of this type is 32 bytes (on a 64-bit architecture).
|
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 |
addOnLinkRoute | add on-link route to the network (default true) |
Implemented in ns3::Ipv6L3Protocol.
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.
|
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::NoBackhaulEpcHelper::GetUeDefaultGatewayAddress6().
|
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.
|
pure virtual |
Get the interface index of the specified NetDevice.
device | The NetDevice for an Ipv6Interface |
Implemented in ns3::Ipv6L3Protocol.
|
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.
Implemented in ns3::Ipv6L3Protocol.
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.
|
privatepure virtual |
Get IPv6 MTU discover state.
Implemented in ns3::Ipv6L3Protocol.
Referenced by GetTypeId().
|
pure virtual |
Get number of addresses on specified IPv6 interface.
interface | Interface number of an IPv6 interface |
Implemented in ns3::Ipv6L3Protocol.
Get the NetDevice of the specified interface number.
interface | The interface number of an IPv6 interface. |
Implemented in ns3::Ipv6L3Protocol.
|
pure virtual |
Get number of interfaces.
Implemented in ns3::Ipv6L3Protocol.
|
pure virtual |
Get L4 protocol by protocol number.
protocolNumber | protocol number |
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::Ipv6Interface::AddAddress(), ns3::Ipv6Interface::DoSetup(), and ns3::Ipv6Interface::Send().
|
pure virtual |
Get L4 protocol by protocol number for the specified interface.
protocolNumber | protocol number |
interfaceIndex | interface index, -1 means "any" interface. |
Implemented in ns3::Ipv6L3Protocol.
|
pure virtual |
Get the routing protocol to be used by this IPv6 stack.
Implemented in ns3::Ipv6L3Protocol.
Referenced by Ipv6ForwardingTest::DoRun().
|
static |
Get the type ID.
Definition at line 34 of file ipv6.cc.
References GetIpForward(), GetMtuDiscover(), ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), SetIpForward(), SetMtuDiscover(), and ns3::TypeId::SetParent().
|
pure virtual |
|
pure virtual |
Add a L4 protocol to a specific interface.
This may be called multiple times for multiple interfaces for the same protocol. To insert for all interfaces, use the separate Insert (Ptr<IpL4Protocol> protocol) method.
Setting a protocol on a specific interface will overwrite the previously bound protocol.
protocol | L4 protocol. |
interfaceIndex | interface index. |
Implemented in ns3::Ipv6L3Protocol.
|
pure virtual |
If the specified IPv6 interface has forwarding enabled.
interface | Interface number of IPv6 interface |
Implemented in ns3::Ipv6L3Protocol.
|
pure virtual |
If the specified interface index is in "up" state.
interface | Interface number of IPv6 interface |
Implemented in ns3::Ipv6L3Protocol.
|
pure virtual |
Register the IPv6 Extensions.
Implemented in ns3::Ipv6L3Protocol.
|
pure virtual |
Register the IPv6 Options.
Implemented in ns3::Ipv6L3Protocol.
|
pure virtual |
|
pure virtual |
Remove a L4 protocol from a specific interface.
protocol | L4 protocol to remove. |
interfaceIndex | interface index. |
Implemented in ns3::Ipv6L3Protocol.
|
pure virtual |
Remove the given address on named Ipv6 interface.
interface | Interface number of an IPv6 interface |
address | the address to remove |
Implemented in ns3::Ipv6L3Protocol.
|
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 |
Higher-level layers call this method to send a packet down the stack to the MAC and PHY layers.
All PMTU values are stored at this level, so packet size calculations should be done mathematically at higher levels.
packet | packet to send |
source | source address of packet |
destination | address of packet |
protocol | number of packet |
route | route to take |
Implemented in ns3::Ipv6L3Protocol.
Referenced by ns3::Icmpv6L4Protocol::NotifyNewAggregate(), ns3::TcpL4Protocol::NotifyNewAggregate(), and ns3::UdpL4Protocol::NotifyNewAggregate().
|
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.
|
privatepure virtual |
Set IPv6 forwarding state.
forward | IPv6 forwarding enabled or not |
Implemented in ns3::Ipv6L3Protocol.
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.
|
privatepure virtual |
Set IPv6 MTU discover state.
mtuDiscover | IPv6 MTU discover enabled or not |
Implemented in ns3::Ipv6L3Protocol.
Referenced by GetTypeId().
|
pure virtual |
Set the Path MTU for the specified IPv6 destination address.
dst | Ipv6 destination address |
pmtu | the Path MTU |
Implemented in ns3::Ipv6L3Protocol.
|
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.
|
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.
|
pure virtual |
Choose the source address to use with destination address.
interface | interface index |
dest | IPv6 destination address |
Implemented in ns3::Ipv6L3Protocol.
|
static |
Any interface magic number.
Definition at line 393 of file ipv6.h.
Referenced by ns3::Ipv6StaticRouting::LookupStatic().