Bug 1876

Summary: enable OLSR HNA table access
Product: ns-3 Reporter: Tom Henderson <tomh>
Component: olsrAssignee: Lalith Suresh <suresh.lalith>
Status: RESOLVED FIXED    
Severity: enhancement CC: gjcarneiro, ns-bugs, tommaso.pecorella
Priority: P5    
Version: pre-release   
Hardware: PC   
OS: Linux   
Attachments: suggested patch

Description Tom Henderson 2014-03-10 00:23:23 EDT
Suggested by Christopher Kosecki here:  http://mailman.isi.edu/pipermail/ns-developers/2014-March/011800.html
Comment 1 Tom Henderson 2014-03-10 00:23:56 EDT
Created attachment 1797 [details]
suggested patch
Comment 2 Tommaso Pecorella 2014-04-19 06:55:35 EDT
I'm not sure if, with the provided pinter, the caller could mess up with the HNA data.
I'd suggets to return a copy of the object, rather than the object itself.

T.
Comment 3 Tom Henderson 2014-04-19 22:32:45 EDT
(In reply to Tommaso Pecorella from comment #2)
> I'm not sure if, with the provided pinter, the caller could mess up with the
> HNA data.
> I'd suggets to return a copy of the object, rather than the object itself.
> 
> T.

I agree about providing read-only access.  How about instead of returning an object copy, to use:

Ptr<const Ipv4StaticRouting> GetRoutingTableAssociation () const;

This should give access to the PrintRoutingTable() and GetRoute()/GetNRoutes() methods.
Comment 4 Tommaso Pecorella 2014-04-20 02:59:22 EDT
(In reply to Tom Henderson from comment #3)
> (In reply to Tommaso Pecorella from comment #2)
> > I'm not sure if, with the provided pinter, the caller could mess up with the
> > HNA data.
> > I'd suggets to return a copy of the object, rather than the object itself.
> > 
> > T.
> 
> I agree about providing read-only access.  How about instead of returning an
> object copy, to use:
> 
> Ptr<const Ipv4StaticRouting> GetRoutingTableAssociation () const;
> 
> This should give access to the PrintRoutingTable() and
> GetRoute()/GetNRoutes() methods.

Seems a good solution.
Comment 5 Lalith Suresh 2014-04-23 18:19:57 EDT
+1. Feel free to commit.
Comment 6 Tommaso Pecorella 2014-04-29 14:44:19 EDT
changeset:   10709:82c7c2aabbb1