|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #include "ns3/packet.h"
40 .SetGroupName (
"Internet")
48 m_calcChecksum (false)
105 os <<
"type=" << (uint32_t)
m_type <<
", code=" << (uint32_t)
m_code;
156 uint32_t size =
data->GetSize ();
167 m_data =
new uint8_t[size];
202 .SetGroupName (
"Internet")
251 uint32_t optionalPayloadSize =
start.GetRemainingSize () -4;
282 static TypeId tid =
TypeId (
"ns3::Icmpv4DestinationUnreachable")
284 .SetGroupName (
"Internet")
294 for (uint8_t j = 0; j < 8; j++)
329 memcpy (payload,
m_data, 8);
375 for (uint8_t j = 0; j < 8; j++)
387 for (uint8_t i = 0; i < 8; i++)
389 os << (uint32_t)
m_data[i];
408 .SetGroupName (
"Internet")
418 for (uint8_t j = 0; j < 8; j++)
441 memcpy (payload,
m_data, 8);
486 for (uint8_t j = 0; j < 8; j++)
498 for (uint8_t i = 0; i < 8; i++)
500 os << (uint32_t)
m_data[i];
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void Serialize(Buffer::Iterator start) const
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
uint32_t m_dataSize
data size
uint16_t m_nextHopMtu
next hop MTU
virtual void Print(std::ostream &os) const
void SetIdentifier(uint16_t id)
Set the Echo identifier.
ICMP Time Exceeded header.
Ipv4Header m_header
carried IPv4 header
uint16_t GetSequenceNumber(void) const
Get the Echo sequence number.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t GetDistanceFrom(Iterator const &o) const
virtual void Serialize(Buffer::Iterator start) const
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
void SetSequenceNumber(uint16_t seq)
Set the Echo sequence number.
uint16_t ReadNtohU16(void)
void WriteU8(uint8_t data)
void WriteU16(uint16_t data)
uint8_t m_data[8]
carried data
void Next(void)
go forward by one byte
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint16_t CalculateIpChecksum(uint16_t size)
Calculate the checksum.
void WriteHtonU16(uint16_t data)
uint16_t m_identifier
identifier
uint8_t m_data[8]
carried data
virtual ~Icmpv4TimeExceeded()
void SetHeader(Ipv4Header header)
Set the ICMP carried IPv4 header.
ICMP Destination Unreachable header.
Ipv4Header GetHeader(void) const
Get the ICMP carried IPv4 header.
Ipv4Header GetHeader(void) const
Get the ICMP carried IPv4 header.
virtual void Print(std::ostream &os) const
virtual void Print(std::ostream &os) const
void GetData(uint8_t payload[8]) const
Get the ICMP carried data.
uint16_t GetNextHopMtu(void) const
Get the next hop MTU.
static TypeId GetTypeId(void)
Get ICMP type.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
uint32_t GetSize(void) const
iterator in a Buffer instance
void GetData(uint8_t payload[8]) const
Get the ICMP carried data.
uint32_t GetDataSize(void) const
Get the Echo data size.
void SetHeader(Ipv4Header header)
Set the ICMP carried IPv4 header.
uint32_t GetData(uint8_t payload[]) const
Get the Echo data.
void SetData(Ptr< const Packet > data)
Set the ICMP carried data.
uint16_t m_sequence
sequence number
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void SetData(Ptr< const Packet > data)
Get the ICMP carried data.
virtual ~Icmpv4DestinationUnreachable()
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
static TypeId GetTypeId(void)
Get ICMP type.
virtual void Serialize(Buffer::Iterator start) const
uint16_t GetIdentifier(void) const
Get the Echo identifier.
virtual uint32_t GetSerializedSize(void) const
void SetData(Ptr< const Packet > data)
Set the Echo data.
static TypeId GetTypeId(void)
Get ICMP type.
virtual uint32_t GetSerializedSize(void) const
Ipv4Header m_header
carried IPv4 header
Icmpv4DestinationUnreachable()
virtual uint32_t GetSerializedSize(void) const
void SetNextHopMtu(uint16_t mtu)
Set the next hop MTU.