Bug 809 - Missing Python binding for Ipv4GlobalRouting::GetRoute
Missing Python binding for Ipv4GlobalRouting::GetRoute
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: python bindings
ns-3.7
All All
: P3 enhancement
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-02-08 14:36 EST by Vikas Kawadia
Modified: 2010-02-10 10:14 EST (History)
1 user (show)

See Also:


Attachments
Modified from the tutorial (2.39 KB, text/x-python)
2010-02-08 14:36 EST, Vikas Kawadia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vikas Kawadia 2010-02-08 14:36:26 EST
Created attachment 757 [details]
Modified from the tutorial

Python bindings for some functions are not generated. An example is:
Ipv4GlobalRouting::  Ipv4RoutingTableEntry *GetRoute (uint32_t i);  

Running the attached first.py (modified from the tutorial) gives the following error:

<ns3.Ipv4GlobalRouting object at 0x8aca4ec>
Traceback (most recent call last):
  File "first.py", line 68, in <module>
    rtentry = rtproto.GetRoute(i)
AttributeError: 'ns3.Ipv4GlobalRouting' object has no attribute 'GetRoute'


Doing a dir() on the object reveals that it indeed does not have GetRoute()

dir(ns3.Ipv4GlobalRouting)
['AddASExternalRouteTo', 'AddHostRouteTo', 'AddNetworkRouteTo', 'AggregateIterator', 'AggregateObject', 'Cleanup', 'Dispose', 'GetAggregateIterator', 'GetAttribute', 'GetAttributeFailSafe', 'GetInstanceTypeId', 'GetNRoutes', 'GetObject', 'GetTypeId', 'NotifyAddAddress', 'NotifyInterfaceDown', 'NotifyInterfaceUp', 'NotifyRemoveAddress', 'RemoveRoute', 'RouteOutput', 'SetAttribute', 'SetAttributeFailSafe', 'SetIpv4', 'Start', 'TraceConnect', 'TraceConnectWithoutContext', 'TraceDisconnect', 'TraceDisconnectWithoutContext', '_DoDispose', '_DoStart', '_GetInstanceTypeId', '_NotifyConstructionCompleted', '_NotifyNewAggregate', '__class__', '__copy__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']



Digging around further, I found ns-3.7/build/debug/bindings/python/ns3modulegen.log which has several hundred errors, including one for the GetRoute() method, which is a blocker for me. The build should not silently fail.


Rescanning python bindings made no difference to the outcome.
Comment 1 Gustavo J. A. M. Carneiro 2010-02-09 06:03:24 EST
Python bindings will always be a bit incomplete due to lack of manpower.  Re-titling.

The problem is due to the lack of annotation specifying caller_owns_return=True/False.
Comment 2 Gustavo J. A. M. Carneiro 2010-02-09 10:43:17 EST
Fixed in ns-3-dev: http://code.nsnam.org/ns-3-dev/rev/7929ba7d13bd
Comment 3 Vikas Kawadia 2010-02-09 13:45:03 EST
(In reply to comment #2)
> Fixed in ns-3-dev: http://code.nsnam.org/ns-3-dev/rev/7929ba7d13bd

Thanks for fixing this. There are many other errors though as can be seen in ns-3.7/build/debug/bindings/python/ns3modulegen.log. Thats why my title was more general. 

If the python bindings will always be a little incomplete, it would be helpful to put this caveat out in some easy to find place. I did not come across it in the manual/tutorial/wiki/an_open_bug_report.

thanks
Comment 4 Gustavo J. A. M. Carneiro 2010-02-10 10:14:12 EST
I'm sorry, but it takes a huge amount of effort to get 100% coverage and so it is not even a goal of the project.  But I've now mentioned this in the Caveats section of the python bindings wiki page.