diff --git a/src/internet/model/ipv4-l3-protocol.cc b/src/internet/model/ipv4-l3-protocol.cc index 1f766bccc..e83e0aaab 100644 --- a/src/internet/model/ipv4-l3-protocol.cc +++ b/src/internet/model/ipv4-l3-protocol.cc @@ -585,14 +585,14 @@ Ipv4L3Protocol::Receive ( Ptr device, Ptr p, uint16_t p if (ipv4Interface->IsUp ()) { - m_rxTrace (packet, m_node->GetObject (), interface); + m_rxTrace (packet, this, interface); } else { NS_LOG_LOGIC ("Dropping received packet -- interface is down"); Ipv4Header ipHeader; packet->RemoveHeader (ipHeader); - m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, Ptr (this), interface); + m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, this, interface); return; } @@ -612,7 +612,7 @@ Ipv4L3Protocol::Receive ( Ptr device, Ptr p, uint16_t p if (!ipHeader.IsChecksumOk ()) { NS_LOG_LOGIC ("Dropping received packet -- checksum not ok"); - m_dropTrace (ipHeader, packet, DROP_BAD_CHECKSUM, Ptr (this), interface); + m_dropTrace (ipHeader, packet, DROP_BAD_CHECKSUM, this, interface); return; } @@ -656,7 +656,7 @@ Ipv4L3Protocol::Receive ( Ptr device, Ptr p, uint16_t p if (m_enableDpd && ipHeader.GetDestination ().IsMulticast () && UpdateDuplicate (packet, ipHeader)) { NS_LOG_LOGIC ("Dropping received packet -- duplicate."); - m_dropTrace (ipHeader, packet, DROP_DUPLICATE, Ptr (this), interface); + m_dropTrace (ipHeader, packet, DROP_DUPLICATE, this, interface); return; } @@ -669,7 +669,7 @@ Ipv4L3Protocol::Receive ( Ptr device, Ptr p, uint16_t p )) { NS_LOG_WARN ("No route found for forwarding packet. Drop."); - m_dropTrace (ipHeader, packet, DROP_NO_ROUTE, Ptr (this), interface); + m_dropTrace (ipHeader, packet, DROP_NO_ROUTE, this, interface); } } @@ -898,7 +898,7 @@ Ipv4L3Protocol::Send (Ptr packet, else { NS_LOG_WARN ("No route to host. Drop."); - m_dropTrace (ipHeader, packet, DROP_NO_ROUTE, Ptr (this), 0); + m_dropTrace (ipHeader, packet, DROP_NO_ROUTE, this, 0); DecreaseIdentification (source, destination, protocol); } } @@ -971,7 +971,7 @@ Ipv4L3Protocol::SendRealOut (Ptr route, if (route == 0) { NS_LOG_WARN ("No route to host. Drop."); - m_dropTrace (ipHeader, packet, DROP_NO_ROUTE, Ptr (this), 0); + m_dropTrace (ipHeader, packet, DROP_NO_ROUTE, this, 0); return; } Ptr outDev = route->GetOutputDevice (); @@ -1003,13 +1003,13 @@ Ipv4L3Protocol::SendRealOut (Ptr route, for ( std::list::iterator it = listFragments.begin (); it != listFragments.end (); it++ ) { NS_LOG_LOGIC ("Sending fragment " << *(it->first) ); - CallTxTrace (it->second, it->first, Ptr (this), interface); + CallTxTrace (it->second, it->first, this, interface); outInterface->Send (it->first, it->second, target); } } else { - CallTxTrace (ipHeader, packet, Ptr (this), interface); + CallTxTrace (ipHeader, packet, this, interface); outInterface->Send (packet, ipHeader, target); } } @@ -1036,7 +1036,7 @@ Ipv4L3Protocol::IpMulticastForward (Ptr mrtentry, Ptr rtentry, Ptr p, const Ip icmp->SendTimeExceededTtl (ipHeader, packet, false); } NS_LOG_WARN ("TTL exceeded. Drop."); - m_dropTrace (header, packet, DROP_TTL_EXPIRED, Ptr (this), interface); + m_dropTrace (header, packet, DROP_TTL_EXPIRED, this, interface); return; } // in case the packet still has a priority tag attached, remove it @@ -1434,7 +1434,7 @@ Ipv4L3Protocol::RouteInputError (Ptr p, const Ipv4Header & ipHeade { NS_LOG_FUNCTION (this << p << ipHeader << sockErrno); NS_LOG_LOGIC ("Route input failure-- dropping packet to " << ipHeader << " with errno " << sockErrno); - m_dropTrace (ipHeader, p, DROP_ROUTE_ERROR, Ptr (this), 0); + m_dropTrace (ipHeader, p, DROP_ROUTE_ERROR, this, 0); // \todo Send an ICMP no route. } @@ -1734,7 +1734,7 @@ Ipv4L3Protocol::HandleFragmentsTimeout (FragmentKey_t key, Ipv4Header & ipHeader Ptr icmp = GetIcmp (); icmp->SendTimeExceededTtl (ipHeader, packet, true); } - m_dropTrace (ipHeader, packet, DROP_FRAGMENT_TIMEOUT, Ptr (this), iif); + m_dropTrace (ipHeader, packet, DROP_FRAGMENT_TIMEOUT, this, iif); // clear the buffers it->second = 0; diff --git a/src/internet/model/ipv6-l3-protocol.cc b/src/internet/model/ipv6-l3-protocol.cc index 10a517fec..bc5086663 100644 --- a/src/internet/model/ipv6-l3-protocol.cc +++ b/src/internet/model/ipv6-l3-protocol.cc @@ -927,7 +927,7 @@ void Ipv6L3Protocol::Send (Ptr packet, Ipv6Address source, Ipv6Address d else { NS_LOG_WARN ("No route to host, drop!"); - m_dropTrace (hdr, packet, DROP_NO_ROUTE, Ptr (this), GetInterfaceForDevice (oif)); + m_dropTrace (hdr, packet, DROP_NO_ROUTE, this, GetInterfaceForDevice (oif)); } } @@ -944,14 +944,14 @@ void Ipv6L3Protocol::Receive (Ptr device, Ptr p, uint16 if (ipv6Interface->IsUp ()) { - m_rxTrace (packet, Ptr (this), interface); + m_rxTrace (packet, this, interface); } else { NS_LOG_LOGIC ("Dropping received packet-- interface is down"); Ipv6Header hdr; packet->RemoveHeader (hdr); - m_dropTrace (hdr, packet, DROP_INTERFACE_DOWN, Ptr (this), interface); + m_dropTrace (hdr, packet, DROP_INTERFACE_DOWN, this, interface); return; } @@ -1015,7 +1015,7 @@ void Ipv6L3Protocol::Receive (Ptr device, Ptr p, uint16 if (isDropped) { - m_dropTrace (hdr, packet, dropReason, Ptr (this), interface); + m_dropTrace (hdr, packet, dropReason, this, interface); } if (stopProcessing) @@ -1177,20 +1177,20 @@ void Ipv6L3Protocol::SendRealOut (Ptr route, Ptr packet, Ipv6 for (std::list::const_iterator it = fragments.begin (); it != fragments.end (); it++) { - CallTxTrace (it->second, it->first, Ptr (this), interface); + CallTxTrace (it->second, it->first, this, interface); outInterface->Send (it->first, it->second, route->GetGateway ()); } } else { - CallTxTrace (ipHeader, packet, Ptr (this), interface); + CallTxTrace (ipHeader, packet, this, interface); outInterface->Send (packet, ipHeader, route->GetGateway ()); } } else { NS_LOG_LOGIC ("Dropping-- outgoing interface is down: " << route->GetGateway ()); - m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, Ptr (this), interface); + m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, this, interface); } } else @@ -1205,20 +1205,20 @@ void Ipv6L3Protocol::SendRealOut (Ptr route, Ptr packet, Ipv6 for (std::list::const_iterator it = fragments.begin (); it != fragments.end (); it++) { - CallTxTrace (it->second, it->first, Ptr (this), interface); + CallTxTrace (it->second, it->first, this, interface); outInterface->Send (it->first, it->second, ipHeader.GetDestination ()); } } else { - CallTxTrace (ipHeader, packet, Ptr (this), interface); + CallTxTrace (ipHeader, packet, this, interface); outInterface->Send (packet, ipHeader, ipHeader.GetDestination ()); } } else { NS_LOG_LOGIC ("Dropping-- outgoing interface is down: " << ipHeader.GetDestination ()); - m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, Ptr (this), interface); + m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, this, interface); } } } @@ -1232,7 +1232,7 @@ void Ipv6L3Protocol::IpForward (Ptr idev, Ptr rtentr if (header.GetDestination().IsDocumentation ()) { NS_LOG_WARN ("Received a packet for 2001:db8::/32 (documentation class). Drop."); - m_dropTrace (header, p, DROP_ROUTE_ERROR, Ptr (this), 0); + m_dropTrace (header, p, DROP_ROUTE_ERROR, this, 0); return; } @@ -1250,7 +1250,7 @@ void Ipv6L3Protocol::IpForward (Ptr idev, Ptr rtentr if (ipHeader.GetHopLimit () == 0) { NS_LOG_WARN ("TTL exceeded. Drop."); - m_dropTrace (ipHeader, packet, DROP_TTL_EXPIRED, Ptr (this), 0); + m_dropTrace (ipHeader, packet, DROP_TTL_EXPIRED, this, 0); // Do not reply to multicast IPv6 address if (ipHeader.GetDestination ().IsMulticast () == false) { @@ -1325,7 +1325,7 @@ void Ipv6L3Protocol::IpMulticastForward (Ptr idev, Ptr packet, Ipv6Header const& i if (isDropped) { - m_dropTrace (ip, packet, dropReason, Ptr (this), iif); + m_dropTrace (ip, packet, dropReason, this, iif); } if (stopProcessing) @@ -1412,7 +1412,7 @@ void Ipv6L3Protocol::LocalDeliver (Ptr packet, Ipv6Header const& i { GetIcmpv6 ()->SendErrorParameterError (malformedPacket, dst, Icmpv6Header::ICMPV6_UNKNOWN_NEXT_HEADER, ip.GetSerializedSize () + nextHeaderPosition); } - m_dropTrace (ip, p, DROP_UNKNOWN_PROTOCOL, Ptr (this), iif); + m_dropTrace (ip, p, DROP_UNKNOWN_PROTOCOL, this, iif); break; } else @@ -1456,7 +1456,7 @@ void Ipv6L3Protocol::RouteInputError (Ptr p, const Ipv6Header& ipH NS_LOG_FUNCTION (this << p << ipHeader << sockErrno); NS_LOG_LOGIC ("Route input failure-- dropping packet to " << ipHeader << " with errno " << sockErrno); - m_dropTrace (ipHeader, p, DROP_ROUTE_ERROR, Ptr (this), 0); + m_dropTrace (ipHeader, p, DROP_ROUTE_ERROR, this, 0); if (!ipHeader.GetDestination ().IsMulticast ()) { @@ -1537,7 +1537,7 @@ void Ipv6L3Protocol::RegisterOptions () void Ipv6L3Protocol::ReportDrop (Ipv6Header ipHeader, Ptr p, DropReason dropReason) { - m_dropTrace (ipHeader, p, dropReason, Ptr (this), 0); + m_dropTrace (ipHeader, p, dropReason, this, 0); } void Ipv6L3Protocol::AddMulticastAddress (Ipv6Address address, uint32_t interface)