Bug 1876 - enable OLSR HNA table access
enable OLSR HNA table access
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: olsr
pre-release
PC Linux
: P5 enhancement
Assigned To: Lalith Suresh
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-10 00:23 EDT by Tom Henderson
Modified: 2014-04-29 14:44 EDT (History)
3 users (show)

See Also:


Attachments
suggested patch (3.15 KB, patch)
2014-03-10 00:23 EDT, Tom Henderson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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