Commit Graph

57 Commits

Author SHA1 Message Date
Matteo Cypriani 3fec57b1ae Move all error #defines in owlps.h 2011-08-26 11:09:41 +02:00
Matteo Cypriani 40bc6d0b59 [Listener] Fix reception timestamp
struct pcap_pkthdr.ts is host-endian, not net-endian, so we have to
convert it to net-endianess when reading it from the packet.
2011-08-24 14:05:16 +02:00
Matteo Cypriani 8f48a22482 [Listener] Fix config parsing memory leaks
The configuration parsing function could call exit() (e.g. with -h, -V,
or in case of error), implying a memory leak. This is fixed.
Additionally, minor cleaning in the configuration functions.
2011-08-24 13:39:01 +02:00
Matteo Cypriani ff17c92bfa [lib-client] Change the prefix for "owl_"
Use the prefix "owl_" instead of "owlclient_".
2011-08-23 19:58:49 +02:00
Matteo Cypriani 442c5a4601 [lib] .h all is prefixed with OWL_ or owl_
All the types, defines, etc. are now prefixed with "OWL_" or "owl_".
TRUE and FALSE become owl_true and owl_false.
2011-08-22 22:43:35 +02:00
Matteo Cypriani 1d6016a3ce [lib] Move listener code to owlps-listener.h (bis)
Move the last piece of listener-specific code from owlps.h to
owlps-listener.h.
2011-08-22 22:43:35 +02:00
Matteo Cypriani 8327357290 Makefiles: allow to enable -g easily
Add a commented line DEBUG=-g in each Makefile.
2011-08-22 22:43:35 +02:00
Matteo Cypriani 462298d6e8 [Listener] Set the signal flags to 0 2011-08-20 20:00:39 +02:00
Matteo Cypriani de74213102 [lib] Rename OWL_TIMESTAMP_STR_LEN OWL_TIMESTAMP_STRLEN 2011-08-18 14:02:17 +02:00
Matteo Cypriani ac4dd87ef9 Use ++var instead of var++ whenever possible 2011-08-18 11:45:36 +02:00
Matteo Cypriani ab8ad83e52 Add emacs mode command to each Makefile_atheros* 2011-08-18 11:05:45 +02:00
Matteo Cypriani fb9d093d5a [Listener] Add extract_radiotap_data()
Another refactoring step for read_packet().
2011-08-04 00:35:32 +02:00
Matteo Cypriani 4bae0c9b4e [Listener] Add extract_calibration_data()
A first step in the long way of read_packet() refactoring.
2011-08-04 00:25:08 +02:00
Matteo Cypriani ac3c7b4352 [lib] Move listener code to owlps-listener.h
Move listener-specific code (Radiotap fields' definition, etc.) from
owlps.h to owlps-listener.h.
2011-08-03 23:13:16 +02:00
Matteo Cypriani a174a01e0f Rename Atheros Makefiles: specify OpenWrt version
*/Makefile_atheros become */Makefile_atheros_openwrt-8.09.
2011-07-25 13:13:21 +02:00
Matteo Cypriani 1dae048f0c [lib-client] Delay in ms instead of microseconds
In owlclient_send_request(), the delay between two packets is now in
milliseconds.
Client & Listener updated to reflect the change.
2011-07-25 12:46:20 +02:00
Matteo Cypriani e976d80d73 [Listener] Makefiles: split OWLPSFLAGS
Split OWLPSFLAGS into several lines, in order to ease the (un)activation
of options.
2011-07-25 12:46:20 +02:00
Matteo Cypriani 051ce9147c Use -D DEBUG / NDEBUG in Makefiles
Instead of #define DEBUG, we now prefer to use either verbose levels
or, when needed, NDEBUG. Each Makefile was modified to be able to pass
-D NDEBUG to the compiler (but the corresponding lines are commented),
except in the modules where assert is never used, in which case the
Makefile passes -D DEBUG.

Long story short: to totally disable debugging code, comment-out the
"-D DEBUG" lines and uncomment the "-D NDEBUG" lines, in every Makefile.
2011-07-25 12:46:20 +02:00
Matteo Cypriani f008db0e1c [Listener] Use perror() after recvfrom() 2011-07-25 12:46:20 +02:00
Matteo Cypriani f71a56bb9a [Listener] Use verbose levels 2011-07-25 12:46:20 +02:00
Matteo Cypriani a62387e465 [Listener] Switch verbose mode to verbose level 2011-07-25 12:46:19 +02:00
Matteo Cypriani 44bf79f9c4 [Listener] Makefile backfire: use -lconfuse
The Confuse library works on OpenWrt, so why don't link it?
2011-07-19 11:55:52 +02:00
Matteo Cypriani c7e0280596 Fix Makefiles for OpenWrt 10.03 2011-07-18 23:34:06 +02:00
Matteo Cypriani 02da7c7851 [Listener] Define le*toh() for OpenBSD
OpenBSD's endian.h uses the names letoh* instead of le*toh.
2011-06-27 10:09:14 +02:00
Matteo Cypriani 306e855ad1 [Listener] Test the platform for endian.h
The <endian.h> header is Glibc-specific. On BSD platforms, one have to
use <sys/endian.h>.
(This was the occasion to improve the preprocessor code here.)
2011-06-27 10:09:14 +02:00
Matteo Cypriani 5f72702b88 [Listener] Use ETHERTYPE_IP instead of ETH_P_IP
ETH_P_IP is Linux-specific.
2011-06-27 10:09:14 +02:00
Matteo Cypriani 3ac53e7b76 [Listener] Fix compilation without USE_PTHREAD 2011-06-27 10:09:14 +02:00
Matteo Cypriani 95b9ea30bf [lib] Fix #includes for OpenBSD
libowlps now builds on OpenBSD (4.9)!
2011-06-27 10:09:14 +02:00
Matteo Cypriani 65487af736 [lib] Makefile: remove unneeded -lrt & -lm
-lrt is now added as needed in each module Makefile, but not directly in
the library. Furthermore, the Makefiles add -lrt only if the platform is
Linux.
2011-06-27 10:09:14 +02:00
Matteo Cypriani 00d89efd40 [lib] Move owl_iface_mode_monitor() in Listener
Only owlps-listener uses owl_iface_mode_monitor(), so we don't need to
keep it in libowlps.
2011-06-27 10:09:14 +02:00
Matteo Cypriani 7dade1c36b Makefiles: get rid of echo -e
Use one call to echo for each line, because the echo's -e option is not
standard.
2011-06-27 10:09:14 +02:00
Matteo Cypriani f54b0d11e1 Makefiles: remove -v incompatible with BSD commands
The -v 'verbose' switch of the standard commands (rm, cp, mkdir, etc.)
is not implemented in BSD versions of the commands, so we avoid using
it.
2011-06-27 10:09:14 +02:00
Matteo Cypriani 5364944c68 Add missing Makefiles for OpenWrt 10.03 (Backfire)
* libowlps, libowlps-client & owlps-listener:
Add Makefiles to compile for OpenWrt 10.03 (Backfire). (owlps-client had
one already.)

* libowlps & libowlps-client:
Update the Makefiles for OpenWrt 8.09 (Kamikaze).
2011-06-15 10:36:47 +02:00
Matteo Cypriani cc66eb7c59 [Listener] read_packet(): blank the whole request
Blank the whole request with memset() instead of setting to zero each
field.
2011-05-05 13:21:41 +02:00
Matteo Cypriani be784c8ec0 [Listener] Check SS field before to print it 2011-05-03 13:38:50 +02:00
Matteo Cypriani 3196e5a2e0 Makefiles: resolve OWLPS_VERSION earlier 2011-04-26 10:15:04 +02:00
Matteo Cypriani 52c3b34170 [Listener] Fix -f: do not quit anymore 2011-04-13 00:12:18 +02:00
Matteo Cypriani c23bddffae [Listener] print_version(): print version number
Use git describe to generate a version label. One can also specify a
label:
  make OWLPS_VERSION=v3.14alpha
2011-04-12 23:29:47 +02:00
Matteo Cypriani d31ac3864e Position endianess conversion in all modules 2011-04-07 16:15:46 +02:00
Matteo Cypriani 7499ef9ec5 [Listener] Refactor endianess #defines 2011-04-07 16:14:55 +02:00
Matteo Cypriani d1c6abdaf7 [Listener] Send coordinates in autocalib. requests
One can now provide the coordinates of the listener on the command line.
2011-04-07 09:17:46 +02:00
Matteo Cypriani c1f4c4e77e [Listener] Check autocalibration_nb_packets
Display a warning if the number of autocalibration packets to send is
null.
2011-04-07 09:17:46 +02:00
Matteo Cypriani df5ed19834 Include headers as needed
Move #includes from .h to .c wherever possible.
2011-03-31 16:03:22 +02:00
Matteo Cypriani d62a7500b1 [lib] Rename run -> owl_run 2011-03-31 16:03:22 +02:00
Matteo Cypriani 4f74524f05 Handle request type in Listener & Aggregator
The listener now sends the request type to the aggregator. The
aggregator writes it to the CSV file and transmit it to the positioning
server.
2011-03-25 17:20:18 +01:00
Matteo Cypriani 204750b8c5 [lib] Rename PACKET_TYPE_* -> OWL_REQUEST_* 2011-03-25 16:30:40 +01:00
Matteo Cypriani 1e1023e6b5 Makefiles: update lib dependencies 2011-03-25 13:50:20 +01:00
Matteo Cypriani 4720399513 [lib] mac_bytes_to_string(): do not malloc anymore
owl_mac_bytes_to_string() now uses a static buffer, so the caller do not
need to free the returned buffer manually. Because of this static
buffer, it is not thread-safe anymore, therefore we introduce
owl_mac_bytes_to_string_r() that is a thread-safe version.
2011-03-25 11:48:25 +01:00
Matteo Cypriani e8aa0838f4 Use ETHER_ADDR_LEN instead of 6 2011-03-25 11:48:25 +01:00
Matteo Cypriani 5f9de6e1dc [Listener] Fix the "don't want to quit" bug
In capture(), the pcap_loop() call was blocking, so the program did not
quit if no packet came on rtap_iface. This is now fixed by a call to
pcap_breakloop() in the signal handlers.
2011-03-25 11:48:24 +01:00