ns-3
ns3::Ipv6Interface Class Reference

The IPv6 representation of a network interface. More...

#include <ipv6-interface.h>

Inheritance diagram for ns3::Ipv6Interface:
Collaboration diagram for ns3::Ipv6Interface:

List of all members.

Public Member Functions

 Ipv6Interface ()
 Constructs an Ipv6Interface.
virtual ~Ipv6Interface ()
 Destructor.
void SetNode (Ptr< Node > node)
 Set node associated with interface.
void SetDevice (Ptr< NetDevice > device)
 Set the NetDevice.
virtual Ptr< NetDeviceGetDevice () const
 Get the NetDevice.
void SetMetric (uint16_t metric)
 Set the metric.
uint16_t GetMetric () const
 Get the metric.
bool IsUp () const
 Is the interface UP ?
bool IsDown () const
 Is the interface DOWN ?
void SetUp ()
 Enable this interface.
void SetDown ()
 Disable this interface.
bool IsForwarding () const
 If the interface allows forwarding packets.
void SetForwarding (bool forward)
 Set forwarding enabled or not.
void SetCurHopLimit (uint8_t curHopLimit)
 Set the current hop limit.
uint8_t GetCurHopLimit () const
 Get the current hop limit value.
void SetBaseReachableTime (uint16_t baseReachableTime)
 Set the base reachable time.
uint16_t GetBaseReachableTime () const
 Get the base reachable time.
void SetReachableTime (uint16_t reachableTime)
 Set the reachable time.
uint16_t GetReachableTime () const
 Get the reachable time.
void SetRetransTimer (uint16_t retransTimer)
 Set the retransmission timer.
uint16_t GetRetransTimer () const
 Get the retransmission timer.
void Send (Ptr< Packet > p, Ipv6Address dest)
 Send a packet through this interface.
bool AddAddress (Ipv6InterfaceAddress iface)
 Add an IPv6 address.
Ipv6InterfaceAddress GetLinkLocalAddress () const
 Get link-local address from IPv6 interface.
Ipv6InterfaceAddress GetAddress (uint32_t index) const
 Get an address from IPv6 interface.
Ipv6InterfaceAddress GetAddressMatchingDestination (Ipv6Address dst)
 Get an address which is in the same network prefix as destination.
uint32_t GetNAddresses (void) const
 Get number of addresses on this IPv6 interface.
Ipv6InterfaceAddress RemoveAddress (uint32_t index)
 Remove an address from interface.
void SetState (Ipv6Address address, Ipv6InterfaceAddress::State_e state)
 Update state of an interface address.
void SetNsDadUid (Ipv6Address address, uint32_t uid)
 Update NS DAD packet UID of an interface address.
