netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using netlink for intra-kernel requests?
@ 2009-12-08 21:42 Jon Loeliger
  2009-12-09 13:33 ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Loeliger @ 2009-12-08 21:42 UTC (permalink / raw)
  To: netdev

Guys,

I am looking for some documentation or an example that explains
how to use the Netlink interface to generate a message, send it,
and receive and process a reply all within the kernel.  I can
find lots of examples how to do this from user space, and even
the RFC shirks off talking about intra-kernel netlink messages.

Specifically, I would like to generate a RTM_GETQDISC message,
send it to the RTNL socket, and set up a listner to receive a reply.

I think I can create the netlink message in an skb.  And I think
I should call rtnl_notify() to deliver it (on the init_net namespace
with pid == 0, right?).  But where or how do I establish a means to
get the response?

I tried to read through some of the similar routing bits, but
even they confess that they "should use netlink", but then doesn't.

I feel like I am missing or don't know where to find the
documentation for the intra-kernel netlink messaging.

Thanks,
jdl



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using netlink for intra-kernel requests?
  2009-12-08 21:42 Using netlink for intra-kernel requests? Jon Loeliger
@ 2009-12-09 13:33 ` Andi Kleen
  2009-12-09 16:41   ` Jon Loeliger
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2009-12-09 13:33 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: netdev

Jon Loeliger <jdl@bigfootnetworks.com> writes:
>
> I tried to read through some of the similar routing bits, but
> even they confess that they "should use netlink", but then doesn't.

That was the great plan at some point, but it never
happened.
>
> I feel like I am missing or don't know where to find the
> documentation for the intra-kernel netlink messaging.

I don't think the kernel uses intra kernel netlink normally,
just tends to call functions directly. That's more efficient
anyways.

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using netlink for intra-kernel requests?
  2009-12-09 13:33 ` Andi Kleen
@ 2009-12-09 16:41   ` Jon Loeliger
  0 siblings, 0 replies; 3+ messages in thread
From: Jon Loeliger @ 2009-12-09 16:41 UTC (permalink / raw)
  To: Andi Kleen; +Cc: netdev

On Wed, 2009-12-09 at 14:33 +0100, Andi Kleen wrote:
> Jon Loeliger <jdl@bigfootnetworks.com> writes:
> > I feel like I am missing or don't know where to find the
> > documentation for the intra-kernel netlink messaging.
> 
> I don't think the kernel uses intra kernel netlink normally,
> just tends to call functions directly. That's more efficient
> anyways.
> 
> -Andi

Hi Andi,

OK.  So, _which_ set of netlink functions should I use?
Is rtnl_notify() the correct one to use to send a netlink
request for the RTM_GETQDISC or RTM_GETTCCLASS data?

What's the mechanism used to send and then receive a reply?
Will it be async?  How do I specify the call-back to receive
the reply netlink message?  Or will it be synchronous and
I pass in some call-back-reply function?

Thanks for you suggestions!
jdl



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-09 16:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-08 21:42 Using netlink for intra-kernel requests? Jon Loeliger
2009-12-09 13:33 ` Andi Kleen
2009-12-09 16:41   ` Jon Loeliger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).