Unused, never used, never going to be used.
Prefer to check for the locally administered bit being 1 and the unicast
bit being 0 in a MAC to determine if it's randomized.
Signed-off-by: Tucker Polomik <t.polomik@cablelabs.com>
msg-format.txt describes the data structures and data flow of
station-sniffer's client/server architecture.
Signed-off-by: Tucker Polomik <t.polomik@cablelabs.com>
Removes MSG_CHANGE_KEEPALIVE_TIMEOUT_MS and
MSG_CHANGE_PACKET_PERIODICITY_MS, two messages which were originally
provisioned for dynamic tuning and debugging, but have gone totally
unused.
Signed-off-by: Tucker Polomik <t.polomik@cablelabs.com>
Calling push_back() [or any member that may cause reallocation on an STL
data structure] while iterating the data structure via a range-based
for-loop may lead to undefined behavior.
Since range-based for-loops depend on the .begin() and .end() iterators
of iterable data structures, a reallocation will cause the end()
iterator to move, leaving the previous reference used for terminating
the for-loop incorrect.
To avoid this, mark new clients that have 'rung' our server socket for
addition after iterating the current poll FD set.
Signed-off-by: Tucker Polomik <t.polomik@cablelabs.com>
Update command line argument parsing and help message to reflect
packet_wait_time parameter no longer existing.
Signed-off-by: Tucker Polomik <t.polomik@cablelabs.com>
Exposes new message type that allows a Unix client to ask if a given STA
MAC has disassociated from any BSS on the band that station-sniffer is
sniffing on.
We simply parse every packet and check if it's a management frame, and
if so:
1. check it's subtype
2. if disassociation, enqueue a message for clients
This allows other client applications a new way to ask about station
association state where it otherwise may not be valid (for example, a
station is not known to hostapd on a destination access point after a
virtual BSS roam occurs).
Signed-off-by: Tucker Polomik <t.polomik@cablelabs.com>
If a broadcast MAC address was registered as a staiton of interest to
the station manager, and a non-broadcast MAC address was subsequently
registered, the station manager would stop capturing broadcast traffic
(i.e. every packet that it can hear in the radio's current band).
This is a bug that was revealed by adding unit tests -- the manager
instance should continue to capture broadcast traffic until the
broadcast MAC is explicitly removed from it's MAC table.
Signed-off-by: Tucker Polomik <t.polomik@cablelabs.com>
Newer versions (>1.5.0) of libpcap do not set immediate mode on live
capture interfaces by default.
As a result, we would see a station physically move far from an AP but
the reported signal strength would sometimes take up to 60 seconds to
'catch up' due to packets being queued for processing.
Now, with immediate mode enabled, every packet is taken from the kernel
and given to registered pcap callbacks as the packet arrives.
Also removes a spammy debug log.
Signed-off-by: Tucker Polomik <t.polomik@cablelabs.com>
It's entirely possible that when station-sniffer starts up, no beacon
information is available, but that it becomes available later on. An
example of such a situation is when a prplMesh agent has a wireless
backhaul interface defined, but is not onboarded yet. In such a case,
the APs of the device will only start beaconing once the agent is
onboarded to the controller. Until then no beacon information will be
available.
To avoid the need to restart station-sniffer in such a case, start a
new thread to check for bandwidth information periodically if it was
not available initially. Once the agent onboards, the bandwidth
information will become available.
Note that we also slightly change what was done in commit
0625732af3 so that we stop running if
the pcap thread stops, but not if the bandwidth thread stops (in case
it happens to be the one we're joining).
Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>