Bug 2246 - Some DSR LogComponents and classes are not defined in a unique way
Some DSR LogComponents and classes are not defined in a unique way
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: dsr
ns-3.24
All All
: P5 enhancement
Assigned To: Yufei Cheng
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-14 09:09 UTC by Mohit
Modified: 2015-12-19 17:57 UTC (History)
4 users (show)

See Also:


Attachments
DSR Log Components Patch (1.72 KB, patch)
2015-12-14 09:09 UTC, Mohit
Details | Diff
Patch to resolve LogComponent names and Class names in DSR (109.73 KB, patch)
2015-12-18 07:04 UTC, Mohit
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mohit 2015-12-14 09:09:27 UTC
Created attachment 2205 [details]
DSR Log Components Patch

Some files of DSR protocol do not define the LogComponents in a unique way.

Example: dsr-passive-buff.cc defines Log Component as

NS_LOG_COMPONENT_DEFINE ("PassiveBuffer");

The patch attached here (for ns-3.24) changes all such occurrences to contain "Dsr" as prefix.

Example: NS_LOG_COMPONENT_DEFINE ("DsrPassiveBuffer");

Thanks to: Tommaso

Regards,
Mohit P. Tahiliani
Comment 1 Tommaso Pecorella 2015-12-14 20:57:48 UTC
Let me explain the problem and why I do agree with Mohit (we discussed about this).

Classes are "protected" by namespaces, while LogComponent space is not.
If one duplicates the DSR module (namely, to do some experiments with a modified DSR), he/she can automatically change all the "dsr" strings (with some care about capitalizations) and have a fresh copy to work with.
This works for everything BUT for the LogComponents. Unless there's "Dsr" in the name.

AODV, DSDV and OLSR already follow this (even though I don't think it was intentional).
DSR almost follows the convention, with the only exception of PassiveBuffer.

As a side note, I'd rather change the class name as well to, e.g., DsrPassiveBuffer, just because almost all the other Dsr-related classes are starting with Dsr.
Comment 2 Tom Henderson 2015-12-15 13:04:08 UTC
(In reply to Tommaso Pecorella from comment #1)
> Let me explain the problem and why I do agree with Mohit (we discussed about
> this).
> 
> Classes are "protected" by namespaces, while LogComponent space is not.
> If one duplicates the DSR module (namely, to do some experiments with a
> modified DSR), he/she can automatically change all the "dsr" strings (with
> some care about capitalizations) and have a fresh copy to work with.
> This works for everything BUT for the LogComponents. Unless there's "Dsr" in
> the name.
> 
> AODV, DSDV and OLSR already follow this (even though I don't think it was
> intentional).
> DSR almost follows the convention, with the only exception of PassiveBuffer.
> 
> As a side note, I'd rather change the class name as well to, e.g.,
> DsrPassiveBuffer, just because almost all the other Dsr-related classes are
> starting with Dsr.


I agree with both the proposed logging changes and the class name adjustment.
Comment 3 Tommaso Pecorella 2015-12-17 19:06:59 UTC
(In reply to Tom Henderson from comment #2)
> (In reply to Tommaso Pecorella from comment #1)
> > Let me explain the problem and why I do agree with Mohit (we discussed about
> > this).
> > 
> > Classes are "protected" by namespaces, while LogComponent space is not.
> > If one duplicates the DSR module (namely, to do some experiments with a
> > modified DSR), he/she can automatically change all the "dsr" strings (with
> > some care about capitalizations) and have a fresh copy to work with.
> > This works for everything BUT for the LogComponents. Unless there's "Dsr" in
> > the name.
> > 
> > AODV, DSDV and OLSR already follow this (even though I don't think it was
> > intentional).
> > DSR almost follows the convention, with the only exception of PassiveBuffer.
> > 
> > As a side note, I'd rather change the class name as well to, e.g.,
> > DsrPassiveBuffer, just because almost all the other Dsr-related classes are
> > starting with Dsr.
> 
> 
> I agree with both the proposed logging changes and the class name adjustment.

Mohit wrote me that he's working on a revised patch. As soon as it's ready I'll check it, I'll rebuild the python bindings and I'll push.
Comment 4 Mohit 2015-12-18 07:04:58 UTC
Created attachment 2213 [details]
Patch to resolve LogComponent names and Class names in DSR

I have attached a revised patch. This takes care of Log Component names and Class names in DSR.
Comment 5 Tommaso Pecorella 2015-12-19 17:57:24 UTC
changeset:   11793:d05cb298c103