linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Piggott <cpiggott@gmail.com>
To: linux-wireless@vger.kernel.org
Subject: Re: nl80211 scanning from userspace
Date: Mon, 16 Aug 2010 19:16:04 -0400	[thread overview]
Message-ID: <AANLkTin90i08fbYeyrc17a7=smhshxR69=ushqUSkA0Z@mail.gmail.com> (raw)
In-Reply-To: <AANLkTi=sb0PT4FHsjbuAOQjnDq79GHEj8LbCLTtO8MeS@mail.gmail.com>

Forgive me if this is an obtuse question but why would one use
nl_socket_add_membership, if all that isn't necessary to get back the
scan results?

On Mon, Aug 16, 2010 at 5:55 PM, Christopher Piggott <cpiggott@gmail.com> wrote:
> OHHH.  I am with you now.  I looked at driver_nl80211.c and somehow
> had a blind spot  when it came to message NLM_F_DUMP.  I see it now,
> and it's sending me back results.
>
> I am tempted to write a slightly higher level API on top of some of
> this, once I understand the semantics of all of this a little better.
> I will search around first and see if any attempts have already been
> made.
>
> Thank you very much for pushing me in the right direction.
>
> --Chris
>
>
> On Mon, Aug 16, 2010 at 5:43 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
>> On Mon, 2010-08-16 at 17:22 -0400, Christopher Piggott wrote:
>>> It's hard to figure out what's going on sometimes.  I set up an error handler:
>>>
>>> static int error_handler(struct sockaddr_nl *nla, struct nlmsgerr
>>> *err, void *arg) {
>>>     printf("ERROR %s (%d)\n", strerror(err->error), err->error);
>>>     return NL_SKIP;
>>> }
>>>
>>> which also returns -95 (operation not supported) just as you said.
>>> So, I'll have to figure out what you mean by "dumping."
>>>
>>> I did find this:
>>>
>>>         mcid = nl_get_multicast_id(state->nl_sock, "nl80211", "scan");
>>>
>>> in iw:event.c and traced it to some code in iw:genl.c, a file that
>>> starts out by commenting "This ought to be provided by libnl".  That
>>> situation doesn't seem to have changed.
>>>
>>> Is this the area of the code you mean when you say "dump" ?  That I
>>> need to register myself to receive the scan results?
>>
>> No, you need to use NLM_F_DUMP etc. Really, check wpa_supplicant :)
>>
>> johannes
>>
>>
>

  reply	other threads:[~2010-08-16 23:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-16 19:06 nl80211 scanning from userspace Christopher Piggott
2010-08-16 19:13 ` Johannes Berg
     [not found]   ` <AANLkTiniqFJzrWFzNJTxsF31EZfSTei89dbS2Ak4YDjH@mail.gmail.com>
2010-08-16 19:41     ` Johannes Berg
2010-08-16 21:22       ` Christopher Piggott
2010-08-16 21:43         ` Johannes Berg
2010-08-16 21:55           ` Christopher Piggott
2010-08-16 23:16             ` Christopher Piggott [this message]
2010-08-17  8:51               ` Johannes Berg
     [not found]                 ` <AANLkTikzWs65zQYbCJQuvLv0e_010Rgy-C6J4ucpzBfa@mail.gmail.com>
2010-08-20 23:42                   ` Fwd: " Christopher Piggott
2010-08-21  9:21                     ` Johannes Berg
2010-08-22 19:49                       ` Christopher Piggott
2010-08-21 15:39                     ` Bob Copeland

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='AANLkTin90i08fbYeyrc17a7=smhshxR69=ushqUSkA0Z@mail.gmail.com' \
    --to=cpiggott@gmail.com \
    --cc=linux-wireless@vger.kernel.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).