00001 /* Linux Prism II Stumbler - Utility Scan for 802_11 networks under Linux 00002 * 00003 * File : Airjack.h 00004 * Project : WifiScanner (c) 2002 Herv<E9> Schauer Consultants 00005 * Usage : This utility is written for use with IEEE 802.11 adapters based 00006 * on Intersil's PRISM II chipset (PCMCIA). 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License 00010 * as published by the Free Software Foundation; either version 2 00011 * of the License, or (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00021 * 00022 */ 00023 00024 #ifndef __AIRJACK_H__ 00025 #define __AIRJACK_H__ 00026 00027 int selectChannelAIRJACK(char *devname, int channel); 00028 int shutCardAIRJACK(char *devname); 00029 int openCardAIRJACK(char *devname); 00030 int getPacketAIRJACK(p80211_caphdr_t * wlan_header, UINT8 * buf, int maxlen); 00031 int openPacketAIRJACK(char *devname); 00032 void closePacketAIRJACK(void); 00033 00034 void sendDeauth(UINT8 dest[WLAN_ADDR_LEN], UINT8 bssid[WLAN_ADDR_LEN], 00035 UINT8 channel); 00036 00037 struct aj_config { 00038 __u16 mode; /* mac port operating mode */ 00039 __u8 ownmac[6]; /* our mac address */ 00040 __u8 monitor; /* are we in monitor mode */ 00041 __u8 channel; /* channel to operate on... */ 00042 __u8 essid[33]; /* first byte is length */ 00043 }; 00044 00045 struct a3_80211 { 00046 union { 00047 __u16 fc1_frame_control; 00048 struct { 00049 __u16 fc2_version:2; 00050 __u16 fc2_type:2; 00051 __u16 fc2_subtype:4; 00052 __u16 fc2_to_ds:1; 00053 __u16 fc2_from_ds:1; 00054 __u16 fc2_more_frag:1; 00055 __u16 fc2_retry:1; 00056 __u16 fc2_pwr_man:1; 00057 __u16 fc2_more_data:1; 00058 __u16 fc2_wep:1; 00059 __u16 fc2_order:1; 00060 } fc2; 00061 } fc1; 00062 __u16 mh_duration_id; 00063 __u8 mh_mac1[6]; 00064 __u8 mh_mac2[6]; 00065 __u8 mh_mac3[6]; 00066 union { 00067 __u16 seq1_seq; 00068 struct { 00069 __u16 seq2_frag_num:4; 00070 __u16 seq2_seq_num:12; 00071 } seq2; 00072 } seq1; 00073 }; 00074 00075 /* manefest constants to make Mac Headers more straitforward */ 00076 #define mh_fc fc1.fc1_frame_control 00077 #define mh_version fc1.fc2.fc2_version 00078 #define mh_type fc1.fc2.fc2_type 00079 #define mh_subtype fc1.fc2.fc2_subtype 00080 #define mh_to_ds fc1.fc2.fc2_to_ds 00081 #define mh_from_ds fc1.fc2.fc2_from_ds 00082 #define mh_more_frag fc1.fc2.fc2_more_frag 00083 #define mh_retry fc1.fc2.fc2_retry 00084 #define mh_pwr_man fc1.fc2.fc2_pwr_man 00085 #define mh_more_data fc1.fc2.fc2_more_data 00086 #define mh_wep fc1.fc2.fc2_wep 00087 #define mh_order fc1.fc2.fc2_order 00088 #define mh_aid mh_duration_id 00089 #define mh_ra mh_mac1 00090 #define mh_da mh_mac1 00091 #define mh_ps_bssid mh_mac1 00092 #define mh_cf_bssid mh_mac2 00093 #define mh_ta mh_mac2 00094 #define mh_sa mh_mac2 00095 #define mh_bssid mh_mac3 00096 #define mh_seq seq1.seq1_seq 00097 #define mh_frag_num seq1.seq2.seq2_frag_num 00098 #define mh_seq_num seq1.seq2.seq2_seq_num 00099 00100 /*** Frame Control Types ***/ 00101 00102 #define FC_TYPE_MGT 0x00 /* management type */ 00103 #define FC_TYPE_CTL 0x01 /* control type */ 00104 #define FC_TYPE_DATA 0x02 /* data type */ 00105 #define FC_TYPE_RESR 0x03 /* reserved for later use */ 00106 00107 /*** Management SubTypes ***/ 00108 #define MGT_AS_RQ 0x00 /* association request */ 00109 #define MGT_AS_RS 0x01 /* association responce */ 00110 #define MGT_REAS_RQ 0x02 /* reassociation request */ 00111 #define MGT_REAS_RS 0x03 /* reassociation responce */ 00112 #define MGT_PB_RQ 0x04 /* probe request */ 00113 #define MGT_PB_RS 0x05 /* probe responce */ 00114 #define MGT_RESERV1 0x06 00115 #define MGT_RESERV2 0x07 00116 #define MGT_BEACON 0x08 /* beacon */ 00117 #define MGT_ATIM 0x09 /* announcement trafic indication message */ 00118 #define MGT_DISAS 0x0A /* disassociation */ 00119 #define MGT_AUTH 0x0B /* authentication */ 00120 #define MGT_DEAUTH 0x0C /* de-authentication */ 00121 #define MGT_RESERV3 0x0D 00122 #define MGT_RESERV4 0x0E 00123 #define MGT_RESERV5 0x0F 00124 00125 /* Airjack26 device private ioctl calls */ 00126 #define SIOCAJSMODE SIOCDEVPRIVATE /* so i here this probably wont work on 2.5.x, blah */ 00127 #define SIOCAJGMODE SIOCAJSMODE + 1 00128 00129 00130 #endif