mirror of
				https://github.com/berlin-open-wireless-lab/DAWN.git
				synced 2025-03-09 15:40:12 +00:00 
			
		
		
		
	feed hostapd with nr reports
This commit is contained in:
		
							parent
							
								
									1804d18bf5
								
							
						
					
					
						commit
						a63c723e31
					
				
					 5 changed files with 64 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -894,6 +894,37 @@ ap insert_to_ap_array(ap entry) {
 | 
			
		|||
    return entry;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int ap_get_nr(struct blob_buf *b_local, uint8_t own_bssid_addr[]) {
 | 
			
		||||
 | 
			
		||||
    pthread_mutex_lock(&ap_array_mutex);
 | 
			
		||||
    int i;
 | 
			
		||||
 | 
			
		||||
    void* nbs = blobmsg_open_array(b_local, "list");
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i <= ap_entry_last; i++) {
 | 
			
		||||
        if (mac_is_equal(own_bssid_addr, ap_array[i].bssid_addr)) {
 | 
			
		||||
            continue; //TODO: Skip own entry?!
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        void* nr_entry = blobmsg_open_array(b_local, NULL);
 | 
			
		||||
 | 
			
		||||
        char mac_buf[20];
 | 
			
		||||
        sprintf(mac_buf, MACSTRLOWER, MAC2STR(ap_array[i].bssid_addr));
 | 
			
		||||
        blobmsg_add_string(b_local, NULL, mac_buf);
 | 
			
		||||
 | 
			
		||||
        blobmsg_add_string(b_local, NULL, (char *) ap_array[i].ssid);
 | 
			
		||||
        blobmsg_add_string(b_local, NULL, ap_array[i].neighbor_report);
 | 
			
		||||
        blobmsg_close_array(b_local, nr_entry);
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    blobmsg_close_array(b_local, nbs);
 | 
			
		||||
 | 
			
		||||
    pthread_mutex_unlock(&ap_array_mutex);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ap_get_collision_count(int col_domain) {
 | 
			
		||||
 | 
			
		||||
    int ret_sta_count = 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue