Bug 1296

Summary: Enhancement in Internet module
Product: ns-3 Reporter: Alex Afanasyev <alexander.afanasyev>
Component: internetAssignee: George Riley <riley>
Status: RESOLVED FIXED    
Severity: normal CC: bswenson3, ns-bugs, tomh, tommaso.pecorella
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: Patch implementing GetRouting calls for Ipv4RoutingHelper and Ipv6RoutingHelper

Description Alex Afanasyev 2011-11-14 21:27:42 UTC
The following commits slightly modify internals of Internet and Network modules:

https://bitbucket.org/cawka/ns-3-dev/changeset/0d7805b771d3
https://bitbucket.org/cawka/ns-3-dev/changeset/f6efe075519f
Comment 1 Tommaso Pecorella 2012-03-14 19:56:36 UTC
https://bitbucket.org/cawka/ns-3-dev/changeset/0d7805b771d3
Integrated in changeset 7758 - c678188af993
Comment 2 Tommaso Pecorella 2012-03-14 20:25:03 UTC
About https://bitbucket.org/cawka/ns-3-dev/changeset/f6efe075519f

This contains two separate enhancements: one (print metric infos) is going to 
be patched soon by
http://codereview.appspot.com/5784068/

The other one is a GetRouting helper function. I don't have anything against 
this one, but please make one similar for IPv6.
The only drawback I see, tho, is that the helper function needs to include the 
listrouting. Not a biggie tho.

There are two other "minor" things included there: 
1) a change that seems more like an optimization rather than anything else, and 
2) a change from private to protected of a bunch of member variables in 
IPv4StaticRouting.

I don't mind the optimization, but I *do* mind the change from private to 
protected.

Summarizing:
+1 for the GetRouting Helper function, but do it for IPv6 as well please.
+1 for the optimization in Ipv4StaticRouting::PrintRoutingTable (as above, 
check if the v6 one can be optimized as well).
-1 for the private to protected

Last but not least: do two separate commits, don't mix optimizations with new 
APIs.
Comment 3 Alex Afanasyev 2012-04-18 14:23:20 UTC
Created attachment 1381 [details]
Patch implementing GetRouting calls for Ipv4RoutingHelper and Ipv6RoutingHelper

Here is the patch that implements only Ipv4RoutingHelper<T>::GetRouting (ptr) and Ipv6RoutingHelper<T>::GetRouting (ptr) methods.
Comment 4 Tommaso Pecorella 2012-04-24 17:11:10 UTC
+1

T.
Comment 5 Tom Henderson 2012-05-06 12:22:12 UTC
(In reply to comment #4)
> +1
> 
> T.


There is a small copy/paste error in the IPv6 version of doxygen (referencing IPv4)-- otherwise, I support merging it.
Comment 6 Brian Swenson 2013-04-08 10:21:35 UTC
Any reason not to commit this for upcoming release build?
Comment 7 Tommaso Pecorella 2013-04-08 10:53:48 UTC
(In reply to comment #6)
> Any reason not to commit this for upcoming release build?

None from my side.

T.
Comment 8 Tommaso Pecorella 2013-07-09 16:51:24 UTC
Pushed in changeset: 9918:dc9ec9fb4578
Comment 9 Alex Afanasyev 2013-07-27 17:40:34 UTC
I just noticed that this patch was applied in a modified form, which I believe would not work.

That is, the new static method is templated method:

+  template<class T>
+  static Ptr<T> GetRouting (Ptr<Ipv4RoutingProtocol> protocol);

In other words, it has to have implementation inside the header file.  Right now, it is "implemented" in .cc file, which is kind of meaningless for templated functions: any attempt would result in unresolved symbol error (I guess nobody used it for now, so it was ok...)
Comment 10 Tommaso Pecorella 2013-07-27 18:02:10 UTC
You're totally right. I didn't notice they was templates.

changeset: 9976:ddcab0ac2e27