X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Fhdw-sniff.git;a=blobdiff_plain;f=main.c;fp=main.c;h=1ed6040162674d8327cabe510a73dc6d71d3a3b6;hp=8004e9ef6347bc40cefdcd76a846964857314623;hb=c191ef245532c978ebdfbcb25056500fab9eb638;hpb=04773ef6afbd043429d526ca375e5caba1294c99 diff --git a/main.c b/main.c index 8004e9e..1ed6040 100644 --- a/main.c +++ b/main.c @@ -23,7 +23,13 @@ int display_console(t_info *info,char *string) { display_line(display,0,0,2,0,'-'); display_string(display,4,0,"sta",3); - display_line(display,8,0,x,0,'-'); + display_line(display,8,0,12,0,'-'); + + display_string(display,13,0,"bssid",5); + display_line(display,19,0,23,0,'-'); + + display_string(display,24,0,"M",1); + display_line(display,26,0,x,0,'-'); //display_line(display,0,0,0,y,'|'); //display_line(display,x,0,x,y,'|'); @@ -117,7 +123,8 @@ int hop_channel(t_event *event,void *ptr) { info=(t_info *)ptr; - if(info->current_channel>=CHANNEL_MAX) info->current_channel=1; + if((info->current_channel>CHANNEL_MAX)|(info->current_channel==0)) + info->current_channel=1; memset(&iwreq,0,sizeof(iwreq)); strcpy(iwreq.ifr_name,info->device); iwreq.u.freq.e=0; @@ -127,8 +134,9 @@ int hop_channel(t_event *event,void *ptr) { perror("ioctl"); return -23; } - ++(info->current_channel); - return 23; + ++(info->current_channel); + + return 23; } int main(int argc, char **argv) { @@ -201,11 +209,12 @@ int main(int argc, char **argv) { system(sys_call); if(info.log_fd==0) { - if((info.log_fd=open("/tmp/hdw-sniff.log",O_RDWR|O_CREAT))!=0) - puts("using logfile /tmp/hdw-sniff.log ..."); - else { - puts("failed to open logfile ..."); - return -23; + if((info.log_fd=open("/tmp/hdw-sniff.log",O_RDWR|O_CREAT))!=0) + puts("using logfile /tmp/hdw-sniff.log ..."); + else { + puts("failed to open logfile ..."); + return -23; + } } /* pcap */ @@ -248,5 +257,4 @@ int main(int argc, char **argv) { puts("bugreports: hackbard@hackdaworld.org"); return 23; - }