RadioTap Archive on lore.kernel.org
 help / color / Atom feed
* Fwd: ieee80211_radiotap_iterator_next return values
       [not found] ` <CAN_+VLVe6D=HLeKynF1OLnv=X4Pn34xfDUsR1rvVCCR5BB5xdg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-05-10 12:55   ` Lee Hambley
       [not found]     ` <CAN_+VLVY9OY5OdAHs6mdzKLXcubAbHPXprsQis58+_ze939hQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Hambley @ 2013-05-10 12:55 UTC (permalink / raw)
  To: radiotap-S783fYmB3Ccdnm+yROfE0A

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

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: 3364 bytes --]

<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Hi Guys,
<div><br></div><div>I&#39;m new on the list, playing around trying to extract the radiotap headers from IEEE802.11 traffic, specifically relating to signal strength/etc.</div><div><br></div><div>I&#39;ve got some code that is using the functions <span style="color:rgb(153,0,0);font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;font-weight:bold;line-height:18px;white-space:pre-wrap">ieee80211_radiotap_iterator_init()</span> and <span style="color:rgb(153,0,0);font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;font-weight:bold;line-height:18px;white-space:pre-wrap">ieee80211_radiotap_iterator_next()</span> from radiotap-parser.c, </div>

<div><br></div><div>I&#39;m not sure what I&#39;m doing incorrectly, perhaps someone can educate me? I&#39;m using the sample code from <a href="http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/Documentation/networking/radiotap-headers.txt?v=2.6.25" target="_blank">http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/Documentation/networking/radiotap-headers.txt?v=2.6.25</a> more or less without modification, it fits very well to what I was trying to achieve:</div>

<div><br></div><font face="courier new, monospace"> /* where packet is `const u_char *packet&#39; */<br><br>struct ieee80211_radiotap_iterator rti;<br>struct ieee80211_radiotap_header *rth = ( struct ieee80211_radiotap_header * ) packet;<br>

int ret = ieee80211_radiotap_iterator_init(&amp;rti, rth, rth-&gt;it_len);<br>while(!ret) {<br>  printf(&quot;Itteration: %d\n&quot;, count++);<br>  ret = ieee80211_radiotap_iterator_next(&amp;rti);<br>  if(ret) {<br>    continue;<br>

  }<br>  switch(rti.this_arg_index) {<br></font><span style="font-family:&#39;courier new&#39;,monospace">  default:</span><font face="courier new, monospace"><br>    printf(&quot;Constant: %d\n&quot;, *rti.this_arg);<br>

    break;<br>  }</font><div><font face="courier new, monospace">}</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">There&#39;s limited scope for having screwed something up in that code, I think, I&#39;m confused by the `</font><font face="courier new, monospace">1</font><font face="arial, helvetica, sans-serif">&#39; being returned from `</font><span style="font-family:&#39;courier new&#39;,monospace">ieee80211_radiotap_iterator_init</span><span style="font-family:arial,helvetica,sans-serif">&#39; which according to the implenentation doesn&#39;t seem like an error condition in the implementation </span><font face="arial, helvetica, sans-serif"><a href="http://lxr.free-electrons.com/source/net/wireless/radiotap.c#L95" target="_blank">http://lxr.free-electrons.com/source/net/wireless/radiotap.c#L95</a></font></div>

<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Thanks for anything anyone on the list can suggest, I&#39;m out of my element working at such a low level in C, but needs must!</font></div>
<span class="HOEnZb"><font color="#888888">
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">- Lee Hambley</font></div></font></span></div>
</div><br></div>

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

