[Listener] Access Point -> Capture Point

Same work as for the Aggregator, without any user-visible change.
This commit is contained in:
Matteo Cypriani 2013-06-14 14:04:05 -04:00
parent 0c3083bd41
commit 9e7b55c317
1 changed files with 11 additions and 11 deletions

View File

@ -52,8 +52,8 @@
char *program_name = NULL ;
uint8_t my_mac_bytes[ETHER_ADDR_LEN] ; // AP MAC address
char my_ip[INET_ADDRSTRLEN] ; // AP IP address
uint8_t my_mac_bytes[ETHER_ADDR_LEN] ; // CP MAC address
char my_ip[INET_ADDRSTRLEN] ; // CP IP address
/* Will we dump the configuration?
* Note that we declare this option as a global variable because
@ -1093,11 +1093,11 @@ void read_packet(const struct pcap_pkthdr *pkt_header,
memcpy(request.mobile_mac_addr_bytes, &pkt_data[offset],
ETHER_ADDR_LEN) ;
// Drop the packet if it comes from the AP itself:
// Drop the packet if it comes from the CP itself:
if (owl_mac_equals(my_mac_bytes, request.mobile_mac_addr_bytes))
return ;
// Copy AP MAC :
// Copy CP MAC :
memcpy(request.ap_mac_addr_bytes, my_mac_bytes, ETHER_ADDR_LEN) ;
// Capture time is in the pcap header (host-endian):
owl_timeval_to_timestamp(&pkt_header->ts, &request.capture_time) ;
@ -1324,7 +1324,7 @@ void display_captured_request(owl_captured_request *request,
char
request_time_str[OWL_TIMESTAMP_STRLEN],
capture_time_str[OWL_TIMESTAMP_STRLEN],
ap_mac_addr_str[OWL_ETHER_ADDR_STRLEN],
cp_mac_addr_str[OWL_ETHER_ADDR_STRLEN],
mobile_mac_addr_str[OWL_ETHER_ADDR_STRLEN],
mobile_ip_str[INET_ADDRSTRLEN] ;
@ -1335,7 +1335,7 @@ void display_captured_request(owl_captured_request *request,
owl_ntoh_timestamp(&tmp_time) ;
owl_timestamp_to_string(&tmp_time, capture_time_str) ;
owl_mac_bytes_to_string_r(request->ap_mac_addr_bytes,
ap_mac_addr_str) ;
cp_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,
@ -1343,11 +1343,11 @@ void display_captured_request(owl_captured_request *request,
printf("*** Request to send ***\n"
"\tType: %"PRIu8"\n"
"\tMAC AP: %s\n"
"\tMobile MAC: %s\n"
"\tMobile IP: %s\n"
"\tCP's MAC: %s\n"
"\tMobile's MAC: %s\n"
"\tMobile's IP: %s\n"
"\tRequest timestamp: %s\n"
"\tRequest arrival time on the AP: %s\n"
"\tRequest arrival time on the CP: %s\n"
"\tSignal: %"PRId8" dBm\n"
"\tPosition X: %f\n"
"\tPosition Y: %f\n"
@ -1357,7 +1357,7 @@ void display_captured_request(owl_captured_request *request,
"\tPacket size: %"PRIu32"\n"
,
request->type,
ap_mac_addr_str,
cp_mac_addr_str,
mobile_mac_addr_str,
mobile_ip_str,
request_time_str,