[Ns-bugs] [Bug 405] wifi log messages improvements

code@nsnam.ece.gatech.edu code at nsnam.ece.gatech.edu
Tue Nov 25 06:15:38 PST 2008


http://www.nsnam.org/bugzilla/show_bug.cgi?id=405


Mathieu Lacage <mathieu.lacage at sophia.inria.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mathieu.lacage at sophia.inria.
                   |                            |fr




--- Comment #2 from Mathieu Lacage <mathieu.lacage at sophia.inria.fr>  2008-11-25 09:15:38 EDT ---
(In reply to comment #0)
> Created an attachment (id=294)
 --> (http://www.nsnam.org/bugzilla/attachment.cgi?id=294) [details]
> patch
> 
> Uses NS_LOG_APPEND_CONTEXT to add node and netdevice index.  This may not apply
> to ns-3-dev directly, as I am working in another branch, but you get the idea. 
> Logs become something like this:
> 
> 0.000734987s [node 2 dev 0] MacLow:ReceiveOk(0x2d7b250, ns3::WifiMacHeader
> (CTL_ACK Duration/ID=0us, RA=d0:00:00:00:00:03) ns3::WifiMacTrailer (),
> 9.35955, wimax, 0)
> 0.000734987s [node 2 dev 0] MacLow:ReceiveOk(): d0:00:00:00:00:03
> duration/id=0ns
> 0.000734987s [node 2 dev 0] MacLow:ReceiveOk(): hdr.IsCts (): 0; hdr.GetAddr1
> (): d0:00:00:00:00:03; m_self: d0:00:00:00:00:03; m_ctsTimeoutEvent.IsRunning
> (): 0; m_currentPacket: 0
> 0.000734987s [node 2 dev 0] MacLow:ReceiveOk(): d0:00:00:00:00:03 rx drop
> CTL_ACK

The problem is that I spent an inordinate amount of time making sure that the
MacLow class does not depend on a pointer back to the NetDevice class. If you
want to add context to the log output in the MacLow layer, you should consider
printing the MAC address which is stored in the MacLow class.

In the higher MAC layers, they all have access to the MacLow class, so, you can
invoke GetAddress on it and print it in the context without needing the extra
back pointer to NetDevice.


-- 
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