]> hackdaworld.org Git - my-code/hdw-sniff.git/commitdiff
added flite support for new beacon frames
authorhackbard <hackbard>
Fri, 10 Jun 2005 14:45:45 +0000 (14:45 +0000)
committerhackbard <hackbard>
Fri, 10 Jun 2005 14:45:45 +0000 (14:45 +0000)
parse.c

diff --git a/parse.c b/parse.c
index f18ba98810a4bba628920170dc8f59428c4e1ef9..7eac80362f91202bed52bbfe8b995ede8e553850 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -46,12 +46,15 @@ void parse_package(unsigned char *ptr,const struct pcap_pkthdr *pcap_header,cons
   t_beacon_fb *beacon_fb;
   int ret;
   char string[MESSAGE_MAX];
+  char sc[MAX_SYSCALL_CHARS];
+  unsigned char new;
 
   info=(t_info *)ptr;
 
   info->count++;
 
   memset(&new_sta,0,sizeof(t_sta));
+  new=0;
 
   if(info->dump_fd!=0) {
     ret=write(info->dump_fd,pcap_header,sizeof(struct pcap_pkthdr));
@@ -80,6 +83,7 @@ void parse_package(unsigned char *ptr,const struct pcap_pkthdr *pcap_header,cons
       if((ret==L_EMPTY_LIST)|(ret==L_NO_SUCH_ELEMENT)) {
         list_add_element(&(info->sniffed_sta),&new_sta,sizeof(t_sta));
         sta=(t_sta *)info->sniffed_sta.current->data;
+        new=1;
       }
       else sta=(t_sta *)info->sniffed_sta.current->data;
       // fill in stuff ...
@@ -95,6 +99,10 @@ void parse_package(unsigned char *ptr,const struct pcap_pkthdr *pcap_header,cons
                  (i==ADDR_LEN-1)?'.':':');
       string[22+3*ADDR_LEN+1]=0;
       display_console(info,string);
+      if(new) {
+        snprintf(sc,MAX_SYSCALL_CHARS,"flite 'new ssid: %s'",sta->ssid);
+        system(sc);
+      } 
     }
 
   }