Looking for examples of the python wrapper
Arend van Spriel
arend at broadcom.com
Fri Sep 6 04:01:23 EDT 2013
On 09/05/2013 08:03 PM, Teto wrote:
> Thanks for commiting the patches.
>
> I thnik there is a bug with py_nl_cb_set/py_nl_cb_err . The first
> registration always fail (I've changed the order of registrations
> etc..) whereas the following cb registrations work.
> pynl_find_cbinfo: cb=0x2005a30: not found
> pynl_get_cbinfo: cb=0x2005a30: added 0x1f156b0
> py_nl_cb_err: cb=0x2005a30, info=0x1f156b0, kind=3
> pynl_find_cbinfo: cb=0x2005a30: found=0x1f156b0
> pynl_get_cbinfo: cb=0x2005a30: done
> py_nl_cb_set: cb=0x2005a30, info=0x1f156b0, type=0, kind=3
This is not a bug. The function pynl_get_cbinfo tries to lookup the
callback info for the given nl_cb instance using pynl_find_cbinfo. When
that lookup fails it will allocate a new callback info structure. That
is exactly what the first two messages tell. This tracing is actually
for debugging purposes and I should have turned it off.
> I've joined a copy of the file which is a slight modification of the
> commited example. As I needed nl_socket_add_membership, I've added it
> to the bindings.
Indeed, for receiving netlink events. I had a patch for that as well.
Not sure where that ended up.
Regards,
Arend
> On Fri, Aug 30, 2013 at 9:55 AM, Arend van Spriel <arend at broadcom.com> wrote:
>> On 08/29/13 11:59, Thomas Graf wrote:
>>>
>>> On 08/28/13 at 09:46pm, Teto wrote:
>>>>
>>>> Hi,
>>>>
>>>> I am really interested in using your python wrapper. I've compiled it
>>>> from trunk. Before losing a lot of time trying to find how it works, I
>>>> was wondering if you had any example available you could send on this
>>>> mailing-list please ?
>>>>
>>>> I am especially interested in the genl wrapper (that's why I
>>>> downloaded i from trunk) to subscribe to a custom netlink family
>>>> requests.
>>>
>>>
>>> Arend, do you have examples to share?
>>
>>
>> I have. They are mainly on nl80211 family (I am biased to that). I will
>> share them through a patch.
>>
>> Regards,
>> Arend
>>
>>
>>
More information about the libnl
mailing list