[scripts] AggCheck: detect duplicated timestamps

owlps-aggcheck uses the timestamp alone to identify requests, which
causes problem in case two requests have the same timestamp. This commit
allows the script to detect duplicated timestamps, and documents the
bug.
This commit is contained in:
Matteo Cypriani 2014-07-24 12:26:30 -04:00
parent 8c5e8c62f6
commit e51a8d4f1b
1 changed files with 19 additions and 0 deletions

View File

@ -58,6 +58,16 @@ behaviour unless B<-d> or B<-n> is used).
=back
=head1 BUGS
When using B<-n> or B<-d>, each timestamp must be unique in the input file. This
is due to the fact that this script uses the timestamp alone as the identifier
of a request (instead of using both the timestamp and the transmitter's MAC
address). This should seldom be a problem in practice, but if you encounter
this case, a workaround is to manually add a decimal to one of the duplicated
timestamps.
=head1 COPYING
This script and its documentation are part of the Owl Positioning System (OwlPS)
@ -219,6 +229,15 @@ while (<>) {
. " ($nb_pkts_expected packets expected).\n";
}
# Make sure we don't have a request with the same timestamp already, because
# it will be a problem if we want to print the statistics or the
# distribution
if (($print_stats or $print_distribution) and $transmitters{$timestamp}) {
die "A request with timestamp \"$timestamp\" was already stored;"
. " this program doesn't work properly with non-unique timestamps"
. " (see section \"BUGS\" in the manual page).";
}
# Read the captured requests and count the packets
while ($field_nb < @fields) {
my $mac_cp = $fields[$field_nb];