From 93d5e38d57336f1bb5cae614bb6ad2b2fcb8a399 Mon Sep 17 00:00:00 2001 From: chopps Date: Sun, 23 Jan 2000 23:50:13 +0000 Subject: [PATCH] Add beginnings of ieee 802.11 generic stuff --- sys/net/Makefile | 10 ++++----- sys/net/if_ieee80211.h | 48 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 sys/net/if_ieee80211.h diff --git a/sys/net/Makefile b/sys/net/Makefile index 9132da402119..d834c31f8ac7 100644 --- a/sys/net/Makefile +++ b/sys/net/Makefile @@ -1,13 +1,13 @@ -# $NetBSD: Makefile,v 1.5 1999/07/01 08:12:47 itojun Exp $ +# $NetBSD: Makefile,v 1.6 2000/01/23 23:50:13 chopps Exp $ KDIR= /sys/net INCSDIR= /usr/include/net INCS= bpf.h bpfdesc.h ethertypes.h if.h if_arc.h if_arp.h if_atm.h if_dl.h \ - if_ether.h if_fddi.h if_gre.h if_hippi.h if_llc.h if_media.h if_ppp.h \ - if_pppvar.h if_slvar.h if_sppp.h if_stripvar.h if_token.h if_tun.h \ - if_types.h netisr.h pfil.h ppp-comp.h ppp_defs.h radix.h raw_cb.h \ - route.h slcompress.h slip.h zlib.h + if_ether.h if_fddi.h if_gre.h if_hippi.h if_ieee80211.h if_llc.h \ + if_media.h if_ppp.h if_pppvar.h if_slvar.h if_sppp.h if_stripvar.h \ + if_token.h if_tun.h if_types.h netisr.h pfil.h ppp-comp.h ppp_defs.h \ + radix.h raw_cb.h route.h slcompress.h slip.h zlib.h INCS+= pfkeyv2.h if_gif.h .include diff --git a/sys/net/if_ieee80211.h b/sys/net/if_ieee80211.h new file mode 100644 index 000000000000..deca8da9f6a8 --- /dev/null +++ b/sys/net/if_ieee80211.h @@ -0,0 +1,48 @@ +/* $NetBSD: if_ieee80211.h,v 1.1 2000/01/23 23:50:14 chopps Exp $ */ + +/* + * generic definitions for IEEE 802.11 frames + */ +struct ieee80211_frame { + u_int8_t i_fc[2]; + u_int8_t i_dur[2]; + u_int8_t i_addr1[ETHER_ADDR_LEN]; + u_int8_t i_addr2[ETHER_ADDR_LEN]; + u_int8_t i_addr3[ETHER_ADDR_LEN]; + u_int8_t i_seq[2]; + /* possibly followed by addr4[ETHER_ADDR_LEN]; */ +}; + +#define IEEE80211_FC0_VERSION_MASK 0x03 +#define IEEE80211_FC0_VERSION_0 0x00 +#define IEEE80211_FC0_TYPE_MASK 0x0c +#define IEEE80211_FC0_TYPE_MGT 0x00 +#define IEEE80211_FC0_TYPE_CTL 0x04 +#define IEEE80211_FC0_TYPE_DATA 0x08 +#define IEEE80211_FC0_SUBTYPE_MASK 0xf0 +#define IEEE80211_FC0_SUBTYPE_ASSOC_REQ 0x00 +#define IEEE80211_FC0_SUBTYPE_ASSOC_RESP 0x10 +#define IEEE80211_FC0_SUBTYPE_REASSOC_REQ 0x20 +#define IEEE80211_FC0_SUBTYPE_REASSOC_RESP 0x30 +#define IEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40 +#define IEEE80211_FC0_SUBTYPE_PROBE_RESP 0x50 +#define IEEE80211_FC0_SUBTYPE_BEACON 0x80 +#define IEEE80211_FC0_SUBTYPE_DISASSOC 0xa0 +#define IEEE80211_FC0_SUBTYPE_AUTH_REQ 0xb0 +#define IEEE80211_FC0_SUBTYPE_AUTH_RESP /* XXX */ +#define IEEE80211_FC0_SUBTYPE_ATIM /* XXX */ +#define IEEE80211_FC0_SUBTYPE_PS_POLL /* XXX */ +#define IEEE80211_FC0_SUBTYPE_RTS /* XXX */ +#define IEEE80211_FC0_SUBTYPE_CTS /* XXX */ +#define IEEE80211_FC0_SUBTYPE_ACK /* XXX */ + +#define IEEE80211_FC1_RCVFROM_MASK 0x03 +#define IEEE80211_FC1_RCVFROM_TERMINAL 0x00 +#define IEEE80211_FC1_RCVFROM_AP 0x01 +#define IEEE80211_FC1_RCVFROM_AP2AP 0x02 + +#define IEEE80211_NWID_LEN 32 + +/* nwid is u_int8_t array of IEEE80211_NWID_LEN pointed at by ifr.ifr_data */ +#define SIOCS80211NWID _IOWR('i', 230, struct ifreq) +#define SIOCG80211NWID _IOWR('i', 231, struct ifreq)