Partially clean up function logging of internet module.
--- a/src/internet/model/arp-cache.cc Fri Apr 19 22:39:55 2013 +0200
+++ b/src/internet/model/arp-cache.cc Sat Apr 20 00:29:36 2013 +0200
@@ -109,12 +109,14 @@
Ptr<NetDevice>
ArpCache::GetDevice (void) const
{
+ NS_LOG_FUNCTION (this);
return m_device;
}
Ptr<Ipv4Interface>
ArpCache::GetInterface (void) const
{
+ NS_LOG_FUNCTION (this);
return m_interface;
}
@@ -140,16 +142,19 @@
Time
ArpCache::GetAliveTimeout (void) const
{
+ NS_LOG_FUNCTION (this);
return m_aliveTimeout;
}
Time
ArpCache::GetDeadTimeout (void) const
{
+ NS_LOG_FUNCTION (this);
return m_deadTimeout;
}
Time
ArpCache::GetWaitReplyTimeout (void) const
{
+ NS_LOG_FUNCTION (this);
return m_waitReplyTimeout;
}
@@ -157,7 +162,7 @@
ArpCache::SetArpRequestCallback (Callback<void, Ptr<const ArpCache>,
Ipv4Address> arpRequestCallback)
{
- NS_LOG_FUNCTION (this);
+ NS_LOG_FUNCTION (this << &arpRequestCallback);
m_arpRequestCallback = arpRequestCallback;
}
@@ -240,6 +245,7 @@
ArpCache::Entry *
ArpCache::Lookup (Ipv4Address to)
{
+ NS_LOG_FUNCTION (this << to);
if (m_arpCache.find (to) != m_arpCache.end ())
{
ArpCache::Entry *entry = m_arpCache[to];
@@ -272,16 +278,19 @@
bool
ArpCache::Entry::IsDead (void)
{
+ NS_LOG_FUNCTION (this);
return (m_state == DEAD) ? true : false;
}
bool
ArpCache::Entry::IsAlive (void)
{
+ NS_LOG_FUNCTION (this);
return (m_state == ALIVE) ? true : false;
}
bool
ArpCache::Entry::IsWaitReply (void)
{
+ NS_LOG_FUNCTION (this);
return (m_state == WAIT_REPLY) ? true : false;
}
@@ -336,12 +345,14 @@
Address
ArpCache::Entry::GetMacAddress (void) const
{
+ NS_LOG_FUNCTION (this);
NS_ASSERT (m_state == ALIVE);
return m_macAddress;
}
Ipv4Address
ArpCache::Entry::GetIpv4Address (void) const
{
+ NS_LOG_FUNCTION (this);
return m_ipv4Address;
}
void
@@ -353,6 +364,7 @@
Time
ArpCache::Entry::GetTimeout (void) const
{
+ NS_LOG_FUNCTION (this);
switch (m_state) {
case ArpCache::Entry::WAIT_REPLY:
return m_arp->GetWaitReplyTimeout ();
@@ -369,6 +381,7 @@
bool
ArpCache::Entry::IsExpired (void) const
{
+ NS_LOG_FUNCTION (this);
Time timeout = GetTimeout ();
Time delta = Simulator::Now () - m_lastSeen;
NS_LOG_DEBUG ("delta=" << delta.GetSeconds () << "s");
@@ -396,12 +409,13 @@
void
ArpCache::Entry::UpdateSeen (void)
{
- NS_LOG_FUNCTION (this << m_macAddress << m_ipv4Address);
+ NS_LOG_FUNCTION (this);
m_lastSeen = Simulator::Now ();
}
uint32_t
ArpCache::Entry::GetRetries (void) const
{
+ NS_LOG_FUNCTION (this);
return m_retries;
}
void
--- a/src/internet/model/arp-header.cc Fri Apr 19 22:39:55 2013 +0200
+++ b/src/internet/model/arp-header.cc Sat Apr 20 00:29:36 2013 +0200
@@ -21,6 +21,9 @@
#include "ns3/assert.h"
#include "ns3/address-utils.h"
#include "arp-header.h"
+#include "ns3/log.h"
+
+NS_LOG_COMPONENT_DEFINE ("ArpHeader");
namespace ns3 {
@@ -32,6 +35,7 @@
Address destinationHardwareAddress,
Ipv4Address destinationProtocolAddress)
{
+ NS_LOG_FUNCTION (this << sourceHardwareAddress << sourceProtocolAddress << destinationHardwareAddress << destinationProtocolAddress);
m_type = ARP_TYPE_REQUEST;
m_macSource = sourceHardwareAddress;
m_macDest = destinationHardwareAddress;
@@ -44,6 +48,7 @@
Address destinationHardwareAddress,
Ipv4Address destinationProtocolAddress)
{
+ NS_LOG_FUNCTION (this << sourceHardwareAddress << sourceProtocolAddress << destinationHardwareAddress << destinationProtocolAddress);
m_type = ARP_TYPE_REPLY;
m_macSource = sourceHardwareAddress;
m_macDest = destinationHardwareAddress;
@@ -53,31 +58,37 @@
bool
ArpHeader::IsRequest (void) const
{
+ NS_LOG_FUNCTION (this);
return (m_type == ARP_TYPE_REQUEST) ? true : false;
}
bool
ArpHeader::IsReply (void) const
{
+ NS_LOG_FUNCTION (this);
return (m_type == ARP_TYPE_REPLY) ? true : false;
}
Address
ArpHeader::GetSourceHardwareAddress (void)
{
+ NS_LOG_FUNCTION (this);
return m_macSource;
}
Address
ArpHeader::GetDestinationHardwareAddress (void)
{
+ NS_LOG_FUNCTION (this);
return m_macDest;
}
Ipv4Address
ArpHeader::GetSourceIpv4Address (void)
{
+ NS_LOG_FUNCTION (this);
return m_ipv4Source;
}
Ipv4Address
ArpHeader::GetDestinationIpv4Address (void)
{
+ NS_LOG_FUNCTION (this);
return m_ipv4Dest;
}
@@ -94,11 +105,13 @@
TypeId
ArpHeader::GetInstanceTypeId (void) const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
void
ArpHeader::Print (std::ostream &os) const
{
+ NS_LOG_FUNCTION (this << &os);
if (IsRequest ())
{
os << "request "
@@ -121,6 +134,7 @@
uint32_t
ArpHeader::GetSerializedSize (void) const
{
+ NS_LOG_FUNCTION (this);
NS_ASSERT((m_macSource.GetLength () == 6) || (m_macSource.GetLength () == 8));
NS_ASSERT (m_macSource.GetLength () == m_macDest.GetLength ());
@@ -133,6 +147,7 @@
void
ArpHeader::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
NS_ASSERT (m_macSource.GetLength () == m_macDest.GetLength ());
@@ -152,6 +167,7 @@
uint32_t
ArpHeader::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
i.Next (2); // Skip HRD
uint32_t protocolType = i.ReadNtohU16 (); // Read PRO
--- a/src/internet/model/arp-l3-protocol.cc Fri Apr 19 22:39:55 2013 +0200
+++ b/src/internet/model/arp-l3-protocol.cc Sat Apr 20 00:29:36 2013 +0200
@@ -69,7 +69,7 @@
void
ArpL3Protocol::SetNode (Ptr<Node> node)
{
- NS_LOG_FUNCTION (this);
+ NS_LOG_FUNCTION (this << node);
m_node = node;
}
@@ -80,6 +80,7 @@
void
ArpL3Protocol::NotifyNewAggregate ()
{
+ NS_LOG_FUNCTION (this);
if (m_node == 0)
{
Ptr<Node>node = this->GetObject<Node> ();
@@ -245,7 +246,7 @@
Ptr<ArpCache> cache,
Address *hardwareDestination)
{
- NS_LOG_FUNCTION (this << packet << destination << device << cache);
+ NS_LOG_FUNCTION (this << packet << destination << device << cache << hardwareDestination);
ArpCache::Entry *entry = cache->Lookup (destination);
if (entry != 0)
{
@@ -332,7 +333,7 @@
void
ArpL3Protocol::SendArpReply (Ptr<const ArpCache> cache, Ipv4Address myIp, Ipv4Address toIp, Address toMac)
{
- NS_LOG_FUNCTION (this << cache << toIp << toMac);
+ NS_LOG_FUNCTION (this << cache << myIp << toIp << toMac);
ArpHeader arp;
NS_LOG_LOGIC ("ARP: sending reply from node "<<m_node->GetId ()<<
"|| src: " << cache->GetDevice ()->GetAddress () <<
--- a/src/internet/model/candidate-queue.cc Fri Apr 19 22:39:55 2013 +0200
+++ b/src/internet/model/candidate-queue.cc Sat Apr 20 00:29:36 2013 +0200
@@ -61,19 +61,19 @@
CandidateQueue::CandidateQueue()
: m_candidates ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
}
CandidateQueue::~CandidateQueue()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
Clear ();
}
void
CandidateQueue::Clear (void)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
while (!m_candidates.empty ())
{
SPFVertex *p = Pop ();
@@ -97,7 +97,7 @@
SPFVertex *
CandidateQueue::Pop (void)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
if (m_candidates.empty ())
{
return 0;
@@ -111,7 +111,7 @@
SPFVertex *
CandidateQueue::Top (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
if (m_candidates.empty ())
{
return 0;
@@ -123,21 +123,21 @@
bool
CandidateQueue::Empty (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_candidates.empty ();
}
uint32_t
CandidateQueue::Size (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_candidates.size ();
}
SPFVertex *
CandidateQueue::Find (const Ipv4Address addr) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
CandidateList_t::const_iterator i = m_candidates.begin ();
for (; i != m_candidates.end (); i++)
@@ -155,7 +155,7 @@
void
CandidateQueue::Reorder (void)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
m_candidates.sort (&CandidateQueue::CompareSPFVertex);
NS_LOG_LOGIC ("After reordering the CandidateQueue");
--- a/src/internet/model/global-route-manager-impl.cc Fri Apr 19 22:39:55 2013 +0200
+++ b/src/internet/model/global-route-manager-impl.cc Sat Apr 20 00:29:36 2013 +0200
@@ -40,7 +40,7 @@
#include "candidate-queue.h"
#include "ipv4-global-routing.h"
-NS_LOG_COMPONENT_DEFINE ("GlobalRouteManager");
+NS_LOG_COMPONENT_DEFINE ("GlobalRouteManagerImpl");
namespace ns3 {
@@ -89,7 +89,7 @@
m_children (),
m_vertexProcessed (false)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
}
SPFVertex::SPFVertex (GlobalRoutingLSA* lsa) :
@@ -102,7 +102,7 @@
m_children (),
m_vertexProcessed (false)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << lsa);
if (lsa->GetLSType () == GlobalRoutingLSA::RouterLSA)
{
@@ -118,7 +118,7 @@
SPFVertex::~SPFVertex ()
{
- NS_LOG_FUNCTION (m_vertexId);
+ NS_LOG_FUNCTION (this);
NS_LOG_LOGIC ("Children vertices - " << m_children);
NS_LOG_LOGIC ("Parent verteices - " << m_parents);
@@ -170,63 +170,63 @@
void
SPFVertex::SetVertexType (SPFVertex::VertexType type)
{
- NS_LOG_FUNCTION (type);
+ NS_LOG_FUNCTION (this << type);
m_vertexType = type;
}
SPFVertex::VertexType
SPFVertex::GetVertexType (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_vertexType;
}
void
SPFVertex::SetVertexId (Ipv4Address id)
{
- NS_LOG_FUNCTION (id);
+ NS_LOG_FUNCTION (this << id);
m_vertexId = id;
}
Ipv4Address
SPFVertex::GetVertexId (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_vertexId;
}
void
SPFVertex::SetLSA (GlobalRoutingLSA* lsa)
{
- NS_LOG_FUNCTION (lsa);
+ NS_LOG_FUNCTION (this << lsa);
m_lsa = lsa;
}
GlobalRoutingLSA*
SPFVertex::GetLSA (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_lsa;
}
void
SPFVertex::SetDistanceFromRoot (uint32_t distance)
{
- NS_LOG_FUNCTION (distance);
+ NS_LOG_FUNCTION (this << distance);
m_distanceFromRoot = distance;
}
uint32_t
SPFVertex::GetDistanceFromRoot (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_distanceFromRoot;
}
void
SPFVertex::SetParent (SPFVertex* parent)
{
- NS_LOG_FUNCTION (parent);
+ NS_LOG_FUNCTION (this << parent);
// always maintain only one parent when using setter/getter methods
m_parents.clear ();
@@ -236,7 +236,7 @@
SPFVertex*
SPFVertex::GetParent (uint32_t i) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << i);
// If the index i is out-of-range, return 0 and do nothing
if (m_parents.size () <= i)
@@ -255,7 +255,7 @@
void
SPFVertex::MergeParent (const SPFVertex* v)
{
- NS_LOG_FUNCTION (v);
+ NS_LOG_FUNCTION (this << v);
NS_LOG_LOGIC ("Before merge, list of parents = " << m_parents);
// combine the two lists first, and then remove any duplicated after
@@ -270,7 +270,7 @@
void
SPFVertex::SetRootExitDirection (Ipv4Address nextHop, int32_t id)
{
- NS_LOG_FUNCTION (nextHop << id);
+ NS_LOG_FUNCTION (this << nextHop << id);
// always maintain only one root's exit
m_ecmpRootExits.clear ();
@@ -284,14 +284,14 @@
void
SPFVertex::SetRootExitDirection (SPFVertex::NodeExit_t exit)
{
- NS_LOG_FUNCTION (exit);
+ NS_LOG_FUNCTION (this << exit);
SetRootExitDirection (exit.first, exit.second);
}
SPFVertex::NodeExit_t
SPFVertex::GetRootExitDirection (uint32_t i) const
{
- NS_LOG_FUNCTION (i);
+ NS_LOG_FUNCTION (this << i);
typedef ListOfNodeExit_t::const_iterator CIter_t;
NS_ASSERT_MSG (i < m_ecmpRootExits.size (), "Index out-of-range when accessing SPFVertex::m_ecmpRootExits!");
@@ -304,7 +304,7 @@
SPFVertex::NodeExit_t
SPFVertex::GetRootExitDirection () const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
NS_ASSERT_MSG (m_ecmpRootExits.size () <= 1, "Assumed there is at most one exit from the root to this vertex");
return GetRootExitDirection (0);
@@ -313,7 +313,7 @@
void
SPFVertex::MergeRootExitDirections (const SPFVertex* vertex)
{
- NS_LOG_FUNCTION (vertex);
+ NS_LOG_FUNCTION (this << vertex);
// obtain the external list of exit directions
//
@@ -328,7 +328,7 @@
void
SPFVertex::InheritAllRootExitDirections (const SPFVertex* vertex)
{
- NS_LOG_FUNCTION (vertex);
+ NS_LOG_FUNCTION (this << vertex);
// discard all exit direction currently associated with this vertex,
// and copy all the exit directions from the given vertex
@@ -344,21 +344,21 @@
uint32_t
SPFVertex::GetNRootExitDirections () const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_ecmpRootExits.size ();
}
uint32_t
SPFVertex::GetNChildren (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_children.size ();
}
SPFVertex*
SPFVertex::GetChild (uint32_t n) const
{
- NS_LOG_FUNCTION (n);
+ NS_LOG_FUNCTION (this << n);
uint32_t j = 0;
for ( ListOfSPFVertex_t::const_iterator i = m_children.begin ();
@@ -377,7 +377,7 @@
uint32_t
SPFVertex::AddChild (SPFVertex* child)
{
- NS_LOG_FUNCTION (child);
+ NS_LOG_FUNCTION (this << child);
m_children.push_back (child);
return m_children.size ();
}
@@ -385,18 +385,21 @@
void
SPFVertex::SetVertexProcessed (bool value)
{
+ NS_LOG_FUNCTION (this << value);
m_vertexProcessed = value;
}
bool
SPFVertex::IsVertexProcessed (void) const
{
+ NS_LOG_FUNCTION (this);
return m_vertexProcessed;
}
void
SPFVertex::ClearVertexProcessed (void)
{
+ NS_LOG_FUNCTION (this);
for (uint32_t i = 0; i < this->GetNChildren (); i++)
{
this->GetChild (i)->ClearVertexProcessed ();
@@ -415,12 +418,12 @@
m_database (),
m_extdatabase ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
}
GlobalRouteManagerLSDB::~GlobalRouteManagerLSDB ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
LSDBMap_t::iterator i;
for (i= m_database.begin (); i!= m_database.end (); i++)
{
@@ -441,7 +444,7 @@
void
GlobalRouteManagerLSDB::Initialize ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
LSDBMap_t::iterator i;
for (i= m_database.begin (); i!= m_database.end (); i++)
{
@@ -453,7 +456,7 @@
void
GlobalRouteManagerLSDB::Insert (Ipv4Address addr, GlobalRoutingLSA* lsa)
{
- NS_LOG_FUNCTION (addr << lsa);
+ NS_LOG_FUNCTION (this << addr << lsa);
if (lsa->GetLSType () == GlobalRoutingLSA::ASExternalLSAs)
{
m_extdatabase.push_back (lsa);
@@ -467,19 +470,21 @@
GlobalRoutingLSA*
GlobalRouteManagerLSDB::GetExtLSA (uint32_t index) const
{
+ NS_LOG_FUNCTION (this << index);
return m_extdatabase.at (index);
}
uint32_t
GlobalRouteManagerLSDB::GetNumExtLSAs () const
{
+ NS_LOG_FUNCTION (this);
return m_extdatabase.size ();
}
GlobalRoutingLSA*
GlobalRouteManagerLSDB::GetLSA (Ipv4Address addr) const
{
- NS_LOG_FUNCTION (addr);
+ NS_LOG_FUNCTION (this << addr);
//
// Look up an LSA by its address.
//
@@ -497,7 +502,7 @@
GlobalRoutingLSA*
GlobalRouteManagerLSDB::GetLSAByLinkData (Ipv4Address addr) const
{
- NS_LOG_FUNCTION (addr);
+ NS_LOG_FUNCTION (this << addr);
//
// Look up an LSA by its address.
//
@@ -529,13 +534,13 @@
:
m_spfroot (0)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
m_lsdb = new GlobalRouteManagerLSDB ();
}
GlobalRouteManagerImpl::~GlobalRouteManagerImpl ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
if (m_lsdb)
{
delete m_lsdb;
@@ -545,7 +550,7 @@
void
GlobalRouteManagerImpl::DebugUseLsdb (GlobalRouteManagerLSDB* lsdb)
{
- NS_LOG_FUNCTION (lsdb);
+ NS_LOG_FUNCTION (this << lsdb);
if (m_lsdb)
{
delete m_lsdb;
@@ -556,7 +561,7 @@
void
GlobalRouteManagerImpl::DeleteGlobalRoutes ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
NodeList::Iterator listEnd = NodeList::End ();
for (NodeList::Iterator i = NodeList::Begin (); i != listEnd; i++)
{
@@ -600,7 +605,7 @@
void
GlobalRouteManagerImpl::BuildGlobalRoutingDatabase ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
//
// Walk the list of nodes looking for the GlobalRouter Interface. Nodes with
// global router interfaces are, not too surprisingly, our routers.
@@ -683,7 +688,7 @@
void
GlobalRouteManagerImpl::InitializeRoutes ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
//
// Walk the list of nodes in the system.
//
@@ -733,7 +738,7 @@
void
GlobalRouteManagerImpl::SPFNext (SPFVertex* v, CandidateQueue& candidate)
{
- NS_LOG_FUNCTION (v << &candidate);
+ NS_LOG_FUNCTION (this << v << &candidate);
SPFVertex* w = 0;
GlobalRoutingLSA* w_lsa = 0;
@@ -969,7 +974,7 @@
GlobalRoutingLinkRecord* l,
uint32_t distance)
{
- NS_LOG_FUNCTION (v << w << l << distance);
+ NS_LOG_FUNCTION (this << v << w << l << distance);
//
// If w is a NetworkVertex, l should be null
/*
@@ -1156,7 +1161,7 @@
SPFVertex* w,
GlobalRoutingLinkRecord* prev_link)
{
- NS_LOG_FUNCTION (v << w << prev_link);
+ NS_LOG_FUNCTION (this << v << w << prev_link);
bool skip = true;
bool found_prev_link = false;
@@ -1231,7 +1236,7 @@
void
GlobalRouteManagerImpl::DebugSPFCalculate (Ipv4Address root)
{
- NS_LOG_FUNCTION (root);
+ NS_LOG_FUNCTION (this << root);
SPFCalculate (root);
}
@@ -1244,7 +1249,7 @@
bool
GlobalRouteManagerImpl::CheckForStubNode (Ipv4Address root)
{
- NS_LOG_FUNCTION (root);
+ NS_LOG_FUNCTION (this << root);
GlobalRoutingLSA *rlsa = m_lsdb->GetLSA (root);
Ipv4Address myRouterId = rlsa->GetLinkStateId ();
int transits = 0;
@@ -1492,7 +1497,7 @@
void
GlobalRouteManagerImpl::ProcessASExternals (SPFVertex* v, GlobalRoutingLSA* extlsa)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << v << extlsa);
NS_LOG_LOGIC ("Processing external for destination " <<
extlsa->GetLinkStateId () <<
", for router " << v->GetVertexId () <<
@@ -1526,7 +1531,7 @@
void
GlobalRouteManagerImpl::SPFAddASExternal (GlobalRoutingLSA *extlsa, SPFVertex *v)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << extlsa << v);
NS_ASSERT_MSG (m_spfroot, "GlobalRouteManagerImpl::SPFAddASExternal (): Root pointer not set");
// Two cases to consider: We are advertising the external ourselves
@@ -1653,7 +1658,7 @@
void
GlobalRouteManagerImpl::SPFProcessStubs (SPFVertex* v)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << v);
NS_LOG_LOGIC ("Processing stubs for " << v->GetVertexId ());
if (v->GetVertexType () == SPFVertex::VertexRouter)
{
@@ -1687,7 +1692,7 @@
void
GlobalRouteManagerImpl::SPFIntraAddStub (GlobalRoutingLinkRecord *l, SPFVertex* v)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << l << v);
NS_ASSERT_MSG (m_spfroot,
"GlobalRouteManagerImpl::SPFIntraAddStub (): Root pointer not set");
@@ -1827,7 +1832,7 @@
int32_t
GlobalRouteManagerImpl::FindOutgoingInterfaceId (Ipv4Address a, Ipv4Mask amask)
{
- NS_LOG_FUNCTION (a << amask);
+ NS_LOG_FUNCTION (this << a << amask);
//
// We have an IP address <a> and a vertex ID of the root of the SPF tree.
// The question is what interface index does this address correspond to.
@@ -1914,7 +1919,7 @@
void
GlobalRouteManagerImpl::SPFIntraAddRouter (SPFVertex* v)
{
- NS_LOG_FUNCTION (v);
+ NS_LOG_FUNCTION (this << v);
NS_ASSERT_MSG (m_spfroot,
"GlobalRouteManagerImpl::SPFIntraAddRouter (): Root pointer not set");
@@ -2059,7 +2064,7 @@
void
GlobalRouteManagerImpl::SPFIntraAddTransit (SPFVertex* v)
{
- NS_LOG_FUNCTION (v);
+ NS_LOG_FUNCTION (this << v);
NS_ASSERT_MSG (m_spfroot,
"GlobalRouteManagerImpl::SPFIntraAddTransit (): Root pointer not set");
@@ -2177,7 +2182,7 @@
void
GlobalRouteManagerImpl::SPFVertexAddParent (SPFVertex* v)
{
- NS_LOG_FUNCTION (v);
+ NS_LOG_FUNCTION (this << v);
for (uint32_t i=0;;)
{
--- a/src/internet/model/global-route-manager.cc Fri Apr 19 22:39:55 2013 +0200
+++ b/src/internet/model/global-route-manager.cc Sat Apr 20 00:29:36 2013 +0200
@@ -24,6 +24,8 @@
#include "global-route-manager.h"
#include "global-route-manager-impl.h"
+NS_LOG_COMPONENT_DEFINE ("GlobalRouteManager");
+
namespace ns3 {
// ---------------------------------------------------------------------------
@@ -35,6 +37,7 @@
void
GlobalRouteManager::DeleteGlobalRoutes ()
{
+ NS_LOG_FUNCTION_NOARGS ();
SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
DeleteGlobalRoutes ();
}
@@ -42,6 +45,7 @@
void
GlobalRouteManager::BuildGlobalRoutingDatabase (void)
{
+ NS_LOG_FUNCTION_NOARGS ();
SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
BuildGlobalRoutingDatabase ();
}
@@ -49,6 +53,7 @@
void
GlobalRouteManager::InitializeRoutes (void)
{
+ NS_LOG_FUNCTION_NOARGS ();
SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
InitializeRoutes ();
}
@@ -56,6 +61,7 @@
uint32_t
GlobalRouteManager::AllocateRouterId (void)
{
+ NS_LOG_FUNCTION_NOARGS ();
static uint32_t routerId = 0;
return routerId++;
}
--- a/src/internet/model/global-router-interface.cc Fri Apr 19 22:39:55 2013 +0200
+++ b/src/internet/model/global-router-interface.cc Sat Apr 20 00:29:36 2013 +0200
@@ -48,7 +48,7 @@
m_linkType (Unknown),
m_metric (0)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
}
GlobalRoutingLinkRecord::GlobalRoutingLinkRecord (
@@ -67,41 +67,41 @@
GlobalRoutingLinkRecord::~GlobalRoutingLinkRecord ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
}
Ipv4Address
GlobalRoutingLinkRecord::GetLinkId (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_linkId;
}
void
GlobalRoutingLinkRecord::SetLinkId (Ipv4Address addr)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << addr);
m_linkId = addr;
}
Ipv4Address
GlobalRoutingLinkRecord::GetLinkData (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_linkData;
}
void
GlobalRoutingLinkRecord::SetLinkData (Ipv4Address addr)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << addr);
m_linkData = addr;
}
GlobalRoutingLinkRecord::LinkType
GlobalRoutingLinkRecord::GetLinkType (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_linkType;
}
@@ -109,21 +109,21 @@
GlobalRoutingLinkRecord::SetLinkType (
GlobalRoutingLinkRecord::LinkType linkType)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << linkType);
m_linkType = linkType;
}
uint16_t
GlobalRoutingLinkRecord::GetMetric (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_metric;
}
void
GlobalRoutingLinkRecord::SetMetric (uint16_t metric)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << metric);
m_metric = metric;
}
@@ -144,7 +144,7 @@
m_status (GlobalRoutingLSA::LSA_SPF_NOT_EXPLORED),
m_node_id (0)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
}
GlobalRoutingLSA::GlobalRoutingLSA (
@@ -171,7 +171,7 @@
m_status (lsa.m_status),
m_node_id (lsa.m_node_id)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << &lsa);
NS_ASSERT_MSG (IsEmpty (),
"GlobalRoutingLSA::GlobalRoutingLSA (): Non-empty LSA in constructor");
CopyLinkRecords (lsa);
@@ -180,7 +180,7 @@
GlobalRoutingLSA&
GlobalRoutingLSA::operator= (const GlobalRoutingLSA& lsa)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << &lsa);
m_lsType = lsa.m_lsType;
m_linkStateId = lsa.m_linkStateId;
m_advertisingRtr = lsa.m_advertisingRtr;
@@ -196,7 +196,7 @@
void
GlobalRoutingLSA::CopyLinkRecords (const GlobalRoutingLSA& lsa)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << &lsa);
for (ListOfLinkRecords_t::const_iterator i = lsa.m_linkRecords.begin ();
i != lsa.m_linkRecords.end ();
i++)
@@ -218,14 +218,14 @@
GlobalRoutingLSA::~GlobalRoutingLSA()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
ClearLinkRecords ();
}
void
GlobalRoutingLSA::ClearLinkRecords (void)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
for ( ListOfLinkRecords_t::iterator i = m_linkRecords.begin ();
i != m_linkRecords.end ();
i++)
@@ -245,7 +245,7 @@
uint32_t
GlobalRoutingLSA::AddLinkRecord (GlobalRoutingLinkRecord* lr)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << lr);
m_linkRecords.push_back (lr);
return m_linkRecords.size ();
}
@@ -253,14 +253,14 @@
uint32_t
GlobalRoutingLSA::GetNLinkRecords (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_linkRecords.size ();
}
GlobalRoutingLinkRecord *
GlobalRoutingLSA::GetLinkRecord (uint32_t n) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << n);
uint32_t j = 0;
for ( ListOfLinkRecords_t::const_iterator i = m_linkRecords.begin ();
i != m_linkRecords.end ();
@@ -278,77 +278,77 @@
bool
GlobalRoutingLSA::IsEmpty (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_linkRecords.size () == 0;
}
GlobalRoutingLSA::LSType
GlobalRoutingLSA::GetLSType (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_lsType;
}
void
GlobalRoutingLSA::SetLSType (GlobalRoutingLSA::LSType typ)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << typ);
m_lsType = typ;
}
Ipv4Address
GlobalRoutingLSA::GetLinkStateId (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_linkStateId;
}
void
GlobalRoutingLSA::SetLinkStateId (Ipv4Address addr)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << addr);
m_linkStateId = addr;
}
Ipv4Address
GlobalRoutingLSA::GetAdvertisingRouter (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_advertisingRtr;
}
void
GlobalRoutingLSA::SetAdvertisingRouter (Ipv4Address addr)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << addr);
m_advertisingRtr = addr;
}
void
GlobalRoutingLSA::SetNetworkLSANetworkMask (Ipv4Mask mask)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << mask);
m_networkLSANetworkMask = mask;
}
Ipv4Mask
GlobalRoutingLSA::GetNetworkLSANetworkMask (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_networkLSANetworkMask;
}
GlobalRoutingLSA::SPFStatus
GlobalRoutingLSA::GetStatus (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_status;
}
uint32_t
GlobalRoutingLSA::AddAttachedRouter (Ipv4Address addr)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << addr);
m_attachedRouters.push_back (addr);
return m_attachedRouters.size ();
}
@@ -356,14 +356,14 @@
uint32_t
GlobalRoutingLSA::GetNAttachedRouters (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_attachedRouters.size ();
}
Ipv4Address
GlobalRoutingLSA::GetAttachedRouter (uint32_t n) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << n);
uint32_t j = 0;
for ( ListOfAttachedRouters_t::const_iterator i = m_attachedRouters.begin ();
i != m_attachedRouters.end ();
@@ -381,27 +381,28 @@
void
GlobalRoutingLSA::SetStatus (GlobalRoutingLSA::SPFStatus status)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << status);
m_status = status;
}
Ptr<Node>
GlobalRoutingLSA::GetNode (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return NodeList::GetNode (m_node_id);
}
void
GlobalRoutingLSA::SetNode (Ptr<Node> node)
{
- NS_LOG_FUNCTION (node);
+ NS_LOG_FUNCTION (this << node);
m_node_id = node->GetId ();
}
void
GlobalRoutingLSA::Print (std::ostream &os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << std::endl;
os << "========== Global Routing LSA ==========" << std::endl;
os << "m_lsType = " << m_lsType;
@@ -516,31 +517,33 @@
GlobalRouter::GlobalRouter ()
: m_LSAs ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
m_routerId.Set (GlobalRouteManager::AllocateRouterId ());
}
GlobalRouter::~GlobalRouter ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
ClearLSAs ();
}
void
GlobalRouter::SetRoutingProtocol (Ptr<Ipv4GlobalRouting> routing)
{
+ NS_LOG_FUNCTION (this << routing);
m_routingProtocol = routing;
}
Ptr<Ipv4GlobalRouting>
GlobalRouter::GetRoutingProtocol (void)
{
+ NS_LOG_FUNCTION (this);
return m_routingProtocol;
}
void
GlobalRouter::DoDispose ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
m_routingProtocol = 0;
for (InjectedRoutesI k = m_injectedRoutes.begin ();
k != m_injectedRoutes.end ();
@@ -554,7 +557,7 @@
void
GlobalRouter::ClearLSAs ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
for ( ListOfLSAs_t::iterator i = m_LSAs.begin ();
i != m_LSAs.end ();
i++)
@@ -574,7 +577,7 @@
Ipv4Address
GlobalRouter::GetRouterId (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_routerId;
}
@@ -587,7 +590,7 @@
uint32_t
GlobalRouter::DiscoverLSAs ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
Ptr<Node> node = GetObject<Node> ();
NS_ABORT_MSG_UNLESS (node, "GlobalRouter::DiscoverLSAs (): GetObject for <Node> interface failed");
NS_LOG_LOGIC ("For node " << node->GetId () );
@@ -735,7 +738,7 @@
void
GlobalRouter::ProcessBroadcastLink (Ptr<NetDevice> nd, GlobalRoutingLSA *pLSA, NetDeviceContainer &c)
{
- NS_LOG_FUNCTION (nd << pLSA << &c);
+ NS_LOG_FUNCTION (this << nd << pLSA << &c);
if (nd->IsBridge ())
{
@@ -750,7 +753,7 @@
void
GlobalRouter::ProcessSingleBroadcastLink (Ptr<NetDevice> nd, GlobalRoutingLSA *pLSA, NetDeviceContainer &c)
{
- NS_LOG_FUNCTION (nd << pLSA << &c);
+ NS_LOG_FUNCTION (this << nd << pLSA << &c);
GlobalRoutingLinkRecord *plr = new GlobalRoutingLinkRecord;
NS_ABORT_MSG_IF (plr == 0, "GlobalRouter::ProcessSingleBroadcastLink(): Can't alloc link record");
@@ -859,7 +862,7 @@
void
GlobalRouter::ProcessBridgedBroadcastLink (Ptr<NetDevice> nd, GlobalRoutingLSA *pLSA, NetDeviceContainer &c)
{
- NS_LOG_FUNCTION (nd << pLSA << &c);
+ NS_LOG_FUNCTION (this << nd << pLSA << &c);
NS_ASSERT_MSG (nd->IsBridge (), "GlobalRouter::ProcessBridgedBroadcastLink(): Called with non-bridge net device");
#if 0
@@ -1020,7 +1023,7 @@
void
GlobalRouter::ProcessPointToPointLink (Ptr<NetDevice> ndLocal, GlobalRoutingLSA *pLSA)
{
- NS_LOG_FUNCTION (ndLocal << pLSA);
+ NS_LOG_FUNCTION (this << ndLocal << pLSA);
//
// We have some preliminaries to do to get enough information to proceed.
@@ -1141,7 +1144,7 @@
void
GlobalRouter::BuildNetworkLSAs (NetDeviceContainer c)
{
- NS_LOG_FUNCTION (&c);
+ NS_LOG_FUNCTION (this << &c);
uint32_t nDesignatedRouters = c.GetN ();
@@ -1241,7 +1244,7 @@
Ipv4Address
GlobalRouter::FindDesignatedRouterForLink (Ptr<NetDevice> ndLocal, bool allowRecursion) const
{
- NS_LOG_FUNCTION (ndLocal << allowRecursion);
+ NS_LOG_FUNCTION (this << ndLocal << allowRecursion);
Ptr<Channel> ch = ndLocal->GetChannel ();
uint32_t nDevices = ch->GetNDevices ();
@@ -1378,7 +1381,7 @@
bool
GlobalRouter::AnotherRouterOnLink (Ptr<NetDevice> nd, bool allowRecursion) const
{
- NS_LOG_FUNCTION (nd << allowRecursion);
+ NS_LOG_FUNCTION (this << nd << allowRecursion);
Ptr<Channel> ch = nd->GetChannel ();
if (!ch)
@@ -1469,7 +1472,7 @@
uint32_t
GlobalRouter::GetNumLSAs (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_LSAs.size ();
}
@@ -1479,7 +1482,7 @@
bool
GlobalRouter::GetLSA (uint32_t n, GlobalRoutingLSA &lsa) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << n << &lsa);
NS_ASSERT_MSG (lsa.IsEmpty (), "GlobalRouter::GetLSA (): Must pass empty LSA");
//
// All of the work was done in GetNumLSAs. All we have to do here is to
@@ -1505,7 +1508,7 @@
void
GlobalRouter::InjectRoute (Ipv4Address network, Ipv4Mask networkMask)
{
- NS_LOG_FUNCTION (network << networkMask);
+ NS_LOG_FUNCTION (this << network << networkMask);
Ipv4RoutingTableEntry *route = new Ipv4RoutingTableEntry ();
//
// Interface number does not matter here, using 1.
@@ -1519,7 +1522,7 @@
Ipv4RoutingTableEntry *
GlobalRouter::GetInjectedRoute (uint32_t index)
{
- NS_LOG_FUNCTION (index);
+ NS_LOG_FUNCTION (this << index);
if (index < m_injectedRoutes.size ())
{
uint32_t tmp = 0;
@@ -1542,13 +1545,14 @@
uint32_t
GlobalRouter::GetNInjectedRoutes ()
{
+ NS_LOG_FUNCTION (this);
return m_injectedRoutes.size ();
}
void
GlobalRouter::RemoveInjectedRoute (uint32_t index)
{
- NS_LOG_FUNCTION (index);
+ NS_LOG_FUNCTION (this << index);
NS_ASSERT (index < m_injectedRoutes.size ());
uint32_t tmp = 0;
for (InjectedRoutesI i = m_injectedRoutes.begin (); i != m_injectedRoutes.end (); i++)
@@ -1567,7 +1571,7 @@
bool
GlobalRouter::WithdrawRoute (Ipv4Address network, Ipv4Mask networkMask)
{
- NS_LOG_FUNCTION (network << networkMask);
+ NS_LOG_FUNCTION (this << network << networkMask);
for (InjectedRoutesI i = m_injectedRoutes.begin (); i != m_injectedRoutes.end (); i++)
{
if ((*i)->GetDestNetwork () == network && (*i)->GetDestNetworkMask () == networkMask)
@@ -1589,7 +1593,7 @@
Ptr<NetDevice>
GlobalRouter::GetAdjacent (Ptr<NetDevice> nd, Ptr<Channel> ch) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << nd << ch);
NS_ASSERT_MSG (ch->GetNDevices () == 2, "GlobalRouter::GetAdjacent (): Channel with other than two devices");
//
// This is a point to point channel with two endpoints. Get both of them.
@@ -1627,7 +1631,7 @@
bool
GlobalRouter::FindInterfaceForDevice (Ptr<Node> node, Ptr<NetDevice> nd, uint32_t &index) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << node << nd << &index);
NS_LOG_LOGIC ("For node " << node->GetId () << " for net device " << nd );
Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
@@ -1657,7 +1661,7 @@
Ptr<BridgeNetDevice>
GlobalRouter::NetDeviceIsBridged (Ptr<NetDevice> nd) const
{
- NS_LOG_FUNCTION (nd);
+ NS_LOG_FUNCTION (this << nd);
Ptr<Node> node = nd->GetNode ();
uint32_t nDevices = node->GetNDevices ();
--- a/src/internet/model/icmpv4-l4-protocol.cc Fri Apr 19 22:39:55 2013 +0200
+++ b/src/internet/model/icmpv4-l4-protocol.cc Sat Apr 20 00:29:36 2013 +0200
@@ -31,15 +31,18 @@
Icmpv4L4Protocol::Icmpv4L4Protocol ()
: m_node (0)
{
+ NS_LOG_FUNCTION (this);
}
Icmpv4L4Protocol::~Icmpv4L4Protocol ()
{
+ NS_LOG_FUNCTION (this);
NS_ASSERT (m_node == 0);
}
void
Icmpv4L4Protocol::SetNode (Ptr<Node> node)
{
+ NS_LOG_FUNCTION (this << node);
m_node = node;
}
@@ -51,6 +54,7 @@
void
Icmpv4L4Protocol::NotifyNewAggregate ()
{
+ NS_LOG_FUNCTION (this);
if (m_node == 0)
{
Ptr<Node> node = this->GetObject<Node> ();
@@ -73,17 +77,20 @@
uint16_t
Icmpv4L4Protocol::GetStaticProtocolNumber (void)
{
+ NS_LOG_FUNCTION_NOARGS ();
return PROT_NUMBER;
}
int
Icmpv4L4Protocol::GetProtocolNumber (void) const
{
+ NS_LOG_FUNCTION (this);
return PROT_NUMBER;
}
void
Icmpv4L4Protocol::SendMessage (Ptr<Packet> packet, Ipv4Address dest, uint8_t type, uint8_t code)
{
+ NS_LOG_FUNCTION (this << packet << dest << static_cast<uint32_t> (type) << static_cast<uint32_t> (code));
Ptr<Ipv4> ipv4 = m_node->GetObject<Ipv4> ();
NS_ASSERT (ipv4 != 0 && ipv4->GetRoutingProtocol () != 0);
Ipv4Header header;
@@ -108,6 +115,7 @@
void
Icmpv4L4Protocol::SendMessage (Ptr<Packet> packet, Ipv4Address source, Ipv4Address dest, uint8_t type, uint8_t code, Ptr<Ipv4Route> route)
{
+ NS_LOG_FUNCTION (this << packet << source << dest << static_cast<uint32_t> (type) << static_cast<uint32_t> (code) << route);
Icmpv4Header icmp;
icmp.SetType (type);
icmp.SetCode (code);
@@ -179,6 +187,8 @@
uint32_t info, Ipv4Header ipHeader,
const uint8_t payload[8])
{
+ NS_LOG_FUNCTION (this << source << icmp << info << ipHeader << payload);
+
Ptr<Ipv4> ipv4 = m_node->GetObject<Ipv4> ();
Ptr<IpL4Protocol> l4 = ipv4->GetProtocol (ipHeader.GetProtocol ());
if (l4 != 0)
@@ -264,23 +274,27 @@
void
Icmpv4L4Protocol::SetDownTarget (IpL4Protocol::DownTargetCallback callback)
{
+ NS_LOG_FUNCTION (this << &callback);
m_downTarget = callback;
}
void
Icmpv4L4Protocol::SetDownTarget6 (IpL4Protocol::DownTargetCallback6 callback)
{
+ NS_LOG_FUNCTION (this << &callback);
}
IpL4Protocol::DownTargetCallback
Icmpv4L4Protocol::GetDownTarget (void) const
{
+ NS_LOG_FUNCTION (this);
return m_downTarget;
}
IpL4Protocol::DownTargetCallback6
Icmpv4L4Protocol::GetDownTarget6 (void) const
{
+ NS_LOG_FUNCTION (this);
return (IpL4Protocol::DownTargetCallback6)NULL;
}
--- a/src/internet/model/icmpv4.cc Fri Apr 19 22:39:55 2013 +0200
+++ b/src/internet/model/icmpv4.cc Sat Apr 20 00:29:36 2013 +0200
@@ -20,6 +20,9 @@
#include "icmpv4.h"
#include "ns3/packet.h"
+#include "ns3/log.h"
+
+NS_LOG_COMPONENT_DEFINE ("Icmpv4Header");
namespace ns3 {
@@ -43,28 +46,34 @@
m_code (0),
m_calcChecksum (false)
{
+ NS_LOG_FUNCTION (this);
}
Icmpv4Header::~Icmpv4Header ()
{
+ NS_LOG_FUNCTION (this);
}
void
Icmpv4Header::EnableChecksum (void)
{
+ NS_LOG_FUNCTION (this);
m_calcChecksum = true;
}
TypeId
Icmpv4Header::GetInstanceTypeId (void) const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
uint32_t
Icmpv4Header::GetSerializedSize (void) const
{
+ NS_LOG_FUNCTION (this);
return 4;
}
void
Icmpv4Header::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
i.WriteU8 (m_type);
i.WriteU8 (m_code);
@@ -82,6 +91,7 @@
uint32_t
Icmpv4Header::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
m_type = start.ReadU8 ();
m_code = start.ReadU8 ();
start.Next (2); // uint16_t checksum = start.ReadNtohU16 ();
@@ -90,27 +100,32 @@
void
Icmpv4Header::Print (std::ostream &os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "type=" << (uint32_t)m_type << ", code=" << (uint32_t)m_code;
}
void
Icmpv4Header::SetType (uint8_t type)
{
+ NS_LOG_FUNCTION (this << static_cast<uint32_t> (type));
m_type = type;
}
void
Icmpv4Header::SetCode (uint8_t code)
{
+ NS_LOG_FUNCTION (this << static_cast<uint32_t> (code));
m_code = code;
}
uint8_t
Icmpv4Header::GetType (void) const
{
+ NS_LOG_FUNCTION (this);
return m_type;
}
uint8_t
Icmpv4Header::GetCode (void) const
{
+ NS_LOG_FUNCTION (this);
return m_code;
}
@@ -123,16 +138,20 @@
void
Icmpv4Echo::SetIdentifier (uint16_t id)
{
+ NS_LOG_FUNCTION (this << id);
m_identifier = id;
}
void
Icmpv4Echo::SetSequenceNumber (uint16_t seq)
{
+ NS_LOG_FUNCTION (this << seq);
m_sequence = seq;
}
void
Icmpv4Echo::SetData (Ptr<const Packet> data)
{
+ NS_LOG_FUNCTION (this << *data);
+
uint32_t size = data->GetSize ();
//
// All kinds of optimizations are possible, but let's not get carried away
@@ -152,21 +171,25 @@
uint16_t
Icmpv4Echo::GetIdentifier (void) const
{
+ NS_LOG_FUNCTION (this);
return m_identifier;
}
uint16_t
Icmpv4Echo::GetSequenceNumber (void) const
{
+ NS_LOG_FUNCTION (this);
return m_sequence;
}
uint32_t
Icmpv4Echo::GetDataSize (void) const
{
+ NS_LOG_FUNCTION (this);
return m_dataSize;
}
uint32_t
Icmpv4Echo::GetData (uint8_t payload[]) const
{
+ NS_LOG_FUNCTION (this << payload);
memcpy (payload, m_data, m_dataSize);
return m_dataSize;
}
@@ -184,6 +207,7 @@
m_sequence (0),
m_dataSize (0)
{
+ NS_LOG_FUNCTION (this);
//
// After construction, m_data is always valid until destruction. This is true
// even if m_dataSize is zero.
@@ -192,6 +216,7 @@
}
Icmpv4Echo::~Icmpv4Echo ()
{
+ NS_LOG_FUNCTION (this);
delete [] m_data;
m_data = 0;
m_dataSize = 0;
@@ -199,16 +224,19 @@
TypeId
Icmpv4Echo::GetInstanceTypeId (void) const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
uint32_t
Icmpv4Echo::GetSerializedSize (void) const
{
+ NS_LOG_FUNCTION (this);
return 4 + m_dataSize;
}
void
Icmpv4Echo::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
start.WriteHtonU16 (m_identifier);
start.WriteHtonU16 (m_sequence);
start.Write (m_data, m_dataSize);
@@ -216,6 +244,7 @@
uint32_t
Icmpv4Echo::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
m_identifier = start.ReadNtohU16 ();
m_sequence = start.ReadNtohU16 ();
NS_ASSERT (start.GetSize () >= 4);
@@ -232,6 +261,7 @@
void
Icmpv4Echo::Print (std::ostream &os) const
{
+ NS_LOG_FUNCTION (this << &os);
os << "identifier=" << m_identifier << ", sequence=" << m_sequence;
}
@@ -253,6 +283,7 @@
}
Icmpv4DestinationUnreachable::Icmpv4DestinationUnreachable ()
{
+ NS_LOG_FUNCTION (this);
// make sure that thing is initialized to get initialized bytes
// when the ip payload's size is smaller than 8 bytes.
for (uint8_t j = 0; j < 8; j++)
@@ -264,32 +295,38 @@
void
Icmpv4DestinationUnreachable::SetNextHopMtu (uint16_t mtu)
{
+ NS_LOG_FUNCTION (this << mtu);
m_nextHopMtu = mtu;
}
uint16_t
Icmpv4DestinationUnreachable::GetNextHopMtu (void) const
{
+ NS_LOG_FUNCTION (this);
return m_nextHopMtu;
}
void
Icmpv4DestinationUnreachable::SetData (Ptr<const Packet> data)
{
+ NS_LOG_FUNCTION (this << *data);
data->CopyData (m_data, 8);
}
void
Icmpv4DestinationUnreachable::SetHeader (Ipv4Header header)
{
+ NS_LOG_FUNCTION (this << header);
m_header = header;
}
void
Icmpv4DestinationUnreachable::GetData (uint8_t payload[8]) const
{
+ NS_LOG_FUNCTION (this << payload);
memcpy (payload, m_data, 8);
}
Ipv4Header
Icmpv4DestinationUnreachable::GetHeader (void) const
{
+ NS_LOG_FUNCTION (this);
return m_header;
}
@@ -300,16 +337,19 @@
TypeId
Icmpv4DestinationUnreachable::GetInstanceTypeId (void) const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
uint32_t
Icmpv4DestinationUnreachable::GetSerializedSize (void) const
{
+ NS_LOG_FUNCTION (this);
return 4 + m_header.GetSerializedSize () + 8;
}
void
Icmpv4DestinationUnreachable::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
start.WriteU16 (0);
start.WriteHtonU16 (m_nextHopMtu);
uint32_t size = m_header.GetSerializedSize ();
@@ -321,6 +361,7 @@
uint32_t
Icmpv4DestinationUnreachable::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
i.Next (2);
m_nextHopMtu = i.ReadNtohU16 ();
@@ -335,6 +376,7 @@
void
Icmpv4DestinationUnreachable::Print (std::ostream &os) const
{
+ NS_LOG_FUNCTION (this << &os);
m_header.Print (os);
os << " org data=";
for (uint8_t i = 0; i < 8; i++)
@@ -364,6 +406,7 @@
}
Icmpv4TimeExceeded::Icmpv4TimeExceeded ()
{
+ NS_LOG_FUNCTION (this);
// make sure that thing is initialized to get initialized bytes
// when the ip payload's size is smaller than 8 bytes.
for (uint8_t j = 0; j < 8; j++)
@@ -376,41 +419,49 @@
void
Icmpv4TimeExceeded::SetData (Ptr<const Packet> data)
{
+ NS_LOG_FUNCTION (this << *data);
data->CopyData (m_data, 8);
}
void
Icmpv4TimeExceeded::SetHeader (Ipv4Header header)
{
+ NS_LOG_FUNCTION (this << header);
m_header = header;
}
void
Icmpv4TimeExceeded::GetData (uint8_t payload[8]) const
{
+ NS_LOG_FUNCTION (this << payload);
memcpy (payload, m_data, 8);
}
Ipv4Header
Icmpv4TimeExceeded::GetHeader (void) const
{
+ NS_LOG_FUNCTION (this);
return m_header;
}
Icmpv4TimeExceeded::~Icmpv4TimeExceeded ()
{
+ NS_LOG_FUNCTION (this);
}
TypeId
Icmpv4TimeExceeded::GetInstanceTypeId (void) const
{
+ NS_LOG_FUNCTION (this);
return GetTypeId ();
}
uint32_t
Icmpv4TimeExceeded::GetSerializedSize (void) const
{
+ NS_LOG_FUNCTION (this);
return 4 + m_header.GetSerializedSize () + 8;
}
void
Icmpv4TimeExceeded::Serialize (Buffer::Iterator start) const
{
+ NS_LOG_FUNCTION (this << &start);
start.WriteU32 (0);
uint32_t size = m_header.GetSerializedSize ();
m_header.Serialize (start);
@@ -421,6 +472,7 @@
uint32_t
Icmpv4TimeExceeded::Deserialize (Buffer::Iterator start)
{
+ NS_LOG_FUNCTION (this << &start);
Buffer::Iterator i = start;
i.Next (4);
uint32_t read = m_header.Deserialize (i);
@@ -434,6 +486,7 @@
void
Icmpv4TimeExceeded::Print (std::ostream &os) const
{
+ NS_LOG_FUNCTION (this << &os);
m_header.Print (os);
os << " org data=";
for (uint8_t i = 0; i < 8; i++)
--- 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 ());
--- a/src/internet/model/icmpv6-l4-protocol.cc Fri Apr 19 22:39:55 2013 +0200
+++ b/src/internet/model/icmpv6-l4-protocol.cc Sat Apr 20 00:29:36 2013 +0200
@@ -79,17 +79,17 @@
Icmpv6L4Protocol::Icmpv6L4Protocol ()
: m_node (0)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
}
Icmpv6L4Protocol::~Icmpv6L4Protocol ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
}
void Icmpv6L4Protocol::DoDispose ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
for (CacheList::const_iterator it = m_cacheList.begin (); it != m_cacheList.end (); it++)
{
Ptr<NdiscCache> cache = *it;
@@ -105,7 +105,7 @@
void Icmpv6L4Protocol::NotifyNewAggregate ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
if (m_node == 0)
{
Ptr<Node> node = this->GetObject<Node> ();
@@ -139,18 +139,19 @@
int Icmpv6L4Protocol::GetProtocolNumber () const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return PROT_NUMBER;
}
int Icmpv6L4Protocol::GetVersion () const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return 1;
}
bool Icmpv6L4Protocol::IsAlwaysDad () const
{
+ NS_LOG_FUNCTION (this);
return m_alwaysDad;
}
--- a/src/internet/model/ipv4-global-routing.cc Fri Apr 19 22:39:55 2013 +0200
+++ b/src/internet/model/ipv4-global-routing.cc Sat Apr 20 00:29:36 2013 +0200
@@ -59,14 +59,14 @@
: m_randomEcmpRouting (false),
m_respondToInterfaceEvents (false)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
m_rand = CreateObject<UniformRandomVariable> ();
}
Ipv4GlobalRouting::~Ipv4GlobalRouting ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
}
void
@@ -74,7 +74,7 @@
Ipv4Address nextHop,
uint32_t interface)
{
- NS_LOG_FUNCTION (dest << nextHop << interface);
+ NS_LOG_FUNCTION (this << dest << nextHop << interface);
Ipv4RoutingTableEntry *route = new Ipv4RoutingTableEntry ();
*route = Ipv4RoutingTableEntry::CreateHostRouteTo (dest, nextHop, interface);
m_hostRoutes.push_back (route);
@@ -84,7 +84,7 @@
Ipv4GlobalRouting::AddHostRouteTo (Ipv4Address dest,
uint32_t interface)
{
- NS_LOG_FUNCTION (dest << interface);
+ NS_LOG_FUNCTION (this << dest << interface);
Ipv4RoutingTableEntry *route = new Ipv4RoutingTableEntry ();
*route = Ipv4RoutingTableEntry::CreateHostRouteTo (dest, interface);
m_hostRoutes.push_back (route);
@@ -96,7 +96,7 @@
Ipv4Address nextHop,
uint32_t interface)
{
- NS_LOG_FUNCTION (network << networkMask << nextHop << interface);
+ NS_LOG_FUNCTION (this << network << networkMask << nextHop << interface);
Ipv4RoutingTableEntry *route = new Ipv4RoutingTableEntry ();
*route = Ipv4RoutingTableEntry::CreateNetworkRouteTo (network,
networkMask,
@@ -110,7 +110,7 @@
Ipv4Mask networkMask,
uint32_t interface)
{
- NS_LOG_FUNCTION (network << networkMask << interface);
+ NS_LOG_FUNCTION (this << network << networkMask << interface);
Ipv4RoutingTableEntry *route = new Ipv4RoutingTableEntry ();
*route = Ipv4RoutingTableEntry::CreateNetworkRouteTo (network,
networkMask,
@@ -124,7 +124,7 @@
Ipv4Address nextHop,
uint32_t interface)
{
- NS_LOG_FUNCTION (network << networkMask << nextHop);
+ NS_LOG_FUNCTION (this << network << networkMask << nextHop);
Ipv4RoutingTableEntry *route = new Ipv4RoutingTableEntry ();
*route = Ipv4RoutingTableEntry::CreateNetworkRouteTo (network,
networkMask,
@@ -137,7 +137,7 @@
Ptr<Ipv4Route>
Ipv4GlobalRouting::LookupGlobal (Ipv4Address dest, Ptr<NetDevice> oif)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << dest << oif);
NS_LOG_LOGIC ("Looking for route for destination " << dest);
Ptr<Ipv4Route> rtentry = 0;
// store all available routes that bring packets to their destination
@@ -246,7 +246,7 @@
uint32_t
Ipv4GlobalRouting::GetNRoutes (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
uint32_t n = 0;
n += m_hostRoutes.size ();
n += m_networkRoutes.size ();
@@ -257,7 +257,7 @@
Ipv4RoutingTableEntry *
Ipv4GlobalRouting::GetRoute (uint32_t index) const
{
- NS_LOG_FUNCTION (index);
+ NS_LOG_FUNCTION (this << index);
if (index < m_hostRoutes.size ())
{
uint32_t tmp = 0;
@@ -306,7 +306,7 @@
void
Ipv4GlobalRouting::RemoveRoute (uint32_t index)
{
- NS_LOG_FUNCTION (index);
+ NS_LOG_FUNCTION (this << index);
if (index < m_hostRoutes.size ())
{
uint32_t tmp = 0;
@@ -371,7 +371,7 @@
void
Ipv4GlobalRouting::DoDispose (void)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
for (HostRoutesI i = m_hostRoutes.begin ();
i != m_hostRoutes.end ();
i = m_hostRoutes.erase (i))