Commit Graph

107 Commits

Author SHA1 Message Date
Matteo Cypriani bce8896b4b Add explicit padding for all the structs
Indicate padding bytes explicitly in all the structures. Some of the
structures could have their size reduced by reordering their fields by
size (especially in owlps.h).
2016-11-23 17:02:21 -05:00
Matteo Cypriani bc6ec14fa8 Update COPYRIGHT.t2t URL 2016-11-03 22:00:33 -04:00
Matteo Cypriani dd8497fb53 [Listener] Radiotap: handle Extended Present Flags
Check the 31st bit of the Present Flags field, i.e. the Ext bit, set
when additional Present Flags fields follow.
2014-03-20 14:53:58 -04:00
Matteo Cypriani f35a96891f [Listener] Remove const from keep_mode_monitor()
keep_mode_monitor()'s argument was marked as const by mistake,
preventing compilation with OWLPS_LISTENER_KEEPS_MONITOR on.
2014-02-18 11:20:58 -05:00
Matteo Cypriani 69e8b49300 Mark arguments as const as needed in C programs
This was already done in the libraries, but not in the programs.
2013-10-02 11:28:48 -04:00
Matteo Cypriani ef2b4e9e58 [Listener] Add an assert, improve 2 comments 2013-10-02 10:51:55 -04:00
Matteo Cypriani c4cf57c903 [Listener] Test numbers from the command line
Check the return value of relevant calls to strtol().
Force base 10 when reading integers from the command line.
2013-09-27 15:22:57 -04:00
Matteo Cypriani e5883d99d5 Finish supporting getaddrinfo()
- For static buffers, use a size suited for host names and not only IP
  addresses.
- Change variable names.
- Adapt usage messages and documentation.
2013-09-23 17:03:51 -04:00
Matteo Cypriani 75e04cfc17 Quit handling useless network client structures
It is useless to handle a client structure on recvfrom() or accept()
when nothing is done with this information.
Changed in Aggregator, Listener, Positioner and UDP-to-HTTP.
2013-09-23 17:03:50 -04:00
Matteo Cypriani 25cc1ee67a [lib] getaddrinfo() in create_udp_trx_socket()
Use getaddrinfo() to resolve names in owl_create_udp_trx_socket(). The
client_description parameter has been removed from the function's
synopsis.
2013-09-23 17:03:50 -04:00
Matteo Cypriani 82154b9a46 Cosmetic changes in C modules 2013-09-23 16:10:53 -04:00
Matteo Cypriani 46e1510536 [Listener] Improve config file-related warning
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.
2013-07-17 18:09:15 -04:00
Matteo Cypriani b5915aee8d [Listener] Fix/improve help message 2013-07-17 18:09:14 -04:00
Matteo Cypriani 6c1c182039 [Listener] Adapt get_mac_addr() to build on BSD
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.
2013-07-17 18:09:12 -04:00
Matteo Cypriani 7d3650fb5d [Listener] Improve BSD friendliness 2013-07-17 18:09:12 -04:00
Matteo Cypriani 14e9a4122a [Listener] Improve *_addr()
Improve the code of the get_mac_addr() and get_ip_addr() functions,
their signature and documentation.
2013-07-17 18:09:12 -04:00
Matteo Cypriani 69cba07122 [lib] Access Point -> Capture Point (API change)
Same work as for Aggregator and Listener to get rid of the old "AP"
terminology.

