I'm sniffing WiFi packets for RSSI (my interest is probe request and data null, timestamp and source mac address), and I need to save the results in pcap
files for further processing.
The problem is that I need to divide the info to multiple different files, creating one file per hour.
I don't have an idea how to check the elapsed time in my program, except multithreading (while(1)
, sleep()
and check with clock()
function). I'm using Ubuntu, but the target platform is a router with Linux OpenWrt installed.
My first concert are the problems with cross compilation + pthread.h
, thread.h
or something else, or maybe there should be no issues in OpenWrt?
And the other side of the question - isn't it too complicated to use multithreading for this silly problem?
Maybe there are other solutions? (i.e. a small pseudo-multithreading solution, or some simpler tricks)?