[Ns-bugs] [Bug 671] RecvIfIndex tag in sockets
code@nsnam.ece.gatech.edu
code at nsnam.ece.gatech.edu
Fri Nov 27 15:52:27 PST 2009
http://www.nsnam.org/bugzilla/show_bug.cgi?id=671
Tom Henderson <tomh at tomh.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tomh at tomh.org
--- Comment #2 from Tom Henderson <tomh at tomh.org> 2009-11-27 18:52:26 EDT ---
> Index: src/node/node.cc
> ===================================================================
> --- a/src/node/node.cc
> +++ b/src/node/node.cc
> @@ -28,6 +28,7 @@
> #include "ns3/uinteger.h"
> #include "ns3/log.h"
> #include "ns3/assert.h"
> +#include "ns3/socket.h"
>
> NS_LOG_COMPONENT_DEFINE ("Node");
>
> @@ -247,6 +248,10 @@
> << ") Packet UID " << packet->GetUid ());
> bool found = false;
>
> + SocketRecvIfTag tag;
> + tag.SetRecvIf (device->GetIfIndex());
> + packet->AddTag (tag);
The above is obsolete Tag usage. Needs to be a byte or packet tag. Suggest
PacketTag.
> +
> + virtual void SetIfIndex(uint32_t ifIndex);
>
> +void
> +Socket::SetIfIndex(uint32_t ifIndex)
> +{
> + NS_ASSERT(0);
> +}
> +
Suggest to delete Socket::SetIfIndex () since it just causes an assert, and is
not documented.
(minor nit-- please use space before parentheses in function names)
> +class SocketRecvIfTag : public Tag
This class needs doxygen.
Has this been tested for loopback interface (will loopback hit the node.cc code
segment)?
--
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Ns-bugs
mailing list