radiotap.netbsd.org archive mirror
 help / color / mirror / Atom feed
From: Lee Hambley <lee.hambley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: radiotap-S783fYmB3Ccdnm+yROfE0A@public.gmane.org
Subject: Fwd: ieee80211_radiotap_iterator_next return values
Date: Fri, 10 May 2013 15:16:31 +0200	[thread overview]
Message-ID: <CAN_+VLVATb9v+yfX4Cen6uOaR9=cTRVd0f3EPX10G97-8tr6_A@mail.gmail.com> (raw)
In-Reply-To: <CAN_+VLVY9OY5OdAHs6mdzKLXcubAbHPXprsQis58+_ze939hQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2237 bytes --]

I've cross-posted to StackOverflow because I wasn't sure whether my message
had made it to the list or not thus far. The SO post includes more details,
better explanation and more code in my example. My apologies for the spam.

 •
http://stackoverflow.com/questions/16483010/libpcap-radiotap-header-extraction

Lee Hambley
--
http://lee.hambley.name/
+49 (0) 170 298 5667


---------- Forwarded message ----------
From: Lee Hambley <lee.hambley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: 10 May 2013 14:55
Subject: Fwd: ieee80211_radiotap_iterator_next return values
To: radiotap-S783fYmB3Ccdnm+yROfE0A@public.gmane.org


Hi Guys,

I'm new on the list, playing around trying to extract the radiotap headers
from IEEE802.11 traffic, specifically relating to signal strength/etc.

I've got some code that is using the functions
ieee80211_radiotap_iterator_init() and ieee80211_radiotap_iterator_next()
 from radiotap-parser.c,

I'm not sure what I'm doing incorrectly, perhaps someone can educate me?
I'm using the sample code from
http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/Documentation/networking/radiotap-headers.txt?v=2.6.25more
or less without modification, it fits very well to what I was trying
to achieve:

 /* where packet is `const u_char *packet' */

struct ieee80211_radiotap_iterator rti;
struct ieee80211_radiotap_header *rth = ( struct ieee80211_radiotap_header
* ) packet;
int ret = ieee80211_radiotap_iterator_init(&rti, rth, rth->it_len);
while(!ret) {
  printf("Itteration: %d\n", count++);
  ret = ieee80211_radiotap_iterator_next(&rti);
  if(ret) {
    continue;
  }
  switch(rti.this_arg_index) {
  default:
    printf("Constant: %d\n", *rti.this_arg);
    break;
  }
}

There's limited scope for having screwed something up in that code, I
think, I'm confused by the `1' being returned from `
ieee80211_radiotap_iterator_init' which according to the implenentation
doesn't seem like an error condition in the implementation
http://lxr.free-electrons.com/source/net/wireless/radiotap.c#L95

Thanks for anything anyone on the list can suggest, I'm out of my element
working at such a low level in C, but needs must!

- Lee Hambley

[-- Attachment #2: Type: text/html, Size: 4553 bytes --]

  parent reply	other threads:[~2013-05-10 13:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAN_+VLVe6D=HLeKynF1OLnv=X4Pn34xfDUsR1rvVCCR5BB5xdg@mail.gmail.com>
     [not found] ` <CAN_+VLVe6D=HLeKynF1OLnv=X4Pn34xfDUsR1rvVCCR5BB5xdg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-10 12:55   ` Fwd: ieee80211_radiotap_iterator_next return values Lee Hambley
     [not found]     ` <CAN_+VLVY9OY5OdAHs6mdzKLXcubAbHPXprsQis58+_ze939hQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-10 13:16       ` Lee Hambley [this message]
2013-05-10 13:32       ` Johannes Berg
     [not found]         ` <1368192729.8390.17.camel-8Nb76shvtaUJvtFkdXX2HixXY32XiHfO@public.gmane.org>
2013-05-10 14:40           ` Lee Hambley
     [not found]             ` <CAN_+VLX8_suEo_=C2sXoz00aRNtbAtpmKjfVUZVHc1RQbe29ew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-10 15:22               ` Lee Hambley
     [not found]                 ` <CAN_+VLXwax5Ok_BJ-d2ss8M90yyMjQ8smZo4uSpwGdnSQWSH-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-10 16:44                   ` Johannes Berg

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='CAN_+VLVATb9v+yfX4Cen6uOaR9=cTRVd0f3EPX10G97-8tr6_A@mail.gmail.com' \
    --to=lee.hambley-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=radiotap-S783fYmB3Ccdnm+yROfE0A@public.gmane.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).