From 11a58a55c367a68b969eff96aa76e57b4883799c Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Thu, 15 Nov 2007 16:08:28 +0000 Subject: [PATCH] Add a few NS_LOG_LOGIC calls in PacketSocket::SendTo () --- src/node/packet-socket.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/node/packet-socket.cc b/src/node/packet-socket.cc index 448b84334..000d95966 100644 --- a/src/node/packet-socket.cc +++ b/src/node/packet-socket.cc @@ -222,22 +222,26 @@ PacketSocket::SendTo(const Address &address, const Packet &p) PacketSocketAddress ad; if (m_state == STATE_CLOSED) { + NS_LOG_LOGIC ("ERROR_BADF"); m_errno = ERROR_BADF; return -1; } if (m_state == STATE_OPEN) { // XXX should return another error here. + NS_LOG_LOGIC ("ERROR_INVAL"); m_errno = ERROR_INVAL; return -1; } if (m_shutdownSend) { + NS_LOG_LOGIC ("ERROR_SHUTDOWN"); m_errno = ERROR_SHUTDOWN; return -1; } if (!PacketSocketAddress::IsMatchingType (address)) { + NS_LOG_LOGIC ("ERROR_AFNOSUPPORT"); m_errno = ERROR_AFNOSUPPORT; return -1; } @@ -250,6 +254,7 @@ PacketSocket::SendTo(const Address &address, const Packet &p) Ptr device = m_node->GetDevice (ad.GetSingleDevice ()); if (!device->Send (p, dest, ad.GetProtocol ())) { + NS_LOG_LOGIC ("error: NetDevice::Send error"); error = true; } } @@ -260,6 +265,7 @@ PacketSocket::SendTo(const Address &address, const Packet &p) Ptr device = m_node->GetDevice (i); if (!device->Send (p, dest, ad.GetProtocol ())) { + NS_LOG_LOGIC ("error: NetDevice::Send error"); error = true; } } @@ -271,6 +277,7 @@ PacketSocket::SendTo(const Address &address, const Packet &p) if (error) { + NS_LOG_LOGIC ("ERROR_INVAL 2"); m_errno = ERROR_INVAL; return -1; }