All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Green <andy@warmcat.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 3/4] mac80211: Monitor mode radiotap injection docs
Date: Thu, 29 Mar 2007 12:18:57 +0100	[thread overview]
Message-ID: <460BA0A1.7080106@warmcat.com> (raw)
In-Reply-To: <1174500950.3944.15.camel@johannes.berg>

Johannes Berg wrote:
> On Tue, 2007-03-20 at 10:39 +0000, andy@warmcat.com wrote:
> 
>> +++ b/Documentation/networking/mac80211-injection.txt
> 
> This needs to be for cfg80211.

Well, the actual injection action is happening in mac80211.  I think 
you're looking at it as a cfg80211 wext-replacing type thing and I am 
looking at it as completely generic mac80211 packet injection from 
userspace.

>> +Radiotap headers are variable-length and extensible, you can get most of the
>> +information you need to know on them from:
>> +
>> +./include/net/ieee80211_radiotap.h
>> +
>> +But note: all fields in the radiotap header are *little endian*.
>> +
>> +There is a fixed portion at the start which contains a u32 bitmap that defines
>> +if the possible argument is present or not.  At the moment there are only 13
>> +possible arguments defined, but in case we run out of space in the u32 it is
>> +defined that b31 set indicates that there is another u32 bitmap following, and
>> +the start of the arguments is moved forward 4 bytes each time.
> 
> Drop all that, it's generic radiotap description. Put it into another
> file if you want.

This kind of description makes documentation useful to the reader, who 
may never have heard of radiotap (it is not very visible in Google right 
now in a useful way).

>> +After the fixed part of the header, the arguments follow.
>> +
>> + - the arguments are all little-endian!
> 
> duplicated information.

Yes when documenting something, you duplicate critical information, it 
is not an error but a static Forward Error Correction technology for 
lossy readers.

>> +The ieee80211 header follows immediately afterwards, looking for example like
>> +this:
>> +
>> +	0x08, 0x01, 0x00, 0x00,
>> +	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
>> +	0x13, 0x22, 0x33, 0x44, 0x55, 0x66,
>> +	0x13, 0x22, 0x33, 0x44, 0x55, 0x66,
>> +	0x10, 0x86
>> +
>> +Then lastly there is the payload.
> 
> Scratch that, somebody who doesn't know how a IEEE 802.11 header looks
> like has no business reading that file anyway ;)

Everybody has to learn from nothing!

>> Libpcap can also be used,
>> +(which is easier than doing the work to bind the socket to the right
>> +interface), along the following lines:
>> +
>> +	ppcap = pcap_open_live(szInterfaceName, 800, 1, 20, szErrbuf);
>> +...
>> +	r = pcap_inject(ppcap, u8aSendBuffer, nLength);
>> +
>> +You can also find sources for a complete inject test applet here:
>> +
>> +http://penumbra.warmcat.com/_twk/tiki-index.php?page=packetspammer
> 
> Is it big enough to warrant being elsewhere? I don't see how an example
> program can be more than a few lines of code and then it could be
> included here as a C file.

It's ~380 lines.  It also knows how to conjure up management interfaces. 
  I can chop it down and put it in here if you feel it is important.

I appreciate the comments, but I am 100% sure that some correct 
documentation that may be over-chatty is better than no documentation at 
all.  After hesitating and starting to change it I left it as it is, if 
you still feel these things are important comment in that direction 
again on the new patch and I will grit my teeth and change it.

-Andy

  reply	other threads:[~2007-03-29 11:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-20 10:39 [PATCH 0/4] Try #5: Radiotap on Monitor Mode interfaces for rx and tx andy
2007-03-20 10:39 ` [PATCH 1/4] mac80211: Coding style cleanups andy
2007-03-21 18:58   ` Johannes Berg
2007-03-29 11:17     ` Andy Green
2007-03-20 10:39 ` [PATCH 2/4] mac80211: Add radiotap support for Monitor mode RX andy
2007-03-21 18:51   ` Johannes Berg
2007-03-22 23:18     ` Michael Wu
2007-03-23 13:44       ` Johannes Berg
2007-03-20 10:39 ` [PATCH 3/4] mac80211: Monitor mode radiotap injection docs andy
2007-03-21 18:15   ` Johannes Berg
2007-03-29 11:18     ` Andy Green [this message]
2007-03-29 11:26       ` Johannes Berg
2007-03-20 10:39 ` [PATCH 4/4] mac80211: Monitor mode radiotap-based packet injection andy
2007-03-21 18:28   ` Johannes Berg
2007-03-29 11:14     ` Andy Green
2007-03-29 11:19       ` Johannes Berg
2007-03-29 11:33         ` Andy Green
2007-03-29 11:48           ` Johannes Berg
2007-03-21 18:10 ` [PATCH 0/4] Try #5: Radiotap on Monitor Mode interfaces for rx and tx Johannes Berg
2007-03-22 22:58   ` Michael Wu
2007-03-23 14:01     ` Johannes Berg
2007-03-23  8:57   ` Andy Green
2007-03-23 13:57     ` Johannes Berg
2007-03-21 18:46 ` Johannes Berg
2007-03-22 23:10   ` Michael Wu

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=460BA0A1.7080106@warmcat.com \
    --to=andy@warmcat.com \
    --cc=johannes@sipsolutions.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.