Per command callback
Thomas Graf
tgraf at infradead.org
Fri Nov 5 09:11:50 EDT 2010
On Fri, Nov 05, 2010 at 11:22:07AM +0200, Dima Kukulniak wrote:
>
> >
> > Currently I have to figure out the intended command based on the
> > containing attributes. There must be also an easier way to figure out
> > the command in my generic receive method. How can that be achieved?
> >
>
> I think you can extract the command id from gen netlink header of a
> netlink message which is
>
> struct genlmsghdr {
> __u8 cmd;
> __u8 version;
> __u16 reserved;
> };
>
> And the rest can be organised in call back for a valid message.
That's the way to do it right now but it would definitely be nice to
have an API allowing to register a callback per genl command.
More information about the libnl
mailing list