[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:
parent
2af46ea263
commit
22ee24655a
|
@ -693,6 +693,7 @@ void listen_for_aps(void)
|
||||||
struct sockaddr_in client; // UDP client structure
|
struct sockaddr_in client; // UDP client structure
|
||||||
socklen_t client_len = sizeof(client) ; // Size of clients
|
socklen_t client_len = sizeof(client) ; // Size of clients
|
||||||
autocalibration_hello message ;
|
autocalibration_hello message ;
|
||||||
|
char ap_ip_addr[16] ;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "Autocalibration Hello thread launched.\n") ;
|
fprintf(stderr, "Autocalibration Hello thread launched.\n") ;
|
||||||
|
@ -720,11 +721,14 @@ void listen_for_aps(void)
|
||||||
continue ;
|
continue ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
strncpy(ap_ip_addr, inet_ntoa(client.sin_addr), 16) ;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "Got a Hello message.\n") ;
|
fprintf(stderr, "Got a Hello message from « %s »\n",
|
||||||
|
ap_ip_addr) ;
|
||||||
#endif // DEBUG
|
#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) ;
|
(void) close(listen_sockfd) ;
|
||||||
|
|
|
@ -925,7 +925,6 @@ void autocalibrate_hello()
|
||||||
&serv, NULL) ;
|
&serv, NULL) ;
|
||||||
|
|
||||||
memcpy(&message.ap_mac_addr_bytes, my_mac, 6) ;
|
memcpy(&message.ap_mac_addr_bytes, my_mac, 6) ;
|
||||||
strncpy(message.ap_ip_addr, my_ip, 16) ;
|
|
||||||
|
|
||||||
while (run)
|
while (run)
|
||||||
{
|
{
|
||||||
|
|
|
@ -92,7 +92,6 @@ typedef struct _request
|
||||||
typedef struct _autocalibration_hello
|
typedef struct _autocalibration_hello
|
||||||
{
|
{
|
||||||
unsigned char ap_mac_addr_bytes[6];
|
unsigned char ap_mac_addr_bytes[6];
|
||||||
char ap_ip_addr[16] ;
|
|
||||||
} autocalibration_hello ;
|
} autocalibration_hello ;
|
||||||
|
|
||||||
typedef struct _autocalibration_order
|
typedef struct _autocalibration_order
|
||||||
|
|
Loading…
Reference in New Issue