[PATCH 0/8] python: rework callback and extending functionality

Arend van Spriel arend at broadcom.com
Thu Sep 5 08:11:24 EDT 2013


The previous submitted callback code in swig allocated memory that was
never released (oops, sorry). The callback code has been reworked. Also
figured out how to call a instance method of a python class so that is
in this series as well.

The commit 'nl_cb: store nl_cb_type in struct nl_cb' sets the member
upon doing the callback. Preferrably, I would like to add it as a parameter
in the callback function, but that would change the API affecting libnl
applications.

Furthermore, this series has a few examples on how to use the Python/SWIG
API.

Arend van Spriel (8):
  python: fix typo in Socket::__str__() function
  python: rework netlink callback handling
  python: allow callback function to be a class method
  python: remove unnecessary callback type definitions
  nl_cb: store nl_cb_type in struct nl_cb
  add python tests using swig provided api
  use Callback object constructing Socket
  python: add send and receive functions to Socket class

 include/netlink-private/netlink.h |    7 +-
 include/netlink-private/types.h   |   16 +-
 include/netlink/handlers.h        |    2 +
 lib/handlers.c                    |   24 +-
 python/examples/iface.py          |   93 +++
 python/examples/nl80211.py        | 1577 +++++++++++++++++++++++++++++++++++++
 python/examples/wiphy.py          |  141 ++++
 python/netlink/capi.i             |  228 ++++--
 python/netlink/core.py            |   52 +-
 python/netlink/utils.h            |   41 +
 10 files changed, 2115 insertions(+), 66 deletions(-)
 create mode 100644 python/examples/iface.py
 create mode 100644 python/examples/nl80211.py
 create mode 100644 python/examples/wiphy.py
 create mode 100644 python/netlink/utils.h

-- 
1.7.10.4





More information about the libnl mailing list