[i-c] Remove ap_ip_addr from autocalibration_hello

The listener does not send its IP address explicitly in the Hello
message anymore. Instead, the aggregator now extract the source address
of the Hello packet.
This commit is contained in:
Matteo Cypriani 2011-02-28 17:00:53 +01:00
parent 2af46ea263
commit 22ee24655a
3 changed files with 6 additions and 4 deletions

View File

@ -693,6 +693,7 @@ void listen_for_aps(void)
struct sockaddr_in client; // UDP client structure
socklen_t client_len = sizeof(client) ; // Size of clients
autocalibration_hello message ;
char ap_ip_addr[16] ;
#ifdef DEBUG
fprintf(stderr, "Autocalibration Hello thread launched.\n") ;
@ -720,11 +721,14 @@ void listen_for_aps(void)
continue ;
}
strncpy(ap_ip_addr, inet_ntoa(client.sin_addr), 16) ;
#ifdef DEBUG
fprintf(stderr, "Got a Hello message.\n") ;
fprintf(stderr, "Got a Hello message from « %s »\n",
ap_ip_addr) ;
#endif // DEBUG
update_ap(message.ap_mac_addr_bytes, message.ap_ip_addr) ;
update_ap(message.ap_mac_addr_bytes, ap_ip_addr) ;
}
(void) close(listen_sockfd) ;

View File

@ -925,7 +925,6 @@ void autocalibrate_hello()
&serv, NULL) ;
memcpy(&message.ap_mac_addr_bytes, my_mac, 6) ;
strncpy(message.ap_ip_addr, my_ip, 16) ;
while (run)
{

View File

@ -92,7 +92,6 @@ typedef struct _request
typedef struct _autocalibration_hello
{
unsigned char ap_mac_addr_bytes[6];
char ap_ip_addr[16] ;
} autocalibration_hello ;
typedef struct _autocalibration_order