self.__next__() bound method does not take an extra argument.
https://github.com/thom311/libnl/pull/57
Signed-off-by: Hiroaki KAWAI <kawai@stratosphere.co.jp>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Here are a few things I fixed and that provoked a python error.
I canno't answer to this thread but one solution I found while using
the python binding is to iterate over all and filter via python
http://list-archives.org/2013/09/09/libnl-lists-infradead-org/missing-feature-for-retrieving-cached-
address-objects/f/5031600704
Example:
cache = nlrta.AddressCache()
cache.resync()
for i in cache:
print ("item", i ) # then you can filter here
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Adding class methods send_auto_complete() and recvmsgs()
that call their swig capi equivalent function.
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
The property name used in __str__ should be local_port
instead of localPort to get rid of the AttributeError.
>>> str(s)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../netlink/core.py", line 172, in __str__
return 'nlsock<{0}>'.format(self.localPort)
AttributeError: 'Socket' object has no attribute 'localPort'
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
The initial commit adding netlink callback handling also introduced
memory leak issue. The python callback info was stored in an allocated
structure, but that was never freed.
Only exposing nl_cb_alloc() as is. nl_cb_get() is removed as it is
not very useful to use reference counting mechanism. Python uses
that itself internally. To deal properly with Python callback info
the function nl_cb_put() and nl_cb_clone() have a custom wrapper
taking care of Python reference counting.
This commit also adds a Callback python class using the netlink
callback functions.
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>