lkml.org 
[lkml]   [2002]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] New ARPHRD types
Attached is a patch for include/linux/if_arp.h, which adds two new 
ARPHRD types, ARPHRD_IEEE80211_FULL and ARPHRD_IEEE80211_CAPTURE.

This patch is against 2.4.20-pre8, but it should also go into 2.5.x as
well, assuming I'm not flamed into oblivion..

A bit of explanation. First, _FULL:

IEEE 802.11 has a variable "hardware" header length, 24 bytes for most
frames but 30 bytes for others. This poses a problem if you want to
expose a native 802.11 netdev interface to the OS, as
netdev->hardhdr_len et.al. aren't variable.

But wait, isn't there already ARPHRD_IEEE80211? Yes, but unfortunately,
common usage of this type assumes 24-byte headers. So if we break this
assumption, we break backwards compatibility with existing apps.
Remember this is intended for a native 802.11 netdev, and plenty of
stuff uses PF_PACKET sockets on these interfaces expecting packets to
come and go a certian way. For Rx frames we can play games with the
skb->mac.raw pointer, but this won't do for Tx frames.

Onto the _CAPTURE type.

(See http://www.shaftnet.org/~pizza/software/capturefrm.txt for the
longwinded version including the header format)

"The original header format for 'monitor mode' or capturing frames was
a considerable hack. The document covers a redesign of that format."

That "considerable hack" is ARPHRD_IEEE80211_PRISM, which has since come
to be used by many other drivers in lieu of a better way to do things.
Unfortunately, there is no version field in the old format, so for the
sake of making a clean break we'd like to get a new ARP type defined for
it.

This new header is non-hardware specific and has many more useful
fields, as well as the removal of a lot of cruft. And there's now
version and length fields, so we can expand on this format cleanly in
the future and not bother you guys with new ARPHRD types. :)

...

Nothing in the wild is currently using either of these types, but that
will change RSN.. and I can't push patches to libpcap&ethereal until the
ARP types are in the kernel and therefore fixed. :)

- Pizza
--
Solomon Peachy solomon@linux-wlan.com
AbsoluteValue Systems http://www.linux-wlan.com
715-D North Drive +1 (321) 259-0737 (office)
Melbourne, FL 32934 +1 (321) 259-0286 (fax)
--- /usr/src/linux/include/linux/if_arp.h Mon Oct 14 14:16:29 2002
+++ if_arp.h Mon Oct 21 17:47:29 2002
@@ -83,6 +83,8 @@
#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */
#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */
#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */
+#define ARPHRD_IEEE80211_FULL 803 /* IEEE 802.11 w/ fixed headerlen */
+#define ARPHRD_IEEE80211_CAPTURE 804 /* IEEE 802.11 w/ new capture header */

#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:30    [W:0.169 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site