From: hackbard Date: Thu, 2 Jun 2005 15:03:09 +0000 (+0000) Subject: temp X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=04773ef6afbd043429d526ca375e5caba1294c99;p=my-code%2Fhdw-sniff.git temp --- diff --git a/main.c b/main.c index 699eeac..8004e9e 100644 --- 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,'-'); - 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,'|'); @@ -135,7 +135,6 @@ int main(int argc, char **argv) { t_info info; int pcap_fd; - int logfd; 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 */ - for(i=1;idump_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) - 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 ... */ + /* debug log */ + dprintf(info->log_fd,"new package -> %02x/n",package[0]); /* go on parsing frame ctl header here ... */ - return 23; - } diff --git a/parse.h b/parse.h index ef167ad..a657833 100644 --- a/parse.h +++ b/parse.h @@ -5,6 +5,11 @@ /* 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 {