diff --git a/enrichment/indexed_capture.py b/enrichment/indexed_capture.py index be61eb3..f178227 100644 --- a/enrichment/indexed_capture.py +++ b/enrichment/indexed_capture.py @@ -72,6 +72,27 @@ class IndexedCapture: capture.close() + # Debugging indexing + # 1. Inspect self.channel_to_aps and self.channel_to_clients + # Are they empty? + print(f"Indexed {len(self.time_index)} packets.") + # Are they missing just specific channels? + print(f"Channels with APs: {len(self.channel_to_aps)}") + # Are they populated, but wrong? + print(f"Channels with clients: {len(self.channel_to_clients)}") + # How many channels were seen? + print(f"Total channels: {len(set(self.channel_to_aps.keys()).union(set(self.channel_to_clients.keys())))}") + # How many APS were put into channel_to_aps? + print(f"Total APs: {sum(len(aps) for aps in self.channel_to_aps.values())}") + # How many clients were put into channel_to_clients? + print(f"Total clients: {sum(len(clients) for clients in self.channel_to_clients.values())}") + # Print out a few entries from channel_to_clients. + for channel, clients in list(self.channel_to_clients.items())[:5]: + print(f"Channel {channel}: {len(clients)} clients") + # Print out a few entries from channel_to_aps. + for channel, aps in list(self.channel_to_aps.items())[:5]: + print(f"Channel {channel}: {len(aps)} APs") + def _process_management_frame(self, packet, wlan, radio, channel): try: mgt = packet.get_multiple_layers('wlan.mgt')[0]