Implements the unique identifier for DHCPv6. More...
#include "dhcp6-duid.h"
Collaboration diagram for ns3::Duid:Classes | |
| class | DuidHash |
| Class providing a hash for DUIDs. More... | |
Public Types | |
| enum class | Type { LLT = 1 , EN , LL , UUID } |
| DUID type. More... | |
Public Member Functions | |
| Duid () | |
| Default constructor. | |
| uint32_t | Deserialize (Buffer::Iterator start, uint32_t len) |
| Deserialize the DUID. | |
| Type | GetDuidType () const |
| Get the DUID type. | |
| uint16_t | GetHardwareType () const |
| Get the hardware type. | |
| uint8_t | GetLength () const |
| Get the length of the DUID. | |
| uint32_t | GetSerializedSize () const |
| Get the DUID serialized size. | |
| Time | GetTime () const |
| Get the time at which the DUID is generated. | |
| void | Initialize (Ptr< Node > node) |
| Initialize the DUID for a client or server. | |
| bool | IsInvalid () const |
| Check if the DUID is invalid. | |
| bool | operator== (const Duid &duid) const |
| Comparison operator. | |
| void | Serialize (Buffer::Iterator start) const |
| Serialize the DUID. | |
| void | SetDuid (std::vector< uint8_t > identifier) |
| Set the identifier as the DUID. | |
| void | SetDuidType (Type duidType) |
| Set the DUID type. | |
| void | SetHardwareType (uint16_t hardwareType) |
| Set the hardware type. | |
| void | SetTime (Time time) |
| Set the time at which DUID is generated. | |
Private Member Functions | |
| std::vector< uint8_t > | GetIdentifier () const |
| Return the identifier of the node. | |
Private Attributes | |
| Type | m_duidType |
| Type of the DUID. | |
| uint16_t | m_hardwareType |
| Valid hardware type assigned by IANA. | |
| std::vector< uint8_t > | m_identifier |
| Identifier of the node in bytes. | |
| Time | m_time |
| Time at which the DUID is generated. | |
Friends | |
| bool | operator< (const Duid &a, const Duid &b) |
| Less than operator. | |
Implements the unique identifier for DHCPv6.
Definition at line 26 of file dhcp6-duid.h.
|
strong |
| ns3::Duid::Duid | ( | ) |
Default constructor.
Definition at line 24 of file dhcp6-duid.cc.
References LL, m_duidType, m_hardwareType, m_identifier, and m_time.
Referenced by ns3::Duid::DuidHash::operator()(), operator<, and operator==().
Here is the caller graph for this function:| uint32_t ns3::Duid::Deserialize | ( | Buffer::Iterator | start, |
| uint32_t | len ) |
Deserialize the DUID.
| start | The buffer iterator. |
| len | The number of bytes to be read. |
Definition at line 209 of file dhcp6-duid.cc.
References m_duidType, m_hardwareType, m_identifier, ns3::Buffer::Iterator::ReadNtohU16(), and ns3::Buffer::Iterator::ReadU8().
Referenced by ns3::Dhcp6Header::Deserialize().
Here is the call graph for this function:
Here is the caller graph for this function:| Duid::Type ns3::Duid::GetDuidType | ( | ) | const |
Get the DUID type.
Definition at line 81 of file dhcp6-duid.cc.
References m_duidType.
| uint16_t ns3::Duid::GetHardwareType | ( | ) | const |
Get the hardware type.
Definition at line 93 of file dhcp6-duid.cc.
References m_hardwareType.
|
private |
Return the identifier of the node.
Definition at line 75 of file dhcp6-duid.cc.
References m_identifier.
| uint8_t ns3::Duid::GetLength | ( | ) | const |
Get the length of the DUID.
Definition at line 69 of file dhcp6-duid.cc.
References m_identifier.
Referenced by ns3::Dhcp6Header::AddIdentifierOption(), and operator<.
Here is the caller graph for this function:| uint32_t ns3::Duid::GetSerializedSize | ( | ) | const |
Get the DUID serialized size.
Definition at line 190 of file dhcp6-duid.cc.
References m_identifier.
Referenced by ns3::Dhcp6Header::Serialize().
Here is the caller graph for this function:| Time ns3::Duid::GetTime | ( | ) | const |
Get the time at which the DUID is generated.
Definition at line 177 of file dhcp6-duid.cc.
References m_time.
Initialize the DUID for a client or server.
| node | The node for which the DUID is to be generated. |
Definition at line 132 of file dhcp6-duid.cc.
References ns3::Address::CopyTo(), ns3::DynamicCast(), ns3::Address::GetLength(), ns3::Address::IsInvalid(), NS_ASSERT_MSG, NS_LOG_DEBUG, and SetDuid().
Here is the call graph for this function:| bool ns3::Duid::IsInvalid | ( | ) | const |
Check if the DUID is invalid.
Definition at line 63 of file dhcp6-duid.cc.
References m_identifier.
| bool ns3::Duid::operator== | ( | const Duid & | duid | ) | const |
Comparison operator.
| duid | header to compare |
Definition at line 33 of file dhcp6-duid.cc.
References Duid(), m_duidType, m_hardwareType, and m_identifier.
Here is the call graph for this function:| void ns3::Duid::Serialize | ( | Buffer::Iterator | start | ) | const |
Serialize the DUID.
| start | The buffer iterator. |
Definition at line 196 of file dhcp6-duid.cc.
References m_duidType, m_hardwareType, m_identifier, ns3::Buffer::Iterator::WriteHtonU16(), and ns3::Buffer::Iterator::WriteU8().
Referenced by ns3::Dhcp6Header::Serialize().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::Duid::SetDuid | ( | std::vector< uint8_t > | identifier | ) |
Set the identifier as the DUID.
| identifier | the identifier of the node. |
Definition at line 106 of file dhcp6-duid.cc.
References LL, m_duidType, m_identifier, NS_ASSERT_MSG, NS_LOG_FUNCTION, and SetHardwareType().
Referenced by Initialize().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::Duid::SetDuidType | ( | Duid::Type | duidType | ) |
Set the DUID type.
| duidType | the DUID type. |
Definition at line 87 of file dhcp6-duid.cc.
References m_duidType.
| void ns3::Duid::SetHardwareType | ( | uint16_t | hardwareType | ) |
Set the hardware type.
| hardwareType | the hardware type. |
Definition at line 99 of file dhcp6-duid.cc.
References m_hardwareType, and NS_LOG_FUNCTION.
Referenced by SetDuid().
Here is the caller graph for this function:| void ns3::Duid::SetTime | ( | Time | time | ) |
Set the time at which DUID is generated.
| time | the timestamp. |
Definition at line 183 of file dhcp6-duid.cc.
References m_time, and NS_LOG_FUNCTION.
Less than operator.
| a | the first operand |
| b | the first operand |
Definition at line 39 of file dhcp6-duid.cc.
References Duid(), GetLength(), m_duidType, m_hardwareType, m_identifier, and NS_ASSERT.
|
private |
Type of the DUID.
We currently use only DUID-LL, based on the link-layer address.
Definition at line 176 of file dhcp6-duid.h.
Referenced by Duid(), Deserialize(), GetDuidType(), operator<, operator==(), Serialize(), SetDuid(), and SetDuidType().
|
private |
Valid hardware type assigned by IANA.
Definition at line 178 of file dhcp6-duid.h.
Referenced by Duid(), Deserialize(), GetHardwareType(), operator<, operator==(), Serialize(), and SetHardwareType().
|
private |
Identifier of the node in bytes.
Definition at line 180 of file dhcp6-duid.h.
Referenced by Duid(), Deserialize(), GetIdentifier(), GetLength(), GetSerializedSize(), IsInvalid(), operator<, operator==(), Serialize(), and SetDuid().
|
private |