more beacon work
[my-code/hdw-sniff.git] / main.h
diff --git a/main.h b/main.h
index 55dba3a..e9fd872 100644 (file)
--- a/main.h
+++ b/main.h
@@ -5,33 +5,74 @@
  *
  */
 
+#ifndef MAIN_H
+#define MAIN_H
+
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <sys/socket.h>
+#include <time.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <pcap.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <linux/wireless.h>
+
+#include "parse.h"
+
+#include "event.h"
+#include "display.h"
+#include "input.h"
+#include "list.h"
 
 #define SYSCALL_MAX 32
+#define CHANNEL_MAX 13
 #define MAX_DEV_CHARS 6
-#define SELECT_SEC 0
-#define SELECT_USEC 200000
+#define MAX_SYSCALL_CHARS 64
+
+#define HOP_SEC 0
+#define HOP_USEC 200000
 
 /* modes */
-#define MONITORING_MODE 0x01
-#define MANAGED_MODE 0x00
-#define QUIT_MODE 0x02
+#define MODE_MONITOR (1<<0)
+#define MODE_WLANNG (1<<1)
+#define MODE_QUIT (1<<2)
+#define MODE_HEXOUT (1<<3)
+#define MODE_ASCIIOUT (1<<4)
 
 #define MAX_BYTE_WEP 13 /* maximal 104 bit key */
 
 /* type definitions */
 typedef struct s_info {
+  t_event event;
+  t_display display;
+  t_input input;
+  int count; /* count packages */
+  int count_m;
+  int count_c;
+  int count_d;
   unsigned char mode; /* monitoring/managed mode */
   char device[MAX_DEV_CHARS]; /* sniffed devie */
-  int logfile_fd; /* file descriptof for logfile */
+  int log_fd; /* file descriptor for logfile */
   int pcap_fd; /* fd for reading pcap events */
-  char key[13]; /* wep key */
-  
+  int dump_fd; /* fd for dumping received packages */
+  int current_channel;
+  int channel_hop_fd;
+  pcap_t *pcap_handle;
+  t_list sniffed_sta;
+  int view_table;
 } t_info;
 
-
 /* function prototypes */
-int usage(void); 
+void parse_package(unsigned char *ptr,const struct pcap_pkthdr *pcap_header,const unsigned char *package);
+int display_console(t_info *info,char *string);
+
+#endif