ns-3
|
The IPv6 representation of a network interface. More...
#include <ipv6-interface.h>
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< NetDevice > | GetDevice () 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. | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type ID. | |
Protected Member Functions | |
virtual void | DoDispose () |
Dispose this object. |
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.
bool ns3::Ipv6Interface::AddAddress | ( | Ipv6InterfaceAddress | iface | ) |
Add an IPv6 address.
iface | address to add |
References ns3::Icmpv6L4Protocol::DoDAD(), ns3::Icmpv6L4Protocol::FunctionDadTimeout(), ns3::Ipv6InterfaceAddress::GetAddress(), ns3::Object::GetObject(), ns3::Ipv6Address::IsAny(), ns3::Ipv6Address::IsLocalhost(), NS_LOG_FUNCTION_NOARGS, ns3::Simulator::Schedule(), and ns3::Seconds().
Referenced by ns3::Ipv6L3Protocol::AddAddress().
Ipv6InterfaceAddress ns3::Ipv6Interface::GetAddress | ( | uint32_t | index | ) | const |
Get an address from IPv6 interface.
index | index |
References NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::FunctionDadTimeout(), ns3::Ipv6L3Protocol::GetAddress(), and ns3::Ipv6L3Protocol::RemoveAutoconfiguredAddress().
Get an address which is in the same network prefix as destination.
dst | destination address |
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 |
uint8_t ns3::Ipv6Interface::GetCurHopLimit | ( | ) | const |
Ptr< NetDevice > ns3::Ipv6Interface::GetDevice | ( | void | ) | const [virtual] |
Get the NetDevice.
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::Ipv6L3Protocol::AddAutoconfiguredAddress(), ns3::Icmpv6L4Protocol::DoDAD(), ns3::Icmpv6L4Protocol::FunctionDadTimeout(), ns3::Ipv6L3Protocol::GetMtu(), ns3::Ipv6L3Protocol::GetNetDevice(), ns3::Ipv6L3Protocol::Receive(), ns3::Icmpv6L4Protocol::Receive(), ns3::Ipv6L3Protocol::RemoveAutoconfiguredAddress(), and Send().
Get link-local address from IPv6 interface.
References NS_ASSERT_MSG, and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::Icmpv6L4Protocol::Lookup().
uint16_t ns3::Ipv6Interface::GetMetric | ( | void | ) | const |
Get the metric.
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::Ipv6L3Protocol::GetMetric().
uint32_t ns3::Ipv6Interface::GetNAddresses | ( | void | ) | const |
Get number of addresses on this IPv6 interface.
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::Icmpv6L4Protocol::FunctionDadTimeout(), ns3::Ipv6L3Protocol::GetNAddresses(), ns3::Icmpv6L4Protocol::Lookup(), and ns3::Ipv6L3Protocol::RemoveAutoconfiguredAddress().
uint16_t ns3::Ipv6Interface::GetReachableTime | ( | ) | const |
uint16_t ns3::Ipv6Interface::GetRetransTimer | ( | ) | const |
TypeId ns3::Ipv6Interface::GetTypeId | ( | void | ) | [static] |
Get the type ID.
This method returns the TypeId associated to ns3::Ipv6Interface.
This object is accessible through the following paths with Config::Set and Config::Connect:
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 ?
References NS_LOG_FUNCTION_NOARGS.
bool ns3::Ipv6Interface::IsForwarding | ( | void | ) | const |
If the interface allows forwarding packets.
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::Ipv6L3Protocol::IsForwarding().
bool ns3::Ipv6Interface::IsUp | ( | void | ) | const |
Is the interface UP ?
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.
index | index to remove |
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.
p | packet to send |
dest | next hop address of packet. |
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.
baseReachableTime | the value to set |
References NS_LOG_FUNCTION.
void ns3::Ipv6Interface::SetCurHopLimit | ( | uint8_t | curHopLimit | ) |
void ns3::Ipv6Interface::SetDevice | ( | Ptr< NetDevice > | device | ) |
void ns3::Ipv6Interface::SetForwarding | ( | bool | forward | ) |
Set forwarding enabled or not.
forward | forwarding state |
References NS_LOG_FUNCTION.
Referenced by ns3::Ipv6L3Protocol::SetForwarding().
void ns3::Ipv6Interface::SetMetric | ( | uint16_t | metric | ) |
Set the metric.
metric | configured routing metric (cost) of this interface |
References NS_LOG_FUNCTION.
Referenced by ns3::Ipv6L3Protocol::SetMetric().
void ns3::Ipv6Interface::SetNode | ( | Ptr< Node > | node | ) |
void ns3::Ipv6Interface::SetNsDadUid | ( | Ipv6Address | address, |
uint32_t | uid | ||
) |
Update NS DAD packet UID of an interface address.
address | IPv6 address |
uid | packet UID |
References NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::DoDAD().
void ns3::Ipv6Interface::SetReachableTime | ( | uint16_t | reachableTime | ) |
void ns3::Ipv6Interface::SetRetransTimer | ( | uint16_t | retransTimer | ) |
void ns3::Ipv6Interface::SetState | ( | Ipv6Address | address, |
Ipv6InterfaceAddress::State_e | state | ||
) |
Update state of an interface address.
address | IPv6 address |
state | new state |
References NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::FunctionDadTimeout().