libnl/python
Arend van Spriel e77ea939c4 add support functions for attributes and callback handlers
added support functions to access the netlink attributes and use
custom callback handlers. Most is wrapped as is, but there are
a couple of special cases handled.

1) void *nla_data(struct nlattr *);
The return value is changed to a Python byte array so it includes
the lenght of the data stream.

2) int nla_parse_nested(...);
This returns a tuple (err, dict). 'err' is the error code and 'dict'
is a dictionary with attribute identifier as key and value represents
a struct nlattr object.

3) macro nla_for_each_nested()
Provide nla_get_nested() which returns a Python list of struct nlattr
objects that is iterable.

4) allocate struct nla_policy array
Provide nla_policy_array() function that allocates consecutive space
in memory for struct nla_policy array entries. Each entry is put in
a Python list so the entry fields can be modified in Python. This
array object can be passed to the nla_parse_nested() function.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-07-18 23:22:18 +02:00
..
doc python interface to netlink protocols 2011-05-10 12:17:33 +02:00
netlink add support functions for attributes and callback handlers 2013-07-18 23:22:18 +02:00
.gitignore python: Include python/ in distribution and provide a README on how to build & install 2011-08-12 10:45:47 +02:00
Makefile.am python: Include python/ in distribution and provide a README on how to build & install 2011-08-12 10:45:47 +02:00
README python: Include python/ in distribution and provide a README on how to build & install 2011-08-12 10:45:47 +02:00
setup.py.in python: Link against nl-3 and nl-route-3 2011-10-26 10:54:10 +02:00

***************************************************************************

NOTE: The python wrapper is experimental and may or may not work.

***************************************************************************

For the brave:

  (requires an installed libnl)
  - $ python ./setup.py build
  - $ sudo python ./setup.py install