* Fwd: ieee80211_radiotap_iterator_next return values
       [not found]     ` <CAN_+VLVY9OY5OdAHs6mdzKLXcubAbHPXprsQis58+_ze939hQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-05-10 13:16       ` Lee Hambley
  2013-05-10 13:32       ` Johannes Berg
  1 sibling, 0 replies; 6+ messages in thread
From: Lee Hambley @ 2013-05-10 13:16 UTC (permalink / raw)
  To: radiotap-S783fYmB3Ccdnm+yROfE0A

[-- 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 --]

<div dir="ltr">I&#39;ve cross-posted to StackOverflow because I wasn&#39;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.<div>
<br></div><div> • <a href="http://stackoverflow.com/questions/16483010/libpcap-radiotap-header-extraction">http://stackoverflow.com/questions/16483010/libpcap-radiotap-header-extraction</a><br></div><div><br clear="all"><div>
Lee Hambley<div>--</div><div><a href="http://lee.hambley.name/" target="_blank">http://lee.hambley.name/</a></div><div>+49 (0) 170 298 5667</div></div>
<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Lee Hambley</b> <span dir="ltr">&lt;<a href="mailto:lee.hambley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org">lee.hambley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>&gt;</span><br>
Date: 10 May 2013 14:55<br>Subject: Fwd: ieee80211_radiotap_iterator_next return values<br>To: <a href="mailto:radiotap-S783fYmB3Ccdnm+yROfE0A@public.gmane.org">radiotap@netbsd.org</a><br><br><br><div class=""><div class="h5"><div dir="ltr"><div class="gmail_quote">
<div dir="ltr">Hi Guys,
<div><br></div><div>I&#39;m new on the list, playing around trying to extract the radiotap headers from IEEE802.11 traffic, specifically relating to signal strength/etc.</div><div><br></div><div>I&#39;ve got some code that is using the functions <span style="color:rgb(153,0,0);font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;font-weight:bold;line-height:18px;white-space:pre-wrap">ieee80211_radiotap_iterator_init()</span> and <span style="color:rgb(153,0,0);font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;font-weight:bold;line-height:18px;white-space:pre-wrap">ieee80211_radiotap_iterator_next()</span> from radiotap-parser.c, </div>


<div><br></div><div>I&#39;m not sure what I&#39;m doing incorrectly, perhaps someone can educate me? I&#39;m using the sample code from <a href="http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/Documentation/networking/radiotap-headers.txt?v=2.6.25" target="_blank">http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/Documentation/networking/radiotap-headers.txt?v=2.6.25</a> more or less without modification, it fits very well to what I was trying to achieve:</div>


<div><br></div><font face="courier new, monospace"> /* where packet is `const u_char *packet&#39; */<br><br>struct ieee80211_radiotap_iterator rti;<br>struct ieee80211_radiotap_header *rth = ( struct ieee80211_radiotap_header * ) packet;<br>


int ret = ieee80211_radiotap_iterator_init(&amp;rti, rth, rth-&gt;it_len);<br>while(!ret) {<br>  printf(&quot;Itteration: %d\n&quot;, count++);<br>  ret = ieee80211_radiotap_iterator_next(&amp;rti);<br>  if(ret) {<br>    continue;<br>


  }<br>  switch(rti.this_arg_index) {<br></font><span style="font-family:&#39;courier new&#39;,monospace">  default:</span><font face="courier new, monospace"><br>    printf(&quot;Constant: %d\n&quot;, *rti.this_arg);<br>


    break;<br>  }</font><div><font face="courier new, monospace">}</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">There&#39;s limited scope for having screwed something up in that code, I think, I&#39;m confused by the `</font><font face="courier new, monospace">1</font><font face="arial, helvetica, sans-serif">&#39; being returned from `</font><span style="font-family:&#39;courier new&#39;,monospace">ieee80211_radiotap_iterator_init</span><span style="font-family:arial,helvetica,sans-serif">&#39; which according to the implenentation doesn&#39;t seem like an error condition in the implementation </span><font face="arial, helvetica, sans-serif"><a href="http://lxr.free-electrons.com/source/net/wireless/radiotap.c#L95" target="_blank">http://lxr.free-electrons.com/source/net/wireless/radiotap.c#L95</a></font></div>


