diff --git a/src/applications/onoff/onoff-application.cc b/src/applications/onoff/onoff-application.cc index 2d9ada4f8..5542b9bb9 100644 --- a/src/applications/onoff/onoff-application.cc +++ b/src/applications/onoff/onoff-application.cc @@ -91,7 +91,7 @@ OnOffApplication::GetTypeId (void) OnOffApplication::OnOffApplication () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_socket = 0; m_connected = false; m_residualBits = 0; @@ -101,14 +101,13 @@ OnOffApplication::OnOffApplication () OnOffApplication::~OnOffApplication() { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void OnOffApplication::SetMaxBytes(uint32_t maxBytes) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << maxBytes); + NS_LOG_FUNCTION (this << maxBytes); m_maxBytes = maxBytes; } @@ -116,7 +115,7 @@ OnOffApplication::SetMaxBytes(uint32_t maxBytes) void OnOffApplication::DoDispose (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_socket = 0; // chain up @@ -126,7 +125,7 @@ OnOffApplication::DoDispose (void) // Application Methods void OnOffApplication::StartApplication() // Called at time specified by Start { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // Create the socket if not already if (!m_socket) @@ -146,7 +145,7 @@ void OnOffApplication::StartApplication() // Called at time specified by Start void OnOffApplication::StopApplication() // Called at time specified by Stop { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_sendEvent.IsRunning ()) { // Cancel the pending send packet event @@ -161,14 +160,14 @@ void OnOffApplication::StopApplication() // Called at time specified by Stop // Event handlers void OnOffApplication::StartSending() { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); ScheduleNextTx(); // Schedule the send packet event } void OnOffApplication::StopSending() { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Simulator::Cancel(m_sendEvent); } @@ -176,7 +175,7 @@ void OnOffApplication::StopSending() // Private helpers void OnOffApplication::ScheduleNextTx() { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_maxBytes == 0 || m_totBytes < m_maxBytes) { @@ -196,7 +195,7 @@ void OnOffApplication::ScheduleNextTx() void OnOffApplication::ScheduleStartEvent() { // Schedules the event to start sending data (switch to the "On" state) - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Time offInterval = Seconds(m_offTime.GetValue()); NS_LOG_LOGIC ("start at " << offInterval); @@ -205,7 +204,7 @@ void OnOffApplication::ScheduleStartEvent() void OnOffApplication::ScheduleStopEvent() { // Schedules the event to stop sending data (switch to "Off" state) - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Time onInterval = Seconds(m_onTime.GetValue()); NS_LOG_LOGIC ("stop at " << onInterval); @@ -215,7 +214,7 @@ void OnOffApplication::ScheduleStopEvent() void OnOffApplication::SendPacket() { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC ("sending packet at " << Simulator::Now()); NS_ASSERT (m_sendEvent.IsExpired ()); Ptr packet = Create (m_pktSize); @@ -229,7 +228,7 @@ void OnOffApplication::SendPacket() void OnOffApplication::ConnectionSucceeded(Ptr) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_connected = true; ScheduleStartEvent(); @@ -237,7 +236,7 @@ void OnOffApplication::ConnectionSucceeded(Ptr) void OnOffApplication::ConnectionFailed(Ptr) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); cout << "OnOffApplication, Connection Failed" << endl; } diff --git a/src/applications/udp-echo/udp-echo-client.cc b/src/applications/udp-echo/udp-echo-client.cc index 5bbf56c80..a26085c65 100644 --- a/src/applications/udp-echo/udp-echo-client.cc +++ b/src/applications/udp-echo/udp-echo-client.cc @@ -63,7 +63,7 @@ UdpEchoClient::GetTypeId (void) UdpEchoClient::UdpEchoClient () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_sent = 0; m_socket = 0; m_sendEvent = EventId (); @@ -71,7 +71,7 @@ UdpEchoClient::UdpEchoClient () UdpEchoClient::~UdpEchoClient() { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void @@ -84,14 +84,14 @@ UdpEchoClient::SetRemote (Ipv4Address ip, uint16_t port) void UdpEchoClient::DoDispose (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Application::DoDispose (); } void UdpEchoClient::StartApplication (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_socket) { @@ -111,7 +111,7 @@ UdpEchoClient::StartApplication (void) void UdpEchoClient::StopApplication () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_socket) { @@ -125,14 +125,14 @@ UdpEchoClient::StopApplication () void UdpEchoClient::ScheduleTransmit (Time dt) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_sendEvent = Simulator::Schedule(dt, &UdpEchoClient::Send, this); } void UdpEchoClient::Send (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_ASSERT (m_sendEvent.IsExpired ()); @@ -154,8 +154,7 @@ UdpEchoClient::Receive( Ptr packet, const Address &from) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << socket << packet << from); + NS_LOG_FUNCTION (this << socket << packet << from); if (InetSocketAddress::IsMatchingType (from)) { diff --git a/src/applications/udp-echo/udp-echo-server.cc b/src/applications/udp-echo/udp-echo-server.cc index c188dcc0e..6ae38a86d 100644 --- a/src/applications/udp-echo/udp-echo-server.cc +++ b/src/applications/udp-echo/udp-echo-server.cc @@ -49,25 +49,25 @@ UdpEchoServer::GetTypeId (void) UdpEchoServer::UdpEchoServer () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } UdpEchoServer::~UdpEchoServer() { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void UdpEchoServer::DoDispose (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Application::DoDispose (); } void UdpEchoServer::StartApplication (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_socket) { @@ -85,7 +85,7 @@ UdpEchoServer::StartApplication (void) void UdpEchoServer::StopApplication () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_socket) { @@ -100,8 +100,7 @@ UdpEchoServer::Receive( Ptr packet, const Address &from) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << socket << packet << from); + NS_LOG_FUNCTION (this << socket << packet << from); if (InetSocketAddress::IsMatchingType (from)) { diff --git a/src/common/error-model.cc b/src/common/error-model.cc index 4796b473b..9de7a838b 100644 --- a/src/common/error-model.cc +++ b/src/common/error-model.cc @@ -52,18 +52,18 @@ TypeId ErrorModel::GetTypeId (void) ErrorModel::ErrorModel () : m_enable (true) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } ErrorModel::~ErrorModel () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } bool ErrorModel::IsCorrupt (Ptr p) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); bool result; // Insert any pre-conditions here result = DoCorrupt (p); @@ -74,28 +74,28 @@ ErrorModel::IsCorrupt (Ptr p) void ErrorModel::Reset (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); DoReset (); } void ErrorModel::Enable (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_enable = true; } void ErrorModel::Disable (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_enable = false; } bool ErrorModel::IsEnabled (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_enable; } @@ -131,53 +131,53 @@ TypeId RateErrorModel::GetTypeId (void) RateErrorModel::RateErrorModel () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } RateErrorModel::~RateErrorModel () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } enum ErrorUnit RateErrorModel::GetUnit (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_unit; } void RateErrorModel::SetUnit (enum ErrorUnit error_unit) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_unit = error_unit; } double RateErrorModel::GetRate (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_rate; } void RateErrorModel::SetRate (double rate) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_rate = rate; } void RateErrorModel::SetRandomVariable (const RandomVariable &ranvar) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_ranvar = ranvar; } bool RateErrorModel::DoCorrupt (Ptr p) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_enable) { return false; @@ -200,14 +200,14 @@ RateErrorModel::DoCorrupt (Ptr p) bool RateErrorModel::DoCorruptPkt (Ptr p) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return (m_ranvar.GetValue () < m_rate); } bool RateErrorModel::DoCorruptByte (Ptr p) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // compute pkt error rate, assume uniformly distributed byte error double per = 1 - pow (1.0 - m_rate, p->GetSize ()); return (m_ranvar.GetValue () < per); @@ -216,7 +216,7 @@ RateErrorModel::DoCorruptByte (Ptr p) bool RateErrorModel::DoCorruptBit(Ptr p) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // compute pkt error rate, assume uniformly distributed bit error double per = 1 - pow (1.0 - m_rate, (8 * p->GetSize ()) ); return (m_ranvar.GetValue () < per); @@ -225,7 +225,7 @@ RateErrorModel::DoCorruptBit(Ptr p) void RateErrorModel::DoReset (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); /* re-initialize any state; no-op for now */ } @@ -246,25 +246,25 @@ TypeId ListErrorModel::GetTypeId (void) ListErrorModel::ListErrorModel () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } ListErrorModel::~ListErrorModel () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } std::list ListErrorModel::GetList (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_packetList; } void ListErrorModel::SetList (const std::list &packetlist) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_packetList = packetlist; } @@ -274,7 +274,7 @@ ListErrorModel::SetList (const std::list &packetlist) bool ListErrorModel::DoCorrupt (Ptr p) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_enable) { return false; @@ -294,7 +294,7 @@ ListErrorModel::DoCorrupt (Ptr p) void ListErrorModel::DoReset (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_packetList.clear(); } diff --git a/src/common/packet-metadata.cc b/src/common/packet-metadata.cc index 103061d81..0582577ef 100644 --- a/src/common/packet-metadata.cc +++ b/src/common/packet-metadata.cc @@ -649,7 +649,7 @@ PacketMetadata::DoAddHeader (uint32_t uid, uint32_t size) m_metadataSkipped = true; return; } - NS_LOG_PARAMS ("uid=" << uid << "size=" << size << ""); + NS_LOG_FUNCTION ("uid=" << uid << "size=" << size << ""); struct PacketMetadata::SmallItem item; item.next = m_head; @@ -670,7 +670,7 @@ PacketMetadata::RemoveHeader (const Header &header, uint32_t size) m_metadataSkipped = true; return; } - NS_LOG_PARAMS ("(uid=" << uid << ", size=" << size << ")"); + NS_LOG_FUNCTION ("(uid=" << uid << ", size=" << size << ")"); struct PacketMetadata::SmallItem item; struct PacketMetadata::ExtraItem extraItem; uint32_t read = ReadItems (m_head, &item, &extraItem); @@ -708,7 +708,7 @@ PacketMetadata::AddTrailer (const Trailer &trailer, uint32_t size) m_metadataSkipped = true; return; } - NS_LOG_PARAMS ("(uid=" << uid << ", size=" << size << ")"); + NS_LOG_FUNCTION ("(uid=" << uid << ", size=" << size << ")"); struct PacketMetadata::SmallItem item; item.next = 0xffff; item.prev = m_tail; @@ -728,7 +728,7 @@ PacketMetadata::RemoveTrailer (const Trailer &trailer, uint32_t size) m_metadataSkipped = true; return; } - NS_LOG_PARAMS ("(uid=" << uid << ", size=" << size << ")"); + NS_LOG_FUNCTION ("(uid=" << uid << ", size=" << size << ")"); struct PacketMetadata::SmallItem item; struct PacketMetadata::ExtraItem extraItem; uint32_t read = ReadItems (m_tail, &item, &extraItem); diff --git a/src/core/log.cc b/src/core/log.cc index 8d0c45ac5..d15c0aab7 100644 --- a/src/core/log.cc +++ b/src/core/log.cc @@ -162,10 +162,6 @@ LogComponent::EnvVarCheck (char const * name) { level |= LOG_FUNCTION; } - else if (lev == "param") - { - level |= LOG_PARAM; - } else if (lev == "logic") { level |= LOG_LOGIC; @@ -202,10 +198,6 @@ LogComponent::EnvVarCheck (char const * name) { level |= LOG_LEVEL_FUNCTION; } - else if (lev == "level_param") - { - level |= LOG_LEVEL_PARAM; - } else if (lev == "level_logic") { level |= LOG_LEVEL_LOGIC; @@ -347,10 +339,6 @@ LogComponentPrintList (void) { std::cout << "|function"; } - if (i->second->IsEnabled (LOG_PARAM)) - { - std::cout << "|param"; - } if (i->second->IsEnabled (LOG_LOGIC)) { std::cout << "|logic"; diff --git a/src/core/log.h b/src/core/log.h index e5471e533..a7faf99de 100644 --- a/src/core/log.h +++ b/src/core/log.h @@ -40,20 +40,18 @@ * * Use the environment variable NS_LOG to define a ':'-separated list of * logging components to enable. For example (using bash syntax), - * NS_LOG="OlsrAgent" would enable one component; - * NS_LOG="OlsrAgent:Ipv4L3Protocol" would enable two - * components, etc. NS_LOG="*" will enable all available log components at - * all levels. + * NS_LOG="OlsrAgent" would enable one component at all log levels. + * NS_LOG="OlsrAgent:Ipv4L3Protocol" would enable two components, + * at all log levels, etc. + * NS_LOG="*" will enable all available log components at all levels. * - * To obtain more components than just debug log level, more components - * can be enabled selectively with the following - * syntax: NS_LOG='Component1=func|param|warn:Component2=error|debug' - * This example would enable the 'func', 'param', and 'warn' log + * To control more selectively the log levels for each component, use + * this syntax: NS_LOG='Component1=func|warn:Component2=error|debug' + * This example would enable the 'func', and 'warn' log * levels for 'Component1' and the 'error' and 'debug' log levels * for 'Component2'. The wildcard can be used here as well. For example * NS_LOG='*=level_all|prefix' would enable all log levels and prefix all * prints with the component and function names. - * */ /** @@ -157,7 +155,7 @@ * * Output the name of the function. */ -#define NS_LOG_FUNCTION \ +#define NS_LOG_FUNCTION_NOARGS() \ do \ { \ if (g_log.IsEnabled (ns3::LOG_FUNCTION)) \ @@ -174,22 +172,22 @@ * \ingroup logging * \param parameters the parameters to output. * - * If log level LOG_PARAM is enabled, this macro will output + * If log level LOG_FUNCTION is enabled, this macro will output * all input parameters separated by ", ". * * Typical usage looks like: * \code - * NS_LOG_PARAMS (aNumber< device) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << device); + NS_LOG_FUNCTION (this << device); NS_ASSERT(device != 0); CsmaDeviceRec rec(device); @@ -92,8 +91,7 @@ CsmaChannel::Attach(Ptr device) bool CsmaChannel::Reattach(Ptr device) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << device); + NS_LOG_FUNCTION (this << device); NS_ASSERT(device != 0); std::vector::iterator it; @@ -118,8 +116,7 @@ CsmaChannel::Reattach(Ptr device) bool CsmaChannel::Reattach(uint32_t deviceId) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << deviceId); + NS_LOG_FUNCTION (this << deviceId); if (deviceId < m_deviceList.size()) { @@ -140,8 +137,7 @@ CsmaChannel::Reattach(uint32_t deviceId) bool CsmaChannel::Detach(uint32_t deviceId) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << deviceId); + NS_LOG_FUNCTION (this << deviceId); if (deviceId < m_deviceList.size()) { @@ -171,8 +167,7 @@ CsmaChannel::Detach(uint32_t deviceId) bool CsmaChannel::Detach(Ptr device) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << device); + NS_LOG_FUNCTION (this << device); NS_ASSERT(device != 0); std::vector::iterator it; @@ -190,8 +185,7 @@ CsmaChannel::Detach(Ptr device) bool CsmaChannel::TransmitStart(Ptr p, uint32_t srcId) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p << srcId); + NS_LOG_FUNCTION (this << p << srcId); NS_LOG_INFO ("UID is " << p->GetUid () << ")"); if (m_state != IDLE) @@ -222,8 +216,7 @@ CsmaChannel::IsActive(uint32_t deviceId) bool CsmaChannel::TransmitEnd() { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << m_currentPkt << m_currentSrc); + NS_LOG_FUNCTION (this << m_currentPkt << m_currentSrc); NS_LOG_INFO ("UID is " << m_currentPkt->GetUid () << ")"); NS_ASSERT(m_state == TRANSMITTING); @@ -248,8 +241,7 @@ CsmaChannel::TransmitEnd() void CsmaChannel::PropagationCompleteEvent() { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << m_currentPkt); + NS_LOG_FUNCTION (this << m_currentPkt); NS_LOG_INFO ("UID is " << m_currentPkt->GetUid () << ")"); NS_ASSERT(m_state == PROPAGATING); diff --git a/src/devices/csma/csma-net-device.cc b/src/devices/csma/csma-net-device.cc index 6ea4ee01d..25f65e6f5 100644 --- a/src/devices/csma/csma-net-device.cc +++ b/src/devices/csma/csma-net-device.cc @@ -88,8 +88,7 @@ CsmaNetDevice::CsmaNetDevice () m_linkUp (false), m_mtu (0xffff) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this); + NS_LOG_FUNCTION (this); m_txMachineState = READY; m_tInterframeGap = Seconds(0); m_channel = 0; @@ -97,14 +96,14 @@ CsmaNetDevice::CsmaNetDevice () CsmaNetDevice::~CsmaNetDevice() { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_queue = 0; } void CsmaNetDevice::DoDispose () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_channel = 0; m_node = 0; NetDevice::DoDispose (); @@ -119,35 +118,35 @@ CsmaNetDevice::SetAddress (Mac48Address self) void CsmaNetDevice::SetSendEnable (bool sendEnable) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_sendEnable = sendEnable; } void CsmaNetDevice::SetReceiveEnable (bool receiveEnable) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_receiveEnable = receiveEnable; } bool CsmaNetDevice::IsSendEnabled (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return (m_sendEnable); } bool CsmaNetDevice::IsReceiveEnabled (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return (m_receiveEnable); } void CsmaNetDevice::SetDataRate (DataRate bps) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_channel || bps <= m_channel->GetDataRate ()) { m_bps = bps; @@ -157,7 +156,7 @@ CsmaNetDevice::SetDataRate (DataRate bps) void CsmaNetDevice::SetInterframeGap (Time t) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_tInterframeGap = t; } @@ -166,7 +165,7 @@ CsmaNetDevice::SetBackoffParams (Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t ceiling, uint32_t maxRetries) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_backoff.m_slotTime = slotTime; m_backoff.m_minSlots = minSlots; m_backoff.m_maxSlots = maxSlots; @@ -178,7 +177,7 @@ void CsmaNetDevice::AddHeader (Ptr p, Mac48Address dest, uint16_t protocolNumber) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_encapMode == RAW) { return; @@ -217,7 +216,7 @@ CsmaNetDevice::AddHeader (Ptr p, Mac48Address dest, bool CsmaNetDevice::ProcessHeader (Ptr p, uint16_t & param) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_encapMode == RAW) { return true; @@ -256,7 +255,7 @@ CsmaNetDevice::ProcessHeader (Ptr p, uint16_t & param) void CsmaNetDevice::TransmitStart () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC ("m_currentPkt=" << m_currentPkt); NS_LOG_LOGIC ("UID is " << m_currentPkt->GetUid ()); // @@ -323,7 +322,7 @@ CsmaNetDevice::TransmitStart () void CsmaNetDevice::TransmitAbort (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC ("Pkt UID is " << m_currentPkt->GetUid () << ")"); // Try to transmit a new packet @@ -337,7 +336,7 @@ CsmaNetDevice::TransmitAbort (void) void CsmaNetDevice::TransmitCompleteEvent (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // This function is called to finish the process of transmitting a packet. // We need to tell the channel that we've stopped wiggling the wire and @@ -363,7 +362,7 @@ CsmaNetDevice::TransmitCompleteEvent (void) void CsmaNetDevice::TransmitReadyEvent (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // This function is called to enable the transmitter after the interframe // gap has passed. If there are pending transmissions, we use this opportunity @@ -388,8 +387,7 @@ CsmaNetDevice::TransmitReadyEvent (void) bool CsmaNetDevice::Attach (Ptr ch) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << &ch); + NS_LOG_FUNCTION (this << &ch); m_channel = ch; @@ -407,16 +405,14 @@ CsmaNetDevice::Attach (Ptr ch) void CsmaNetDevice::AddQueue (Ptr q) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << q); + NS_LOG_FUNCTION (this << q); m_queue = q; } void CsmaNetDevice::AddReceiveErrorModel (Ptr em) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (em); + NS_LOG_FUNCTION (em); m_receiveErrorModel = em; } @@ -424,7 +420,7 @@ void CsmaNetDevice::AddReceiveErrorModel (Ptr em) void CsmaNetDevice::Receive (Ptr packet) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); EthernetHeader header (false); EthernetTrailer trailer; @@ -522,7 +518,7 @@ CsmaNetDevice::Receive (Ptr packet) Ptr CsmaNetDevice::GetQueue(void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_queue; } @@ -610,8 +606,7 @@ CsmaNetDevice::GetMulticast (void) const Address CsmaNetDevice::MakeMulticastAddress (Ipv4Address multicastGroup) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << multicastGroup); + NS_LOG_FUNCTION (this << multicastGroup); // // First, get the generic multicast address. // @@ -667,7 +662,7 @@ CsmaNetDevice::IsPointToPoint (void) const bool CsmaNetDevice::Send(Ptr packet, const Address& dest, uint16_t protocolNumber) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC ("p=" << packet); NS_LOG_LOGIC ("UID is " << packet->GetUid () << ")"); diff --git a/src/devices/point-to-point/point-to-point-channel.cc b/src/devices/point-to-point/point-to-point-channel.cc index 5a055000d..85886c63a 100644 --- a/src/devices/point-to-point/point-to-point-channel.cc +++ b/src/devices/point-to-point/point-to-point-channel.cc @@ -56,14 +56,13 @@ PointToPointChannel::PointToPointChannel() Channel ("PointToPoint Channel"), m_nDevices(0) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void PointToPointChannel::Attach(Ptr device) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << device); + NS_LOG_FUNCTION (this << device); NS_ASSERT(m_nDevices < N_DEVICES && "Only two devices permitted"); NS_ASSERT(device != 0); @@ -86,8 +85,7 @@ PointToPointChannel::TransmitStart(Ptr p, Ptr src, const Time& txTime) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p << src); + NS_LOG_FUNCTION (this << p << src); NS_LOG_LOGIC ("UID is " << p->GetUid () << ")"); NS_ASSERT(m_link[0].m_state != INITIALIZING); @@ -107,14 +105,14 @@ PointToPointChannel::TransmitStart(Ptr p, uint32_t PointToPointChannel::GetNDevices (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_nDevices; } Ptr PointToPointChannel::GetPointToPointDevice (uint32_t i) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_ASSERT(i < 2); return m_link[i].m_src; } @@ -122,21 +120,21 @@ PointToPointChannel::GetPointToPointDevice (uint32_t i) const const DataRate& PointToPointChannel::GetDataRate (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_bps; } const Time& PointToPointChannel::GetDelay (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_delay; } Ptr PointToPointChannel::GetDevice (uint32_t i) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return GetPointToPointDevice (i); } diff --git a/src/devices/point-to-point/point-to-point-net-device.cc b/src/devices/point-to-point/point-to-point-net-device.cc index 49bbd8551..adb6e8f6f 100644 --- a/src/devices/point-to-point/point-to-point-net-device.cc +++ b/src/devices/point-to-point/point-to-point-net-device.cc @@ -79,8 +79,7 @@ PointToPointNetDevice::PointToPointNetDevice () m_linkUp (false), m_mtu (0xffff) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this); + NS_LOG_FUNCTION (this); } PointToPointNetDevice::~PointToPointNetDevice () @@ -95,7 +94,7 @@ PointToPointNetDevice::SetAddress (Mac48Address self) void PointToPointNetDevice::AddHeader(Ptr p, uint16_t protocolNumber) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); LlcSnapHeader llc; llc.SetType (protocolNumber); p->AddHeader (llc); @@ -104,7 +103,7 @@ PointToPointNetDevice::AddHeader(Ptr p, uint16_t protocolNumber) bool PointToPointNetDevice::ProcessHeader(Ptr p, uint16_t& param) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); LlcSnapHeader llc; p->RemoveHeader (llc); @@ -115,7 +114,7 @@ PointToPointNetDevice::ProcessHeader(Ptr p, uint16_t& param) void PointToPointNetDevice::DoDispose() { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_node = 0; m_channel = 0; m_receiveErrorModel = 0; @@ -124,7 +123,7 @@ void PointToPointNetDevice::DoDispose() void PointToPointNetDevice::SetDataRate(const DataRate& bps) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_channel || bps <= m_channel->GetDataRate ()) { m_bps = bps; @@ -133,15 +132,14 @@ void PointToPointNetDevice::SetDataRate(const DataRate& bps) void PointToPointNetDevice::SetInterframeGap(const Time& t) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_tInterframeGap = t; } bool PointToPointNetDevice::TransmitStart (Ptr p) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p); + NS_LOG_FUNCTION (this << p); NS_LOG_LOGIC ("UID is " << p->GetUid () << ")"); // // This function is called to start the process of transmitting a packet. @@ -164,7 +162,7 @@ PointToPointNetDevice::TransmitStart (Ptr p) void PointToPointNetDevice::TransmitComplete (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // This function is called to finish the process of transmitting a packet. // We need to tell the channel that we've stopped wiggling the wire and @@ -184,8 +182,7 @@ void PointToPointNetDevice::TransmitComplete (void) bool PointToPointNetDevice::Attach (Ptr ch) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << &ch); + NS_LOG_FUNCTION (this << &ch); m_channel = ch; @@ -211,24 +208,21 @@ PointToPointNetDevice::Attach (Ptr ch) void PointToPointNetDevice::AddQueue (Ptr q) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << q); + NS_LOG_FUNCTION (this << q); m_queue = q; } void PointToPointNetDevice::AddReceiveErrorModel (Ptr em) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS ("(" << em << ")"); + NS_LOG_FUNCTION ("(" << em << ")"); m_receiveErrorModel = em; } void PointToPointNetDevice::Receive (Ptr packet) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << packet); + NS_LOG_FUNCTION (this << packet); uint16_t protocol = 0; if (m_receiveErrorModel && m_receiveErrorModel->IsCorrupt (packet) ) @@ -246,7 +240,7 @@ void PointToPointNetDevice::Receive (Ptr packet) Ptr PointToPointNetDevice::GetQueue(void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_queue; } @@ -344,7 +338,7 @@ PointToPointNetDevice::IsPointToPoint (void) const bool PointToPointNetDevice::Send(Ptr packet, const Address& dest, uint16_t protocolNumber) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC ("p=" << packet << ", dest=" << &dest); NS_LOG_LOGIC ("UID is " << packet->GetUid ()); diff --git a/src/helper/ipv4-address-helper.cc b/src/helper/ipv4-address-helper.cc index c1802f288..d58a814ec 100644 --- a/src/helper/ipv4-address-helper.cc +++ b/src/helper/ipv4-address-helper.cc @@ -31,7 +31,7 @@ namespace ns3 { Ipv4AddressHelper::Ipv4AddressHelper () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // Set the default values to an illegal state. Do this so the client is @@ -52,7 +52,7 @@ Ipv4AddressHelper::SetBase ( const Ipv4Mask mask, const Ipv4Address address) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_network = network.GetHostOrder (); m_mask = mask.GetHostOrder (); @@ -114,7 +114,7 @@ Ipv4AddressHelper::NewAddress (void) Ipv4Address Ipv4AddressHelper::NewNetwork (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); ++m_network; m_address = m_base; return Ipv4Address (m_network << m_shift); @@ -123,7 +123,7 @@ Ipv4AddressHelper::NewNetwork (void) Ipv4InterfaceContainer Ipv4AddressHelper::Assign (const NetDeviceContainer &c) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ipv4InterfaceContainer retval; for (uint32_t i = 0; i < c.GetN (); ++i) { Ptr device = c.Get (i); @@ -156,7 +156,7 @@ const uint32_t N_BITS = 32; uint32_t Ipv4AddressHelper::NumAddressBits (uint32_t maskbits) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for (uint32_t i = 0; i < N_BITS; ++i) { if (maskbits & 1) diff --git a/src/internet-node/arp-ipv4-interface.cc b/src/internet-node/arp-ipv4-interface.cc index bd52d676d..5a8e19514 100644 --- a/src/internet-node/arp-ipv4-interface.cc +++ b/src/internet-node/arp-ipv4-interface.cc @@ -35,12 +35,12 @@ namespace ns3 { ArpIpv4Interface::ArpIpv4Interface () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } ArpIpv4Interface::~ArpIpv4Interface () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void @@ -70,8 +70,7 @@ ArpIpv4Interface::GetDevice (void) const void ArpIpv4Interface::SendTo (Ptr p, Ipv4Address dest) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p << dest); + NS_LOG_FUNCTION (this << p << dest); NS_ASSERT (GetDevice () != 0); if (GetDevice ()->NeedsArp ()) diff --git a/src/internet-node/arp-l3-protocol.cc b/src/internet-node/arp-l3-protocol.cc index 6dc017623..55d28e48d 100644 --- a/src/internet-node/arp-l3-protocol.cc +++ b/src/internet-node/arp-l3-protocol.cc @@ -47,12 +47,12 @@ ArpL3Protocol::GetTypeId (void) ArpL3Protocol::ArpL3Protocol () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } ArpL3Protocol::~ArpL3Protocol () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void @@ -64,7 +64,7 @@ ArpL3Protocol::SetNode (Ptr node) void ArpL3Protocol::DoDispose (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for (CacheList::const_iterator i = m_cacheList.begin (); i != m_cacheList.end (); i++) { delete *i; @@ -77,7 +77,7 @@ ArpL3Protocol::DoDispose (void) ArpCache * ArpL3Protocol::FindCache (Ptr device) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for (CacheList::const_iterator i = m_cacheList.begin (); i != m_cacheList.end (); i++) { if ((*i)->GetDevice () == device) @@ -97,7 +97,7 @@ ArpL3Protocol::FindCache (Ptr device) void ArpL3Protocol::Receive(Ptr device, Ptr packet, uint16_t protocol, const Address &from) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); ArpCache *cache = FindCache (device); ArpHeader arp; packet->RemoveHeader (arp); @@ -161,7 +161,7 @@ ArpL3Protocol::Lookup (Ptr packet, Ipv4Address destination, Ptr device, Address *hardwareDestination) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); ArpCache *cache = FindCache (device); ArpCache::Entry *entry = cache->Lookup (destination); if (entry != 0) @@ -230,7 +230,7 @@ ArpL3Protocol::Lookup (Ptr packet, Ipv4Address destination, void ArpL3Protocol::SendArpRequest (ArpCache const *cache, Ipv4Address to) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); ArpHeader arp; NS_LOG_LOGIC ("ARP: sending request from node "<GetId ()<< " || src: " << cache->GetDevice ()->GetAddress () << @@ -249,7 +249,7 @@ ArpL3Protocol::SendArpRequest (ArpCache const *cache, Ipv4Address to) void ArpL3Protocol::SendArpReply (ArpCache const *cache, Ipv4Address toIp, Address toMac) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); ArpHeader arp; NS_LOG_LOGIC ("ARP: sending reply from node "<GetId ()<< "|| src: " << cache->GetDevice ()->GetAddress () << diff --git a/src/internet-node/ipv4-end-point-demux.cc b/src/internet-node/ipv4-end-point-demux.cc index 2d473751f..3d3f779be 100644 --- a/src/internet-node/ipv4-end-point-demux.cc +++ b/src/internet-node/ipv4-end-point-demux.cc @@ -29,12 +29,12 @@ NS_LOG_COMPONENT_DEFINE ("Ipv4EndPointDemux"); Ipv4EndPointDemux::Ipv4EndPointDemux () : m_ephemeral (49152) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } Ipv4EndPointDemux::~Ipv4EndPointDemux () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++) { Ipv4EndPoint *endPoint = *i; @@ -46,7 +46,7 @@ Ipv4EndPointDemux::~Ipv4EndPointDemux () bool Ipv4EndPointDemux::LookupPortLocal (uint16_t port) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++) { if ((*i)->GetLocalPort () == port) @@ -60,7 +60,7 @@ Ipv4EndPointDemux::LookupPortLocal (uint16_t port) bool Ipv4EndPointDemux::LookupLocal (Ipv4Address addr, uint16_t port) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++) { if ((*i)->GetLocalPort () == port && @@ -75,7 +75,7 @@ Ipv4EndPointDemux::LookupLocal (Ipv4Address addr, uint16_t port) Ipv4EndPoint * Ipv4EndPointDemux::Allocate (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); uint16_t port = AllocateEphemeralPort (); if (port == 0) { @@ -91,8 +91,7 @@ Ipv4EndPointDemux::Allocate (void) Ipv4EndPoint * Ipv4EndPointDemux::Allocate (Ipv4Address address) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << address); + NS_LOG_FUNCTION (this << address); uint16_t port = AllocateEphemeralPort (); if (port == 0) { @@ -108,8 +107,7 @@ Ipv4EndPointDemux::Allocate (Ipv4Address address) Ipv4EndPoint * Ipv4EndPointDemux::Allocate (uint16_t port) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << port); + NS_LOG_FUNCTION (this << port); return Allocate (Ipv4Address::GetAny (), port); } @@ -117,8 +115,7 @@ Ipv4EndPointDemux::Allocate (uint16_t port) Ipv4EndPoint * Ipv4EndPointDemux::Allocate (Ipv4Address address, uint16_t port) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << address << port); + NS_LOG_FUNCTION (this << address << port); if (LookupLocal (address, port)) { NS_LOG_WARN ("Duplicate address/port; failing."); @@ -134,8 +131,7 @@ Ipv4EndPoint * Ipv4EndPointDemux::Allocate (Ipv4Address localAddress, uint16_t localPort, Ipv4Address peerAddress, uint16_t peerPort) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << localAddress << localPort << peerAddress << peerPort); + NS_LOG_FUNCTION (this << localAddress << localPort << peerAddress << peerPort); for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++) { if ((*i)->GetLocalPort () == localPort && @@ -160,7 +156,7 @@ Ipv4EndPointDemux::Allocate (Ipv4Address localAddress, uint16_t localPort, void Ipv4EndPointDemux::DeAllocate (Ipv4EndPoint *endPoint) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++) { if (*i == endPoint) @@ -182,13 +178,13 @@ Ipv4EndPointDemux::Lookup (Ipv4Address daddr, uint16_t dport, Ipv4Address saddr, uint16_t sport, Ptr incomingInterface) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); EndPoints retval1; // Matches exact on local port, wildcards on others EndPoints retval2; // Matches exact on local port/adder, wildcards on others EndPoints retval3; // Matches all but local address EndPoints retval4; // Exact match on all 4 - NS_LOG_PARAMS (this << daddr << dport << saddr << sport << incomingInterface); + NS_LOG_FUNCTION (this << daddr << dport << saddr << sport << incomingInterface); NS_LOG_DEBUG ("Looking up endpoint for destination address " << daddr); for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++) { @@ -276,7 +272,7 @@ Ipv4EndPointDemux::Lookup (Ipv4Address daddr, uint16_t dport, uint16_t Ipv4EndPointDemux::AllocateEphemeralPort (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); uint16_t port = m_ephemeral; do { diff --git a/src/internet-node/ipv4-interface.cc b/src/internet-node/ipv4-interface.cc index 9d750f068..d99e68969 100644 --- a/src/internet-node/ipv4-interface.cc +++ b/src/internet-node/ipv4-interface.cc @@ -38,42 +38,39 @@ Ipv4Interface::Ipv4Interface () : m_ifup(false), m_metric(1) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this); + NS_LOG_FUNCTION (this); } Ipv4Interface::~Ipv4Interface () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void Ipv4Interface::DoDispose (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Object::DoDispose (); } void Ipv4Interface::SetAddress (Ipv4Address a) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << a); + NS_LOG_FUNCTION (this << a); m_address = a; } void Ipv4Interface::SetNetworkMask (Ipv4Mask mask) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << mask); + NS_LOG_FUNCTION (this << mask); m_netmask = mask; } Ipv4Address Ipv4Interface::GetBroadcast (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); uint32_t mask = m_netmask.GetHostOrder (); uint32_t address = m_address.GetHostOrder (); Ipv4Address broadcast = Ipv4Address (address | (~mask)); @@ -83,36 +80,35 @@ Ipv4Interface::GetBroadcast (void) const Ipv4Mask Ipv4Interface::GetNetworkMask (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_netmask; } void Ipv4Interface::SetMetric (uint16_t metric) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (metric); + NS_LOG_FUNCTION (metric); m_metric = metric; } uint16_t Ipv4Interface::GetMetric (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_metric; } Ipv4Address Ipv4Interface::GetAddress (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_address; } uint16_t Ipv4Interface::GetMtu (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (GetDevice () == 0) { uint32_t mtu = (1<<16) - 1; @@ -129,28 +125,28 @@ Ipv4Interface::GetMtu (void) const bool Ipv4Interface::IsUp (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_ifup; } bool Ipv4Interface::IsDown (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return !m_ifup; } void Ipv4Interface::SetUp (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_ifup = true; } void Ipv4Interface::SetDown (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_ifup = false; } @@ -158,7 +154,7 @@ Ipv4Interface::SetDown (void) void Ipv4Interface::Send(Ptr p, Ipv4Address dest) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (IsUp()) { NS_LOG_LOGIC ("SendTo"); SendTo(p, dest); diff --git a/src/internet-node/ipv4-l3-protocol.cc b/src/internet-node/ipv4-l3-protocol.cc index 9401d7559..5c6e4aa05 100644 --- a/src/internet-node/ipv4-l3-protocol.cc +++ b/src/internet-node/ipv4-l3-protocol.cc @@ -73,14 +73,14 @@ Ipv4L3Protocol::Ipv4L3Protocol() : m_nInterfaces (0), m_identification (0) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_staticRouting = CreateObject (); AddRoutingProtocol (m_staticRouting, 0); } Ipv4L3Protocol::~Ipv4L3Protocol () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void @@ -93,7 +93,7 @@ Ipv4L3Protocol::SetNode (Ptr node) void Ipv4L3Protocol::DoDispose (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_interfaces.clear (); m_node = 0; m_staticRouting->Dispose (); @@ -104,7 +104,7 @@ Ipv4L3Protocol::DoDispose (void) void Ipv4L3Protocol::SetupLoopback (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ptr interface = CreateObject (); interface->SetNode (m_node); @@ -118,7 +118,7 @@ Ipv4L3Protocol::SetupLoopback (void) void Ipv4L3Protocol::SetDefaultTtl (uint8_t ttl) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_defaultTtl = ttl; } @@ -128,8 +128,7 @@ Ipv4L3Protocol::AddHostRouteTo (Ipv4Address dest, Ipv4Address nextHop, uint32_t interface) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << dest << nextHop << interface); + NS_LOG_FUNCTION (this << dest << nextHop << interface); m_staticRouting->AddHostRouteTo (dest, nextHop, interface); } @@ -137,8 +136,7 @@ void Ipv4L3Protocol::AddHostRouteTo (Ipv4Address dest, uint32_t interface) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << dest << interface); + NS_LOG_FUNCTION (this << dest << interface); m_staticRouting->AddHostRouteTo (dest, interface); } @@ -148,8 +146,7 @@ Ipv4L3Protocol::AddNetworkRouteTo (Ipv4Address network, Ipv4Address nextHop, uint32_t interface) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << network << networkMask << nextHop << interface); + NS_LOG_FUNCTION (this << network << networkMask << nextHop << interface); m_staticRouting->AddNetworkRouteTo (network, networkMask, nextHop, interface); } @@ -158,8 +155,7 @@ Ipv4L3Protocol::AddNetworkRouteTo (Ipv4Address network, Ipv4Mask networkMask, uint32_t interface) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << network << networkMask << interface); + NS_LOG_FUNCTION (this << network << networkMask << interface); m_staticRouting->AddNetworkRouteTo (network, networkMask, interface); } @@ -167,8 +163,7 @@ void Ipv4L3Protocol::SetDefaultRoute (Ipv4Address nextHop, uint32_t interface) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << nextHop << interface); + NS_LOG_FUNCTION (this << nextHop << interface); m_staticRouting->SetDefaultRoute (nextHop, interface); } @@ -178,8 +173,7 @@ Ipv4L3Protocol::Lookup ( Ptr packet, Ipv4RoutingProtocol::RouteReplyCallback routeReply) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << &ipHeader << packet << &routeReply); + NS_LOG_FUNCTION (this << &ipHeader << packet << &routeReply); Lookup (Ipv4RoutingProtocol::IF_INDEX_ANY, ipHeader, packet, routeReply); } @@ -191,8 +185,7 @@ Ipv4L3Protocol::Lookup ( Ptr packet, Ipv4RoutingProtocol::RouteReplyCallback routeReply) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << ifIndex << &ipHeader << packet << &routeReply); + NS_LOG_FUNCTION (this << ifIndex << &ipHeader << packet << &routeReply); for (Ipv4RoutingProtocolList::const_iterator rprotoIter = m_routingProtocols.begin (); @@ -240,8 +233,7 @@ void Ipv4L3Protocol::AddRoutingProtocol (Ptr routingProtocol, int priority) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << &routingProtocol << priority); + NS_LOG_FUNCTION (this << &routingProtocol << priority); m_routingProtocols.push_back (std::pair > (-priority, routingProtocol)); m_routingProtocols.sort (); @@ -250,22 +242,21 @@ Ipv4L3Protocol::AddRoutingProtocol (Ptr routingProtocol, uint32_t Ipv4L3Protocol::GetNRoutes (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_staticRouting->GetNRoutes (); } Ipv4Route * Ipv4L3Protocol::GetRoute (uint32_t index) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_staticRouting->GetRoute (index); } void Ipv4L3Protocol::RemoveRoute (uint32_t index) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << index); + NS_LOG_FUNCTION (this << index); m_staticRouting->RemoveRoute (index); } @@ -275,8 +266,7 @@ Ipv4L3Protocol::AddMulticastRoute (Ipv4Address origin, uint32_t inputInterface, std::vector outputInterfaces) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << origin << group << inputInterface << &outputInterfaces); + NS_LOG_FUNCTION (this << origin << group << inputInterface << &outputInterfaces); m_staticRouting->AddMulticastRoute (origin, group, inputInterface, outputInterfaces); @@ -285,8 +275,7 @@ Ipv4L3Protocol::AddMulticastRoute (Ipv4Address origin, void Ipv4L3Protocol::SetDefaultMulticastRoute (uint32_t outputInterface) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << outputInterface); + NS_LOG_FUNCTION (this << outputInterface); m_staticRouting->SetDefaultMulticastRoute (outputInterface); } @@ -294,15 +283,14 @@ Ipv4L3Protocol::SetDefaultMulticastRoute (uint32_t outputInterface) uint32_t Ipv4L3Protocol::GetNMulticastRoutes (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_staticRouting->GetNMulticastRoutes (); } Ipv4MulticastRoute * Ipv4L3Protocol::GetMulticastRoute (uint32_t index) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << index); + NS_LOG_FUNCTION (this << index); return m_staticRouting->GetMulticastRoute (index); } @@ -311,24 +299,21 @@ Ipv4L3Protocol::RemoveMulticastRoute (Ipv4Address origin, Ipv4Address group, uint32_t inputInterface) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << origin << group << inputInterface); + NS_LOG_FUNCTION (this << origin << group << inputInterface); m_staticRouting->RemoveMulticastRoute (origin, group, inputInterface); } void Ipv4L3Protocol::RemoveMulticastRoute (uint32_t index) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << index); + NS_LOG_FUNCTION (this << index); m_staticRouting->RemoveMulticastRoute (index); } uint32_t Ipv4L3Protocol::AddInterface (Ptr device) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << &device); + NS_LOG_FUNCTION (this << &device); Ptr interface = CreateObject (); interface->SetNode (m_node); interface->SetDevice (device); @@ -338,8 +323,7 @@ Ipv4L3Protocol::AddInterface (Ptr device) uint32_t Ipv4L3Protocol::AddIpv4Interface (Ptrinterface) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << interface); + NS_LOG_FUNCTION (this << interface); uint32_t index = m_nInterfaces; m_interfaces.push_back (interface); m_nInterfaces++; @@ -349,8 +333,7 @@ Ipv4L3Protocol::AddIpv4Interface (Ptrinterface) Ptr Ipv4L3Protocol::GetInterface (uint32_t index) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << index); + NS_LOG_FUNCTION (this << index); uint32_t tmp = 0; for (Ipv4InterfaceList::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i++) { @@ -366,15 +349,14 @@ Ipv4L3Protocol::GetInterface (uint32_t index) const uint32_t Ipv4L3Protocol::GetNInterfaces (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_nInterfaces; } uint32_t Ipv4L3Protocol::FindInterfaceForAddr (Ipv4Address addr) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << addr); + NS_LOG_FUNCTION (this << addr); uint32_t ifIndex = 0; for (Ipv4InterfaceList::const_iterator i = m_interfaces.begin (); @@ -395,8 +377,7 @@ Ipv4L3Protocol::FindInterfaceForAddr (Ipv4Address addr) const uint32_t Ipv4L3Protocol::FindInterfaceForAddr (Ipv4Address addr, Ipv4Mask mask) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << addr << mask); + NS_LOG_FUNCTION (this << addr << mask); uint32_t ifIndex = 0; for (Ipv4InterfaceList::const_iterator i = m_interfaces.begin (); @@ -417,8 +398,7 @@ Ipv4L3Protocol::FindInterfaceForAddr (Ipv4Address addr, Ipv4Mask mask) const int32_t Ipv4L3Protocol::FindInterfaceIndexForDevice (Ptr device) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << device); + NS_LOG_FUNCTION (this << device); uint32_t ifIndex = 0; for (Ipv4InterfaceList::const_iterator i = m_interfaces.begin (); @@ -437,8 +417,7 @@ Ipv4L3Protocol::FindInterfaceIndexForDevice (Ptr device) const Ptr Ipv4L3Protocol::FindInterfaceForDevice (Ptr device) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << &device); + NS_LOG_FUNCTION (this << &device); for (Ipv4InterfaceList::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i++) { if ((*i)->GetDevice () == device) @@ -452,8 +431,7 @@ Ipv4L3Protocol::FindInterfaceForDevice (Ptr device) void Ipv4L3Protocol::Receive( Ptr device, Ptr packet, uint16_t protocol, const Address &from) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << &device << packet << protocol << from); + NS_LOG_FUNCTION (this << &device << packet << protocol << from); NS_LOG_LOGIC ("Packet from " << from << " received on node " << m_node->GetId ()); @@ -494,8 +472,7 @@ Ipv4L3Protocol::Send (Ptr packet, Ipv4Address destination, uint8_t protocol) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << packet << source << destination << protocol); + NS_LOG_FUNCTION (this << packet << source << destination << protocol); Ipv4Header ipHeader; @@ -545,8 +522,7 @@ Ipv4L3Protocol::SendRealOut (bool found, Ptr packet, Ipv4Header const &ipHeader) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << found << &route << packet << &ipHeader); + NS_LOG_FUNCTION (this << found << &route << packet << &ipHeader); packet->AddHeader (ipHeader); if (!found) @@ -580,8 +556,7 @@ Ipv4L3Protocol::Forwarding ( Ipv4Header &ipHeader, Ptr device) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (ifIndex << packet << &ipHeader<< device); + NS_LOG_FUNCTION (ifIndex << packet << &ipHeader<< device); NS_LOG_LOGIC ("Forwarding logic for node: " << m_node->GetId ()); for (Ipv4InterfaceList::const_iterator i = m_interfaces.begin (); @@ -661,8 +636,7 @@ void Ipv4L3Protocol::ForwardUp (Ptr p, Ipv4Header const&ip, Ptr incomingInterface) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p << &ip); + NS_LOG_FUNCTION (this << p << &ip); Ptr demux = m_node->GetObject (); Ptr protocol = demux->GetProtocol (ip.GetProtocol ()); @@ -672,8 +646,7 @@ Ipv4L3Protocol::ForwardUp (Ptr p, Ipv4Header const&ip, void Ipv4L3Protocol::JoinMulticastGroup (Ipv4Address origin, Ipv4Address group) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << origin << group); + NS_LOG_FUNCTION (this << origin << group); m_multicastGroups.push_back( std::pair (origin, group)); } @@ -681,8 +654,7 @@ Ipv4L3Protocol::JoinMulticastGroup (Ipv4Address origin, Ipv4Address group) void Ipv4L3Protocol::LeaveMulticastGroup (Ipv4Address origin, Ipv4Address group) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << origin << group); + NS_LOG_FUNCTION (this << origin << group); for (Ipv4MulticastGroupList::iterator i = m_multicastGroups.begin (); i != m_multicastGroups.end (); @@ -699,8 +671,7 @@ Ipv4L3Protocol::LeaveMulticastGroup (Ipv4Address origin, Ipv4Address group) void Ipv4L3Protocol::SetAddress (uint32_t i, Ipv4Address address) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << i << address); + NS_LOG_FUNCTION (this << i << address); Ptr interface = GetInterface (i); interface->SetAddress (address); } @@ -708,8 +679,7 @@ Ipv4L3Protocol::SetAddress (uint32_t i, Ipv4Address address) void Ipv4L3Protocol::SetNetworkMask (uint32_t i, Ipv4Mask mask) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << i << mask); + NS_LOG_FUNCTION (this << i << mask); Ptr interface = GetInterface (i); interface->SetNetworkMask (mask); } @@ -717,8 +687,7 @@ Ipv4L3Protocol::SetNetworkMask (uint32_t i, Ipv4Mask mask) Ipv4Mask Ipv4L3Protocol::GetNetworkMask (uint32_t i) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << i); + NS_LOG_FUNCTION (this << i); Ptr interface = GetInterface (i); return interface->GetNetworkMask (); } @@ -726,8 +695,7 @@ Ipv4L3Protocol::GetNetworkMask (uint32_t i) const Ipv4Address Ipv4L3Protocol::GetAddress (uint32_t i) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << i); + NS_LOG_FUNCTION (this << i); Ptr interface = GetInterface (i); return interface->GetAddress (); } @@ -735,8 +703,7 @@ Ipv4L3Protocol::GetAddress (uint32_t i) const void Ipv4L3Protocol::SetMetric (uint32_t i, uint16_t metric) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (i << metric); + NS_LOG_FUNCTION (i << metric); Ptr interface = GetInterface (i); interface->SetMetric (metric); } @@ -744,8 +711,7 @@ Ipv4L3Protocol::SetMetric (uint32_t i, uint16_t metric) uint16_t Ipv4L3Protocol::GetMetric (uint32_t i) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (i); + NS_LOG_FUNCTION (i); Ptr interface = GetInterface (i); return interface->GetMetric (); } @@ -754,8 +720,7 @@ bool Ipv4L3Protocol::GetIfIndexForDestination ( Ipv4Address destination, uint32_t& ifIndex) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << destination << &ifIndex); + NS_LOG_FUNCTION (this << destination << &ifIndex); // // The first thing we do in trying to determine a source address is to // consult the routing protocols. These will also check for a default route @@ -824,8 +789,7 @@ Ipv4L3Protocol::GetIfIndexForDestination ( uint16_t Ipv4L3Protocol::GetMtu (uint32_t i) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << i); + NS_LOG_FUNCTION (this << i); Ptr interface = GetInterface (i); return interface->GetMtu (); } @@ -833,8 +797,7 @@ Ipv4L3Protocol::GetMtu (uint32_t i) const bool Ipv4L3Protocol::IsUp (uint32_t i) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << i); + NS_LOG_FUNCTION (this << i); Ptr interface = GetInterface (i); return interface->IsUp (); } @@ -842,8 +805,7 @@ Ipv4L3Protocol::IsUp (uint32_t i) const void Ipv4L3Protocol::SetUp (uint32_t i) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << i); + NS_LOG_FUNCTION (this << i); Ptr interface = GetInterface (i); interface->SetUp (); @@ -861,8 +823,7 @@ Ipv4L3Protocol::SetUp (uint32_t i) void Ipv4L3Protocol::SetDown (uint32_t ifaceIndex) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << ifaceIndex); + NS_LOG_FUNCTION (this << ifaceIndex); Ptr interface = GetInterface (ifaceIndex); interface->SetDown (); diff --git a/src/internet-node/ipv4-loopback-interface.cc b/src/internet-node/ipv4-loopback-interface.cc index b97dd7923..68acda205 100644 --- a/src/internet-node/ipv4-loopback-interface.cc +++ b/src/internet-node/ipv4-loopback-interface.cc @@ -34,12 +34,12 @@ namespace ns3 { Ipv4LoopbackInterface::Ipv4LoopbackInterface () : m_node (0) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } Ipv4LoopbackInterface::~Ipv4LoopbackInterface () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_ASSERT (m_node != 0); } @@ -58,8 +58,7 @@ Ipv4LoopbackInterface::SetNode (Ptr node) void Ipv4LoopbackInterface::SendTo (Ptr packet, Ipv4Address dest) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << packet << dest); + NS_LOG_FUNCTION (this << packet << dest); Ptr ipv4 = m_node->GetObject (); diff --git a/src/internet-node/ipv4-static-routing.cc b/src/internet-node/ipv4-static-routing.cc index 454fe950e..ba3f27c35 100644 --- a/src/internet-node/ipv4-static-routing.cc +++ b/src/internet-node/ipv4-static-routing.cc @@ -29,7 +29,7 @@ namespace ns3 { Ipv4StaticRouting::Ipv4StaticRouting () : m_defaultRoute (0), m_defaultMulticastRoute (0) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void @@ -37,7 +37,7 @@ Ipv4StaticRouting::AddHostRouteTo (Ipv4Address dest, Ipv4Address nextHop, uint32_t interface) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ipv4Route *route = new Ipv4Route (); *route = Ipv4Route::CreateHostRouteTo (dest, nextHop, interface); m_hostRoutes.push_back (route); @@ -47,7 +47,7 @@ void Ipv4StaticRouting::AddHostRouteTo (Ipv4Address dest, uint32_t interface) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ipv4Route *route = new Ipv4Route (); *route = Ipv4Route::CreateHostRouteTo (dest, interface); m_hostRoutes.push_back (route); @@ -59,7 +59,7 @@ Ipv4StaticRouting::AddNetworkRouteTo (Ipv4Address network, Ipv4Address nextHop, uint32_t interface) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ipv4Route *route = new Ipv4Route (); *route = Ipv4Route::CreateNetworkRouteTo (network, networkMask, @@ -73,7 +73,7 @@ Ipv4StaticRouting::AddNetworkRouteTo (Ipv4Address network, Ipv4Mask networkMask, uint32_t interface) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ipv4Route *route = new Ipv4Route (); *route = Ipv4Route::CreateNetworkRouteTo (network, networkMask, @@ -85,7 +85,7 @@ void Ipv4StaticRouting::SetDefaultRoute (Ipv4Address nextHop, uint32_t interface) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ipv4Route *route = new Ipv4Route (); *route = Ipv4Route::CreateDefaultRoute (nextHop, interface); delete m_defaultRoute; @@ -98,7 +98,7 @@ Ipv4StaticRouting::AddMulticastRoute(Ipv4Address origin, uint32_t inputInterface, std::vector outputInterfaces) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ipv4MulticastRoute *route = new Ipv4MulticastRoute (); *route = Ipv4MulticastRoute::CreateMulticastRoute (origin, group, inputInterface, outputInterfaces); @@ -108,7 +108,7 @@ Ipv4StaticRouting::AddMulticastRoute(Ipv4Address origin, void Ipv4StaticRouting::SetDefaultMulticastRoute(uint32_t outputInterface) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ipv4Address origin = Ipv4Address::GetAny (); Ipv4Address group = Ipv4Address::GetAny (); uint32_t inputInterface = Ipv4RoutingProtocol::IF_INDEX_ANY; @@ -127,14 +127,14 @@ Ipv4StaticRouting::SetDefaultMulticastRoute(uint32_t outputInterface) uint32_t Ipv4StaticRouting::GetNMulticastRoutes (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_multicastRoutes.size () + m_defaultMulticastRoute ? 1 : 0; } Ipv4MulticastRoute * Ipv4StaticRouting::GetMulticastRoute (uint32_t index) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_ASSERT_MSG(index < m_multicastRoutes.size (), "Ipv4StaticRouting::GetMulticastRoute (): Index out of range"); // @@ -182,7 +182,7 @@ Ipv4StaticRouting::GetMulticastRoute (uint32_t index) const Ipv4MulticastRoute * Ipv4StaticRouting::GetDefaultMulticastRoute () const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_defaultMulticastRoute != 0) { return m_defaultMulticastRoute; @@ -195,7 +195,7 @@ Ipv4StaticRouting::RemoveMulticastRoute(Ipv4Address origin, Ipv4Address group, uint32_t inputInterface) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for (MulticastRoutesI i = m_multicastRoutes.begin (); i != m_multicastRoutes.end (); i++) @@ -216,7 +216,7 @@ Ipv4StaticRouting::RemoveMulticastRoute(Ipv4Address origin, void Ipv4StaticRouting::RemoveMulticastRoute(uint32_t index) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // From an external point of view the default route appears to be in slot 0 // of the routing table. The implementation, however, puts it in a separate @@ -261,7 +261,7 @@ Ipv4StaticRouting::RemoveMulticastRoute(uint32_t index) Ipv4Route * Ipv4StaticRouting::LookupStatic (Ipv4Address dest) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for (HostRoutesCI i = m_hostRoutes.begin (); i != m_hostRoutes.end (); i++) @@ -298,7 +298,7 @@ Ipv4StaticRouting::LookupStatic ( Ipv4Address group, uint32_t ifIndex) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // We treat the "any" address (typically 0.0.0.0) as a wildcard in our matching // scheme. @@ -400,7 +400,7 @@ Ipv4StaticRouting::LookupStatic ( uint32_t Ipv4StaticRouting::GetNRoutes (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); uint32_t n = 0; if (m_defaultRoute != 0) { @@ -414,7 +414,7 @@ Ipv4StaticRouting::GetNRoutes (void) Ipv4Route * Ipv4StaticRouting::GetDefaultRoute () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_defaultRoute != 0) { return m_defaultRoute; @@ -428,7 +428,7 @@ Ipv4StaticRouting::GetDefaultRoute () Ipv4Route * Ipv4StaticRouting::GetRoute (uint32_t index) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (index == 0 && m_defaultRoute != 0) { return m_defaultRoute; @@ -470,7 +470,7 @@ Ipv4StaticRouting::GetRoute (uint32_t index) void Ipv4StaticRouting::RemoveRoute (uint32_t index) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (index == 0 && m_defaultRoute != 0) { delete m_defaultRoute; @@ -520,8 +520,7 @@ Ipv4StaticRouting::RequestRoute ( Ptr packet, RouteReplyCallback routeReply) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << ifIndex << &ipHeader << packet << &routeReply); + NS_LOG_FUNCTION (this << ifIndex << &ipHeader << packet << &routeReply); NS_LOG_LOGIC ("source = " << ipHeader.GetSource ()); @@ -573,8 +572,7 @@ Ipv4StaticRouting::RequestRoute ( bool Ipv4StaticRouting::RequestIfIndex (Ipv4Address destination, uint32_t& ifIndex) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << destination << &ifIndex); + NS_LOG_FUNCTION (this << destination << &ifIndex); // // First, see if this is a multicast packet we have a route for. If we // have a route, then send the packet down each of the specified interfaces. @@ -621,7 +619,7 @@ Ipv4StaticRouting::RequestIfIndex (Ipv4Address destination, uint32_t& ifIndex) void Ipv4StaticRouting::DoDispose (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for (HostRoutesI i = m_hostRoutes.begin (); i != m_hostRoutes.end (); i = m_hostRoutes.erase (i)) diff --git a/src/internet-node/tcp-l4-protocol.cc b/src/internet-node/tcp-l4-protocol.cc index 70dc3de20..c7fdccbd1 100644 --- a/src/internet-node/tcp-l4-protocol.cc +++ b/src/internet-node/tcp-l4-protocol.cc @@ -49,7 +49,7 @@ TcpStateMachine::TcpStateMachine() : aT (LAST_STATE, StateActionVec_t(LAST_EVENT)), eV (MAX_FLAGS) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // Create the state table // Closed state @@ -290,15 +290,13 @@ TcpStateMachine::TcpStateMachine() SA TcpStateMachine::Lookup (States_t s, Events_t e) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << s << e); + NS_LOG_FUNCTION (this << s << e); return aT[s][e]; } Events_t TcpStateMachine::FlagsEvent (uint8_t f) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << f); + NS_LOG_FUNCTION (this << f); // Lookup event from flags if (f >= MAX_FLAGS) return BAD_FLAGS; return eV[f]; // Look up flags event @@ -337,13 +335,13 @@ TcpL4Protocol::GetTypeId (void) TcpL4Protocol::TcpL4Protocol () : m_endPoints (new Ipv4EndPointDemux ()) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC("Made a TcpL4Protocol "< TcpL4Protocol::CreateSocket (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ptr rtt = m_rttFactory.Create (); Ptr socket = CreateObject (); socket->SetNode (m_node); @@ -391,31 +389,28 @@ TcpL4Protocol::CreateSocket (void) Ipv4EndPoint * TcpL4Protocol::Allocate (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_endPoints->Allocate (); } Ipv4EndPoint * TcpL4Protocol::Allocate (Ipv4Address address) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << address); + NS_LOG_FUNCTION (this << address); return m_endPoints->Allocate (address); } Ipv4EndPoint * TcpL4Protocol::Allocate (uint16_t port) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << port); + NS_LOG_FUNCTION (this << port); return m_endPoints->Allocate (port); } Ipv4EndPoint * TcpL4Protocol::Allocate (Ipv4Address address, uint16_t port) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << address << port); + NS_LOG_FUNCTION (this << address << port); return m_endPoints->Allocate (address, port); } @@ -423,8 +418,7 @@ Ipv4EndPoint * TcpL4Protocol::Allocate (Ipv4Address localAddress, uint16_t localPort, Ipv4Address peerAddress, uint16_t peerPort) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << localAddress << localPort << peerAddress << peerPort); + NS_LOG_FUNCTION (this << localAddress << localPort << peerAddress << peerPort); return m_endPoints->Allocate (localAddress, localPort, peerAddress, peerPort); } @@ -432,8 +426,7 @@ TcpL4Protocol::Allocate (Ipv4Address localAddress, uint16_t localPort, void TcpL4Protocol::DeAllocate (Ipv4EndPoint *endPoint) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << endPoint); + NS_LOG_FUNCTION (this << endPoint); m_endPoints->DeAllocate (endPoint); } @@ -443,8 +436,7 @@ TcpL4Protocol::Receive (Ptr packet, Ipv4Address const &destination, Ptr incomingInterface) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << packet << source << destination << incomingInterface); + NS_LOG_FUNCTION (this << packet << source << destination << incomingInterface); TcpHeader tcpHeader; //these two do a peek, so that the packet can be forwarded up @@ -481,8 +473,7 @@ TcpL4Protocol::Send (Ptr packet, Ipv4Address saddr, Ipv4Address daddr, uint16_t sport, uint16_t dport) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << packet << saddr << daddr << sport << dport); + NS_LOG_FUNCTION (this << packet << saddr << daddr << sport << dport); TcpHeader tcpHeader; tcpHeader.SetDestinationPort (dport); @@ -512,8 +503,7 @@ TcpL4Protocol::SendPacket (Ptr packet, TcpHeader outgoingHeader, << " ack " << outgoingHeader.GetAckNumber() << " flags " << std::hex << (int)outgoingHeader.GetFlags() << std::dec << " data size " << packet->GetSize()); - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << packet << saddr << daddr); + NS_LOG_FUNCTION (this << packet << saddr << daddr); // XXX outgoingHeader cannot be logged outgoingHeader.SetLength (5); //header length in units of 32bit words diff --git a/src/internet-node/tcp-socket.cc b/src/internet-node/tcp-socket.cc index 58495f5bf..cabd17eb0 100644 --- a/src/internet-node/tcp-socket.cc +++ b/src/internet-node/tcp-socket.cc @@ -80,8 +80,7 @@ TcpSocket::GetTypeId () m_rtt (0), m_lastMeasuredRtt (Seconds(0.0)) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this); + NS_LOG_FUNCTION (this); } @@ -125,7 +124,7 @@ TcpSocket::TcpSocket(const TcpSocket& sock) m_cnTimeout (sock.m_cnTimeout), m_cnCount (sock.m_cnCount) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC("Invoked the copy constructor"); //copy the pending data if necessary if(sock.m_pendingData) @@ -143,8 +142,7 @@ TcpSocket::TcpSocket(const TcpSocket& sock) TcpSocket::~TcpSocket () { - NS_LOG_FUNCTION; - NS_LOG_PARAMS(this); + NS_LOG_FUNCTION(this); m_node = 0; if (m_endPoint != 0) { @@ -198,21 +196,21 @@ TcpSocket::SetRtt (Ptr rtt) enum Socket::SocketErrno TcpSocket::GetErrno (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_errno; } Ptr TcpSocket::GetNode (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_node; } void TcpSocket::Destroy (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_node = 0; m_endPoint = 0; m_tcp = 0; @@ -221,7 +219,7 @@ TcpSocket::Destroy (void) int TcpSocket::FinishBind (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_endPoint == 0) { return -1; @@ -236,15 +234,14 @@ TcpSocket::FinishBind (void) int TcpSocket::Bind (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_endPoint = m_tcp->Allocate (); return FinishBind (); } int TcpSocket::Bind (const Address &address) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this< p) //p here is just data, no headers int TcpSocket::Send (const uint8_t* buf, uint32_t size) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << buf << size); + NS_LOG_FUNCTION (this << buf << size); if (m_state == ESTABLISHED || m_state == SYN_SENT || m_state == CLOSE_WAIT) { // Ok to buffer some data to send if (!m_pendingData) @@ -390,8 +385,7 @@ int TcpSocket::Send (const uint8_t* buf, uint32_t size) int TcpSocket::DoSendTo (Ptr p, const Address &address) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p << address); + NS_LOG_FUNCTION (this << p << address); InetSocketAddress transport = InetSocketAddress::ConvertFrom (address); Ipv4Address ipv4 = transport.GetIpv4 (); uint16_t port = transport.GetPort (); @@ -400,8 +394,7 @@ int TcpSocket::DoSendTo (Ptr p, const Address &address) int TcpSocket::DoSendTo (Ptr p, Ipv4Address ipv4, uint16_t port) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p << ipv4 << port); + NS_LOG_FUNCTION (this << p << ipv4 << port); if (m_endPoint == 0) { if (Bind () == -1) @@ -425,8 +418,7 @@ int TcpSocket::DoSendTo (Ptr p, Ipv4Address ipv4, uint16_t port) int TcpSocket::SendTo (const Address &address, Ptr p) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << address << p); + NS_LOG_FUNCTION (this << address << p); if (!m_connected) { m_errno = ERROR_NOTCONN; @@ -441,8 +433,7 @@ TcpSocket::SendTo (const Address &address, Ptr p) int TcpSocket::Listen (uint32_t q) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << q); + NS_LOG_FUNCTION (this << q); Actions_t action = ProcessEvent (APP_LISTEN); ProcessAction (action); return 0; @@ -457,8 +448,7 @@ TcpSocket::ForwardUp (Ptr packet, Ipv4Address ipv4, uint16_t port) " sport " << m_endPoint->GetPeerPort() << " saddr " << m_endPoint->GetPeerAddress()); - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << packet << ipv4 << port); + NS_LOG_FUNCTION (this << packet << ipv4 << port); if (m_shutdownRecv) { return; @@ -486,8 +476,7 @@ TcpSocket::ForwardUp (Ptr packet, Ipv4Address ipv4, uint16_t port) Actions_t TcpSocket::ProcessEvent (Events_t e) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << e); + NS_LOG_FUNCTION (this << e); States_t saveState = m_state; NS_LOG_LOGIC ("TcpSocket " << this << " processing event " << e); // simulation singleton is a way to get a single global static instance of a @@ -538,8 +527,7 @@ Actions_t TcpSocket::ProcessEvent (Events_t e) void TcpSocket::SendEmptyPacket (uint8_t flags) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << flags); + NS_LOG_FUNCTION (this << flags); Ptr p = Create (); TcpHeader header; @@ -569,8 +557,7 @@ void TcpSocket::SendEmptyPacket (uint8_t flags) bool TcpSocket::ProcessAction (Actions_t a) { // These actions do not require a packet or any TCP Headers - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << a); + NS_LOG_FUNCTION (this << a); switch (a) { case NO_ACT: @@ -648,8 +635,7 @@ bool TcpSocket::ProcessPacketAction (Actions_t a, Ptr p, const TcpHeader& tcpHeader, const Address& fromAddress) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << a << p << fromAddress); + NS_LOG_FUNCTION (this << a << p << fromAddress); uint32_t localIfIndex; Ptr ipv4 = m_node->GetObject (); switch (a) @@ -813,8 +799,7 @@ void TcpSocket::ConnectionSucceeded() bool TcpSocket::SendPendingData (bool withAck) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << withAck); + NS_LOG_FUNCTION (this << withAck); NS_LOG_LOGIC ("ENTERING SendPendingData"); if (!m_pendingData) { @@ -900,26 +885,26 @@ bool TcpSocket::SendPendingData (bool withAck) uint32_t TcpSocket::UnAckDataCount () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_nextTxSequence - m_highestRxAck; } uint32_t TcpSocket::BytesInFlight () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_highTxMark - m_highestRxAck; } uint32_t TcpSocket::Window () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC ("TcpSocket::Window() "< p, const TcpHeader& tcpHeader, const Address& fromAddress) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p << "tcpHeader " << fromAddress); + NS_LOG_FUNCTION (this << p << "tcpHeader " << fromAddress); NS_LOG_LOGIC ("TcpSocket " << this << " NewRx," << " seq " << tcpHeader.GetSequenceNumber() << " ack " << tcpHeader.GetAckNumber() @@ -1077,8 +1061,7 @@ void TcpSocket::CommonNewAck (SequenceNumber ack, bool skipTimer) { // CommonNewAck is called only for "New" (non-duplicate) acks // and MUST be called by any subclass, from the NewAck function // Always cancel any pending re-tx timer on new acknowledgement - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << ack << skipTimer); + NS_LOG_FUNCTION (this << ack << skipTimer); //DEBUG(1,(cout << "TCP " << this << "Cancelling retx timer " << endl)); if (!skipTimer) { @@ -1121,8 +1104,7 @@ Ptr TcpSocket::Copy () void TcpSocket::NewAck (SequenceNumber seq) { // New acknowledgement up to sequence number "seq" // Adjust congestion window in response to new ack's received - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << seq); + NS_LOG_FUNCTION (this << seq); NS_LOG_LOGIC ("TcpSocket " << this << " NewAck " << " seq " << seq << " cWnd " << m_cWnd @@ -1149,8 +1131,7 @@ void TcpSocket::NewAck (SequenceNumber seq) void TcpSocket::DupAck (const TcpHeader& t, uint32_t count) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << "t " << count); + NS_LOG_FUNCTION (this << "t " << count); NS_LOG_LOGIC ("TcpSocket " << this << " DupAck " << t.GetAckNumber () << ", count " << count << ", time " << Simulator::Now ()); @@ -1172,8 +1153,7 @@ void TcpSocket::DupAck (const TcpHeader& t, uint32_t count) void TcpSocket::ReTxTimeout () { // Retransmit timeout - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this); + NS_LOG_FUNCTION (this); m_ssThresh = Window () / 2; // Per RFC2581 m_ssThresh = std::max (m_ssThresh, 2 * m_segmentSize); // Set cWnd to segSize on timeout, per rfc2581 @@ -1200,8 +1180,7 @@ void TcpSocket::LastAckTimeout () void TcpSocket::Retransmit () { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this); + NS_LOG_FUNCTION (this); uint8_t flags = TcpHeader::NONE; if (m_state == SYN_SENT) { diff --git a/src/internet-node/udp-l4-protocol.cc b/src/internet-node/udp-l4-protocol.cc index 2259cd632..424908712 100644 --- a/src/internet-node/udp-l4-protocol.cc +++ b/src/internet-node/udp-l4-protocol.cc @@ -52,12 +52,12 @@ UdpL4Protocol::GetTypeId (void) UdpL4Protocol::UdpL4Protocol () : m_endPoints (new Ipv4EndPointDemux ()) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } UdpL4Protocol::~UdpL4Protocol () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void @@ -81,7 +81,7 @@ UdpL4Protocol::GetVersion (void) const void UdpL4Protocol::DoDispose (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_endPoints != 0) { delete m_endPoints; @@ -94,7 +94,7 @@ UdpL4Protocol::DoDispose (void) Ptr UdpL4Protocol::CreateSocket (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ptr socket = CreateObject (); socket->SetNode (m_node); socket->SetUdp (this); @@ -104,39 +104,35 @@ UdpL4Protocol::CreateSocket (void) Ipv4EndPoint * UdpL4Protocol::Allocate (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_endPoints->Allocate (); } Ipv4EndPoint * UdpL4Protocol::Allocate (Ipv4Address address) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << address); + NS_LOG_FUNCTION (this << address); return m_endPoints->Allocate (address); } Ipv4EndPoint * UdpL4Protocol::Allocate (uint16_t port) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << port); + NS_LOG_FUNCTION (this << port); return m_endPoints->Allocate (port); } Ipv4EndPoint * UdpL4Protocol::Allocate (Ipv4Address address, uint16_t port) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << address << port); + NS_LOG_FUNCTION (this << address << port); return m_endPoints->Allocate (address, port); } Ipv4EndPoint * UdpL4Protocol::Allocate (Ipv4Address localAddress, uint16_t localPort, Ipv4Address peerAddress, uint16_t peerPort) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << localAddress << localPort << peerAddress << peerPort); + NS_LOG_FUNCTION (this << localAddress << localPort << peerAddress << peerPort); return m_endPoints->Allocate (localAddress, localPort, peerAddress, peerPort); } @@ -144,8 +140,7 @@ UdpL4Protocol::Allocate (Ipv4Address localAddress, uint16_t localPort, void UdpL4Protocol::DeAllocate (Ipv4EndPoint *endPoint) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << endPoint); + NS_LOG_FUNCTION (this << endPoint); m_endPoints->DeAllocate (endPoint); } @@ -155,8 +150,7 @@ UdpL4Protocol::Receive(Ptr packet, Ipv4Address const &destination, Ptr interface) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << packet << source << destination); + NS_LOG_FUNCTION (this << packet << source << destination); UdpHeader udpHeader; packet->RemoveHeader (udpHeader); @@ -175,8 +169,7 @@ UdpL4Protocol::Send (Ptr packet, Ipv4Address saddr, Ipv4Address daddr, uint16_t sport, uint16_t dport) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << packet << saddr << daddr << sport << dport); + NS_LOG_FUNCTION (this << packet << saddr << daddr << sport << dport); UdpHeader udpHeader; udpHeader.SetDestination (dport); diff --git a/src/internet-node/udp-socket.cc b/src/internet-node/udp-socket.cc index 383870c34..97eaceec1 100644 --- a/src/internet-node/udp-socket.cc +++ b/src/internet-node/udp-socket.cc @@ -42,12 +42,12 @@ UdpSocket::UdpSocket () m_shutdownRecv (false), m_connected (false) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } UdpSocket::~UdpSocket () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_node = 0; if (m_endPoint != 0) @@ -83,21 +83,21 @@ UdpSocket::SetUdp (Ptr udp) enum Socket::SocketErrno UdpSocket::GetErrno (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_errno; } Ptr UdpSocket::GetNode (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_node; } void UdpSocket::Destroy (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_node = 0; m_endPoint = 0; m_udp = 0; @@ -106,7 +106,7 @@ UdpSocket::Destroy (void) int UdpSocket::FinishBind (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_endPoint == 0) { return -1; @@ -119,7 +119,7 @@ UdpSocket::FinishBind (void) int UdpSocket::Bind (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_endPoint = m_udp->Allocate (); return FinishBind (); } @@ -127,8 +127,7 @@ UdpSocket::Bind (void) int UdpSocket::Bind (const Address &address) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << address); + NS_LOG_FUNCTION (this << address); if (!InetSocketAddress::IsMatchingType (address)) { @@ -161,7 +160,7 @@ UdpSocket::Bind (const Address &address) int UdpSocket::ShutdownSend (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_shutdownSend = true; return 0; } @@ -169,7 +168,7 @@ UdpSocket::ShutdownSend (void) int UdpSocket::ShutdownRecv (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_shutdownRecv = false; return 0; } @@ -177,7 +176,7 @@ UdpSocket::ShutdownRecv (void) int UdpSocket::Close(void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NotifyCloseCompleted (); return 0; } @@ -185,8 +184,7 @@ UdpSocket::Close(void) int UdpSocket::Connect(const Address & address) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << address); + NS_LOG_FUNCTION (this << address); Ipv4Route routeToDest; InetSocketAddress transport = InetSocketAddress::ConvertFrom (address); m_defaultAddress = transport.GetIpv4 (); @@ -200,8 +198,7 @@ UdpSocket::Connect(const Address & address) int UdpSocket::Send (Ptr p) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p); + NS_LOG_FUNCTION (this << p); if (!m_connected) { @@ -214,7 +211,7 @@ UdpSocket::Send (Ptr p) int UdpSocket::DoSend (Ptr p) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_endPoint == 0) { if (Bind () == -1) @@ -236,8 +233,7 @@ UdpSocket::DoSend (Ptr p) int UdpSocket::DoSendTo (Ptr p, const Address &address) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p << address); + NS_LOG_FUNCTION (this << p << address); if (!m_connected) { @@ -258,8 +254,7 @@ UdpSocket::DoSendTo (Ptr p, const Address &address) int UdpSocket::DoSendTo (Ptr p, Ipv4Address dest, uint16_t port) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p << dest << port); + NS_LOG_FUNCTION (this << p << dest << port); Ipv4Route routeToDest; @@ -322,8 +317,7 @@ UdpSocket::DoSendTo (Ptr p, Ipv4Address dest, uint16_t port) int UdpSocket::SendTo(const Address &address, Ptr p) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << address << p); + NS_LOG_FUNCTION (this << address << p); InetSocketAddress transport = InetSocketAddress::ConvertFrom (address); Ipv4Address ipv4 = transport.GetIpv4 (); uint16_t port = transport.GetPort (); @@ -333,8 +327,7 @@ UdpSocket::SendTo(const Address &address, Ptr p) void UdpSocket::ForwardUp (Ptr packet, Ipv4Address ipv4, uint16_t port) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << packet << ipv4 << port); + NS_LOG_FUNCTION (this << packet << ipv4 << port); if (m_shutdownRecv) { diff --git a/src/mobility/random-direction-2d-mobility-model.cc b/src/mobility/random-direction-2d-mobility-model.cc index d49bd7a62..d05f45143 100644 --- a/src/mobility/random-direction-2d-mobility-model.cc +++ b/src/mobility/random-direction-2d-mobility-model.cc @@ -85,7 +85,7 @@ RandomDirection2dMobilityModel::BeginPause (void) void RandomDirection2dMobilityModel::SetDirectionAndSpeed (double direction) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); double speed = m_speed.GetValue (); const Vector vector (std::cos (direction) * speed, std::sin (direction) * speed, diff --git a/src/node/channel.cc b/src/node/channel.cc index 2e8eb50ba..6f23bad49 100644 --- a/src/node/channel.cc +++ b/src/node/channel.cc @@ -37,33 +37,31 @@ Channel::GetTypeId (void) Channel::Channel () : m_name("Channel") { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } Channel::Channel (std::string name) : m_name(name) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << name); + NS_LOG_FUNCTION (this << name); } Channel::~Channel () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void Channel::SetName(std::string name) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << name); + NS_LOG_FUNCTION (this << name); m_name = name; } std::string Channel::GetName(void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_name; } diff --git a/src/node/drop-tail-queue.cc b/src/node/drop-tail-queue.cc index 0002e2339..3af0b5ccf 100644 --- a/src/node/drop-tail-queue.cc +++ b/src/node/drop-tail-queue.cc @@ -44,19 +44,18 @@ DropTailQueue::DropTailQueue () : Queue (), m_packets () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } DropTailQueue::~DropTailQueue () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } bool DropTailQueue::DoEnqueue (Ptr p) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p); + NS_LOG_FUNCTION (this << p); if (m_packets.size () >= m_maxPackets) { @@ -72,8 +71,7 @@ DropTailQueue::DoEnqueue (Ptr p) Ptr DropTailQueue::DoDequeue (void) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this); + NS_LOG_FUNCTION (this); if (m_packets.empty()) { @@ -92,8 +90,7 @@ DropTailQueue::DoDequeue (void) Ptr DropTailQueue::DoPeek (void) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this); + NS_LOG_FUNCTION (this); if (m_packets.empty()) { diff --git a/src/node/ipv4-address-generator.cc b/src/node/ipv4-address-generator.cc index 292407223..527425b25 100644 --- a/src/node/ipv4-address-generator.cc +++ b/src/node/ipv4-address-generator.cc @@ -78,14 +78,14 @@ private: Ipv4AddressGeneratorImpl::Ipv4AddressGeneratorImpl () : m_entries (), m_test (false) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Reset (); } void Ipv4AddressGeneratorImpl::Reset (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); uint32_t mask = 0; // @@ -123,7 +123,7 @@ Ipv4AddressGeneratorImpl::Reset (void) Ipv4AddressGeneratorImpl::~Ipv4AddressGeneratorImpl () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void @@ -132,7 +132,7 @@ Ipv4AddressGeneratorImpl::Init ( const Ipv4Mask mask, const Ipv4Address addr) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // We're going to be playing with the actual bits in the network and mask so // pull them out into ints. @@ -170,7 +170,7 @@ Ipv4AddressGeneratorImpl::Init ( Ipv4AddressGeneratorImpl::GetNetwork ( const Ipv4Mask mask) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); uint32_t index = MaskToIndex (mask); return Ipv4Address (m_netTable[index].network << m_netTable[index].shift); @@ -180,7 +180,7 @@ Ipv4AddressGeneratorImpl::GetNetwork ( Ipv4AddressGeneratorImpl::NextNetwork ( const Ipv4Mask mask) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // The way this is expected to be used is that an address and network prefix // are initialized, and then NextAddress() is called repeatedly to set the @@ -200,7 +200,7 @@ Ipv4AddressGeneratorImpl::InitAddress ( const Ipv4Address addr, const Ipv4Mask mask) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); uint32_t index = MaskToIndex (mask); uint32_t addrBits = addr.GetHostOrder (); @@ -215,7 +215,7 @@ Ipv4AddressGeneratorImpl::InitAddress ( Ipv4AddressGeneratorImpl::GetAddress ( const Ipv4Mask mask) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); uint32_t index = MaskToIndex (mask); @@ -227,7 +227,7 @@ Ipv4AddressGeneratorImpl::GetAddress ( Ipv4Address Ipv4AddressGeneratorImpl::NextAddress (const Ipv4Mask mask) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // The way this is expected to be used is that an address and network prefix // are initialized, and then NextAddress() is called repeatedly to set the @@ -256,7 +256,7 @@ Ipv4AddressGeneratorImpl::NextAddress (const Ipv4Mask mask) bool Ipv4AddressGeneratorImpl::AddAllocated (const Ipv4Address address) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); uint32_t addr = address.GetHostOrder (); @@ -347,7 +347,7 @@ Ipv4AddressGeneratorImpl::AddAllocated (const Ipv4Address address) void Ipv4AddressGeneratorImpl::TestMode (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_test = true; } @@ -390,7 +390,7 @@ Ipv4AddressGenerator::Init ( const Ipv4Mask mask, const Ipv4Address addr) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); SimulationSingleton::Get () ->Init (net, mask, addr); @@ -399,7 +399,7 @@ Ipv4AddressGenerator::Init ( Ipv4Address Ipv4AddressGenerator::NextNetwork (const Ipv4Mask mask) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return SimulationSingleton::Get () ->NextNetwork (mask); @@ -408,7 +408,7 @@ Ipv4AddressGenerator::NextNetwork (const Ipv4Mask mask) Ipv4Address Ipv4AddressGenerator::GetNetwork (const Ipv4Mask mask) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return SimulationSingleton::Get () ->GetNetwork (mask); @@ -419,7 +419,7 @@ Ipv4AddressGenerator::InitAddress ( const Ipv4Address addr, const Ipv4Mask mask) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); SimulationSingleton::Get () ->InitAddress (addr, mask); @@ -428,7 +428,7 @@ Ipv4AddressGenerator::InitAddress ( Ipv4Address Ipv4AddressGenerator::GetAddress (const Ipv4Mask mask) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return SimulationSingleton::Get () ->GetAddress (mask); @@ -437,7 +437,7 @@ Ipv4AddressGenerator::GetAddress (const Ipv4Mask mask) Ipv4Address Ipv4AddressGenerator::NextAddress (const Ipv4Mask mask) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return SimulationSingleton::Get () ->NextAddress (mask); @@ -446,7 +446,7 @@ Ipv4AddressGenerator::NextAddress (const Ipv4Mask mask) void Ipv4AddressGenerator::Reset (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return SimulationSingleton::Get () ->Reset (); @@ -455,7 +455,7 @@ Ipv4AddressGenerator::Reset (void) bool Ipv4AddressGenerator::AddAllocated (const Ipv4Address addr) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return SimulationSingleton::Get () ->AddAllocated (addr); @@ -464,7 +464,7 @@ Ipv4AddressGenerator::AddAllocated (const Ipv4Address addr) void Ipv4AddressGenerator::TestMode (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); SimulationSingleton::Get () ->TestMode (); diff --git a/src/node/node-list.cc b/src/node/node-list.cc index e687fe5fc..08e3b6f3f 100644 --- a/src/node/node-list.cc +++ b/src/node/node-list.cc @@ -88,7 +88,7 @@ NodeListPriv::DoGet (void) void NodeListPriv::Delete (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Config::UnregisterRootNamespaceObject (Get ()); (*DoGet ()) = 0; } @@ -96,11 +96,11 @@ NodeListPriv::Delete (void) NodeListPriv::NodeListPriv () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } NodeListPriv::~NodeListPriv () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for (std::vector >::iterator i = m_nodes.begin (); i != m_nodes.end (); i++) { diff --git a/src/node/packet-socket.cc b/src/node/packet-socket.cc index 3d7c09ec5..7d3578475 100644 --- a/src/node/packet-socket.cc +++ b/src/node/packet-socket.cc @@ -31,8 +31,7 @@ namespace ns3 { PacketSocket::PacketSocket () { - NS_LOG_FUNCTION; - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_state = STATE_OPEN; m_shutdownSend = false; m_shutdownRecv = false; @@ -47,34 +46,34 @@ PacketSocket::SetNode (Ptr node) PacketSocket::~PacketSocket () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void PacketSocket::DoDispose (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_device = 0; } enum Socket::SocketErrno PacketSocket::GetErrno (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_errno; } Ptr PacketSocket::GetNode (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_node; } int PacketSocket::Bind (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); PacketSocketAddress address; address.SetProtocol (0); address.SetAllDevices (); @@ -84,7 +83,7 @@ PacketSocket::Bind (void) int PacketSocket::Bind (const Address &address) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!PacketSocketAddress::IsMatchingType (address)) { m_errno = ERROR_INVAL; @@ -97,7 +96,7 @@ PacketSocket::Bind (const Address &address) int PacketSocket::DoBind (const PacketSocketAddress &address) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_state == STATE_BOUND || m_state == STATE_CONNECTED) { @@ -130,7 +129,7 @@ PacketSocket::DoBind (const PacketSocketAddress &address) int PacketSocket::ShutdownSend (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_state == STATE_CLOSED) { m_errno = ERROR_BADF; @@ -143,7 +142,7 @@ PacketSocket::ShutdownSend (void) int PacketSocket::ShutdownRecv (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_state == STATE_CLOSED) { m_errno = ERROR_BADF; @@ -156,7 +155,7 @@ PacketSocket::ShutdownRecv (void) int PacketSocket::Close(void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_state == STATE_CLOSED) { m_errno = ERROR_BADF; @@ -170,7 +169,7 @@ PacketSocket::Close(void) int PacketSocket::Connect(const Address &ad) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); PacketSocketAddress address; if (m_state == STATE_CLOSED) { @@ -205,7 +204,7 @@ PacketSocket::Connect(const Address &ad) int PacketSocket::Send (Ptr p) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_state == STATE_OPEN || m_state == STATE_BOUND) { @@ -218,7 +217,7 @@ PacketSocket::Send (Ptr p) int PacketSocket::SendTo(const Address &address, Ptr p) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); PacketSocketAddress ad; if (m_state == STATE_CLOSED) { @@ -291,7 +290,7 @@ void PacketSocket::ForwardUp (Ptr device, Ptr packet, uint16_t protocol, const Address &from) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_shutdownRecv) { return; diff --git a/src/node/queue.cc b/src/node/queue.cc index 5b1852d8b..d4d5c0323 100644 --- a/src/node/queue.cc +++ b/src/node/queue.cc @@ -49,20 +49,19 @@ Queue::Queue() : m_nTotalDroppedBytes(0), m_nTotalDroppedPackets(0) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } Queue::~Queue() { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } bool Queue::Enqueue (Ptr p) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p); + NS_LOG_FUNCTION (this << p); NS_LOG_LOGIC ("m_traceEnqueue (p)"); m_traceEnqueue (p); @@ -79,8 +78,7 @@ Queue::Enqueue (Ptr p) Ptr Queue::Dequeue (void) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this); + NS_LOG_FUNCTION (this); Ptr packet = DoDequeue (); @@ -102,15 +100,14 @@ Queue::Dequeue (void) void Queue::DequeueAll (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_ASSERT_MSG (0, "Don't know what to do with dequeued packets!"); } Ptr Queue::Peek (void) const { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this); + NS_LOG_FUNCTION (this); return DoPeek (); } @@ -118,7 +115,7 @@ Queue::Peek (void) const uint32_t Queue::GetNPackets (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC ("returns " << m_nPackets); return m_nPackets; } @@ -126,7 +123,7 @@ Queue::GetNPackets (void) const uint32_t Queue::GetNBytes (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC (" returns " << m_nBytes); return m_nBytes; } @@ -134,7 +131,7 @@ Queue::GetNBytes (void) const bool Queue::IsEmpty (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC ("returns " << (m_nPackets == 0)); return m_nPackets == 0; } @@ -142,7 +139,7 @@ Queue::IsEmpty (void) const uint32_t Queue::GetTotalReceivedBytes (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC("returns " << m_nTotalReceivedBytes); return m_nTotalReceivedBytes; } @@ -150,7 +147,7 @@ Queue::GetTotalReceivedBytes (void) const uint32_t Queue::GetTotalReceivedPackets (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC ("returns " << m_nTotalReceivedPackets); return m_nTotalReceivedPackets; } @@ -158,7 +155,7 @@ Queue::GetTotalReceivedPackets (void) const uint32_t Queue:: GetTotalDroppedBytes (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC ("returns " << m_nTotalDroppedBytes); return m_nTotalDroppedBytes; } @@ -166,7 +163,7 @@ Queue:: GetTotalDroppedBytes (void) const uint32_t Queue::GetTotalDroppedPackets (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC("returns " << m_nTotalDroppedPackets); return m_nTotalDroppedPackets; } @@ -174,7 +171,7 @@ Queue::GetTotalDroppedPackets (void) const void Queue::ResetStatistics (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_nTotalReceivedBytes = 0; m_nTotalReceivedPackets = 0; m_nTotalDroppedBytes = 0; @@ -184,8 +181,7 @@ Queue::ResetStatistics (void) void Queue::Drop (Ptr p) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << p); + NS_LOG_FUNCTION (this << p); m_nTotalDroppedPackets++; m_nTotalDroppedBytes += p->GetSize (); diff --git a/src/node/socket.cc b/src/node/socket.cc index b909aa1e2..0bf9e95b4 100644 --- a/src/node/socket.cc +++ b/src/node/socket.cc @@ -30,13 +30,13 @@ namespace ns3 { Socket::~Socket () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } void Socket::SetCloseCallback (Callback > closeCompleted) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_closeCompleted = closeCompleted; } @@ -46,7 +46,7 @@ Socket::SetConnectCallback ( Callback > connectionFailed, Callback > halfClose) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_connectionSucceeded = connectionSucceeded; m_connectionFailed = connectionFailed; m_halfClose = halfClose; @@ -58,7 +58,7 @@ Socket::SetAcceptCallback ( Callback, const Address&> newConnectionCreated, Callback > closeRequested) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_connectionRequest = connectionRequest; m_newConnectionCreated = newConnectionCreated; m_closeRequested = closeRequested; @@ -67,20 +67,20 @@ Socket::SetAcceptCallback ( void Socket::SetSendCallback (Callback, uint32_t> dataSent) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_dataSent = dataSent; } void Socket::SetRecvCallback (Callback, Ptr,const Address&> receivedData) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_receivedData = receivedData; } int Socket::Send (const uint8_t* buf, uint32_t size) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ptr p; if (buf) { @@ -95,7 +95,7 @@ int Socket::Send (const uint8_t* buf, uint32_t size) int Socket::SendTo (const Address &address, const uint8_t* buf, uint32_t size) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ptr p; if(buf) { @@ -117,7 +117,7 @@ int Socket::Listen(uint32_t queueLimit) void Socket::NotifyCloseCompleted (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_closeCompleted.IsNull ()) { m_closeCompleted (this); @@ -127,7 +127,7 @@ Socket::NotifyCloseCompleted (void) void Socket::NotifyConnectionSucceeded (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_connectionSucceeded.IsNull ()) { m_connectionSucceeded (this); @@ -137,7 +137,7 @@ Socket::NotifyConnectionSucceeded (void) void Socket::NotifyConnectionFailed (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_connectionFailed.IsNull ()) { m_connectionFailed (this); @@ -147,7 +147,7 @@ Socket::NotifyConnectionFailed (void) void Socket::NotifyHalfClose (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_halfClose.IsNull ()) { m_halfClose (this); @@ -157,7 +157,7 @@ Socket::NotifyHalfClose (void) bool Socket::NotifyConnectionRequest (const Address &from) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_connectionRequest.IsNull ()) { return m_connectionRequest (this, from); @@ -175,7 +175,7 @@ Socket::NotifyConnectionRequest (const Address &from) void Socket::NotifyNewConnectionCreated (Ptr socket, const Address &from) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_newConnectionCreated.IsNull ()) { m_newConnectionCreated (socket, from); @@ -185,7 +185,7 @@ Socket::NotifyNewConnectionCreated (Ptr socket, const Address &from) void Socket::NotifyCloseRequested (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_closeRequested.IsNull ()) { m_closeRequested (this); @@ -195,7 +195,7 @@ Socket::NotifyCloseRequested (void) void Socket::NotifyDataSent (uint32_t size) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_dataSent.IsNull ()) { m_dataSent (this, size); @@ -205,7 +205,7 @@ Socket::NotifyDataSent (uint32_t size) void Socket::NotifyDataReceived (Ptr p, const Address &from) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (!m_receivedData.IsNull ()) { m_receivedData (this, p, from); diff --git a/src/routing/global-routing/candidate-queue.cc b/src/routing/global-routing/candidate-queue.cc index 242e427ae..4f5b3cf27 100644 --- a/src/routing/global-routing/candidate-queue.cc +++ b/src/routing/global-routing/candidate-queue.cc @@ -28,19 +28,19 @@ namespace ns3 { CandidateQueue::CandidateQueue() : m_candidates () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } CandidateQueue::~CandidateQueue() { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Clear (); } void CandidateQueue::Clear (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); while (!m_candidates.empty ()) { SPFVertex *p = Pop (); @@ -52,8 +52,7 @@ CandidateQueue::Clear (void) void CandidateQueue::Push (SPFVertex *vNew) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << vNew); + NS_LOG_FUNCTION (this << vNew); CandidateList_t::iterator i = m_candidates.begin (); @@ -71,7 +70,7 @@ CandidateQueue::Push (SPFVertex *vNew) SPFVertex * CandidateQueue::Pop (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_candidates.empty ()) { return 0; @@ -85,7 +84,7 @@ CandidateQueue::Pop (void) SPFVertex * CandidateQueue::Top (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_candidates.empty ()) { return 0; @@ -97,21 +96,21 @@ CandidateQueue::Top (void) const bool CandidateQueue::Empty (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_candidates.empty (); } uint32_t CandidateQueue::Size (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_candidates.size (); } SPFVertex * CandidateQueue::Find (const Ipv4Address addr) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); CandidateList_t::const_iterator i = m_candidates.begin (); for (; i != m_candidates.end (); i++) @@ -129,7 +128,7 @@ CandidateQueue::Find (const Ipv4Address addr) const void CandidateQueue::Reorder (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); std::list temp; while (!m_candidates.empty ()) { diff --git a/src/routing/global-routing/global-route-manager-impl.cc b/src/routing/global-routing/global-route-manager-impl.cc index 9381c1cff..68d5dc43a 100644 --- a/src/routing/global-routing/global-route-manager-impl.cc +++ b/src/routing/global-routing/global-route-manager-impl.cc @@ -54,7 +54,7 @@ SPFVertex::SPFVertex () : m_parent (0), m_children () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } SPFVertex::SPFVertex (GlobalRoutingLSA* lsa) : @@ -66,7 +66,7 @@ SPFVertex::SPFVertex (GlobalRoutingLSA* lsa) : m_parent (0), m_children () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (lsa->GetLSType () == GlobalRoutingLSA::RouterLSA) { NS_LOG_LOGIC ("Setting m_vertexType to VertexRouter"); @@ -81,7 +81,7 @@ SPFVertex::SPFVertex (GlobalRoutingLSA* lsa) : SPFVertex::~SPFVertex () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for ( ListOfSPFVertex_t::iterator i = m_children.begin (); i != m_children.end (); i++) @@ -97,112 +97,112 @@ SPFVertex::~SPFVertex () void SPFVertex::SetVertexType (SPFVertex::VertexType type) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_vertexType = type; } SPFVertex::VertexType SPFVertex::GetVertexType (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_vertexType; } void SPFVertex::SetVertexId (Ipv4Address id) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_vertexId = id; } Ipv4Address SPFVertex::GetVertexId (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_vertexId; } void SPFVertex::SetLSA (GlobalRoutingLSA* lsa) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_lsa = lsa; } GlobalRoutingLSA* SPFVertex::GetLSA (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_lsa; } void SPFVertex::SetDistanceFromRoot (uint32_t distance) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_distanceFromRoot = distance; } uint32_t SPFVertex::GetDistanceFromRoot (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_distanceFromRoot; } void SPFVertex::SetOutgoingTypeId (uint32_t id) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_rootOif = id; } uint32_t SPFVertex::GetOutgoingTypeId (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_rootOif; } void SPFVertex::SetNextHop (Ipv4Address nextHop) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_nextHop = nextHop; } Ipv4Address SPFVertex::GetNextHop (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_nextHop; } void SPFVertex::SetParent (SPFVertex* parent) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_parent = parent; } SPFVertex* SPFVertex::GetParent (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_parent; } uint32_t SPFVertex::GetNChildren (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_children.size (); } SPFVertex* SPFVertex::GetChild (uint32_t n) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); uint32_t j = 0; for ( ListOfSPFVertex_t::const_iterator i = m_children.begin (); @@ -221,7 +221,7 @@ SPFVertex::GetChild (uint32_t n) const uint32_t SPFVertex::AddChild (SPFVertex* child) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_children.push_back (child); return m_children.size (); } @@ -236,12 +236,12 @@ GlobalRouteManagerLSDB::GlobalRouteManagerLSDB () : m_database () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } GlobalRouteManagerLSDB::~GlobalRouteManagerLSDB () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); LSDBMap_t::iterator i; for (i= m_database.begin (); i!= m_database.end (); i++) { @@ -256,7 +256,7 @@ GlobalRouteManagerLSDB::~GlobalRouteManagerLSDB () void GlobalRouteManagerLSDB::Initialize () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); LSDBMap_t::iterator i; for (i= m_database.begin (); i!= m_database.end (); i++) { @@ -268,14 +268,14 @@ GlobalRouteManagerLSDB::Initialize () void GlobalRouteManagerLSDB::Insert (Ipv4Address addr, GlobalRoutingLSA* lsa) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_database.insert (LSDBPair_t (addr, lsa)); } GlobalRoutingLSA* GlobalRouteManagerLSDB::GetLSA (Ipv4Address addr) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // Look up an LSA by its address. // @@ -293,7 +293,7 @@ GlobalRouteManagerLSDB::GetLSA (Ipv4Address addr) const GlobalRoutingLSA* GlobalRouteManagerLSDB::GetLSAByLinkData (Ipv4Address addr) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // Look up an LSA by its address. // @@ -325,13 +325,13 @@ GlobalRouteManagerImpl::GlobalRouteManagerImpl () : m_spfroot (0) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_lsdb = new GlobalRouteManagerLSDB (); } GlobalRouteManagerImpl::~GlobalRouteManagerImpl () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_lsdb) { delete m_lsdb; @@ -341,7 +341,7 @@ GlobalRouteManagerImpl::~GlobalRouteManagerImpl () void GlobalRouteManagerImpl::DebugUseLsdb (GlobalRouteManagerLSDB* lsdb) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); if (m_lsdb) { delete m_lsdb; @@ -359,7 +359,7 @@ GlobalRouteManagerImpl::DebugUseLsdb (GlobalRouteManagerLSDB* lsdb) void GlobalRouteManagerImpl::SelectRouterNodes () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); i++) { Ptr node = *i; @@ -383,7 +383,7 @@ GlobalRouteManagerImpl::SelectRouterNodes () void GlobalRouteManagerImpl::BuildGlobalRoutingDatabase () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // Walk the list of nodes looking for the GlobalRouter Interface. // @@ -464,7 +464,7 @@ GlobalRouteManagerImpl::BuildGlobalRoutingDatabase () void GlobalRouteManagerImpl::InitializeRoutes () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // Walk the list of nodes in the system. // @@ -504,7 +504,7 @@ GlobalRouteManagerImpl::InitializeRoutes () void GlobalRouteManagerImpl::SPFNext (SPFVertex* v, CandidateQueue& candidate) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); SPFVertex* w = 0; GlobalRoutingLSA* w_lsa = 0; @@ -706,7 +706,7 @@ GlobalRouteManagerImpl::SPFNexthopCalculation ( GlobalRoutingLinkRecord* l, uint32_t distance) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // If w is a NetworkVertex, l should be null /* @@ -891,7 +891,7 @@ GlobalRouteManagerImpl::SPFGetNextLink ( SPFVertex* w, GlobalRoutingLinkRecord* prev_link) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); bool skip = true; bool found_prev_link = false; @@ -966,7 +966,7 @@ GlobalRouteManagerImpl::SPFGetNextLink ( void GlobalRouteManagerImpl::DebugSPFCalculate (Ipv4Address root) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); SPFCalculate (root); } @@ -974,8 +974,7 @@ GlobalRouteManagerImpl::DebugSPFCalculate (Ipv4Address root) void GlobalRouteManagerImpl::SPFCalculate (Ipv4Address root) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << root); + NS_LOG_FUNCTION (this << root); SPFVertex *v; // @@ -1124,7 +1123,7 @@ GlobalRouteManagerImpl::SPFCalculate (Ipv4Address root) uint32_t GlobalRouteManagerImpl::FindOutgoingTypeId (Ipv4Address a, Ipv4Mask amask) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); // // We have an IP address and a vertex ID of the root of the SPF tree. // The question is what interface index does this address correspond to. @@ -1200,7 +1199,7 @@ GlobalRouteManagerImpl::FindOutgoingTypeId (Ipv4Address a, Ipv4Mask amask) void GlobalRouteManagerImpl::SPFIntraAddRouter (SPFVertex* v) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_ASSERT_MSG (m_spfroot, "GlobalRouteManagerImpl::SPFIntraAddRouter (): Root pointer not set"); @@ -1317,7 +1316,7 @@ GlobalRouteManagerImpl::SPFIntraAddRouter (SPFVertex* v) void GlobalRouteManagerImpl::SPFIntraAddTransit (SPFVertex* v) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_ASSERT_MSG (m_spfroot, "GlobalRouteManagerImpl::SPFIntraAddTransit (): Root pointer not set"); @@ -1410,7 +1409,7 @@ GlobalRouteManagerImpl::SPFIntraAddTransit (SPFVertex* v) void GlobalRouteManagerImpl::SPFVertexAddParent (SPFVertex* v) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); v->GetParent ()->AddChild (v); } diff --git a/src/routing/global-routing/global-router-interface.cc b/src/routing/global-routing/global-router-interface.cc index 500aca863..cda479043 100644 --- a/src/routing/global-routing/global-router-interface.cc +++ b/src/routing/global-routing/global-router-interface.cc @@ -43,7 +43,7 @@ GlobalRoutingLinkRecord::GlobalRoutingLinkRecord () m_linkType (Unknown), m_metric (0) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } GlobalRoutingLinkRecord::GlobalRoutingLinkRecord ( @@ -57,47 +57,46 @@ GlobalRoutingLinkRecord::GlobalRoutingLinkRecord ( m_linkType (linkType), m_metric (metric) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << linkType << linkId << linkData << metric); + NS_LOG_FUNCTION (this << linkType << linkId << linkData << metric); } GlobalRoutingLinkRecord::~GlobalRoutingLinkRecord () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } Ipv4Address GlobalRoutingLinkRecord::GetLinkId (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_linkId; } void GlobalRoutingLinkRecord::SetLinkId (Ipv4Address addr) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_linkId = addr; } Ipv4Address GlobalRoutingLinkRecord::GetLinkData (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_linkData; } void GlobalRoutingLinkRecord::SetLinkData (Ipv4Address addr) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_linkData = addr; } GlobalRoutingLinkRecord::LinkType GlobalRoutingLinkRecord::GetLinkType (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_linkType; } @@ -105,21 +104,21 @@ GlobalRoutingLinkRecord::GetLinkType (void) const GlobalRoutingLinkRecord::SetLinkType ( GlobalRoutingLinkRecord::LinkType linkType) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_linkType = linkType; } uint16_t GlobalRoutingLinkRecord::GetMetric (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_metric; } void GlobalRoutingLinkRecord::SetMetric (uint16_t metric) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_metric = metric; } @@ -139,7 +138,7 @@ GlobalRoutingLSA::GlobalRoutingLSA() m_attachedRouters(), m_status(GlobalRoutingLSA::LSA_SPF_NOT_EXPLORED) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); } GlobalRoutingLSA::GlobalRoutingLSA ( @@ -155,8 +154,7 @@ GlobalRoutingLSA::GlobalRoutingLSA ( m_attachedRouters(), m_status(status) { - NS_LOG_FUNCTION; - NS_LOG_PARAMS (this << status << linkStateId << advertisingRtr); + NS_LOG_FUNCTION (this << status << linkStateId << advertisingRtr); } GlobalRoutingLSA::GlobalRoutingLSA (GlobalRoutingLSA& lsa) @@ -165,7 +163,7 @@ GlobalRoutingLSA::GlobalRoutingLSA (GlobalRoutingLSA& lsa) m_networkLSANetworkMask(lsa.m_networkLSANetworkMask), m_status(lsa.m_status) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_ASSERT_MSG(IsEmpty(), "GlobalRoutingLSA::GlobalRoutingLSA (): Non-empty LSA in constructor"); CopyLinkRecords (lsa); @@ -174,7 +172,7 @@ GlobalRoutingLSA::GlobalRoutingLSA (GlobalRoutingLSA& lsa) GlobalRoutingLSA& GlobalRoutingLSA::operator= (const GlobalRoutingLSA& lsa) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_lsType = lsa.m_lsType; m_linkStateId = lsa.m_linkStateId; m_advertisingRtr = lsa.m_advertisingRtr; @@ -189,7 +187,7 @@ GlobalRoutingLSA::operator= (const GlobalRoutingLSA& lsa) void GlobalRoutingLSA::CopyLinkRecords (const GlobalRoutingLSA& lsa) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for (ListOfLinkRecords_t::const_iterator i = lsa.m_linkRecords.begin (); i != lsa.m_linkRecords.end (); i++) @@ -211,14 +209,14 @@ GlobalRoutingLSA::CopyLinkRecords (const GlobalRoutingLSA& lsa) GlobalRoutingLSA::~GlobalRoutingLSA() { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); ClearLinkRecords (); } void GlobalRoutingLSA::ClearLinkRecords(void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for ( ListOfLinkRecords_t::iterator i = m_linkRecords.begin (); i != m_linkRecords.end (); i++) @@ -238,7 +236,7 @@ GlobalRoutingLSA::ClearLinkRecords(void) uint32_t GlobalRoutingLSA::AddLinkRecord (GlobalRoutingLinkRecord* lr) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_linkRecords.push_back (lr); return m_linkRecords.size (); } @@ -246,14 +244,14 @@ GlobalRoutingLSA::AddLinkRecord (GlobalRoutingLinkRecord* lr) uint32_t GlobalRoutingLSA::GetNLinkRecords (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_linkRecords.size (); } GlobalRoutingLinkRecord * GlobalRoutingLSA::GetLinkRecord (uint32_t n) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); uint32_t j = 0; for ( ListOfLinkRecords_t::const_iterator i = m_linkRecords.begin (); i != m_linkRecords.end (); @@ -271,77 +269,77 @@ GlobalRoutingLSA::GetLinkRecord (uint32_t n) const bool GlobalRoutingLSA::IsEmpty (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_linkRecords.size () == 0; } GlobalRoutingLSA::LSType GlobalRoutingLSA::GetLSType (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_lsType; } void GlobalRoutingLSA::SetLSType (GlobalRoutingLSA::LSType typ) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_lsType = typ; } Ipv4Address GlobalRoutingLSA::GetLinkStateId (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_linkStateId; } void GlobalRoutingLSA::SetLinkStateId (Ipv4Address addr) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_linkStateId = addr; } Ipv4Address GlobalRoutingLSA::GetAdvertisingRouter (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_advertisingRtr; } void GlobalRoutingLSA::SetAdvertisingRouter (Ipv4Address addr) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_advertisingRtr = addr; } void GlobalRoutingLSA::SetNetworkLSANetworkMask (Ipv4Mask mask) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_networkLSANetworkMask = mask; } Ipv4Mask GlobalRoutingLSA::GetNetworkLSANetworkMask (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_networkLSANetworkMask; } GlobalRoutingLSA::SPFStatus GlobalRoutingLSA::GetStatus (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_status; } uint32_t GlobalRoutingLSA::AddAttachedRouter (Ipv4Address addr) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_attachedRouters.push_back (addr); return m_attachedRouters.size (); } @@ -349,14 +347,14 @@ GlobalRoutingLSA::AddAttachedRouter (Ipv4Address addr) uint32_t GlobalRoutingLSA::GetNAttachedRouters (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_attachedRouters.size (); } Ipv4Address GlobalRoutingLSA::GetAttachedRouter (uint32_t n) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); uint32_t j = 0; for ( ListOfAttachedRouters_t::const_iterator i = m_attachedRouters.begin (); i != m_attachedRouters.end (); @@ -375,7 +373,7 @@ GlobalRoutingLSA::GetAttachedRouter (uint32_t n) const void GlobalRoutingLSA::SetStatus (GlobalRoutingLSA::SPFStatus status) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_status = status; } @@ -444,27 +442,27 @@ GlobalRouter::GetTypeId (void) GlobalRouter::GlobalRouter () : m_LSAs() { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_routerId.Set(GlobalRouteManager::AllocateRouterId ()); } GlobalRouter::~GlobalRouter () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); ClearLSAs(); } void GlobalRouter::DoDispose () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Object::DoDispose (); } void GlobalRouter::ClearLSAs () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); for ( ListOfLSAs_t::iterator i = m_LSAs.begin (); i != m_LSAs.end (); i++) @@ -484,7 +482,7 @@ GlobalRouter::ClearLSAs () Ipv4Address GlobalRouter::GetRouterId (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_routerId; } @@ -495,7 +493,7 @@ GlobalRouter::GetRouterId (void) const uint32_t GlobalRouter::DiscoverLSAs (void) { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ptr node = GetObject (); NS_LOG_LOGIC("For node " << node->GetId () ); NS_ASSERT_MSG(node, @@ -765,7 +763,7 @@ GlobalRouter::FindDesignatedRouterForLink (Ptr node, uint32_t GlobalRouter::GetNumLSAs (void) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); return m_LSAs.size (); } @@ -775,7 +773,7 @@ GlobalRouter::GetNumLSAs (void) const bool GlobalRouter::GetLSA (uint32_t n, GlobalRoutingLSA &lsa) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); 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 @@ -805,7 +803,7 @@ GlobalRouter::GetLSA (uint32_t n, GlobalRoutingLSA &lsa) const Ptr GlobalRouter::GetAdjacent(Ptr nd, Ptr ch) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); NS_ASSERT_MSG(ch->GetNDevices() == 2, "GlobalRouter::GetAdjacent (): Channel with other than two devices"); // @@ -841,7 +839,7 @@ GlobalRouter::GetAdjacent(Ptr nd, Ptr ch) const uint32_t GlobalRouter::FindIfIndexForDevice(Ptr node, Ptr nd) const { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); Ptr ipv4 = node->GetObject (); NS_ASSERT_MSG(ipv4, "QI for interface failed"); for (uint32_t i = 0; i < ipv4->GetNInterfaces(); ++i ) diff --git a/src/routing/olsr/routing-table.cc b/src/routing/olsr/routing-table.cc index 992db5b0d..3fed01438 100644 --- a/src/routing/olsr/routing-table.cc +++ b/src/routing/olsr/routing-table.cc @@ -40,7 +40,7 @@ NS_LOG_COMPONENT_DEFINE ("OlsrRoutingTable"); void RoutingTable::Clear () { - NS_LOG_FUNCTION; + NS_LOG_FUNCTION_NOARGS (); m_table.clear (); } @@ -183,7 +183,7 @@ RoutingTable::AddEntry (Ipv4Address const &dest, uint32_t interface, uint32_t distance) { - NS_LOG_PARAMS (this << dest << next << interface << distance << m_mainAddress); + NS_LOG_FUNCTION (this << dest << next << interface << distance << m_mainAddress); NS_ASSERT (distance > 0); @@ -202,7 +202,7 @@ RoutingTable::AddEntry (Ipv4Address const &dest, Ipv4Address const &interfaceAddress, uint32_t distance) { - NS_LOG_PARAMS (this << dest << next << interfaceAddress << distance << m_mainAddress); + NS_LOG_FUNCTION (this << dest << next << interfaceAddress << distance << m_mainAddress); NS_ASSERT (distance > 0); NS_ASSERT (m_ipv4);