AW: How to cast a struct nl_object

Joerg Pommnitz pommnitz at yahoo.com
Thu Mar 17 07:55:22 EDT 2011


Sorry, I feel rather stupid now. struct nl_object is actually a public type 
defined
in netlink-types.h. I was confused by the fact that "struct nl_object" is not 
documented in the DocBook documentation on 
http://www.infradead.org/~tgr/libnl/doc-2.0
Please disregard my previous question.

 -- 
Regards 
Joerg 




----- Ursprüngliche Mail ----
> Von: Joerg Pommnitz <pommnitz at yahoo.com>
> An: libnl at lists.infradead.org
> Gesendet: Donnerstag, den 17. März 2011, 12:37:54 Uhr
> Betreff: How to cast a struct nl_object
> 
> Hello all,
> I'm somewhat at a loss regarding something that should be simple  enough:
> figuring out the actual type of a struct nl_object instance and  casting
> it to the actual type.
> Unfortunately I could not figure out (so  far) how to do this cleanly. There
> seems to be no official way to access the  NLHDR_COMMON fields.
> 
> So: If I have a freshly parsed struct nl_object  instance, how do I actually
> use it and get the information inside without  resorting to hacks?
> 
> Just in case: Here is what I'm trying to do:
> I'm  subscribed to the RTNLGRP_IPV4_IFADDR group and receiving messages. I  
>pass
> the messages up to nl_msg_parse with my own callback function to  actually 
>handle
> the parsed message. This is where I'm stuck: The callback  function gets a 
> struct nl_object instance. I'd like to access the  information inside it.
> 
>  -- 
> Regards 
> Joerg 
> 
> 
> 





More information about the libnl mailing list