--- a/src/internet/model/icmpv6-header.cc Fri Apr 19 22:39:55 2013 +0200
+++ b/src/internet/model/icmpv6-header.cc Sat Apr 20 00:29:36 2013 +0200
@@ -26,13 +26,13 @@
#include "icmpv6-header.h"
+NS_LOG_COMPONENT_DEFINE ("Icmpv6Header");
+
namespace ns3
{
NS_OBJECT_ENSURE_REGISTERED (Icmpv6Header);
-NS_LOG_COMPONENT_DEFINE ("Icmpv6Header");
-
TypeId Icmpv6Header::GetTypeId ()
{
static TypeId tid = TypeId ("ns3::Icmpv6Header")
@@ -44,6 +44,7 @@
TypeId Icmpv6Header::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
@@ -53,54 +54,65 @@
m_type (0),
m_code (0)
{
+ NS_LOG_FUNCTION (this);
}
Icmpv6Header::~Icmpv6Header ()
{
+ NS_LOG_FUNCTION (this);
}
uint8_t Icmpv6Header::GetType () const
{
+ NS_LOG_FUNCTION (this);
return m_type;
}
void Icmpv6Header::SetType (uint8_t type)
{
+ NS_LOG_FUNCTION (this << static_cast<uint32_t> (type));
m_type = type;
}
uint8_t Icmpv6Header::GetCode () const
{
+ NS_LOG_FUNCTION (this);
return m_code;
}
void Icmpv6Header::SetCode (uint8_t code)
{
+ NS_LOG_FUNCTION (this << static_cast<uint32_t> (code));
m_code = code;
}
uint16_t Icmpv6Header::GetChecksum () const
{
+ NS_LOG_FUNCTION (this);
return m_checksum;
}
void Icmpv6Header::SetChecksum (uint16_t checksum)
{
+ NS_LOG_FUNCTION (this << checksum);
m_checksum = checksum;
}
void Icmpv6Header::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)m_type << " code = " << (uint32_t)m_code << " checksum = " << (uint32_t)m_checksum << ")";
}
uint32_t Icmpv6Header::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 4;
}
uint32_t Icmpv6Header::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
m_type = i.ReadU8 ();
@@ -114,6 +126,7 @@
void Icmpv6Header::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
i.WriteU8 (m_type);
@@ -135,6 +148,8 @@
void Icmpv6Header::CalculatePseudoHeaderChecksum (Ipv6Address src, Ipv6Address dst, uint16_t length, uint8_t protocol)
{
+ NS_LOG_FUNCTION (this << src << dst << length << static_cast<uint32_t> (protocol));
+
Buffer buf = Buffer (40);
uint8_t tmp[16];
Buffer::Iterator it;
@@ -161,6 +176,7 @@
Icmpv6NS::Icmpv6NS ()
{
+ NS_LOG_FUNCTION (this);
SetType (ICMPV6_ND_NEIGHBOR_SOLICITATION);
SetCode (0);
SetReserved (0);
@@ -178,11 +194,13 @@
TypeId Icmpv6NS::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
Icmpv6NS::Icmpv6NS (Ipv6Address target)
{
+ NS_LOG_FUNCTION (this << target);
SetType (ICMPV6_ND_NEIGHBOR_SOLICITATION);
SetCode (0);
SetReserved (0);
@@ -197,41 +215,48 @@
Icmpv6NS::~Icmpv6NS ()
{
+ NS_LOG_FUNCTION (this);
}
uint32_t Icmpv6NS::GetReserved () const
{
+ NS_LOG_FUNCTION (this);
return m_reserved;
}
void Icmpv6NS::SetReserved (uint32_t reserved)
{
+ NS_LOG_FUNCTION (this << reserved);
m_reserved = reserved;
}
Ipv6Address Icmpv6NS::GetIpv6Target () const
{
+ NS_LOG_FUNCTION (this);
return m_target;
}
void Icmpv6NS::SetIpv6Target (Ipv6Address target)
{
+ NS_LOG_FUNCTION (this << target);
m_target = target;
}
void Icmpv6NS::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " (NS) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << ")";
}
uint32_t Icmpv6NS::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 24;
}
void Icmpv6NS::Serialize (Buffer::Iterator start) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << &start);
uint8_t buff_target[16];
uint16_t checksum = 0;
Buffer::Iterator i = start;
@@ -255,6 +280,7 @@
uint32_t Icmpv6NS::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
uint8_t buf[16];
Buffer::Iterator i = start;
@@ -281,11 +307,13 @@
TypeId Icmpv6NA::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
Icmpv6NA::Icmpv6NA ()
{
+ NS_LOG_FUNCTION (this);
SetType (ICMPV6_ND_NEIGHBOR_ADVERTISEMENT);
SetCode (0);
SetReserved (0);
@@ -297,70 +325,84 @@
Icmpv6NA::~Icmpv6NA ()
{
+ NS_LOG_FUNCTION (this);
}
uint32_t Icmpv6NA::GetReserved () const
{
+ NS_LOG_FUNCTION (this);
return m_reserved;
}
void Icmpv6NA::SetReserved (uint32_t reserved)
{
+ NS_LOG_FUNCTION (this << reserved);
m_reserved = reserved;
}
Ipv6Address Icmpv6NA::GetIpv6Target () const
{
+ NS_LOG_FUNCTION (this);
return m_target;
}
bool Icmpv6NA::GetFlagR () const
{
+ NS_LOG_FUNCTION (this);
return m_flagR;
}
void Icmpv6NA::SetFlagR (bool r)
{
+ NS_LOG_FUNCTION (this << r);
m_flagR = r;
}
bool Icmpv6NA::GetFlagS () const
{
+ NS_LOG_FUNCTION (this);
return m_flagS;
}
void Icmpv6NA::SetFlagS (bool s)
{
+ NS_LOG_FUNCTION (this << s);
m_flagS = s;
}
bool Icmpv6NA::GetFlagO () const
{
+ NS_LOG_FUNCTION (this);
return m_flagO;
}
void Icmpv6NA::SetFlagO (bool o)
{
+ NS_LOG_FUNCTION (this << o);
m_flagO = o;
}
void Icmpv6NA::SetIpv6Target (Ipv6Address target)
{
+ NS_LOG_FUNCTION (this << target);
m_target = target;
}
void Icmpv6NA::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " (NA) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << ")";
}
uint32_t Icmpv6NA::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 24;
}
void Icmpv6NA::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
uint8_t buff_target[16];
uint16_t checksum = 0;
Buffer::Iterator i = start;
@@ -401,6 +443,7 @@
uint32_t Icmpv6NA::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
uint8_t buf[16];
Buffer::Iterator i = start;
@@ -447,11 +490,13 @@
TypeId Icmpv6RA::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
Icmpv6RA::Icmpv6RA ()
{
+ NS_LOG_FUNCTION (this);
SetType (ICMPV6_ND_ROUTER_ADVERTISEMENT);
SetCode (0);
SetFlags (0);
@@ -466,100 +511,120 @@
Icmpv6RA::~Icmpv6RA ()
{
+ NS_LOG_FUNCTION (this);
}
void Icmpv6RA::SetCurHopLimit (uint8_t m)
{
+ NS_LOG_FUNCTION (this << static_cast<uint32_t> (m));
m_curHopLimit = m;
}
uint8_t Icmpv6RA::GetCurHopLimit () const
{
+ NS_LOG_FUNCTION (this);
return m_curHopLimit;
}
uint16_t Icmpv6RA::GetLifeTime () const
{
+ NS_LOG_FUNCTION (this);
return m_LifeTime;
}
uint32_t Icmpv6RA::GetReachableTime () const
{
+ NS_LOG_FUNCTION (this);
return m_ReachableTime;
}
uint32_t Icmpv6RA::GetRetransmissionTime () const
{
+ NS_LOG_FUNCTION (this);
return m_RetransmissionTimer;
}
void Icmpv6RA::SetLifeTime (uint16_t l)
{
+ NS_LOG_FUNCTION (this << l);
m_LifeTime = l;
}
void Icmpv6RA::SetReachableTime (uint32_t r)
{
+ NS_LOG_FUNCTION (this << r);
m_ReachableTime = r;
}
void Icmpv6RA::SetRetransmissionTime (uint32_t r)
{
+ NS_LOG_FUNCTION (this << r);
m_RetransmissionTimer = r;
}
bool Icmpv6RA::GetFlagM () const
{
+ NS_LOG_FUNCTION (this);
return m_flagM;
}
void Icmpv6RA::SetFlagM (bool m)
{
+ NS_LOG_FUNCTION (this << m);
m_flagM = m;
}
bool Icmpv6RA::GetFlagO () const
{
+ NS_LOG_FUNCTION (this);
return m_flagO;
}
void Icmpv6RA::SetFlagO (bool o)
{
+ NS_LOG_FUNCTION (this << o);
m_flagO = o;
}
bool Icmpv6RA::GetFlagH () const
{
+ NS_LOG_FUNCTION (this);
return m_flagH;
}
void Icmpv6RA::SetFlagH (bool h)
{
+ NS_LOG_FUNCTION (this << h);
m_flagH = h;
}
uint8_t Icmpv6RA::GetFlags () const
{
+ NS_LOG_FUNCTION (this);
return m_flags;
}
void Icmpv6RA::SetFlags (uint8_t f)
{
+ NS_LOG_FUNCTION (this << static_cast<uint32_t> (f));
m_flags = f;
}
void Icmpv6RA::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " (RA) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << ")";
}
uint32_t Icmpv6RA::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 16;
}
void Icmpv6RA::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
uint16_t checksum = 0;
Buffer::Iterator i = start;
uint8_t flags = 0;
@@ -598,6 +663,7 @@
uint32_t Icmpv6RA::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
SetType (i.ReadU8 ());
@@ -643,11 +709,13 @@
TypeId Icmpv6RS::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
Icmpv6RS::Icmpv6RS ()
{
+ NS_LOG_FUNCTION (this);
SetType (ICMPV6_ND_ROUTER_SOLICITATION);
SetCode (0);
SetReserved (0);
@@ -655,30 +723,36 @@
Icmpv6RS::~Icmpv6RS ()
{
+ NS_LOG_FUNCTION (this);
}
uint32_t Icmpv6RS::GetReserved () const
{
+ NS_LOG_FUNCTION (this);
return m_reserved;
}
void Icmpv6RS::SetReserved (uint32_t reserved)
{
+ NS_LOG_FUNCTION (this << reserved);
m_reserved = reserved;
}
void Icmpv6RS::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " (RS) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << ")";
}
uint32_t Icmpv6RS::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 8;
}
void Icmpv6RS::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
NS_LOG_FUNCTION_NOARGS ();
uint16_t checksum = 0;
Buffer::Iterator i = start;
@@ -701,7 +775,7 @@
uint32_t Icmpv6RS::Deserialize (Buffer::Iterator start)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
SetType (i.ReadU8 ());
@@ -725,6 +799,7 @@
TypeId Icmpv6Redirection::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
@@ -733,6 +808,7 @@
m_destination (Ipv6Address ("")),
m_reserved (0)
{
+ NS_LOG_FUNCTION (this);
SetType (ICMPV6_ND_REDIRECTION);
SetCode (0);
m_checksum = 0;
@@ -740,50 +816,60 @@
Icmpv6Redirection::~Icmpv6Redirection ()
{
+ NS_LOG_FUNCTION (this);
}
void Icmpv6Redirection::SetReserved (uint32_t reserved)
{
+ NS_LOG_FUNCTION (this << reserved);
m_reserved = reserved;
}
uint32_t Icmpv6Redirection::GetReserved () const
{
+ NS_LOG_FUNCTION (this);
return m_reserved;
}
Ipv6Address Icmpv6Redirection::GetTarget () const
{
+ NS_LOG_FUNCTION (this);
return m_target;
}
void Icmpv6Redirection::SetTarget (Ipv6Address target)
{
+ NS_LOG_FUNCTION (this << target);
m_target = target;
}
Ipv6Address Icmpv6Redirection::GetDestination () const
{
+ NS_LOG_FUNCTION (this);
return m_destination;
}
void Icmpv6Redirection::SetDestination (Ipv6Address destination)
{
+ NS_LOG_FUNCTION (this << destination);
m_destination = destination;
}
void Icmpv6Redirection::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " (Redirection) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << " target = " << m_target << " destination = " << m_destination << ")";
}
uint32_t Icmpv6Redirection::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 40;
}
void Icmpv6Redirection::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
uint8_t buff[16];
uint16_t checksum = 0;
Buffer::Iterator i = start;
@@ -812,6 +898,7 @@
uint32_t Icmpv6Redirection::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
uint8_t buff[16];
Buffer::Iterator i = start;
@@ -842,11 +929,13 @@
TypeId Icmpv6Echo::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
Icmpv6Echo::Icmpv6Echo ()
{
+ NS_LOG_FUNCTION (this);
SetType (Icmpv6Header::ICMPV6_ECHO_REQUEST);
SetCode (0);
m_checksum = 0;
@@ -856,6 +945,7 @@
Icmpv6Echo::Icmpv6Echo (bool request)
{
+ NS_LOG_FUNCTION (this << request);
SetType (request ? Icmpv6Header::ICMPV6_ECHO_REQUEST : Icmpv6Header::ICMPV6_ECHO_REPLY);
SetCode (0);
m_checksum = 0;
@@ -865,30 +955,36 @@
Icmpv6Echo::~Icmpv6Echo ()
{
+ NS_LOG_FUNCTION (this);
}
uint16_t Icmpv6Echo::GetId () const
{
+ NS_LOG_FUNCTION (this);
return m_id;
}
void Icmpv6Echo::SetId (uint16_t id)
{
+ NS_LOG_FUNCTION (this << id);
m_id = id;
}
uint16_t Icmpv6Echo::GetSeq () const
{
+ NS_LOG_FUNCTION (this);
return m_seq;
}
void Icmpv6Echo::SetSeq (uint16_t seq)
{
+ NS_LOG_FUNCTION (this << seq);
m_seq = seq;
}
void Icmpv6Echo::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (GetType () == 128 ? "128 (Request)" : "129 (Reply)") <<
" code = " << (uint32_t)GetCode () <<
" checksum = " << (uint32_t)GetChecksum () << ")";
@@ -896,11 +992,13 @@
uint32_t Icmpv6Echo::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 8;
}
void Icmpv6Echo::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
uint16_t checksum = 0;
Buffer::Iterator i = start;
@@ -923,6 +1021,7 @@
uint32_t Icmpv6Echo::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
SetType (i.ReadU8 ());
@@ -947,42 +1046,50 @@
TypeId Icmpv6DestinationUnreachable::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
Icmpv6DestinationUnreachable::Icmpv6DestinationUnreachable ()
: m_packet (0)
{
+ NS_LOG_FUNCTION (this);
SetType (ICMPV6_ERROR_DESTINATION_UNREACHABLE);
}
Icmpv6DestinationUnreachable::~Icmpv6DestinationUnreachable ()
{
+ NS_LOG_FUNCTION (this);
}
Ptr<Packet> Icmpv6DestinationUnreachable::GetPacket () const
{
+ NS_LOG_FUNCTION (this);
return m_packet;
}
void Icmpv6DestinationUnreachable::SetPacket (Ptr<Packet> p)
{
+ NS_LOG_FUNCTION (this << *p);
NS_ASSERT (p->GetSize () <= 1280);
m_packet = p;
}
void Icmpv6DestinationUnreachable::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " (Destination Unreachable) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << ")";
}
uint32_t Icmpv6DestinationUnreachable::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 8 + m_packet->GetSize ();
}
void Icmpv6DestinationUnreachable::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
uint16_t checksum = 0;
Buffer::Iterator i = start;
@@ -1007,6 +1114,7 @@
uint32_t Icmpv6DestinationUnreachable::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
uint16_t length = start.GetSize () - 8;
uint8_t* data = new uint8_t[length];
Buffer::Iterator i = start;
@@ -1035,6 +1143,7 @@
TypeId Icmpv6TooBig::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
@@ -1042,46 +1151,55 @@
: m_packet (0),
m_mtu (0)
{
+ NS_LOG_FUNCTION (this);
SetType (ICMPV6_ERROR_PACKET_TOO_BIG);
}
Icmpv6TooBig::~Icmpv6TooBig ()
{
+ NS_LOG_FUNCTION (this);
}
Ptr<Packet> Icmpv6TooBig::GetPacket () const
{
+ NS_LOG_FUNCTION (this);
return m_packet;
}
void Icmpv6TooBig::SetPacket (Ptr<Packet> p)
{
+ NS_LOG_FUNCTION (this << *p);
NS_ASSERT (p->GetSize () <= 1280);
m_packet = p;
}
uint32_t Icmpv6TooBig::GetMtu () const
{
+ NS_LOG_FUNCTION (this);
return m_mtu;
}
void Icmpv6TooBig::SetMtu (uint32_t mtu)
{
+ NS_LOG_FUNCTION (this << mtu);
m_mtu = mtu;
}
void Icmpv6TooBig::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " (Too Big) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << " mtu = " << (uint32_t)GetMtu () << ")";
}
uint32_t Icmpv6TooBig::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 8 + m_packet->GetSize ();
}
void Icmpv6TooBig::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
uint16_t checksum = 0;
Buffer::Iterator i = start;
@@ -1106,6 +1224,7 @@
uint32_t Icmpv6TooBig::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
uint16_t length = start.GetSize () - 8;
uint8_t* data = new uint8_t[length];
Buffer::Iterator i = start;
@@ -1134,42 +1253,51 @@
TypeId Icmpv6TimeExceeded::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
Icmpv6TimeExceeded::Icmpv6TimeExceeded ()
: m_packet (0)
{
+ NS_LOG_FUNCTION (this);
SetType (ICMPV6_ERROR_TIME_EXCEEDED);
}
Icmpv6TimeExceeded::~Icmpv6TimeExceeded ()
{
+ NS_LOG_FUNCTION (this);
}
Ptr<Packet> Icmpv6TimeExceeded::GetPacket () const
{
+ NS_LOG_FUNCTION (this);
return m_packet;
}
void Icmpv6TimeExceeded::SetPacket (Ptr<Packet> p)
{
+ NS_LOG_FUNCTION (this << *p);
NS_ASSERT (p->GetSize () <= 1280);
m_packet = p;
}
void Icmpv6TimeExceeded::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " (Destination Unreachable) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << ")";
}
uint32_t Icmpv6TimeExceeded::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 8 + m_packet->GetSize ();
}
void Icmpv6TimeExceeded::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
+
uint16_t checksum = 0;
Buffer::Iterator i = start;
@@ -1194,6 +1322,8 @@
uint32_t Icmpv6TimeExceeded::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
+
uint16_t length = start.GetSize () - 8;
uint8_t* data = new uint8_t[length];
Buffer::Iterator i = start;
@@ -1222,6 +1352,7 @@
TypeId Icmpv6ParameterError::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
@@ -1229,46 +1360,55 @@
: m_packet (0),
m_ptr (0)
{
+ NS_LOG_FUNCTION (this);
SetType (ICMPV6_ERROR_PARAMETER_ERROR);
}
Icmpv6ParameterError::~Icmpv6ParameterError ()
{
+ NS_LOG_FUNCTION (this);
}
Ptr<Packet> Icmpv6ParameterError::GetPacket () const
{
+ NS_LOG_FUNCTION (this);
return m_packet;
}
void Icmpv6ParameterError::SetPacket (Ptr<Packet> p)
{
+ NS_LOG_FUNCTION (this << *p);
NS_ASSERT (p->GetSize () <= 1280);
m_packet = p;
}
uint32_t Icmpv6ParameterError::GetPtr () const
{
+ NS_LOG_FUNCTION (this);
return m_ptr;
}
void Icmpv6ParameterError::SetPtr (uint32_t ptr)
{
+ NS_LOG_FUNCTION (this << ptr);
m_ptr = ptr;
}
void Icmpv6ParameterError::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " (Destination Unreachable) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << " ptr = " << (uint32_t)GetPtr () << ")";
}
uint32_t Icmpv6ParameterError::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 8 + m_packet->GetSize ();
}
void Icmpv6ParameterError::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
uint16_t checksum = 0;
Buffer::Iterator i = start;
@@ -1293,6 +1433,7 @@
uint32_t Icmpv6ParameterError::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
uint16_t length = start.GetSize () - 8;
uint8_t* data = new uint8_t[length];
Buffer::Iterator i = start;
@@ -1321,12 +1462,14 @@
TypeId Icmpv6OptionHeader::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
Icmpv6OptionHeader::Icmpv6OptionHeader ()
{
+ NS_LOG_FUNCTION (this);
/* TODO */
m_type = 0;
m_len = 0;
@@ -1334,6 +1477,7 @@
Icmpv6OptionHeader::~Icmpv6OptionHeader ()
{
+ NS_LOG_FUNCTION (this);
}
uint8_t Icmpv6OptionHeader::GetType () const
@@ -1344,39 +1488,43 @@
void Icmpv6OptionHeader::SetType (uint8_t type)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << static_cast<uint32_t> (type));
m_type = type;
}
uint8_t Icmpv6OptionHeader::GetLength () const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_len;
}
void Icmpv6OptionHeader::SetLength (uint8_t len)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << static_cast<uint32_t> (len));
m_len = len;
}
void Icmpv6OptionHeader::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength () << ")";
}
uint32_t Icmpv6OptionHeader::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return m_len*8;
}
uint32_t Icmpv6OptionHeader::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
return GetSerializedSize ();
}
void Icmpv6OptionHeader::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
}
NS_OBJECT_ENSURE_REGISTERED (Icmpv6OptionMtu);
@@ -1392,11 +1540,13 @@
TypeId Icmpv6OptionMtu::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
Icmpv6OptionMtu::Icmpv6OptionMtu ()
{
+ NS_LOG_FUNCTION (this);
SetType (Icmpv6Header::ICMPV6_OPT_MTU);
SetLength (1);
SetReserved (0);
@@ -1405,6 +1555,7 @@
Icmpv6OptionMtu::Icmpv6OptionMtu (uint32_t mtu)
: m_mtu (mtu)
{
+ NS_LOG_FUNCTION (this << mtu);
SetType (Icmpv6Header::ICMPV6_OPT_MTU);
SetLength (1);
SetReserved (0);
@@ -1412,40 +1563,48 @@
Icmpv6OptionMtu::~Icmpv6OptionMtu ()
{
+ NS_LOG_FUNCTION (this);
}
uint16_t Icmpv6OptionMtu::GetReserved () const
{
+ NS_LOG_FUNCTION (this);
return m_reserved;
}
void Icmpv6OptionMtu::SetReserved (uint16_t reserved)
{
+ NS_LOG_FUNCTION (this << reserved);
m_reserved = reserved;
}
uint32_t Icmpv6OptionMtu::GetMtu () const
{
+ NS_LOG_FUNCTION (this);
return m_mtu;
}
void Icmpv6OptionMtu::SetMtu (uint32_t mtu)
{
+ NS_LOG_FUNCTION (this << mtu);
m_mtu = mtu;
}
void Icmpv6OptionMtu::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength () << " MTU = " << m_mtu << ")";
}
uint32_t Icmpv6OptionMtu::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 8; /* m_len = 1 so the real size is multiple by 8 */
}
void Icmpv6OptionMtu::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
i.WriteU8 (GetType ());
i.WriteU8 (GetLength ());
@@ -1455,6 +1614,7 @@
uint32_t Icmpv6OptionMtu::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
SetType (i.ReadU8 ());
SetLength (i.ReadU8 ());
@@ -1476,11 +1636,13 @@
TypeId Icmpv6OptionPrefixInformation::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
Icmpv6OptionPrefixInformation::Icmpv6OptionPrefixInformation ()
{
+ NS_LOG_FUNCTION (this);
SetType (Icmpv6Header::ICMPV6_OPT_PREFIX);
SetLength (4);
SetPrefix (Ipv6Address ("::"));
@@ -1493,6 +1655,7 @@
Icmpv6OptionPrefixInformation::Icmpv6OptionPrefixInformation (Ipv6Address prefix, uint8_t prefixlen)
{
+ NS_LOG_FUNCTION (this << prefix << static_cast<uint32_t> (prefixlen));
SetType (Icmpv6Header::ICMPV6_OPT_PREFIX);
SetLength (4);
SetPrefix (prefix);
@@ -1505,81 +1668,97 @@
Icmpv6OptionPrefixInformation::~Icmpv6OptionPrefixInformation ()
{
+ NS_LOG_FUNCTION (this);
}
uint8_t Icmpv6OptionPrefixInformation::GetPrefixLength () const
{
+ NS_LOG_FUNCTION (this);
return m_prefixLength;
}
void Icmpv6OptionPrefixInformation::SetPrefixLength (uint8_t prefixLength)
{
+ NS_LOG_FUNCTION (this << static_cast<uint32_t> (prefixLength));
NS_ASSERT (prefixLength <= 128);
m_prefixLength = prefixLength;
}
uint8_t Icmpv6OptionPrefixInformation::GetFlags () const
{
+ NS_LOG_FUNCTION (this);
return m_flags;
}
void Icmpv6OptionPrefixInformation::SetFlags (uint8_t flags)
{
+ NS_LOG_FUNCTION (this);
m_flags = flags;
}
uint32_t Icmpv6OptionPrefixInformation::GetValidTime () const
{
+ NS_LOG_FUNCTION (this);
return m_validTime;
}
void Icmpv6OptionPrefixInformation::SetValidTime (uint32_t validTime)
{
+ NS_LOG_FUNCTION (this << validTime);
m_validTime = validTime;
}
uint32_t Icmpv6OptionPrefixInformation::GetPreferredTime () const
{
+ NS_LOG_FUNCTION (this);
return m_preferredTime;
}
void Icmpv6OptionPrefixInformation::SetPreferredTime (uint32_t preferredTime)
{
+ NS_LOG_FUNCTION (this << preferredTime);
m_preferredTime = preferredTime;
}
uint32_t Icmpv6OptionPrefixInformation::GetReserved () const
{
+ NS_LOG_FUNCTION (this);
return m_preferredTime;
}
void Icmpv6OptionPrefixInformation::SetReserved (uint32_t reserved)
{
+ NS_LOG_FUNCTION (this << reserved);
m_reserved = reserved;
}
Ipv6Address Icmpv6OptionPrefixInformation::GetPrefix () const
{
+ NS_LOG_FUNCTION (this);
return m_prefix;
}
void Icmpv6OptionPrefixInformation::SetPrefix (Ipv6Address prefix)
{
+ NS_LOG_FUNCTION (this << prefix);
m_prefix = prefix;
}
void Icmpv6OptionPrefixInformation::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength () << " prefix " << m_prefix << ")";
}
uint32_t Icmpv6OptionPrefixInformation::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 32;
}
void Icmpv6OptionPrefixInformation::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
uint8_t buf[16];
@@ -1598,6 +1777,7 @@
uint32_t Icmpv6OptionPrefixInformation::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
uint8_t buf[16];
@@ -1629,21 +1809,25 @@
TypeId Icmpv6OptionLinkLayerAddress::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
Icmpv6OptionLinkLayerAddress::Icmpv6OptionLinkLayerAddress (bool source)
{
+ NS_LOG_FUNCTION (this << source);
SetType (source ? Icmpv6Header::ICMPV6_OPT_LINK_LAYER_SOURCE : Icmpv6Header::ICMPV6_OPT_LINK_LAYER_TARGET);
}
Icmpv6OptionLinkLayerAddress::Icmpv6OptionLinkLayerAddress ()
{
+ NS_LOG_FUNCTION (this);
SetType (Icmpv6Header::ICMPV6_OPT_LINK_LAYER_SOURCE);
}
Icmpv6OptionLinkLayerAddress::Icmpv6OptionLinkLayerAddress (bool source, Address addr)
{
+ NS_LOG_FUNCTION (this << source << addr);
SetType (source ? Icmpv6Header::ICMPV6_OPT_LINK_LAYER_SOURCE : Icmpv6Header::ICMPV6_OPT_LINK_LAYER_TARGET);
SetAddress (addr);
@@ -1657,32 +1841,37 @@
Icmpv6OptionLinkLayerAddress::~Icmpv6OptionLinkLayerAddress ()
{
+ NS_LOG_FUNCTION (this);
}
Address Icmpv6OptionLinkLayerAddress::GetAddress () const
{
+ NS_LOG_FUNCTION (this);
return m_addr;
}
void Icmpv6OptionLinkLayerAddress::SetAddress (Address addr)
{
+ NS_LOG_FUNCTION (this << addr);
m_addr = addr;
}
void Icmpv6OptionLinkLayerAddress::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength () << " L2 Address = " << m_addr << ")";
}
uint32_t Icmpv6OptionLinkLayerAddress::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
uint8_t nb = GetLength() * 8;
return nb;
}
void Icmpv6OptionLinkLayerAddress::Serialize (Buffer::Iterator start) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
uint8_t mac[32];
@@ -1700,6 +1889,7 @@
uint32_t Icmpv6OptionLinkLayerAddress::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
uint8_t mac[32];
@@ -1725,27 +1915,32 @@
TypeId Icmpv6OptionRedirected::GetInstanceTypeId () const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
Icmpv6OptionRedirected::Icmpv6OptionRedirected ()
: m_packet (0)
{
+ NS_LOG_FUNCTION (this);
SetType (Icmpv6Header::ICMPV6_OPT_REDIRECTED);
}
Icmpv6OptionRedirected::~Icmpv6OptionRedirected ()
{
+ NS_LOG_FUNCTION (this);
m_packet = 0;
}
Ptr<Packet> Icmpv6OptionRedirected::GetPacket () const
{
+ NS_LOG_FUNCTION (this);
return m_packet;
}
void Icmpv6OptionRedirected::SetPacket (Ptr<Packet> packet)
{
+ NS_LOG_FUNCTION (this << *packet);
NS_ASSERT (packet->GetSize () <= 1280);
m_packet = packet;
SetLength (1 + (m_packet->GetSize () / 8));
@@ -1753,17 +1948,19 @@
void Icmpv6OptionRedirected::Print (std::ostream& os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength () << ")";
}
uint32_t Icmpv6OptionRedirected::GetSerializedSize () const
{
+ NS_LOG_FUNCTION (this);
return 8 + m_packet->GetSize ();
}
void Icmpv6OptionRedirected::Serialize (Buffer::Iterator start) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
i.WriteU8 (GetType ());
@@ -1781,6 +1978,7 @@
uint32_t Icmpv6OptionRedirected::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
SetType (i.ReadU8 ());