[Listener] Access Point -> Capture Point
Same work as for the Aggregator, without any user-visible change.
This commit is contained in:
parent
0c3083bd41
commit
9e7b55c317
|
@ -52,8 +52,8 @@
|
||||||
|
|
||||||
|
|
||||||
char *program_name = NULL ;
|
char *program_name = NULL ;
|
||||||
uint8_t my_mac_bytes[ETHER_ADDR_LEN] ; // AP MAC address
|
uint8_t my_mac_bytes[ETHER_ADDR_LEN] ; // CP MAC address
|
||||||
char my_ip[INET_ADDRSTRLEN] ; // AP IP address
|
char my_ip[INET_ADDRSTRLEN] ; // CP IP address
|
||||||
|
|
||||||
/* Will we dump the configuration?
|
/* Will we dump the configuration?
|
||||||
* Note that we declare this option as a global variable because
|
* 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],
|
memcpy(request.mobile_mac_addr_bytes, &pkt_data[offset],
|
||||||
ETHER_ADDR_LEN) ;
|
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))
|
if (owl_mac_equals(my_mac_bytes, request.mobile_mac_addr_bytes))
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
// Copy AP MAC :
|
// Copy CP MAC :
|
||||||
memcpy(request.ap_mac_addr_bytes, my_mac_bytes, ETHER_ADDR_LEN) ;
|
memcpy(request.ap_mac_addr_bytes, my_mac_bytes, ETHER_ADDR_LEN) ;
|
||||||
// Capture time is in the pcap header (host-endian):
|
// Capture time is in the pcap header (host-endian):
|
||||||
owl_timeval_to_timestamp(&pkt_header->ts, &request.capture_time) ;
|
owl_timeval_to_timestamp(&pkt_header->ts, &request.capture_time) ;
|
||||||
|
@ -1324,7 +1324,7 @@ void display_captured_request(owl_captured_request *request,
|
||||||
char
|
char
|
||||||
request_time_str[OWL_TIMESTAMP_STRLEN],
|
request_time_str[OWL_TIMESTAMP_STRLEN],
|
||||||
capture_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_mac_addr_str[OWL_ETHER_ADDR_STRLEN],
|
||||||
mobile_ip_str[INET_ADDRSTRLEN] ;
|
mobile_ip_str[INET_ADDRSTRLEN] ;
|
||||||
|
|
||||||
|
@ -1335,7 +1335,7 @@ void display_captured_request(owl_captured_request *request,
|
||||||
owl_ntoh_timestamp(&tmp_time) ;
|
owl_ntoh_timestamp(&tmp_time) ;
|
||||||
owl_timestamp_to_string(&tmp_time, capture_time_str) ;
|
owl_timestamp_to_string(&tmp_time, capture_time_str) ;
|
||||||
owl_mac_bytes_to_string_r(request->ap_mac_addr_bytes,
|
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,
|
owl_mac_bytes_to_string_r(request->mobile_mac_addr_bytes,
|
||||||
mobile_mac_addr_str) ;
|
mobile_mac_addr_str) ;
|
||||||
inet_ntop(AF_INET, &request->mobile_ip_addr_bytes,
|
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"
|
printf("*** Request to send ***\n"
|
||||||
"\tType: %"PRIu8"\n"
|
"\tType: %"PRIu8"\n"
|
||||||
"\tMAC AP: %s\n"
|
"\tCP's MAC: %s\n"
|
||||||
"\tMobile MAC: %s\n"
|
"\tMobile's MAC: %s\n"
|
||||||
"\tMobile IP: %s\n"
|
"\tMobile's IP: %s\n"
|
||||||
"\tRequest timestamp: %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"
|
"\tSignal: %"PRId8" dBm\n"
|
||||||
"\tPosition X: %f\n"
|
"\tPosition X: %f\n"
|
||||||
"\tPosition Y: %f\n"
|
"\tPosition Y: %f\n"
|
||||||
|
@ -1357,7 +1357,7 @@ void display_captured_request(owl_captured_request *request,
|
||||||
"\tPacket size: %"PRIu32"\n"
|
"\tPacket size: %"PRIu32"\n"
|
||||||
,
|
,
|
||||||
request->type,
|
request->type,
|
||||||
ap_mac_addr_str,
|
cp_mac_addr_str,
|
||||||
mobile_mac_addr_str,
|
mobile_mac_addr_str,
|
||||||
mobile_ip_str,
|
mobile_ip_str,
|
||||||
request_time_str,
|
request_time_str,
|
||||||
|
|
Loading…
Reference in New Issue