<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Thanks for anything anyone on the list can suggest, I&#39;m out of my element working at such a low level in C, but needs must!</font></div>

<span><font color="#888888">
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">- Lee Hambley</font></div></font></span></div>
</div><br></div>
</div></div></div><br></div></div>

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

* Re: Fwd: ieee80211_radiotap_iterator_next return values
       [not found]     ` <CAN_+VLVY9OY5OdAHs6mdzKLXcubAbHPXprsQis58+_ze939hQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2013-05-10 13:16       ` Lee Hambley
@ 2013-05-10 13:32       ` Johannes Berg
       [not found]         ` <1368192729.8390.17.camel-8Nb76shvtaUJvtFkdXX2HixXY32XiHfO@public.gmane.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2013-05-10 13:32 UTC (permalink / raw)
  To: Lee Hambley; +Cc: radiotap-S783fYmB3Ccdnm+yROfE0A

On Fri, 2013-05-10 at 14:55 +0200, Lee Hambley wrote:

> int ret = ieee80211_radiotap_iterator_init(&rti, rth, rth->it_len);
> while(!ret) {
>   printf("Itteration: %d\n", count++);
>   ret = ieee80211_radiotap_iterator_next(&rti);

> 
> 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

I think you're confusing the userspace and Linux kernel implementation,
though they're very similar. In any case,
ieee80211_radiotap_iterator_next() cannot return 1, unless one of the
error values is defined to -1 (it returns -EINVAL and a few others)

johannes

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

* Re: Fwd: ieee80211_radiotap_iterator_next return values
       [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>
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Hambley @ 2013-05-10 14:40 UTC (permalink / raw)
  To: radiotap-S783fYmB3Ccdnm+yROfE0A

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

Hi Johannes,

I hadn't even considered that, I'll have to go and have a look for the
userspace implementation of those functions, I'd suppose that the ones I
have pulled in are probably from the kernel if they are returning `1`.

Are these functions included with any of the radiotap (tcpdump, libpcap in
particular) codebases? Or something similar.

Thanks, good to know I did manage to register myself for the list correctly!

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


On 10 May 2013 15:32, Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> wrote:

> On Fri, 2013-05-10 at 14:55 +0200, Lee Hambley wrote:
>
> > int ret = ieee80211_radiotap_iterator_init(&rti, rth, rth->it_len);
> > while(!ret) {
> >   printf("Itteration: %d\n", count++);
> >   ret = ieee80211_radiotap_iterator_next(&rti);
>
> >
> > 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
>
> I think you're confusing the userspace and Linux kernel implementation,
> though they're very similar. In any case,
> ieee80211_radiotap_iterator_next() cannot return 1, unless one of the
> error values is defined to -1 (it returns -EINVAL and a few others)
>
> johannes
>
>
>

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

<div dir="ltr">Hi Johannes,<div><br></div><div>I hadn&#39;t even considered that, I&#39;ll have to go and have a look for the userspace implementation of those functions, I&#39;d suppose that the ones I have pulled in are probably from the kernel if they are returning `1`.</div>
<div><br></div><div style>Are these functions included with any of the radiotap (tcpdump, libpcap in particular) codebases? Or something similar.</div><div style><br></div><div style>Thanks, good to know I did manage to register myself for the list correctly!</div>
</div><div class="gmail_extra"><br clear="all"><div>Lee Hambley<div>--</div><div><a href="http://lee.hambley.name/" target="_blank">http://lee.hambley.name/</a></div><div>+49 (0) 170 298 5667</div></div>
<br><br><div class="gmail_quote">On 10 May 2013 15:32, Johannes Berg <span dir="ltr">&lt;<a href="mailto:johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org" target="_blank">johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Fri, 2013-05-10 at 14:55 +0200, Lee Hambley wrote:<br>
<br>
&gt; int ret = ieee80211_radiotap_iterator_init(&amp;rti, rth, rth-&gt;it_len);<br>
&gt; while(!ret) {<br>
&gt;   printf(&quot;Itteration: %d\n&quot;, count++);<br>
&gt;   ret = ieee80211_radiotap_iterator_next(&amp;rti);<br>
<br>
&gt;<br>
</div><div class="im">&gt; There&#39;s limited scope for having screwed something up in that code, I<br>
&gt; think, I&#39;m confused by the `1&#39; being returned from<br>
&gt; `ieee80211_radiotap_iterator_init&#39; which according to the<br>
&gt; implenentation doesn&#39;t seem like an error condition in the<br>
&gt; implementation <a href="http://lxr.free-electrons.com/source/net/wireless/radiotap.c#L95" target="_blank">http://lxr.free-electrons.com/source/net/wireless/radiotap.c#L95</a><br>
<br>
</div>I think you&#39;re confusing the userspace and Linux kernel implementation,<br>
though they&#39;re very similar. In any case,<br>
ieee80211_radiotap_iterator_next() cannot return 1, unless one of the<br>
error values is defined to -1 (it returns -EINVAL and a few others)<br>
<span class="HOEnZb"><font color="#888888"><br>
johannes<br>
<br>
<br>
</font></span></blockquote></div><br></div>

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

* Re: Fwd: ieee80211_radiotap_iterator_next return values
       [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>
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Hambley @ 2013-05-10 15:22 UTC (permalink / raw)
  To: radiotap-S783fYmB3Ccdnm+yROfE0A

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

To clarify, I'm using (at present) the implementation from
http://airscan.googlecode.com/svn-history/r2/trunk/radiotap-parser.c - not
being an expert in such things it looks like the use of le32_to_cpu is an
indication that this is designed to be used in userspace, but still - the
iteration function is still returning `1'.

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


On 10 May 2013 16:40, Lee Hambley <lee.hambley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> Hi Johannes,
>
> I hadn't even considered that, I'll have to go and have a look for the
userspace implementation of those functions, I'd suppose that the ones I
have pulled in are probably from the kernel if they are returning `1`.
>
> Are these functions included with any of the radiotap (tcpdump, libpcap
in particular) codebases? Or something similar.
>
> Thanks, good to know I did manage to register myself for the list
correctly!
>
> Lee Hambley
> --
> http://lee.hambley.name/
> +49 (0) 170 298 5667
>
>
> On 10 May 2013 15:32, Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> wrote:
>>
>> On Fri, 2013-05-10 at 14:55 +0200, Lee Hambley wrote:
>>
>> > int ret = ieee80211_radiotap_iterator_init(&rti, rth, rth->it_len);
>> > while(!ret) {
>> >   printf("Itteration: %d\n", count++);
>> >   ret = ieee80211_radiotap_iterator_next(&rti);
>>
>> >
>> > 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
>>
>> I think you're confusing the userspace and Linux kernel implementation,
>> though they're very similar. In any case,
>> ieee80211_radiotap_iterator_next() cannot return 1, unless one of the
>> error values is defined to -1 (it returns -EINVAL and a few others)
>>
>> johannes
>>
>>
>

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

<div dir="ltr">To clarify, I&#39;m using (at present) the implementation from <a href="http://airscan.googlecode.com/svn-history/r2/trunk/radiotap-parser.c">http://airscan.googlecode.com/svn-history/r2/trunk/radiotap-parser.c</a> - not being an expert in such things it looks like the use of le32_to_cpu is an indication that this is designed to be used in userspace, but still - the iteration function is still returning `1&#39;.<br>
<br>Lee Hambley<br>--<br><a href="http://lee.hambley.name/">http://lee.hambley.name/</a>+49 (0) 170 298 5667<br><br><br>On 10 May 2013 16:40, Lee Hambley &lt;<a href="mailto:lee.hambley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org">lee.hambley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>&gt; wrote:<br>
&gt;<br>&gt; Hi Johannes,<br>&gt;<br>&gt; I hadn&#39;t even considered that, I&#39;ll have to go and have a look for the userspace implementation of those functions, I&#39;d suppose that the ones I have pulled in are probably from the kernel if they are returning `1`.<br>
&gt;<br>&gt; Are these functions included with any of the radiotap (tcpdump, libpcap in particular) codebases? Or something similar.<br>&gt;<br>&gt; Thanks, good to know I did manage to register myself for the list correctly!<br>
&gt;<br>&gt; Lee Hambley<br>&gt; --<br>&gt; <a href="http://lee.hambley.name/">http://lee.hambley.name/</a><br>&gt; +49 (0) 170 298 5667<br>&gt;<br>&gt;<br>&gt; On 10 May 2013 15:32, Johannes Berg &lt;<a href="mailto:johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org">johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org</a>&gt; wrote:<br>
&gt;&gt;<br>&gt;&gt; On Fri, 2013-05-10 at 14:55 +0200, Lee Hambley wrote:<br>&gt;&gt;<br>&gt;&gt; &gt; int ret = ieee80211_radiotap_iterator_init(&amp;rti, rth, rth-&gt;it_len);<br>&gt;&gt; &gt; while(!ret) {<br>&gt;&gt; &gt;   printf(&quot;Itteration: %d\n&quot;, count++);<br>
&gt;&gt; &gt;   ret = ieee80211_radiotap_iterator_next(&amp;rti);<br>&gt;&gt;<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; There&#39;s limited scope for having screwed something up in that code, I<br>&gt;&gt; &gt; think, I&#39;m confused by the `1&#39; being returned from<br>
&gt;&gt; &gt; `ieee80211_radiotap_iterator_init&#39; which according to the<br>&gt;&gt; &gt; implenentation doesn&#39;t seem like an error condition in the<br>&gt;&gt; &gt; implementation <a href="http://lxr.free-electrons.com/source/net/wireless/radiotap.c#L95">http://lxr.free-electrons.com/source/net/wireless/radiotap.c#L95</a><br>
&gt;&gt;<br>&gt;&gt; I think you&#39;re confusing the userspace and Linux kernel implementation,<br>&gt;&gt; though they&#39;re very similar. In any case,<br>&gt;&gt; ieee80211_radiotap_iterator_next() cannot return 1, unless one of the<br>
&gt;&gt; error values is defined to -1 (it returns -EINVAL and a few others)<br>&gt;&gt;<br>&gt;&gt; johannes<br>&gt;&gt;<br>&gt;&gt;<br>&gt;<br></div>

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

* Re: Fwd: ieee80211_radiotap_iterator_next return values
       [not found]                 ` <CAN_+VLXwax5Ok_BJ-d2ss8M90yyMjQ8smZo4uSpwGdnSQWSH-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-05-10 16:44                   ` Johannes Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2013-05-10 16:44 UTC (permalink / raw)
  To: Lee Hambley; +Cc: radiotap-S783fYmB3Ccdnm+yROfE0A

On Fri, 2013-05-10 at 17:22 +0200, Lee Hambley wrote:
> To clarify, I'm using (at present) the implementation from
> http://airscan.googlecode.com/svn-history/r2/trunk/radiotap-parser.c -
> not being an expert in such things it looks like the use of
> le32_to_cpu is an indication that this is designed to be used in
> userspace, but still - the iteration function is still returning `1'.

That's a (slightly) different implementation that doesn't match the
other implementations you've been looking at. If you read the comments
in that file, it'll be obvious why it returns 1.

Basically though your problem is that you're taking the radiotap parser
from one place, and the example code from another, and the two differ in
API used.

johannes

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

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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
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

RadioTap Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/radiotap/0 radiotap/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 radiotap radiotap/ https://lore.kernel.org/radiotap \
		radiotap@radiotap.org
	public-inbox-index radiotap

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.netbsd.radiotap


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git