[Listener] Display the mobile's IP address
When displaying the request to send, display the IP address of the mobile. Aggregator: clean the code for displaying requests.
This commit is contained in:
parent
5e0a227905
commit
b3b1f8eda2
|
@ -476,16 +476,13 @@ int read_loop(int sockfd)
|
|||
|
||||
if (VERBOSE_REQUESTS)
|
||||
{
|
||||
char // Return values of
|
||||
mobile_ip_str[INET_ADDRSTRLEN], // inet_ntop()
|
||||
// and owl_timestamp_to_string():
|
||||
char
|
||||
request_time_str[OWL_TIMESTAMP_STRLEN],
|
||||
start_time_str[OWL_TIMESTAMP_STRLEN],
|
||||
ap_mac_addr_str[OWL_ETHER_ADDR_STRLEN],
|
||||
mobile_mac_addr_str[OWL_ETHER_ADDR_STRLEN] ;
|
||||
mobile_mac_addr_str[OWL_ETHER_ADDR_STRLEN],
|
||||
mobile_ip_str[INET_ADDRSTRLEN] ;
|
||||
|
||||
inet_ntop(AF_INET, &request.mobile_ip_addr_bytes,
|
||||
mobile_ip_str, INET_ADDRSTRLEN) ;
|
||||
owl_timestamp_to_string(request_time_str,
|
||||
request.request_time) ;
|
||||
owl_timestamp_to_string(start_time_str, request.start_time) ;
|
||||
|
@ -493,6 +490,8 @@ int read_loop(int sockfd)
|
|||
ap_mac_addr_str) ;
|
||||
owl_mac_bytes_to_string_r(request.mobile_mac_addr_bytes,
|
||||
mobile_mac_addr_str) ;
|
||||
inet_ntop(AF_INET, &request.mobile_ip_addr_bytes,
|
||||
mobile_ip_str, INET_ADDRSTRLEN) ;
|
||||
|
||||
fprintf(stderr,
|
||||
"\n"
|
||||
|
|
|
@ -1022,7 +1022,9 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
|
|||
request_time_str[OWL_TIMESTAMP_STRLEN],
|
||||
start_time_str[OWL_TIMESTAMP_STRLEN],
|
||||
ap_mac_addr_str[OWL_ETHER_ADDR_STRLEN],
|
||||
mobile_mac_addr_str[OWL_ETHER_ADDR_STRLEN] ;
|
||||
mobile_mac_addr_str[OWL_ETHER_ADDR_STRLEN],
|
||||
mobile_ip_str[INET_ADDRSTRLEN] ;
|
||||
|
||||
owl_timestamp_to_string(request_time_str,
|
||||
owl_ntoh_timestamp(request.request_time)) ;
|
||||
owl_timestamp_to_string(start_time_str,
|
||||
|
@ -1031,10 +1033,14 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
|
|||
ap_mac_addr_str) ;
|
||||
owl_mac_bytes_to_string_r(request.mobile_mac_addr_bytes,
|
||||
mobile_mac_addr_str) ;
|
||||
inet_ntop(AF_INET, &request.mobile_ip_addr_bytes,
|
||||
mobile_ip_str, INET_ADDRSTRLEN) ;
|
||||
|
||||
printf("*** Request to send ***\n"
|
||||
"\tType: %"PRIu8"\n"
|
||||
"\tMAC AP: %s\n"
|
||||
"\tMobile MAC: %s\n"
|
||||
"\tMobile IP: %s\n"
|
||||
"\tSequence number (request time): %s\n"
|
||||
"\tRequest arrival time on the AP: %s\n"
|
||||
"\tSignal: %d dBm\n"
|
||||
|
@ -1046,6 +1052,7 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
|
|||
request.type,
|
||||
ap_mac_addr_str,
|
||||
mobile_mac_addr_str,
|
||||
mobile_ip_str,
|
||||
request_time_str,
|
||||
start_time_str,
|
||||
rtap_fields[RTAP_ANTENNASIGNALDBM] ?
|
||||
|
|
Loading…
Reference in New Issue