wificurse

wifi jamming tool
git clone git://git.2f30.org/wificurse
Log | Files | Refs | README | LICENSE

wificurse.h (2061B)


      1 /*
      2     wificurse - WiFi Jamming tool
      3     Copyright (C) 2012  oblique
      4 
      5     This program is free software: you can redistribute it and/or modify
      6     it under the terms of the GNU General Public License as published by
      7     the Free Software Foundation, either version 3 of the License, or
      8     (at your option) any later version.
      9 
     10     This program is distributed in the hope that it will be useful,
     11     but WITHOUT ANY WARRANTY; without even the implied warranty of
     12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13     GNU General Public License for more details.
     14 
     15     You should have received a copy of the GNU General Public License
     16     along with this program.  If not, see <http://www.gnu.org/licenses/>.
     17 */
     18 
     19 #ifndef WIFICURSE_H
     20 #define WIFICURSE_H
     21 
     22 #include <stdint.h>
     23 #include <linux/if.h>
     24 #include "iw.h"
     25 #include "ap_list.h"
     26 
     27 
     28 #define VERSION	"0.3.9"
     29 
     30 struct frame_control {
     31 	uint8_t protocol_version:2;
     32 	uint8_t type:2;
     33 	uint8_t subtype:4;
     34 	uint8_t to_ds:1;
     35 	uint8_t from_ds:1;
     36 	uint8_t more_frag:1;
     37 	uint8_t retry:1;
     38 	uint8_t pwr_mgt:1;
     39 	uint8_t more_data:1;
     40 	uint8_t protected_frame:1;
     41 	uint8_t order:1;
     42 } __attribute__((__packed__));
     43 
     44 #define FRAME_CONTROL_TYPE_MGMT_FRAME	0
     45 #define FRAME_CONTROL_SUBTYPE_DEAUTH	12
     46 #define FRAME_CONTROL_SUBTYPE_BEACON	8
     47 
     48 struct sequence_control {
     49 	uint16_t fragment:4;
     50 	uint16_t sequence:12;
     51 } __attribute__((__packed__));
     52 
     53 struct mgmt_frame {
     54 	struct frame_control fc;
     55 	uint16_t duration;
     56 	uint8_t  dest_mac[IFHWADDRLEN];
     57 	uint8_t  src_mac[IFHWADDRLEN];
     58 	uint8_t  bssid[IFHWADDRLEN];
     59 	struct sequence_control sc;
     60 	uint8_t  frame_body[];
     61 } __attribute__((__packed__));
     62 
     63 struct info_element {
     64 	uint8_t id;
     65 	uint8_t len;
     66 	uint8_t info[];
     67 } __attribute__((__packed__));
     68 
     69 #define INFO_ELEMENT_ID_SSID	0
     70 #define INFO_ELEMENT_ID_DS	3
     71 
     72 struct beacon_frame_body {
     73 	uint64_t timestamp;
     74 	uint16_t interval;
     75 	uint16_t capabilities;
     76 	uint8_t  infos[];
     77 } __attribute__((__packed__));
     78 
     79 
     80 int send_deauth(struct iw_dev *dev, struct access_point *ap);
     81 int read_ap_info(struct iw_dev *dev, struct ap_info *api);
     82 
     83 #endif