API change: structures with an ap_mac_addr_bytes field are modified.
2013-07-17 18:09:12 -04:00
Matteo Cypriani 9e7b55c317 [Listener] Access Point -> Capture Point
Same work as for the Aggregator, without any user-visible change.
2013-07-17 18:09:12 -04:00
Matteo Cypriani 5b6f40f59d Improve Aggregator & Listener's exit messages 2013-06-12 18:55:46 -04:00
Matteo Cypriani a29a43a6fa [Listener] Add option -G (dump configuration)
This new option is just like Aggregator's -G option.
2013-06-12 17:18:46 -04:00
Matteo Cypriani 5ddca24738 Print exit message only in verbose mode
Update the exit message printing in all the modules:
- print on standard error
- print only in verbose mode
- use "exiting" instead of "end"
2013-06-12 17:18:46 -04:00
Matteo Cypriani e114a6997a [lib-client] Add "verbose" parameters
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.
2013-06-12 09:38:38 -04:00
Matteo Cypriani 80fd5b287b Update and centralise copyright information 2013-05-29 13:19:06 -04:00
Matteo Cypriani dad2e543d1 CMake: handle Listener's options 2013-05-22 18:36:20 -04:00
Matteo Cypriani 559c884499 [Listener] Add display_captured_request()
Create the display_captured_request() function from read_packet() code.
2013-05-16 14:15:25 -04:00
Matteo Cypriani 75b6539757 [Listener] Warn if rtap SS field is absent
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.
2013-05-16 14:15:25 -04:00
Matteo Cypriani b3f688b2cf [Listener] Improve radiotap parsing
Get rid of the useless parsing loop; make clear we only want to extract
the signal strength and work only for that.
2013-05-16 13:52:57 -04:00
Matteo Cypriani 7a5ed8ec51 [Listener] Remove unused radiotap fields
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.
2013-05-16 11:37:18 -04:00
Matteo Cypriani 4a3e1e1091 [Listener] Improve/fix radiotap fields definitions 2013-05-16 11:09:45 -04:00
Matteo Cypriani 0614b52219 [lib] Stop defining owl_bool (use stdbool.h)
We don't define our own boolean type in owlps.h any more: bool (from
stdbool.h) is used instead.
2013-05-15 15:46:13 -04:00
Matteo Cypriani 2e4fb5a931 [Listener] Remove errbuf comment (cf. prev. commit)
errbuf doesn't seem to begin with ": " in all cases; I fixed that in
the previous commit but forgot to remove the wrong comment.
2013-04-29 11:50:40 -04:00
Matteo Cypriani 2b6a3a73ed [Listener] Fix compilation with confuse (-r/-R)
The handling of -r/-R was buggy with libconfuse enabled.
2013-04-29 10:51:04 -04:00
Matteo Cypriani 4aed9c1ef0 Radiotap Antenna Signal field is signed
Using int8_t instead of uint8_t which was erroneously used to code the
Antenna Signal radiotap field.
2013-04-24 10:59:55 -04:00
Matteo Cypriani a046dcd3fb [Listener] Fix radiotap alignment bug
The fields in the radiotap header are naturally aligned, which was not
taken into account by the parser.
2013-04-23 18:54:38 -04:00
Matteo Cypriani 6f0d5c8da5 [Listener] Warn in case of unknown rtap field 2013-04-23 18:54:38 -04:00
Matteo Cypriani e7b639a020 [Listener] Minor fixes, mostly cosmetic 2013-04-23 18:54:38 -04:00
Matteo Cypriani 6ea849625c [Listener] Add -R option (read from pcap file)
The new -R option allows one to read packets from a pcap file instead of
capturing from a network interface.
2013-04-23 18:32:59 -04:00
Matteo Cypriani c95257f26a [Listener] Use pcap_next_ex instead of pcap_loop
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').
2013-04-23 18:32:37 -04:00
Matteo Cypriani 8df82b9c41 Fix typo "endianness" 2012-11-06 01:22:16 +01:00
Matteo Cypriani d1c64212d8 Test malloc/realloc return values 2012-11-03 16:51:13 +01:00
Matteo Cypriani 8455dd0d74 Add copyright & license information
Add the file COPYRIGHT, the CeCILL license's text, and update the source
files' headers with the copyright and license information.
2012-11-03 14:52:33 +01:00
Matteo Cypriani e239dffa4f [Listener] Do not print a warning if AC_port == 0
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.
2012-05-14 14:06:05 +02:00
Matteo Cypriani c4e03520f3 [Listener] Display the packet size 2012-05-10 11:38:21 +02:00
Matteo Cypriani 07f5b16ca0 [Listener] Receive the new request format
Read the packet number and number of packets after the request type.
A bit of refactoring was done.
2012-05-10 11:29:17 +02:00
Matteo Cypriani 96d1c54e54 Send number of packets at the beginning of request
The packet number and number of packets are now sent right after the
packet type, instead of at the end of the request.
2012-05-09 21:13:52 +02:00
Matteo Cypriani 1cc1ce4302 [Listener] Handle the packet numbering 2012-02-08 10:52:39 +01:00
Matteo Cypriani 6b7e5668fa Add/update headers on the top of each source file 2012-02-06 16:44:09 +01:00
Matteo Cypriani 3ed19bb012 Version printing: "Owl" instead of "Open Wireless" 2012-02-06 13:27:05 +01:00
Matteo Cypriani 1ebc0c57ed Different port for autocal. orders and hello
Differentiate the port on which the autocalibration hello messages are
sent to the aggregator by the listeners, and the one on which the
autocalibration orders are sent by the aggregator to the listeners.

This will allow to run a listener and an aggregator on the same machine
with autocalibration enabled.

Both in the listener and the aggregator, the option -a (autocalibration
port) has been replaced by the options -O (autocalibration order port)
and -H (autocalibration hello port). In the listener, the option -H was
previously used to set the hello delay; this is now the role of the -T
option.
2012-02-06 13:27:05 +01:00
Matteo Cypriani ee3ab7b383 [Listener] Same port for all requests
The autocalibration requests are now sent on the same port as the
positioning request, by default. There was no real reason to send them
on a different port.
2012-02-06 13:27:05 +01:00