netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Ortiz <samuel@sortiz.org>
To: Rodolfo Giometti <giometti@enneenne.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	Thomas Graf <tgraf@suug.ch>,
	netdev@vger.kernel.org
Subject: Re: Generic netlink interface help
Date: Mon, 28 May 2007 17:01:10 +0300	[thread overview]
Message-ID: <20070528140110.GA3733@sortiz.org> (raw)
In-Reply-To: <20070527174759.GV21180@enneenne.com>

On Sun, May 27, 2007 at 07:47:59PM +0200, Rodolfo Giometti wrote:
> On Sun, May 27, 2007 at 03:54:30PM +0200, Johannes Berg wrote:
> 
> > It's written in python without using libnl:
> > http://git.sipsolutions.net/pynl80211.git
> 
> If I well understand I should do something like this:
> 
> 	s = socket(PF_NETLINK, SOCK_RAW, NETLINK_GENERIC);
> 
>         memset(&src_addr, 0, sizeof(src_addr));
>         src_addr.nl_family = AF_NETLINK;
>         src_addr.nl_pid = 0;            /* ask kernel to choose an unique ID */
>         src_addr.nl_groups = 0;         /* not in mcast groups */
>         ret = bind(handle->socket, (struct sockaddr *) &src_addr, sizeof(src_add
> 
> to get access to the generic netlink, then I should request the
> generic family name but I don't understand in which structure I should
> put this request... Can you please halp me?
You should first fetch your attributed family ID by sending a generic
netlink request (CTRL_CMD_GETFAMILY) to the generic netlink control family (GENL_ID_CTRL).
Once you have your family ID, you can build generic netlink messages and
send them there.
I'm linking with libnl, but you can have a look at my irconfig draft at
http://sortiz.org/irda/irconfig.c

Cheers,
Samuel.


> Thanks a lot,
> 
> Rodolfo
> 
> -- 
> 
> GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
> Linux Device Driver                             giometti@gnudd.com
> Embedded Systems                     		giometti@linux.it
> UNIX programming                     phone:     +39 349 2432127

  reply	other threads:[~2007-05-28 14:10 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
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 [this message]
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=20070528140110.GA3733@sortiz.org \
    --to=samuel@sortiz.org \
    --cc=giometti@enneenne.com \
    --cc=johannes@sipsolutions.net \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /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).