netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: Rodolfo Giometti <giometti@enneenne.com>
Cc: Samuel Ortiz <samuel@sortiz.org>, netdev@vger.kernel.org
Subject: Re: Generic netlink interface help
Date: Thu, 24 May 2007 09:51:45 -0400	[thread overview]
Message-ID: <1180014705.4092.18.camel@localhost> (raw)
In-Reply-To: <20070524112144.GB21180@enneenne.com>

On Thu, 2007-24-05 at 13:21 +0200, Rodolfo Giometti wrote:
> On Thu, May 24, 2007 at 10:04:08AM -0000, Samuel Ortiz wrote:
> > 
> > Yes it's possible, even though it could be more tedious and painful.
> 
> I know that. Have you some links to suggest to me in order to have
> some programming examples?
> 

For debugging or writting some simple apps you could also use
iproute2/genl
example on my laptop to discover loaded users:

---------------
hadi@lilsol:~$ genl ctrl ls

Name: nlctrl
        ID: 0x10  Version: 0x2  header size: 0  max attribs: 6
        commands supported:
                #1:  ID-0x3  flags-0xe


Name: nl80211
        ID: 0x11  Version: 0x1  header size: 0  max attribs: 22
        commands supported:
                #1:  ID-0x1  flags-0xa
                #2:  ID-0x6  flags-0xa
                #3:  ID-0x8  flags-0xa
                #4:  ID-0x3  flags-0xb
                #5:  ID-0x4  flags-0xb
                #6:  ID-0x5  flags-0xb
                #7:  ID-0xa  flags-0xb
                #8:  ID-0xb  flags-0xa
                #9:  ID-0xf  flags-0xb
                #10:  ID-0x10  flags-0xa
                #11:  ID-0x12  flags-0xb
                #12:  ID-0x13  flags-0xa
                #13:  ID-0x15  flags-0xa
                #14:  ID-0x19  flags-0xb
                #15:  ID-0x17  flags-0xb
                #16:  ID-0x18  flags-0xb
                #17:  ID-0x1a  flags-0xb
                #18:  ID-0x1b  flags-0xa
                #19:  ID-0xd  flags-0xb


Name: TASKSTATS
        ID: 0x12  Version: 0x1  header size: 0  max attribs: 4
        commands supported:
                #1:  ID-0x1  flags-0xa
---------------------------

Load tipc and repeat...

-----------

hadi@lilsol:~$ sudo modprobe tipc
Name: nlctrl
        ID: 0x10  Version: 0x2  header size: 0  max attribs: 6
        commands supported:
                #1:  ID-0x3  flags-0xe


Name: nl80211
        ID: 0x11  Version: 0x1  header size: 0  max attribs: 22
        commands supported:
                #1:  ID-0x1  flags-0xa
                #2:  ID-0x6  flags-0xa
                #3:  ID-0x8  flags-0xa
                #4:  ID-0x3  flags-0xb
                #5:  ID-0x4  flags-0xb
                #6:  ID-0x5  flags-0xb
                #7:  ID-0xa  flags-0xb
                #8:  ID-0xb  flags-0xa
                #9:  ID-0xf  flags-0xb
                #10:  ID-0x10  flags-0xa
                #11:  ID-0x12  flags-0xb
                #12:  ID-0x13  flags-0xa
                #13:  ID-0x15  flags-0xa
                #14:  ID-0x19  flags-0xb
                #15:  ID-0x17  flags-0xb
                #16:  ID-0x18  flags-0xb
                #17:  ID-0x1a  flags-0xb
                #18:  ID-0x1b  flags-0xa
                #19:  ID-0xd  flags-0xb


Name: TASKSTATS
        ID: 0x12  Version: 0x1  header size: 0  max attribs: 4
        commands supported:
                #1:  ID-0x1  flags-0xa


Name: TIPC
        ID: 0x13  Version: 0x1  header size: 8  max attribs: 0
        commands supported:
                #1:  ID-0x1  flags-0x2

===============

You essentially write a little .so in user space that knows how to
access/intepret your kernel module
I know you are avoiding to use external libraries etc; but this may be a
good way to get started.
I can dig up some simple kernel/user code i have and if you bug Thomas
long enough he may give you another sample code he has.

cheers,
jamal


  parent reply	other threads:[~2007-05-24 13:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-24  8:59 Generic netlink interface help Rodolfo Giometti
2007-05-24  9:43 ` Samuel Ortiz
2007-05-24  9:56   ` Rodolfo Giometti
2007-05-24 10:04     ` Samuel Ortiz
2007-05-24 11:21       ` Rodolfo Giometti
2007-05-24 13:21         ` Paul Moore
2007-05-24 13:51         ` jamal [this message]
2007-05-24 16:34   ` Johannes Berg
2007-05-25 22:18     ` Thomas Graf
2007-05-27 13:24       ` Johannes Berg
2007-05-27 13:50         ` Rodolfo Giometti
2007-05-27 13:54           ` Johannes Berg
2007-05-27 17:47             ` Rodolfo Giometti
2007-05-28 14:01               ` Samuel Ortiz
2007-05-30 21:45         ` Thomas Graf
2007-05-27 17:39   ` Rodolfo Giometti
2007-05-28  1:42     ` Samuel Ortiz
2007-05-28  7:41       ` Rodolfo Giometti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1180014705.4092.18.camel@localhost \
    --to=hadi@cyberus.ca \
    --cc=giometti@enneenne.com \
    --cc=netdev@vger.kernel.org \
    --cc=samuel@sortiz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).