beacons recognized, minimal gui working
[my-code/hdw-sniff.git] / parse.h
diff --git a/parse.h b/parse.h
index ef167ad..3d1d290 100644 (file)
--- a/parse.h
+++ b/parse.h
@@ -5,6 +5,12 @@
 
 /* ieee802.11 stuff */
 
+
+typedef unsigned long long int u64;
+typedef unsigned int u32;
+typedef unsigned short int u16;
+typedef unsigned char u8;
+
 #define ADDR_LEN 6
 
 typedef struct s_frame4_hdr {
@@ -54,8 +60,8 @@ typedef struct s_frame1_hdr {
 #define FCTL_ORDER(X) ((X&0x800)>>15)
 
 #define FCTL_TYPE_MGMT 0
-#define FCTL_TYPE_CTRL 1
-#define FCTL_TYPE_DATA 2
+#define FCTL_TYPE_CTRL 2
+#define FCTL_TYPE_DATA 1
 
 #define FCTL_STYPE_ASSOC_REQ 0x0
 #define FCTL_STYPE_ASSOC_RESP 0x1
@@ -85,6 +91,21 @@ typedef struct s_frame1_hdr {
 #define FCTL_STYPE_CFPOLL 0x6
 #define FCTL_STYPE_CFACKPOLL 0x7
 
+typedef struct s_beacon_fb {
+  u64 timestamp;
+  u16 beacon_int;
+  u16 cap_info;
+  u8 ssid_element_id;
+  u8 ssid_length;
+  u8 ssid[32];
+  u8 srates_element_id;
+  u8 srates_element_length;
+  u8 rest; /* go on here ... */
+} __attribute__ ((packed)) t_beacon_fb;
+
+#define CAP_INFO_ESS(X) ((X&0x0001))
+#define CAP_INFO_IBSS(X) ((X&0x0002)>>1)
+#define CAP_INFO_PRIVACY(X) ((X&0x0010)>>4)
 
 /* hdw-sniff stuff */
 
@@ -101,6 +122,7 @@ typedef struct s_sta {
   int count_mgmt;
   int count_ctrl;
   int count_data;
+  char active;
   char key[WEP_MAX_DIGITS];
 } t_sta;