- display_line(display,0,0,2,0,'-');
- display_string(display,4,0,"sta",3);
- display_line(display,8,0,12,0,'-');
-
- display_string(display,13,0,"bssid",5);
- display_line(display,19,0,23,0,'-');
-
- display_string(display,25,0,"M",1);
- display_line(display,27,0,x,0,'-');
-
- //display_line(display,0,0,0,y,'|');
- //display_line(display,x,0,x,y,'|');
+ count=list_count(&(info->sniffed_sta));
+ cnt=((count>y-5)?y-5:count);
+
+ display_line(display,0,0,x,0,'-');
+ display_string(display,GUI_OFFSET_STA,1,"sta/ap",6);
+ display_string(display,GUI_OFFSET_SSID,1,"| ssid",6);
+ display_string(display,GUI_OFFSET_AP,1,"| ap",4);
+ display_string(display,GUI_OFFSET_WEP,1,"| wep",5);
+ display_string(display,GUI_OFFSET_MGMT,1,"| mgmt",6);
+ display_string(display,GUI_OFFSET_CTRL,1,"| ctrl",6);
+ display_string(display,GUI_OFFSET_DATA,1,"| data",6);
+ display_string(display,GUI_OFFSET_ACTIVE,1,"| act",5);
+ display_line(display,0,2,x,2,'-');
+
+ list_reset(&(info->sniffed_sta));
+
+ for(i=0;i<cnt;i++) {
+ sta=(t_sta *)info->sniffed_sta.current->data;
+ snprintf(help,32,"%02x:%02x:%02x:%02x:%02x:%02x",
+ sta->addr[0],sta->addr[1],sta->addr[2],
+ sta->addr[3],sta->addr[4],sta->addr[5]);
+ display_string(display,GUI_OFFSET_STA,3+i,help,17);
+ s=strlen(sta->ssid);
+ s=((s>=16)?16:s);
+ help[0]='|'; help[1]=' ';
+ memcpy(&help[2],sta->ssid,s);
+ display_string(display,GUI_OFFSET_SSID,3+i,help,s+2);
+ snprintf(help,4,"| %c",sta->ap?'y':'n');
+ 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);
+ 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);
+ list_next(&(info->sniffed_sta));
+ }