X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Fhdw-sniff.git;a=blobdiff_plain;f=main.c;h=b7d0b53b7c4825a25db6763b24ec414560d616fa;hp=e3cb85c7e8e7bc3047f3df0c27a76f31197ded26;hb=0f2d363e4506da5d761c082fd20d450544539bbc;hpb=c189dbc1ce419a70c8a91ba275dbdf57c4de2ec6 diff --git a/main.c b/main.c index e3cb85c..b7d0b53 100644 --- a/main.c +++ b/main.c @@ -56,13 +56,8 @@ int display_console(t_info *info,char *string) { display_string(display,GUI_OFFSET_AP,3+i,help,3); snprintf(help,5,"| %c",sta->wep?'y':'n'); display_string(display,GUI_OFFSET_WEP,3+i,help,4); -/* - snprintf(help,21,"| %04d | %04d | %04d", - sta->count_mgmt,sta->count_ctrl, - sta->count_data); -*/ - snprintf(help,21,"| %04d | n.a. | n.a.", - sta->count_mgmt); + snprintf(help,21,"| %04d | n.a. | %04d", + sta->count_mgmt,sta->count_data); display_string(display,GUI_OFFSET_MGMT,3+i,help,20); snprintf(help,5,"| %c",sta->active); display_string(display,GUI_OFFSET_ACTIVE,3+i,help,4); @@ -81,13 +76,43 @@ int display_console(t_info *info,char *string) { sta->addr[0],sta->addr[1],sta->addr[2], sta->addr[3],sta->addr[4],sta->addr[5]); display_string(display,1,1,help,21); + if(sta->ap) strcpy(help,"(access point)"); + else strcpy(help,"(station)"); + s=strlen(help); + display_string(display,23,1,help,s); + if(sta->wds) { + strcpy(help,"wds link"); + display_string(display,60,1,help,8); + } + snprintf(help,2,"%c",sta->active); + display_string(display,x-1,1,help,1); + snprintf(help,7,"sq: %02d",sta->sq); + display_string(display,x-8,1,help,6); display_line(display,0,2,x,2,'-'); - display_string(display,1,3,info->clean_line,x); display_string(display,1,3,"ssid: ",6); s=strlen(sta->ssid); memcpy(help,sta->ssid,s); display_string(display,7,3,help,s); - display_string(display,1,5,"more specific info soon ...",27); + if(sta->wep) strcpy(help,"crypted"); + else strcpy(help,"not crypted"); + s=strlen(help); + display_string(display,x-s-1,3,help,s); + + snprintf(help,13,"mgmt: %06d",sta->count_mgmt); + display_string(display,1,5,help,12); + snprintf(help,13,"ctrl: %06d",sta->count_ctrl); + display_string(display,1,6,help,12); + snprintf(help,13,"data: %06d",sta->count_data); + display_string(display,1,7,help,12); + + snprintf(help,33,"ethernet snap: %02x %02x %02x %02x %02x %02x", + sta->snap[0],sta->snap[1],sta->snap[2], + sta->snap[3],sta->snap[4],sta->snap[5]); + display_string(display,1,9,help,32); + snprintf(help,25,"bssid: %02x:%02x:%02x:%02x:%02x:%02x", + sta->bssid[0],sta->bssid[1],sta->bssid[2], + sta->bssid[3],sta->bssid[4],sta->bssid[5]); + display_string(display,1,10,help,24); } /* footer */ @@ -132,17 +157,8 @@ int get_user_interaction(t_info *info) { input_get_event(&(info->input),noop,info); - /* - if(info->input.content[0]=='h') { - display_console(info,"hdw-sniff help:"); - display_console(info,"h - print this help"); - display_console(info,"x - enable/disable hex output"); - display_console(info,"a - enable/disable ascii output"); - display_console(info,"q - quit"); - display_console(info,"console navigation: arrow up/down"); - display_console(info,"network list navigation: page up/down"); - } - */ + /* clear display */ + display_clear_screen(&(info->display)); if(info->input.content[0]=='x') { info->mode^=MODE_HEXOUT;