From 9d5db73acb2bb7de2177fb4c2b449b0b967b2da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vedran=20Mileti=C4=87?= Date: Tue, 3 Apr 2012 18:59:41 +0200 Subject: [PATCH] Add time to UdpEchoClient and UdpEchoServer NS_LOG_INFO output. --- src/applications/model/udp-echo-client.cc | 8 ++++---- src/applications/model/udp-echo-server.cc | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/applications/model/udp-echo-client.cc b/src/applications/model/udp-echo-client.cc index 591d1c6aa..9c71d664e 100644 --- a/src/applications/model/udp-echo-client.cc +++ b/src/applications/model/udp-echo-client.cc @@ -308,12 +308,12 @@ UdpEchoClient::Send (void) if (Ipv4Address::IsMatchingType (m_peerAddress)) { - NS_LOG_INFO ("Client sent " << m_size << " bytes to " << + NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s client sent " << m_size << " bytes to " << Ipv4Address::ConvertFrom (m_peerAddress) << " port " << m_peerPort); } else if (Ipv6Address::IsMatchingType (m_peerAddress)) { - NS_LOG_INFO ("Client sent " << m_size << " bytes to " << + NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s client sent " << m_size << " bytes to " << Ipv6Address::ConvertFrom (m_peerAddress) << " port " << m_peerPort); } @@ -333,13 +333,13 @@ UdpEchoClient::HandleRead (Ptr socket) { if (InetSocketAddress::IsMatchingType (from)) { - NS_LOG_INFO ("Client received " << packet->GetSize () << " bytes from " << + NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s client received " << packet->GetSize () << " bytes from " << InetSocketAddress::ConvertFrom (from).GetIpv4 () << " port " << InetSocketAddress::ConvertFrom (from).GetPort ()); } else if (Inet6SocketAddress::IsMatchingType (from)) { - NS_LOG_INFO ("Client received " << packet->GetSize () << " bytes from " << + NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s client received " << packet->GetSize () << " bytes from " << Inet6SocketAddress::ConvertFrom (from).GetIpv6 () << " port " << Inet6SocketAddress::ConvertFrom (from).GetPort ()); } diff --git a/src/applications/model/udp-echo-server.cc b/src/applications/model/udp-echo-server.cc index 662a50923..4da3a54d3 100644 --- a/src/applications/model/udp-echo-server.cc +++ b/src/applications/model/udp-echo-server.cc @@ -147,13 +147,13 @@ UdpEchoServer::HandleRead (Ptr socket) { if (InetSocketAddress::IsMatchingType (from)) { - NS_LOG_INFO ("Server received " << packet->GetSize () << " bytes from " << + NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s server received " << packet->GetSize () << " bytes from " << InetSocketAddress::ConvertFrom (from).GetIpv4 () << " port " << InetSocketAddress::ConvertFrom (from).GetPort ()); } else if (Inet6SocketAddress::IsMatchingType (from)) { - NS_LOG_INFO ("Server received " << packet->GetSize () << " bytes from " << + NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s server received " << packet->GetSize () << " bytes from " << Inet6SocketAddress::ConvertFrom (from).GetIpv6 () << " port " << InetSocketAddress::ConvertFrom (from).GetPort ()); } @@ -166,13 +166,13 @@ UdpEchoServer::HandleRead (Ptr socket) if (InetSocketAddress::IsMatchingType (from)) { - NS_LOG_INFO ("Server sent " << packet->GetSize () << " bytes to " << + NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s server sent " << packet->GetSize () << " bytes to " << InetSocketAddress::ConvertFrom (from).GetIpv4 () << " port " << InetSocketAddress::ConvertFrom (from).GetPort ()); } else if (Inet6SocketAddress::IsMatchingType (from)) { - NS_LOG_INFO ("Server sent " << packet->GetSize () << " bytes to " << + NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s server sent " << packet->GetSize () << " bytes to " << Inet6SocketAddress::ConvertFrom (from).GetIpv6 () << " port " << InetSocketAddress::ConvertFrom (from).GetPort ()); }