2017-04-22 22:01:46

by Simon Wunderlich

[permalink] [raw]
Subject: Re: [Battlemesh] wifibroadcast

Hi Daniel,

On Saturday, April 22, 2017 5:37:03 PM CEST Daniel Golle wrote:
> Hi Simon,
>
> On Fri, Apr 21, 2017 at 09:55:03PM +0200, Simon Wunderlich wrote:
> > Hi Daniel,
> >
> > > mac80211: Parse legacy and HT rate in injected frames
> >
> > Yup, Sven was so kind and helped with this. :D
> >
> > I'm experimenting with some opportunistic routing ideas ...
>
> I just realized that the radiotap headers are still not part of the
> UAPI exported by the kernel. How is one supposed to go about this
> issue? Have lots of diverging local copies of ieee80211_radiotap.h?

Propose a patch and send it to linux wireless to move it? :)

> And change all the kernel-specific types (u16 and such) into their
> corresponding userland types (u_int16)...?

Hmm, uapi is full with __u16, __u32, ... see linux/types.h

>
> I'd be glad if you can share your idea about proper and/or intentional
> use of the kernel's radiotap capabilities...

Well, there is a radiotap parser in the kernel which is quite useful for
reading (net/wireless/radiotap.c). And there is a radiotap library which also
does parsing [1] (seems it's based on the kernel implementation), referenced
from radiotap.org [2]. What is missing (or at least I didn't find it and
implemented something on my own) is a library/function to build radiotap
headers (i.e. for writing). There are quite a few things to consider (padding,
alignment, etc). To make it useful, you would also need to build ieee80211
headers at the same time ...

I have some rough working C code for all of that (integrated into something
bigger), not sure if it would be useful to make a library out of it.

I don't have an idea about "proper" usage though. Since Johannes seems to
maintain most of that radiotap stuff, I'm CC'ing him and linux-wireless. Maybe
there is already more than what we know. :)

Cheers,
Simon

[1] https://github.com/radiotap/radiotap-library/blob/master/radiotap.c
[2] http://www.radiotap.org/


Attachments:
signature.asc (833.00 B)
This is a digitally signed message part.

2017-04-25 14:37:59

by Johannes Berg

[permalink] [raw]
Subject: Re: [Battlemesh] wifibroadcast

On Sun, 2017-04-23 at 00:01 +0200, Simon Wunderlich wrote:

> What is missing (or at least I didn't find it
> and  implemented something on my own) is a library/function to build
> radiotap  headers (i.e. for writing). There are quite a few things to
> consider (padding, alignment, etc).

Yeah, that could be done - but generally it's actually quite easy since
a given application will only have a given subset of radiotap
information it generates... wrapping all of that with some kind of
helper function could result in pretty bloated code.

> To make it useful, you would also need to build ieee80211 headers at
> the same time ...

I don't really agree - these can and should be separate IMHO.

Anyway, there isn't any such thing today.

johannes