12#include "ns3/packet.h"
30 .SetGroupName(
"Internet")
168 m_data =
new uint8_t[size];
208 .SetGroupName(
"Internet")
262 uint32_t optionalPayloadSize = start.GetRemainingSize() - 4;
263 NS_ASSERT(start.GetRemainingSize() >= 4);
294 static TypeId tid =
TypeId(
"ns3::Icmpv4DestinationUnreachable")
296 .SetGroupName(
"Internet")
306 for (uint8_t j = 0; j < 8; j++)
344 memcpy(payload,
m_data, 8);
393 for (uint8_t j = 0; j < 8; j++)
406 for (uint8_t i = 0; i < 8; i++)
427 .SetGroupName(
"Internet")
437 for (uint8_t j = 0; j < 8; j++)
461 memcpy(payload,
m_data, 8);
509 for (uint8_t j = 0; j < 8; j++)
522 for (uint8_t i = 0; i < 8; i++)
iterator in a Buffer instance
uint16_t CalculateIpChecksum(uint16_t size)
Calculate the checksum.
void WriteU8(uint8_t data)
void WriteU16(uint16_t data)
void WriteHtonU16(uint16_t data)
uint32_t GetDistanceFrom(const Iterator &o) const
void Next()
go forward by one byte
ICMP Destination Unreachable header.
Ipv4Header m_header
carried IPv4 header
uint16_t GetNextHopMtu() const
Get the next hop MTU.
uint16_t m_nextHopMtu
next hop MTU
Ipv4Header GetHeader() const
Get the ICMP carried IPv4 header.
void GetData(uint8_t payload[8]) const
Get the ICMP carried data.
void SetNextHopMtu(uint16_t mtu)
Set the next hop MTU.
uint32_t Deserialize(Buffer::Iterator start) override
void Serialize(Buffer::Iterator start) const override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint32_t GetSerializedSize() const override
void SetHeader(Ipv4Header header)
Set the ICMP carried IPv4 header.
void SetData(Ptr< const Packet > data)
Set the ICMP carried data.
~Icmpv4DestinationUnreachable() override
static TypeId GetTypeId()
Get ICMP type.
uint8_t m_data[8]
carried data
Icmpv4DestinationUnreachable()
void Print(std::ostream &os) const override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void Print(std::ostream &os) const override
uint16_t m_identifier
identifier
uint16_t m_sequence
sequence number
uint32_t GetData(uint8_t payload[]) const
Get the Echo data.
void SetIdentifier(uint16_t id)
Set the Echo identifier.
void SetData(Ptr< const Packet > data)
Set the Echo data.
uint32_t GetSerializedSize() const override
uint32_t Deserialize(Buffer::Iterator start) override
uint16_t GetIdentifier() const
Get the Echo identifier.
void Serialize(Buffer::Iterator start) const override
static TypeId GetTypeId()
Get ICMP type.
void SetSequenceNumber(uint16_t seq)
Set the Echo sequence number.
uint32_t GetDataSize() const
Get the Echo data size.
uint32_t m_dataSize
data size
uint16_t GetSequenceNumber() const
Get the Echo sequence number.
ICMP Time Exceeded header.
uint32_t Deserialize(Buffer::Iterator start) override
Ipv4Header m_header
carried IPv4 header
Ipv4Header GetHeader() const
Get the ICMP carried IPv4 header.
void SetHeader(Ipv4Header header)
Set the ICMP carried IPv4 header.
uint32_t GetSerializedSize() const override
void GetData(uint8_t payload[8]) const
Get the ICMP carried data.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void Serialize(Buffer::Iterator start) const override
uint8_t m_data[8]
carried data
static TypeId GetTypeId()
Get ICMP type.
void SetData(Ptr< const Packet > data)
Get the ICMP carried data.
~Icmpv4TimeExceeded() override
void Print(std::ostream &os) const override
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.