Display a warning when the configuration file cannot be read only when
the -f option was used. As stated in comment, the initial plan was to
also display the warning in verbose mode, but at this point of the
program the command-line is not parsed yet, so it's pointless to test
for it.
The get_mac_addr() function was the only real blocker that prevented
building on BSD systems, as it used the Linux-specific SIOCGIFHWADDR
ioctl. When compiling for Linux, we still use this ioctl, but for the
BSD version we use sysctl().
This allows OwlPS Listener to build on BSD (tested on NetBSD, OpenBSD
and DragonFly). That doesn't mean it will actually work when trying to
capture packets though (that has to be tested on real hardware), but
that's still a progress.
owl_send_request() and owl_send_packet() get a boolean "verbose"
parameter that allow to enable or disable message display on run-time
and allow to get rid of the OWLPS_DEBUG compile-time option.
The file libowlps/owlps-config.h.in was added to allow CMake to pass the
installation prefix variable to the programs. That allows the programs
to look for their configuration file at the right position (i.e. in the
etc/owlps directory under the installation prefix).
The generated configuration header of OwlPS Listener is now generated
after the dependencies checking, so that if an option was disabled
because of a missing dependency it is reflected in the generated header.
We chose a centralised approach, since threads are needed in several
modules: the find_package() is done only once in the rood directory.
Not sure it's the best approach though, but this test is several lines
long so doing that avoids duplication of this code.
- Default compiler and linker flags were added silently. They are now
set in the cache if no previous values are present.
- Debug flags and regular flags have been merged.
- Position-independent code (doesn't appear in the cache because CMake
lacks variables like CMAKE_EXE_COMPILE_FLAGS):
- Shared libraries are compiled with -fPIC.
- Executables and static libraries are compiled with -fPIE.
- Executables are linked with -pie -fPIE.
Display a warning if the radiotap antenna signal is absent and the
signal strength could not be extracted. Change the SS value to 127 dBm
(the maximum and improbable value) in this case.
From the radiotap header, we only use the antenna signal field,
therefore we don't need to handle the fields that are after it. We do
need to take into account the fields preceding the antenna signal field
though, in order to know where it is.
pcap_next_ex() will allow us to detect the end of a capture file. Since
we used pcap_loop() to capture one packet at a time anyway, this won't
change anything for live captures.
The variable names were standardised in functions using pcap data types
('pkt_header' and 'pkt_data' instead of 'header' and 'packet').
If the autocalibration request port was not specified, a warning was
issued. This is now fixed by issuing a warning only if the port is too
big, but not if it is zero.