Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Feb 2011 07:12:41 +0100
From:      Bernhard Schmidt <bschmidt@freebsd.org>
To:        freebsd-net@freebsd.org
Cc:        Adam Stylinski <kungfujesus06@gmail.com>
Subject:   Re: Radiotap, BPF, and related system calls
Message-ID:  <201102210712.41124.bschmidt@freebsd.org>
In-Reply-To: <AANLkTimE5qro-UzQfH2Fwt6Pj59uSR8gY9GOfGo8UvEo@mail.gmail.com>
References:  <AANLkTimE5qro-UzQfH2Fwt6Pj59uSR8gY9GOfGo8UvEo@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 20 February 2011 23:56:31 Adam Stylinski wrote:
> Hello,
> 
> I'm somewhat of a novice C programmer endeavoring in a project to
> write my own protocol which will sit on top of the 1480 byte 802.3
> frames (which are on top of 802.11 frames) to accomplish remote file
> transmission.  The communication will be one way, but one roadblock
> I'm running into is discovering the exact system calls I have to
> make to send raw frames.  I want to work on the higher level API as
> opposed to the kernel level (for one I'd like the 802.11 layer to
> auto fragment the 802.3 frames for me).  The exact protocol will
> require two cards in monitor mode so that raw injection and blind
> reception can occur.  Control signals will be transmitted over a TCP
> socket via the internet.  I've found documentation that points to
> the system independent radiotap specification, and from there I've
> seen documentation which talks about initializing the ioctl through
> a BPF clone to be utilized by userland applications.  I'm sure that
> wireshark and other wireless utilities use this, but there is a boat
> load of code I've been looking through to find the precise call
> which opens up the device ioctl, initiates the the tap, and gives me
> simple functions to construct and transmit my simple frames.  I've
> found in the headers many references to the structs themselves, but
> I'm not sure where to start to initiate communication through the
> device.  Any 802.11 experts on this list that could perhaps give me
> some specific instruction or point me to a man page / example code
> which does this?
> 
> Thanks in advance for whatever you can offer me.

You might want to have a look at tools/tools/net80211/wlaninject, the 
code there is supposed to inject raw frames into any 802.11 VAP. On a 
side note, you want to use ahdemo mode for packet injection, not monitor 
mode.

-- 
Bernhard



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102210712.41124.bschmidt>