- Public Member Functions inherited from ns3::Object
virtual TypeId GetInstanceTypeId (void) const
template<typename T >
Ptr< T > GetObject (void) const
template<typename T >
Ptr< T > GetObject (TypeId tid) const
void Dispose (void)
void AggregateObject (Ptr< Object > other)
AggregateIterator GetAggregateIterator (void) const
void Start (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount (const SimpleRefCount &o)
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
uint32_t GetReferenceCount (void) const
- Public Member Functions inherited from ns3::ObjectBase
void SetAttribute (std::string name, const AttributeValue &value)
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
void GetAttribute (std::string name, AttributeValue &value) const
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
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 ()
 Get the type ID.

Protected Member Functions

virtual void DoDispose ()
 Dispose this object.
- Protected Member Functions inherited from ns3::Object
virtual void NotifyNewAggregate (void)
virtual void DoStart (void)
 Object (const Object &o)

Detailed Description

The IPv6 representation of a network interface.

By default IPv6 interfaces are created in the "down" state with IP "fe80::1" and a /64 prefix. Before becoming useable, the user must invoke SetUp on them once the final IPv6 address and mask has been set.


Member Function Documentation

Ipv6InterfaceAddress ns3::Ipv6Interface::GetAddress ( uint32_t  index) const

Get an address from IPv6 interface.

Parameters:
indexindex
Returns:
Ipv6InterfaceAddress address whose index is i

References NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::FunctionDadTimeout(), ns3::Ipv6L3Protocol::GetAddress(), and ns3::Ipv6L3Protocol::RemoveAutoconfiguredAddress().

Ipv6InterfaceAddress ns3::Ipv6Interface::GetAddressMatchingDestination ( Ipv6Address  dst)

Get an address which is in the same network prefix as destination.

Parameters:
dstdestination address
Returns:
Corresponding Ipv6InterfaceAddress or assert if not found

References ns3::Ipv6InterfaceAddress::GetAddress(), ns3::Ipv6InterfaceAddress::GetPrefix(), ns3::Ipv6Prefix::IsMatch(), and NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::Lookup().

uint16_t ns3::Ipv6Interface::GetBaseReachableTime ( ) const

Get the base reachable time.

Returns:
base reachable time

References NS_LOG_FUNCTION_NOARGS.

uint8_t ns3::Ipv6Interface::GetCurHopLimit ( ) const

Get the current hop limit value.

Returns:
current hop limit

References NS_LOG_FUNCTION_NOARGS.

Ipv6InterfaceAddress ns3::Ipv6Interface::GetLinkLocalAddress ( ) const

Get link-local address from IPv6 interface.

Returns:
link-local Ipv6InterfaceAddress, assert if not found

References NS_ASSERT_MSG, and NS_LOG_FUNCTION_NOARGS.

Referenced by ns3::Icmpv6L4Protocol::Lookup().

uint16_t ns3::Ipv6Interface::GetMetric ( void  ) const

Get the metric.

Returns:
the metric

References NS_LOG_FUNCTION_NOARGS.

Referenced by ns3::Ipv6L3Protocol::GetMetric().

uint32_t ns3::Ipv6Interface::GetNAddresses ( void  ) const
uint16_t ns3::Ipv6Interface::GetReachableTime ( ) const

Get the reachable time.

Returns:
reachable time

References NS_LOG_FUNCTION_NOARGS.

uint16_t ns3::Ipv6Interface::GetRetransTimer ( ) const

Get the retransmission timer.

Returns:
retransmission timer

References NS_LOG_FUNCTION_NOARGS.

TypeId ns3::Ipv6Interface::GetTypeId ( void  )
static

Get the type ID.

This method returns the TypeId associated to ns3::Ipv6Interface.

Returns:
type ID

No Attributes defined for this type.
No TraceSources defined for this type.

Reimplemented from ns3::Object.

References ns3::TypeId::SetParent().

bool ns3::Ipv6Interface::IsDown ( void  ) const

Is the interface DOWN ?

Returns:
true if interface is disabled, false otherwise.

References NS_LOG_FUNCTION_NOARGS.

bool ns3::Ipv6Interface::IsForwarding ( void  ) const

If the interface allows forwarding packets.

Returns:
true if forwarding is enabled, false otherwise

References NS_LOG_FUNCTION_NOARGS.

Referenced by ns3::Ipv6L3Protocol::IsForwarding().

bool ns3::Ipv6Interface::IsUp ( void  ) const

Is the interface UP ?

Returns:
true if interface is enabled, false otherwise.

References NS_LOG_FUNCTION_NOARGS.

Referenced by ns3::Ipv6L3Protocol::IsUp(), ns3::Ipv6L3Protocol::Receive(), and Send().

Ipv6InterfaceAddress ns3::Ipv6Interface::RemoveAddress ( uint32_t  index)

Remove an address from interface.

Parameters:
indexindex to remove
Returns:
Ipv6InterfaceAddress address whose index is index

References NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by ns3::Ipv6L3Protocol::RemoveAddress().

void ns3::Ipv6Interface::Send ( Ptr< Packet p,
Ipv6Address  dest 
)

Send a packet through this interface.

Parameters:
ppacket to send
destnext hop address of packet.
Note:
This method will eventually call the private SendTo method which must be implemented by subclasses.

References ns3::NetDevice::GetBroadcast(), GetDevice(), ns3::NetDevice::GetMulticast(), ns3::Object::GetObject(), ns3::NetDevice::IsMulticast(), ns3::Ipv6Address::IsMulticast(), IsUp(), ns3::NetDevice::NeedsArp(), NS_ASSERT, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::NetDevice::PACKET_HOST, ns3::Ipv6L3Protocol::PROT_NUMBER, and ns3::NetDevice::Send().

Referenced by ns3::Icmpv6L4Protocol::DoDAD().

void ns3::Ipv6Interface::SetBaseReachableTime ( uint16_t  baseReachableTime)

Set the base reachable time.

Parameters:
baseReachableTimethe value to set

References NS_LOG_FUNCTION.

void ns3::Ipv6Interface::SetCurHopLimit ( uint8_t  curHopLimit)

Set the current hop limit.

Parameters:
curHopLimitthe value to set

References NS_LOG_FUNCTION.

void ns3::Ipv6Interface::SetDevice ( Ptr< NetDevice device)

Set the NetDevice.

Parameters:
deviceNetDevice

References NS_LOG_FUNCTION.

void ns3::Ipv6Interface::SetForwarding ( bool  forward)

Set forwarding enabled or not.

Parameters:
forwardforwarding state

References NS_LOG_FUNCTION.

Referenced by ns3::Ipv6L3Protocol::SetForwarding().

void ns3::Ipv6Interface::SetMetric ( uint16_t  metric)

Set the metric.

Parameters:
metricconfigured routing metric (cost) of this interface

References NS_LOG_FUNCTION.

Referenced by ns3::Ipv6L3Protocol::SetMetric().

void ns3::Ipv6Interface::SetNode ( Ptr< Node node)

Set node associated with interface.

Parameters:
nodenode

References NS_LOG_FUNCTION.

void ns3::Ipv6Interface::SetNsDadUid ( Ipv6Address  address,
uint32_t  uid 
)

Update NS DAD packet UID of an interface address.

Parameters:
addressIPv6 address
uidpacket UID

References NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::DoDAD().

void ns3::Ipv6Interface::SetReachableTime ( uint16_t  reachableTime)

Set the reachable time.

Parameters:
reachableTimevalue to set

References NS_LOG_FUNCTION.

void ns3::Ipv6Interface::SetRetransTimer ( uint16_t  retransTimer)

Set the retransmission timer.

Parameters:
retransTimervalue to set

References NS_LOG_FUNCTION.

void ns3::Ipv6Interface::SetState ( Ipv6Address  address,
Ipv6InterfaceAddress::State_e  state 
)

Update state of an interface address.

Parameters:
addressIPv6 address
statenew state

References NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::FunctionDadTimeout().


The documentation for this class was generated from the following files: