From 15f44366281908ab385dcbd195e65a4d41f4d049 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Fri, 25 Mar 2011 10:39:02 +0100 Subject: [PATCH] [Aggregator] Use owl_timestamp_equals() --- TODO | 5 +++++ owlps-aggregator/owlps-aggregatord.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 6cbbc0a..74dc29e 100644 --- a/TODO +++ b/TODO @@ -22,6 +22,11 @@ - Use locks to read/write the AP list Currently, several threads can access the list simultaneously, and that's not cool! +- got_request(): option for the maximal difference time + For implicit packet, we consider that packet from the same MAC and + received within an interval of 10ms are part of the same + request. We should define an option to allow user to choose the + time he wants. - Allow blank parameters for output options. - Fix segfault on SIGINT. diff --git a/owlps-aggregator/owlps-aggregatord.c b/owlps-aggregator/owlps-aggregatord.c index e78e9be..057e950 100644 --- a/owlps-aggregator/owlps-aggregatord.c +++ b/owlps-aggregator/owlps-aggregatord.c @@ -703,9 +703,9 @@ void got_request(owl_captured_request request) while (tmp_request != NULL) { // Research criterion: MAC and transmission time if (owl_mac_equals(request.mobile_mac_addr_bytes, - tmp_request->mobile_mac_addr_bytes) == 1 - && owl_time_elapsed_ms(request.request_time, - tmp_request->request_time) == 0) + tmp_request->mobile_mac_addr_bytes) + && owl_timestamp_equals(request.request_time, + tmp_request->request_time)) break ; // If the request exists, we stop on it tmp_request = tmp_request->next ; } @@ -718,7 +718,7 @@ void got_request(owl_captured_request request) // times on the APs less than 10 ms // TODO : define an option for the maximal difference time. if (owl_mac_equals(request.mobile_mac_addr_bytes, - tmp_request->mobile_mac_addr_bytes) == 1 + tmp_request->mobile_mac_addr_bytes) && owl_time_elapsed_ms(request.start_time, tmp_request->request_time) <= 10) break ; // If the request exists, we stop on it