temp
authorhackbard <hackbard>
Thu, 2 Jun 2005 15:03:09 +0000 (15:03 +0000)
committerhackbard <hackbard>
Thu, 2 Jun 2005 15:03:09 +0000 (15:03 +0000)
main.c
main.h
parse.c
parse.h

diff --git a/main.c b/main.c
index 699eeac..8004e9e 100644 (file)
--- a/main.c
+++ b/main.c
@@ -22,8 +22,8 @@ int display_console(t_info *info,char *string) {
   y=display->max_y-1;
 
   display_line(display,0,0,2,0,'-');
   y=display->max_y-1;
 
   display_line(display,0,0,2,0,'-');
-  display_string(display,4,0,"essid",5);
-  display_line(display,10,0,x,0,'-');
+  display_string(display,4,0,"sta",3);
+  display_line(display,8,0,x,0,'-');
 
   //display_line(display,0,0,0,y,'|');
   //display_line(display,x,0,x,y,'|');
 
   //display_line(display,0,0,0,y,'|');
   //display_line(display,x,0,x,y,'|');
@@ -135,7 +135,6 @@ int main(int argc, char **argv) {
 
   t_info info;
   int pcap_fd;
 
   t_info info;
   int pcap_fd;
-  int logfd;
   int i;
   char sys_call[MAX_SYSCALL_CHARS];
   char pcap_error[PCAP_ERRBUF_SIZE];
   int i;
   char sys_call[MAX_SYSCALL_CHARS];
   char pcap_error[PCAP_ERRBUF_SIZE];
@@ -143,12 +142,9 @@ int main(int argc, char **argv) {
   memset(&info,0,sizeof(t_info));
  
  /* parse arguments */
   memset(&info,0,sizeof(t_info));
  
  /* parse arguments */
- for(i=1;i<argc;i++)
- {
-  if(argv[i][0]=='-')
-  {
-   switch(argv[i][1])
-   {
+ for(i=1;i<argc;i++) {
+  if(argv[i][0]=='-') {
+   switch(argv[i][1]) {
     case 'h':
      usage();
     case 'm':
     case 'h':
      usage();
     case 'm':
diff --git a/main.h b/main.h
index 9c2387a..b44ce38 100644 (file)
--- a/main.h
+++ b/main.h
@@ -31,6 +31,7 @@
 #include "event.h"
 #include "display.h"
 #include "input.h"
 #include "event.h"
 #include "display.h"
 #include "input.h"
+#include "list.h"
 
 #define SYSCALL_MAX 32
 #define CHANNEL_MAX 12
 
 #define SYSCALL_MAX 32
 #define CHANNEL_MAX 12
@@ -69,5 +70,6 @@ typedef struct s_info {
 
 /* function prototypes */
 void parse_package(unsigned char *ptr,const struct pcap_pkthdr *pcap_header,const unsigned char *package);
 
 /* function prototypes */
 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
 
 #endif
diff --git a/parse.c b/parse.c
index bae6cd9..cac3821 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -18,7 +18,7 @@ void parse_package(unsigned char *ptr,const struct pcap_pkthdr *pcap_header,cons
 
   t_info *info;
   int i;
 
   t_info *info;
   int i;
-  t_sta sniffed_sta;
+  t_sta new_sta;
   int ret;
 
   info=(t_info *)ptr;
   int ret;
 
   info=(t_info *)ptr;
@@ -28,18 +28,18 @@ void parse_package(unsigned char *ptr,const struct pcap_pkthdr *pcap_header,cons
   if(info->dump_fd!=0) {
     ret=write(info->dump_fd,pcap_header,sizeof(struct pcap_pkthdr));
     if(ret!=sizeof(struct pcap_pkthdr))
   if(info->dump_fd!=0) {
     ret=write(info->dump_fd,pcap_header,sizeof(struct pcap_pkthdr));
     if(ret!=sizeof(struct pcap_pkthdr))
-      display_console(info->display,"warning, pcap header write failed!");
+      display_console(info,"warning, pcap header write failed!");
     ret=write(info->dump_fd,package,pcap_header->caplen);
     if(ret!=pcap_header->caplen)
     ret=write(info->dump_fd,package,pcap_header->caplen);
     if(ret!=pcap_header->caplen)
-      display_console(info->display,"warning, package write failed!");
+      display_console(info,"warning, package write failed!");
   }
   
   /* maybe there is offset to the actual ieee802.11 frame,
      for example prism header ... */
 
   }
   
   /* maybe there is offset to the actual ieee802.11 frame,
      for example prism header ... */
 
+  /* debug log */
+  dprintf(info->log_fd,"new package -> %02x/n",package[0]);
 
   /* go on parsing frame ctl header here ... */
 
 
   /* go on parsing frame ctl header here ... */
 
-  return 23;
-
 }
 }
diff --git a/parse.h b/parse.h
index ef167ad..a657833 100644 (file)
--- a/parse.h
+++ b/parse.h
@@ -5,6 +5,11 @@
 
 /* ieee802.11 stuff */
 
 
 /* ieee802.11 stuff */
 
+
+typedef unsigned int u32;
+typedef unsigned short int u16;
+typedef unsigned char u8;
+
 #define ADDR_LEN 6
 
 typedef struct s_frame4_hdr {
 #define ADDR_LEN 6
 
 typedef struct s_frame4_hdr {