[Listener] Warn if rtap SS field is absent
Display a warning if the radiotap antenna signal is absent and the signal strength could not be extracted. Change the SS value to 127 dBm (the maximum and improbable value) in this case.
This commit is contained in:
parent
b3f688b2cf
commit
75b6539757
|
@ -977,7 +977,6 @@ void read_packet(const struct pcap_pkthdr *pkt_header,
|
||||||
owl_captured_request request ; // Message to send to the aggregator
|
owl_captured_request request ; // Message to send to the aggregator
|
||||||
uint16_t rtap_bytes ; // Radiotap header size
|
uint16_t rtap_bytes ; // Radiotap header size
|
||||||
uint_fast16_t offset ; // Offset to read the packet
|
uint_fast16_t offset ; // Offset to read the packet
|
||||||
bool antenna_signal_present ; // Is the antenna signal field present?
|
|
||||||
uint8_t raw_packet_fc1 ; // First byte of the received frame's FC
|
uint8_t raw_packet_fc1 ; // First byte of the received frame's FC
|
||||||
uint8_t raw_packet_fc2 ; // Second byte of the received frame's FC
|
uint8_t raw_packet_fc2 ; // Second byte of the received frame's FC
|
||||||
// Size of the IEEE 802.11 header:
|
// Size of the IEEE 802.11 header:
|
||||||
|
@ -1168,7 +1167,9 @@ void read_packet(const struct pcap_pkthdr *pkt_header,
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
/* Radiotap header handling */
|
/* Radiotap header handling */
|
||||||
antenna_signal_present = extract_radiotap_ss(pkt_data, &request) ;
|
if (! extract_radiotap_ss(pkt_data, &request))
|
||||||
|
fprintf(stderr, "Warning! The antenna signal field is absent from"
|
||||||
|
" the radiotap header!\n") ;
|
||||||
|
|
||||||
/* Display the packet details */
|
/* Display the packet details */
|
||||||
if (VERBOSE_DISPLAY_CAPTURED)
|
if (VERBOSE_DISPLAY_CAPTURED)
|
||||||
|
@ -1215,7 +1216,7 @@ void read_packet(const struct pcap_pkthdr *pkt_header,
|
||||||
mobile_ip_str,
|
mobile_ip_str,
|
||||||
request_time_str,
|
request_time_str,
|
||||||
capture_time_str,
|
capture_time_str,
|
||||||
antenna_signal_present ? request.ss_dbm : 0,
|
request.ss_dbm,
|
||||||
owl_ntohf(request.x_position),
|
owl_ntohf(request.x_position),
|
||||||
owl_ntohf(request.y_position),
|
owl_ntohf(request.y_position),
|
||||||
owl_ntohf(request.z_position),
|
owl_ntohf(request.z_position),
|
||||||
|
@ -1337,6 +1338,7 @@ bool extract_radiotap_ss(const u_char *pkt_data,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Antenna signal not extracted
|
// Antenna signal not extracted
|
||||||
|
request->ss_dbm = 127 ; // maximum, improbable value
|
||||||
return false ;
|
return false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue