ICMPv6 header. More...
#include <icmpv6-header.h>
Public Member Functions | |
Icmpv6Header () | |
Constructor. | |
virtual | ~Icmpv6Header () |
Destructor. | |
void | CalculatePseudoHeaderChecksum (Ipv6Address src, Ipv6Address dst, uint16_t length, uint8_t protocol) |
Calculate pseudo header checksum for IPv6. | |
virtual uint32_t | Deserialize (Buffer::Iterator start) |
Deserialize the packet. | |
uint16_t | GetChecksum () const |
Get the checksum. | |
uint8_t | GetCode () const |
Get the code field. | |
virtual TypeId | GetInstanceTypeId () const |
Get the instance type ID. | |
virtual uint32_t | GetSerializedSize () const |
Get the serialized size. | |
uint8_t | GetType () const |
Get the type field. | |
virtual void | Print (std::ostream &os) const |
Print informations. | |
virtual void | Serialize (Buffer::Iterator start) const |
Serialize the packet. | |
void | SetChecksum (uint16_t checksum) |
Set the checksum. | |
void | SetCode (uint8_t code) |
Set the code field. | |
void | SetType (uint8_t type) |
Set the type. | |
![]() | |
virtual | ~Header () |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the UID of this class. |
Protected Attributes | |
bool | m_calcChecksum |
Checksum enable or not. | |
uint16_t | m_checksum |
The checksum. |
Private Attributes | |
uint8_t | m_code |
The code. | |
uint8_t | m_type |
The type. |
Additional Inherited Members | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
virtual void | NotifyConstructionCompleted (void) |
ICMPv6 header.
Definition at line 37 of file icmpv6-header.h.
ICMPv6 error code : Destination Unreachable.
ICMPV6_NO_ROUTE | |
ICMPV6_ADM_PROHIBITED | |
ICMPV6_NOT_NEIGHBOUR | |
ICMPV6_ADDR_UNREACHABLE | |
ICMPV6_PORT_UNREACHABLE |
Definition at line 91 of file icmpv6-header.h.
ICMPv6 error code : Parameter Error.
Definition at line 114 of file icmpv6-header.h.
ICMPv6 error code : Time Exceeded.
Definition at line 104 of file icmpv6-header.h.
ICMPv6 Option type code.
ICMPV6_OPT_LINK_LAYER_SOURCE | |
ICMPV6_OPT_LINK_LAYER_TARGET | |
ICMPV6_OPT_PREFIX | |
ICMPV6_OPT_REDIRECTED | |
ICMPV6_OPT_MTU |
Definition at line 78 of file icmpv6-header.h.
ICMPv6 type code.
Definition at line 44 of file icmpv6-header.h.
ns3::Icmpv6Header::Icmpv6Header | ( | ) |
Constructor.
Definition at line 50 of file icmpv6-header.cc.
|
virtual |
Destructor.
Definition at line 58 of file icmpv6-header.cc.
void ns3::Icmpv6Header::CalculatePseudoHeaderChecksum | ( | Ipv6Address | src, |
Ipv6Address | dst, | ||
uint16_t | length, | ||
uint8_t | protocol | ||
) |
Calculate pseudo header checksum for IPv6.
src | source address |
dst | destination address |
length | length |
protocol | the protocol number to use in the underlying IPv6 packet. |
Definition at line 136 of file icmpv6-header.cc.
References ns3::Buffer::AddAtStart(), ns3::Buffer::Begin(), ns3::Buffer::Iterator::CalculateIpChecksum(), m_checksum, ns3::Ipv6Address::Serialize(), ns3::Buffer::Iterator::Write(), ns3::Buffer::Iterator::WriteU16(), and ns3::Buffer::Iterator::WriteU8().
Referenced by ns3::Icmpv6L4Protocol::ForgeNA(), ns3::Icmpv6L4Protocol::ForgeNS(), ns3::Icmpv6L4Protocol::ForgeRS(), ns3::Icmpv6L4Protocol::SendEchoReply(), ns3::Icmpv6L4Protocol::SendMessage(), and ns3::Ipv6RawSocketImpl::SendTo().
|
virtual |
Deserialize the packet.
start | start offset |
Implements ns3::Header.
Reimplemented in ns3::Icmpv6ParameterError, ns3::Icmpv6TimeExceeded, ns3::Icmpv6TooBig, ns3::Icmpv6DestinationUnreachable, ns3::Icmpv6Echo, ns3::Icmpv6Redirection, ns3::Icmpv6RS, ns3::Icmpv6RA, ns3::Icmpv6NA, and ns3::Icmpv6NS.
Definition at line 102 of file icmpv6-header.cc.
References GetSerializedSize(), m_checksum, m_code, m_type, ns3::Buffer::Iterator::ReadNtohU16(), ns3::Buffer::Iterator::ReadU32(), ns3::Buffer::Iterator::ReadU8(), and visualizer.core::start().
uint16_t ns3::Icmpv6Header::GetChecksum | ( | ) | const |
Get the checksum.
Definition at line 82 of file icmpv6-header.cc.
References m_checksum.
Referenced by ns3::Icmpv6NS::Print(), ns3::Icmpv6NA::Print(), ns3::Icmpv6RA::Print(), ns3::Icmpv6RS::Print(), ns3::Icmpv6Redirection::Print(), ns3::Icmpv6Echo::Print(), ns3::Icmpv6DestinationUnreachable::Print(), ns3::Icmpv6TooBig::Print(), ns3::Icmpv6TimeExceeded::Print(), ns3::Icmpv6ParameterError::Print(), ns3::Icmpv6NA::Serialize(), ns3::Icmpv6RA::Serialize(), ns3::Icmpv6RS::Serialize(), ns3::Icmpv6Redirection::Serialize(), ns3::Icmpv6Echo::Serialize(), ns3::Icmpv6DestinationUnreachable::Serialize(), ns3::Icmpv6TooBig::Serialize(), ns3::Icmpv6TimeExceeded::Serialize(), and ns3::Icmpv6ParameterError::Serialize().
uint8_t ns3::Icmpv6Header::GetCode | ( | void | ) | const |
Get the code field.
Definition at line 72 of file icmpv6-header.cc.
References m_code.
Referenced by ns3::Icmpv6L4Protocol::Forward(), ns3::Icmpv6L4Protocol::HandleDestinationUnreachable(), ns3::Icmpv6L4Protocol::HandleParameterError(), ns3::Radvd::HandleRead(), ns3::Icmpv6L4Protocol::HandleTimeExceeded(), ns3::Icmpv6NS::Print(), ns3::Icmpv6NA::Print(), ns3::Icmpv6RA::Print(), ns3::Icmpv6RS::Print(), ns3::Icmpv6Redirection::Print(), ns3::Icmpv6Echo::Print(), ns3::Icmpv6DestinationUnreachable::Print(), ns3::Icmpv6TooBig::Print(), ns3::Icmpv6TimeExceeded::Print(), ns3::Icmpv6ParameterError::Print(), ns3::Icmpv6NS::Serialize(), ns3::Icmpv6NA::Serialize(), ns3::Icmpv6RA::Serialize(), ns3::Icmpv6RS::Serialize(), ns3::Icmpv6Redirection::Serialize(), ns3::Icmpv6Echo::Serialize(), ns3::Icmpv6DestinationUnreachable::Serialize(), ns3::Icmpv6TooBig::Serialize(), ns3::Icmpv6TimeExceeded::Serialize(), and ns3::Icmpv6ParameterError::Serialize().
|
virtual |
Get the instance type ID.
Implements ns3::ObjectBase.
Reimplemented in ns3::Icmpv6ParameterError, ns3::Icmpv6TimeExceeded, ns3::Icmpv6TooBig, ns3::Icmpv6DestinationUnreachable, ns3::Icmpv6Echo, ns3::Icmpv6Redirection, ns3::Icmpv6RS, ns3::Icmpv6RA, ns3::Icmpv6NA, and ns3::Icmpv6NS.
Definition at line 45 of file icmpv6-header.cc.
References GetTypeId().
|
virtual |
Get the serialized size.
Implements ns3::Header.
Reimplemented in ns3::Icmpv6ParameterError, ns3::Icmpv6TimeExceeded, ns3::Icmpv6TooBig, ns3::Icmpv6DestinationUnreachable, ns3::Icmpv6Echo, ns3::Icmpv6Redirection, ns3::Icmpv6RS, ns3::Icmpv6RA, ns3::Icmpv6NA, and ns3::Icmpv6NS.
Definition at line 97 of file icmpv6-header.cc.
Referenced by Deserialize(), and ns3::Icmpv6L4Protocol::SendMessage().
uint8_t ns3::Icmpv6Header::GetType | ( | void | ) | const |
Get the type field.
Definition at line 62 of file icmpv6-header.cc.
References m_type.
Referenced by ns3::Icmpv6L4Protocol::Forward(), ns3::Ipv6RawSocketImpl::ForwardUp(), ns3::Icmpv6NS::Print(), ns3::Icmpv6NA::Print(), ns3::Icmpv6RA::Print(), ns3::Icmpv6RS::Print(), ns3::Icmpv6Redirection::Print(), ns3::Icmpv6Echo::Print(), ns3::Icmpv6DestinationUnreachable::Print(), ns3::Icmpv6TooBig::Print(), ns3::Icmpv6TimeExceeded::Print(), ns3::Icmpv6ParameterError::Print(), ns3::Icmpv6NS::Serialize(), ns3::Icmpv6NA::Serialize(), ns3::Icmpv6RA::Serialize(), ns3::Icmpv6RS::Serialize(), ns3::Icmpv6Redirection::Serialize(), ns3::Icmpv6Echo::Serialize(), ns3::Icmpv6DestinationUnreachable::Serialize(), ns3::Icmpv6TooBig::Serialize(), ns3::Icmpv6TimeExceeded::Serialize(), and ns3::Icmpv6ParameterError::Serialize().
|
static |
Get the UID of this class.
This method returns the TypeId associated to ns3::Icmpv6Header.
No Attributes defined for this type.
No TraceSources defined for this type.
Reimplemented from ns3::Header.
Reimplemented in ns3::Icmpv6ParameterError, ns3::Icmpv6TimeExceeded, ns3::Icmpv6TooBig, ns3::Icmpv6DestinationUnreachable, ns3::Icmpv6Echo, ns3::Icmpv6Redirection, ns3::Icmpv6RS, ns3::Icmpv6RA, ns3::Icmpv6NA, and ns3::Icmpv6NS.
Definition at line 36 of file icmpv6-header.cc.
References ns3::TypeId::SetParent().
Referenced by GetInstanceTypeId().
|
virtual |
Print informations.
os | output stream |
Implements ns3::Header.
Reimplemented in ns3::Icmpv6ParameterError, ns3::Icmpv6TimeExceeded, ns3::Icmpv6TooBig, ns3::Icmpv6DestinationUnreachable, ns3::Icmpv6Echo, ns3::Icmpv6Redirection, ns3::Icmpv6RS, ns3::Icmpv6RA, ns3::Icmpv6NA, and ns3::Icmpv6NS.
Definition at line 92 of file icmpv6-header.cc.
References m_checksum, m_code, and m_type.
|
virtual |
Serialize the packet.
start | start offset |
Implements ns3::Header.
Reimplemented in ns3::Icmpv6ParameterError, ns3::Icmpv6TimeExceeded, ns3::Icmpv6TooBig, ns3::Icmpv6DestinationUnreachable, ns3::Icmpv6Echo, ns3::Icmpv6Redirection, ns3::Icmpv6RS, ns3::Icmpv6RA, ns3::Icmpv6NA, and ns3::Icmpv6NS.
Definition at line 115 of file icmpv6-header.cc.
References ns3::Buffer::Iterator::CalculateIpChecksum(), ns3::Buffer::Iterator::GetSize(), m_calcChecksum, m_checksum, m_code, m_type, ns3::Buffer::Iterator::Next(), visualizer.core::start(), ns3::Buffer::Iterator::WriteU16(), ns3::Buffer::Iterator::WriteU32(), and ns3::Buffer::Iterator::WriteU8().
void ns3::Icmpv6Header::SetChecksum | ( | uint16_t | checksum | ) |
Set the checksum.
checksum | to set |
Definition at line 87 of file icmpv6-header.cc.
References m_checksum.
void ns3::Icmpv6Header::SetCode | ( | uint8_t | code | ) |
Set the code field.
code | code to set |
Definition at line 77 of file icmpv6-header.cc.
References m_code.
Referenced by ns3::Icmpv6NS::Deserialize(), ns3::Icmpv6NA::Deserialize(), ns3::Icmpv6RA::Deserialize(), ns3::Icmpv6RS::Deserialize(), ns3::Icmpv6Redirection::Deserialize(), ns3::Icmpv6Echo::Deserialize(), ns3::Icmpv6DestinationUnreachable::Deserialize(), ns3::Icmpv6TooBig::Deserialize(), ns3::Icmpv6TimeExceeded::Deserialize(), ns3::Icmpv6ParameterError::Deserialize(), ns3::Icmpv6Echo::Icmpv6Echo(), ns3::Icmpv6NA::Icmpv6NA(), ns3::Icmpv6NS::Icmpv6NS(), ns3::Icmpv6RA::Icmpv6RA(), ns3::Icmpv6Redirection::Icmpv6Redirection(), ns3::Icmpv6RS::Icmpv6RS(), ns3::Icmpv6L4Protocol::SendErrorDestinationUnreachable(), ns3::Icmpv6L4Protocol::SendErrorParameterError(), ns3::Icmpv6L4Protocol::SendErrorTimeExceeded(), and ns3::Icmpv6L4Protocol::SendErrorTooBig().
void ns3::Icmpv6Header::SetType | ( | uint8_t | type | ) |
Set the type.
type | type to set |
Definition at line 67 of file icmpv6-header.cc.
References m_type.
Referenced by ns3::Icmpv6NS::Deserialize(), ns3::Icmpv6NA::Deserialize(), ns3::Icmpv6RA::Deserialize(), ns3::Icmpv6RS::Deserialize(), ns3::Icmpv6Redirection::Deserialize(), ns3::Icmpv6Echo::Deserialize(), ns3::Icmpv6DestinationUnreachable::Deserialize(), ns3::Icmpv6TooBig::Deserialize(), ns3::Icmpv6TimeExceeded::Deserialize(), ns3::Icmpv6ParameterError::Deserialize(), ns3::Icmpv6DestinationUnreachable::Icmpv6DestinationUnreachable(), ns3::Icmpv6Echo::Icmpv6Echo(), ns3::Icmpv6NA::Icmpv6NA(), ns3::Icmpv6NS::Icmpv6NS(), ns3::Icmpv6ParameterError::Icmpv6ParameterError(), ns3::Icmpv6RA::Icmpv6RA(), ns3::Icmpv6Redirection::Icmpv6Redirection(), ns3::Icmpv6RS::Icmpv6RS(), ns3::Icmpv6TimeExceeded::Icmpv6TimeExceeded(), and ns3::Icmpv6TooBig::Icmpv6TooBig().
|
protected |
Checksum enable or not.
Definition at line 218 of file icmpv6-header.h.
Referenced by Serialize(), ns3::Icmpv6NS::Serialize(), ns3::Icmpv6NA::Serialize(), ns3::Icmpv6RS::Serialize(), ns3::Icmpv6Redirection::Serialize(), and ns3::Icmpv6Echo::Serialize().
|
protected |
The checksum.
Definition at line 223 of file icmpv6-header.h.
Referenced by CalculatePseudoHeaderChecksum(), Deserialize(), ns3::Icmpv6NS::Deserialize(), ns3::Icmpv6NA::Deserialize(), ns3::Icmpv6RA::Deserialize(), ns3::Icmpv6RS::Deserialize(), ns3::Icmpv6Redirection::Deserialize(), ns3::Icmpv6Echo::Deserialize(), ns3::Icmpv6DestinationUnreachable::Deserialize(), ns3::Icmpv6TooBig::Deserialize(), ns3::Icmpv6TimeExceeded::Deserialize(), ns3::Icmpv6ParameterError::Deserialize(), GetChecksum(), ns3::Icmpv6Echo::Icmpv6Echo(), ns3::Icmpv6NA::Icmpv6NA(), ns3::Icmpv6NS::Icmpv6NS(), ns3::Icmpv6Redirection::Icmpv6Redirection(), Print(), Serialize(), ns3::Icmpv6NS::Serialize(), and SetChecksum().
|
private |
The code.
Definition at line 234 of file icmpv6-header.h.
Referenced by Deserialize(), GetCode(), Print(), Serialize(), and SetCode().
|
private |
The type.
Definition at line 229 of file icmpv6-header.h.
Referenced by Deserialize(), GetType(), Print(), Serialize(), and SetType().