- // new_sta.
- /* debug output */
- dprintf(info->log_fd,"beacon: ");
- for(i=0;i<ADDR_LEN;i++) dprintf(info->log_fd,"%02x ",*((f3hdr->addr2)+i));
- dprintf(info->log_fd," essid: (len=%x) ",beacon_fb->ssid_length);
- for(i=0;i<beacon_fb->ssid_length;i++)
- dprintf(info->log_fd,"%c ",*(u8 *)(beacon_fb->ssid+i));
- dprintf(info->log_fd,"\n");
+ // check sta
+ memcpy(new_sta.addr,f3hdr->addr2,ADDR_LEN);
+ ret=list_search_data(&(info->sniffed_sta),&new_sta,ADDR_LEN);
+ 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;
+ }
+ else sta=(t_sta *)info->sniffed_sta.current->data;
+ // fill in stuff ...
+ memcpy(sta->ssid,beacon_fb->ssid,beacon_fb->ssid_length);
+ if((CAP_INFO_ESS(beacon_fb->cap_info))&
+ (CAP_INFO_IBSS(beacon_fb->cap_info)==0)) sta->ap=AP;
+ if(CAP_INFO_PRIVACY(beacon_fb->cap_info)) sta->wep=WEP;
+ sta->count_mgmt++;
+ switch_active_state(&(sta->active));
+ strncpy(string,"last: beacon, source: ",MESSAGE_MAX);
+ for(i=0;i<ADDR_LEN;i++)
+ snprintf(&string[22+3*i],4,"%02x%c",sta->addr[i],
+ (i==ADDR_LEN-1)?'.':':');
+ string[22+3*ADDR_LEN+1]=0;
+ display_console(info,string);