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.
This commit is contained in:
parent
050026d61f
commit
e5883d99d5
8
TODO.t2t
8
TODO.t2t
|
@ -52,12 +52,6 @@ Work to do in OwlPS
|
||||||
checked), but not constantly in C modules.
|
checked), but not constantly in C modules.
|
||||||
//Done in lib*.//
|
//Done in lib*.//
|
||||||
|
|
||||||
- Allow to use hostnames instead of IP addresses in all modules
|
|
||||||
|
|
||||||
getaddrinfo(3) (or gethostbyname(3)) should be used when opening
|
|
||||||
sockets in libowlps, then string buffer size have to be adapted in all
|
|
||||||
modules to be able to contain a long hostname.
|
|
||||||
|
|
||||||
- Use struct ether_addr to store MAC addresses?
|
- Use struct ether_addr to store MAC addresses?
|
||||||
|
|
||||||
We could use the struct ether_addr to store binary MAC addresses, and
|
We could use the struct ether_addr to store binary MAC addresses, and
|
||||||
|
@ -71,7 +65,7 @@ Work to do in OwlPS
|
||||||
|
|
||||||
= Aggregator =
|
= Aggregator =
|
||||||
|
|
||||||
- An empty positioner_ip should turn off communication with the
|
- An empty positioner_host should turn off communication with the
|
||||||
positioning server.
|
positioning server.
|
||||||
|
|
||||||
- Option to overwrite the output file (ask for a confirmation!).
|
- Option to overwrite the output file (ask for a confirmation!).
|
||||||
|
|
|
@ -24,7 +24,7 @@ June 2013
|
||||||
**owlps-aggregatord** [ **-f** //config_file// ] [ **-G** ]
|
**owlps-aggregatord** [ **-f** //config_file// ] [ **-G** ]
|
||||||
[ **-D** ] [ **-v**[**v**[**v**[**v**]] ] | **-q** ]
|
[ **-D** ] [ **-v**[**v**[**v**[**v**]] ] | **-q** ]
|
||||||
[ **-o** //out_file// ] [ **-F** ]
|
[ **-o** //out_file// ] [ **-F** ]
|
||||||
[ **-i** //positioner_ip// ]
|
[ **-i** //positioner_host// ]
|
||||||
[ **-p** //positioner_port// ]
|
[ **-p** //positioner_port// ]
|
||||||
[ **-l** //listening_port// ]
|
[ **-l** //listening_port// ]
|
||||||
[ **-t** //aggregate_timeout// ]
|
[ **-t** //aggregate_timeout// ]
|
||||||
|
@ -125,8 +125,9 @@ the **-K** option).
|
||||||
"-", i.e. the standard output).
|
"-", i.e. the standard output).
|
||||||
: **-F**
|
: **-F**
|
||||||
Do not flush the output file.
|
Do not flush the output file.
|
||||||
: **-i** //positionner_ip//
|
: **-i** //positionner_host//
|
||||||
IP address of the positioning server (default: 127.0.0.1).
|
Host name or IP address of the positioning server (default:
|
||||||
|
localhost).
|
||||||
: **-p** //positioner_port//
|
: **-p** //positioner_port//
|
||||||
Aggregated requests are transmitted to the positioning server on this
|
Aggregated requests are transmitted to the positioning server on this
|
||||||
port (default: 9902).
|
port (default: 9902).
|
||||||
|
|
|
@ -21,11 +21,11 @@ June 2013
|
||||||
|
|
||||||
= Synopsis =
|
= Synopsis =
|
||||||
|
|
||||||
**owlps-client** [ **-v** | **-q** ] **-i** //dest_ip// [ **-p** //dest_port// ] [ **-I** //iface// ]
|
**owlps-client** [ **-v** | **-q** ] **-i** //dest_host// [ **-p** //dest_port// ] [ **-I** //iface// ]
|
||||||
[ **-t** //delay// ] [ **-n** //nb_packets// ] [ **-s** //packet_size// ]
|
[ **-t** //delay// ] [ **-n** //nb_packets// ] [ **-s** //packet_size// ]
|
||||||
[ **-F** [ //[+]delay// ] [ **-N** //nb_requests// ] [ **-D** ] ] [ **-l** [ //port// ] ]
|
[ **-F** [ //[+]delay// ] [ **-N** //nb_requests// ] [ **-D** ] ] [ **-l** [ //port// ] ]
|
||||||
|
|
||||||
**owlps-client** [ **-v** | **-q** ] **-i** dest_ip [ **-p** //dest_port// ] [ **-I** //iface// ]
|
**owlps-client** [ **-v** | **-q** ] **-i** dest_host [ **-p** //dest_port// ] [ **-I** //iface// ]
|
||||||
[ **-t** //delay// ] [ **-n** //nb_packets// ] [ **-s** //packet_size// ]
|
[ **-t** //delay// ] [ **-n** //nb_packets// ] [ **-s** //packet_size// ]
|
||||||
[ **-F** [ //delay// ] [ **-N** //nb_requests// ] [ **-D** ] ] //direction x y z//
|
[ **-F** [ //delay// ] [ **-N** //nb_requests// ] [ **-D** ] ] //direction x y z//
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@ June 2013
|
||||||
= Description =
|
= Description =
|
||||||
|
|
||||||
**OwlPS Client** is the reference client for OwlPS, i.e. the program run
|
**OwlPS Client** is the reference client for OwlPS, i.e. the program run
|
||||||
by the mobile terminals to send positioning requests. With the second
|
by the mobile terminals to send one or more positioning requests. With
|
||||||
invocation form, that is when the user provides the direction
|
the second invocation form, that is when the user provides the direction
|
||||||
(orientation) and the coordinates of the mobile terminal,
|
(orientation) and the coordinates of the mobile terminal,
|
||||||
//owlps-client// will send calibration requests instead of positioning
|
//owlps-client// will send calibration requests instead of positioning
|
||||||
requests, which can be registered (using OwlPS Aggregator, see
|
requests, which can be registered (using OwlPS Aggregator, see
|
||||||
|
@ -56,8 +56,9 @@ owlps-aggregatord.t2t) to create a manual calibration database.
|
||||||
: **-q**
|
: **-q**
|
||||||
Do not print informational messages and some (less important)
|
Do not print informational messages and some (less important)
|
||||||
warnings.
|
warnings.
|
||||||
: **-i** //dest_ip//
|
: **-i** //dest_host//
|
||||||
Destination IP address of the localisation request.
|
Name or IP address of the destination host of the localisation
|
||||||
|
request.
|
||||||
: **-p** //dest_port//
|
: **-p** //dest_port//
|
||||||
Destination port of the localisation request (default: 9900).
|
Destination port of the localisation request (default: 9900).
|
||||||
: **-t** //delay//
|
: **-t** //delay//
|
||||||
|
@ -86,10 +87,11 @@ owlps-aggregatord.t2t) to create a manual calibration database.
|
||||||
//delay// is the time between the start of the transmissions of both
|
//delay// is the time between the start of the transmissions of both
|
||||||
requests.
|
requests.
|
||||||
: **-N** //nb_requests//
|
: **-N** //nb_requests//
|
||||||
With -F, stop after //nb_requests// requests transmitted instead of
|
With **-F**, stop after //nb_requests// requests transmitted instead
|
||||||
looping indefinitely.
|
of looping indefinitely.
|
||||||
: **-D**
|
: **-D**
|
||||||
Daemon mode (fork to the background). Useful only in flood mode.
|
Daemon mode (fork to the background). Useful only in flood mode (cf.
|
||||||
|
**-F** option).
|
||||||
: **-l** [ //port// ]
|
: **-l** [ //port// ]
|
||||||
Wait for the computed position and display it. The optional argument
|
Wait for the computed position and display it. The optional argument
|
||||||
//port// allows to specify the listening port (default: 9910).
|
//port// allows to specify the listening port (default: 9910).
|
||||||
|
|
|
@ -26,10 +26,10 @@ June 2013
|
||||||
< **-r** //rtap_iface// [ **-w** //wifi_iface// ] | **-R** //pcap_file// >
|
< **-r** //rtap_iface// [ **-w** //wifi_iface// ] | **-R** //pcap_file// >
|
||||||
[ **-K** ] [ **-m** //mode// ]
|
[ **-K** ] [ **-m** //mode// ]
|
||||||
[ **-l** //listening_port// ]
|
[ **-l** //listening_port// ]
|
||||||
[ **-i** //aggregation_ip// ]
|
[ **-i** //aggregation_host// ]
|
||||||
[ **-p** //aggregation_port// ]
|
[ **-p** //aggregation_port// ]
|
||||||
[ **-A** ]
|
[ **-A** ]
|
||||||
[ **-I** //autocalibration_ip// ]
|
[ **-I** //autocalibration_host// ]
|
||||||
[ **-P** //autocalibration_request_port// ]
|
[ **-P** //autocalibration_request_port// ]
|
||||||
[ **-O** //autocalibration_order_port// ]
|
[ **-O** //autocalibration_order_port// ]
|
||||||
[ **-H** //hello_port// ]
|
[ **-H** //hello_port// ]
|
||||||
|
@ -124,8 +124,9 @@ debugging and to replay scenarios.
|
||||||
: **-l** //listening_port//
|
: **-l** //listening_port//
|
||||||
Port to which explicit positioning requests are sent by the mobiles
|
Port to which explicit positioning requests are sent by the mobiles
|
||||||
(default: 9900).
|
(default: 9900).
|
||||||
: **-i** //aggregation_ip//
|
: **-i** //aggregation_host//
|
||||||
IP address of the aggregation server (default: 127.0.0.1).
|
Host name or IP address of the aggregation server (default:
|
||||||
|
localhost).
|
||||||
: **-p** //aggregation_port//
|
: **-p** //aggregation_port//
|
||||||
Port to which the captured requests are transmitted to the aggregation
|
Port to which the captured requests are transmitted to the aggregation
|
||||||
server (default: 9901).
|
server (default: 9901).
|
||||||
|
@ -145,9 +146,9 @@ support of the POSIX threads.
|
||||||
|
|
||||||
: **-A**
|
: **-A**
|
||||||
Enable autocalibration (default: disabled).
|
Enable autocalibration (default: disabled).
|
||||||
: **-I** //autocalibration_ip//
|
: **-I** //autocalibration_host//
|
||||||
Destination IP of the autocalibration requests (default:
|
Host name or IP address of the destination of the autocalibration
|
||||||
//aggregation_ip//).
|
requests (default: //aggregation_host//).
|
||||||
: **-P** //autocalibration_request_port//
|
: **-P** //autocalibration_request_port//
|
||||||
Port to which autocalibration requests are sent (default:
|
Port to which autocalibration requests are sent (default:
|
||||||
//listening_port//).
|
//listening_port//).
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
* This function uses owl_create_udp_trx_socket() (from libowlps)
|
* This function uses owl_create_udp_trx_socket() (from libowlps)
|
||||||
* as a backend, and allows to select a particular network interface.
|
* as a backend, and allows to select a particular network interface.
|
||||||
*
|
*
|
||||||
* @param[in] dest_ip IP address of the remote server.
|
* @param[in] dest_host host name or IP address of the remote server.
|
||||||
* @param[in] dest_port Port on which the remote server listens.
|
* @param[in] dest_port Port on which the remote server listens.
|
||||||
* @param[out] server Structure in which the server information will
|
* @param[out] server Structure in which the server information will
|
||||||
* be saved.
|
* be saved.
|
||||||
|
@ -40,12 +40,12 @@
|
||||||
* If this parameter is `NULL` or an empty string, the interface will
|
* If this parameter is `NULL` or an empty string, the interface will
|
||||||
* be selected automatically.
|
* be selected automatically.
|
||||||
*/
|
*/
|
||||||
int owl_create_trx_socket(const char *const dest_ip,
|
int owl_create_trx_socket(const char *const dest_host,
|
||||||
const uint_fast16_t dest_port,
|
const uint_fast16_t dest_port,
|
||||||
struct sockaddr *const server,
|
struct sockaddr *const server,
|
||||||
const char *const iface)
|
const char *const iface)
|
||||||
{
|
{
|
||||||
int sockfd = owl_create_udp_trx_socket(dest_ip, dest_port, server) ;
|
int sockfd = owl_create_udp_trx_socket(dest_host, dest_port, server) ;
|
||||||
if (sockfd < 0)
|
if (sockfd < 0)
|
||||||
{
|
{
|
||||||
perror("Error! Cannot create UDP sending socket to the aggregation"
|
perror("Error! Cannot create UDP sending socket to the aggregation"
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
/* Function headers */
|
/* Function headers */
|
||||||
/// Opens a transmission socket
|
/// Opens a transmission socket
|
||||||
int owl_create_trx_socket(const char *const dest_ip,
|
int owl_create_trx_socket(const char *const dest_host,
|
||||||
const uint_fast16_t dest_port,
|
const uint_fast16_t dest_port,
|
||||||
struct sockaddr *const server,
|
struct sockaddr *const server,
|
||||||
const char *const iface) ;
|
const char *const iface) ;
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#define DEFAULT_CHECK_INTERVAL 300 // milliseconds
|
#define DEFAULT_CHECK_INTERVAL 300 // milliseconds
|
||||||
#define DEFAULT_CP_KEEP_TIMEOUT 35 // seconds
|
#define DEFAULT_CP_KEEP_TIMEOUT 35 // seconds
|
||||||
#define DEFAULT_AC_ORDER_INTERVAL 1000 // milliseconds
|
#define DEFAULT_AC_ORDER_INTERVAL 1000 // milliseconds
|
||||||
#define POSITIONER_DEFAULT_IP "127.0.0.1"
|
#define POSITIONER_DEFAULT_HOST "localhost"
|
||||||
|
|
||||||
|
|
||||||
/* Verbosity levels */
|
/* Verbosity levels */
|
||||||
|
|
|
@ -248,9 +248,9 @@ int parse_config_file(int argc, char **argv)
|
||||||
// Aggregation listening port
|
// Aggregation listening port
|
||||||
CFG_INT("listening_port", OWL_DEFAULT_LISTENER_PORT, CFGF_NONE),
|
CFG_INT("listening_port", OWL_DEFAULT_LISTENER_PORT, CFGF_NONE),
|
||||||
|
|
||||||
// Port and IP address of the localisation server:
|
// Port and host of the localisation server:
|
||||||
CFG_INT("positioner_port", OWL_DEFAULT_AGGREGATION_PORT, CFGF_NONE),
|
CFG_INT("positioner_port", OWL_DEFAULT_AGGREGATION_PORT, CFGF_NONE),
|
||||||
CFG_STR("positioner_ip", POSITIONER_DEFAULT_IP, CFGF_NONE),
|
CFG_STR("positioner_host", POSITIONER_DEFAULT_HOST, CFGF_NONE),
|
||||||
|
|
||||||
// Output file (default is the standard output)
|
// Output file (default is the standard output)
|
||||||
CFG_STR("output_file", "-", CFGF_NONE),
|
CFG_STR("output_file", "-", CFGF_NONE),
|
||||||
|
@ -397,7 +397,7 @@ int parse_command_line(int argc, char **argv)
|
||||||
strtol(optarg, NULL, 0)) ;
|
strtol(optarg, NULL, 0)) ;
|
||||||
break ;
|
break ;
|
||||||
case 'i' :
|
case 'i' :
|
||||||
cfg_setstr(cfg, "positioner_ip", optarg) ;
|
cfg_setstr(cfg, "positioner_host", optarg) ;
|
||||||
break ;
|
break ;
|
||||||
case 'k' :
|
case 'k' :
|
||||||
cfg_setint(cfg, "keep_timeout", strtol(optarg, NULL, 0)) ;
|
cfg_setint(cfg, "keep_timeout", strtol(optarg, NULL, 0)) ;
|
||||||
|
@ -473,11 +473,11 @@ int check_configuration()
|
||||||
cfg_setint(cfg, "positioner_port", OWL_DEFAULT_AGGREGATION_PORT) ;
|
cfg_setint(cfg, "positioner_port", OWL_DEFAULT_AGGREGATION_PORT) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// positioner_ip //
|
// positioner_host //
|
||||||
if (cfg_getstr(cfg, "positioner_ip")[0] == '\0')
|
if (cfg_getstr(cfg, "positioner_host")[0] == '\0')
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Error! You must specify the IP address of the"
|
fprintf(stderr, "Error! You must specify the host name or IP"
|
||||||
" localisation server.\n") ;
|
" address of the localisation server.\n") ;
|
||||||
print_usage() ;
|
print_usage() ;
|
||||||
owl_run = false ;
|
owl_run = false ;
|
||||||
return OWL_ERR_BAD_USAGE ;
|
return OWL_ERR_BAD_USAGE ;
|
||||||
|
@ -832,7 +832,7 @@ void* monitor_requests(void *NULL_value)
|
||||||
fprintf(stderr, "Monitor requests thread launched.\n") ;
|
fprintf(stderr, "Monitor requests thread launched.\n") ;
|
||||||
|
|
||||||
sockfd =
|
sockfd =
|
||||||
owl_create_udp_trx_socket(cfg_getstr(cfg, "positioner_ip"),
|
owl_create_udp_trx_socket(cfg_getstr(cfg, "positioner_host"),
|
||||||
cfg_getint(cfg, "positioner_port"),
|
cfg_getint(cfg, "positioner_port"),
|
||||||
&serv) ;
|
&serv) ;
|
||||||
pthread_cleanup_push(&owl_close_fd, &sockfd) ;
|
pthread_cleanup_push(&owl_close_fd, &sockfd) ;
|
||||||
|
@ -1519,7 +1519,7 @@ void print_usage()
|
||||||
"\n\t"
|
"\n\t"
|
||||||
" [-o out_file]"
|
" [-o out_file]"
|
||||||
" [-F]"
|
" [-F]"
|
||||||
" [-i positionner_ip]"
|
" [-i positionner_host]"
|
||||||
" [-p positioner_port]"
|
" [-p positioner_port]"
|
||||||
"\n\t"
|
"\n\t"
|
||||||
" [-l listening_port]"
|
" [-l listening_port]"
|
||||||
|
@ -1559,8 +1559,8 @@ void print_usage()
|
||||||
" output).\n"
|
" output).\n"
|
||||||
"\t-F\t\t\tDo not flush the output file after each analyse"
|
"\t-F\t\t\tDo not flush the output file after each analyse"
|
||||||
"\n\t\t\t\tof the requests' list.\n"
|
"\n\t\t\t\tof the requests' list.\n"
|
||||||
"\t-i positionner_ip\tIP address of the positioning server"
|
"\t-i positionner_host\tHost name or IP address of the"
|
||||||
" (default:\n\t\t\t\t%s).\n"
|
" positioning\n\t\t\t\tserver (default: %s).\n"
|
||||||
"\t-p positioner_port\tAggregated requests are transmitted to"
|
"\t-p positioner_port\tAggregated requests are transmitted to"
|
||||||
" the\n\t\t\t\tpositioning server on this port (default:"
|
" the\n\t\t\t\tpositioning server on this port (default:"
|
||||||
"\n\t\t\t\t%d).\n"
|
"\n\t\t\t\t%d).\n"
|
||||||
|
@ -1593,7 +1593,7 @@ void print_usage()
|
||||||
program_name,
|
program_name,
|
||||||
program_name,
|
program_name,
|
||||||
DEFAULT_CONFIG_FILE,
|
DEFAULT_CONFIG_FILE,
|
||||||
POSITIONER_DEFAULT_IP,
|
POSITIONER_DEFAULT_HOST,
|
||||||
OWL_DEFAULT_AGGREGATION_PORT,
|
OWL_DEFAULT_AGGREGATION_PORT,
|
||||||
OWL_DEFAULT_LISTENER_PORT,
|
OWL_DEFAULT_LISTENER_PORT,
|
||||||
DEFAULT_AGGREGATE_TIMEOUT,
|
DEFAULT_AGGREGATE_TIMEOUT,
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
#include <rpc/types.h> // for MAXHOSTNAMELEN
|
||||||
|
|
||||||
|
|
||||||
/* Number of packets to send */
|
/* Number of packets to send */
|
||||||
|
@ -56,7 +57,7 @@
|
||||||
/* Function headers */
|
/* Function headers */
|
||||||
void parse_command_line(int argc, char **argv) ;
|
void parse_command_line(int argc, char **argv) ;
|
||||||
void parse_main_options(int argc, char **argv) ;
|
void parse_main_options(int argc, char **argv) ;
|
||||||
void check_destination_ip(void) ;
|
void check_destination_host(void) ;
|
||||||
void parse_calibration_data(int argc, char **argv) ;
|
void parse_calibration_data(int argc, char **argv) ;
|
||||||
void check_configuration(void) ;
|
void check_configuration(void) ;
|
||||||
void print_configuration(void) ;
|
void print_configuration(void) ;
|
||||||
|
@ -77,7 +78,7 @@ void print_version(void) ;
|
||||||
struct {
|
struct {
|
||||||
bool daemon ;
|
bool daemon ;
|
||||||
bool verbose ;
|
bool verbose ;
|
||||||
char dest_ip[INET_ADDRSTRLEN] ; // Destination IP of the packets
|
char dest_host[MAXHOSTNAMELEN] ; // Destination host of the packets
|
||||||
uint_fast16_t dest_port ;
|
uint_fast16_t dest_port ;
|
||||||
char iface[IFNAMSIZ + 1] ; // Source network interface
|
char iface[IFNAMSIZ + 1] ; // Source network interface
|
||||||
int_fast32_t delay ; // Time between two packet transmissions
|
int_fast32_t delay ; // Time between two packet transmissions
|
||||||
|
@ -95,7 +96,7 @@ struct {
|
||||||
} options = {
|
} options = {
|
||||||
false, // daemon
|
false, // daemon
|
||||||
true, // verbose
|
true, // verbose
|
||||||
"", // dest_ip
|
"", // dest_host
|
||||||
OWL_DEFAULT_REQUEST_PORT, // dest_port
|
OWL_DEFAULT_REQUEST_PORT, // dest_port
|
||||||
"", // iface
|
"", // iface
|
||||||
-1, // delay
|
-1, // delay
|
||||||
|
@ -211,7 +212,7 @@ int main(int argc, char *argv[])
|
||||||
void parse_command_line(int argc, char **argv)
|
void parse_command_line(int argc, char **argv)
|
||||||
{
|
{
|
||||||
parse_main_options(argc, argv) ;
|
parse_main_options(argc, argv) ;
|
||||||
check_destination_ip() ;
|
check_destination_host() ;
|
||||||
parse_calibration_data(argc, argv) ;
|
parse_calibration_data(argc, argv) ;
|
||||||
check_configuration() ;
|
check_configuration() ;
|
||||||
|
|
||||||
|
@ -266,7 +267,7 @@ void parse_main_options(int argc, char **argv)
|
||||||
strncpy(options.iface, optarg, IFNAMSIZ + 1) ;
|
strncpy(options.iface, optarg, IFNAMSIZ + 1) ;
|
||||||
break ;
|
break ;
|
||||||
case 'i' :
|
case 'i' :
|
||||||
strncpy(options.dest_ip, optarg, INET_ADDRSTRLEN) ;
|
strncpy(options.dest_host, optarg, MAXHOSTNAMELEN) ;
|
||||||
break ;
|
break ;
|
||||||
case 'l' :
|
case 'l' :
|
||||||
#ifdef OWLPS_CLIENT_RECEIVES_POSITION
|
#ifdef OWLPS_CLIENT_RECEIVES_POSITION
|
||||||
|
@ -329,12 +330,12 @@ void parse_main_options(int argc, char **argv)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void check_destination_ip()
|
void check_destination_host()
|
||||||
{
|
{
|
||||||
/* Check if we got a destination IP address */
|
/* Check if we got a destination host */
|
||||||
if (options.dest_ip[0] == '\0')
|
if (options.dest_host[0] == '\0')
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Error! You must specify a destination IP address"
|
fprintf(stderr, "Error! You must specify a destination host"
|
||||||
" (-i) .\n") ;
|
" (-i) .\n") ;
|
||||||
print_usage() ;
|
print_usage() ;
|
||||||
exit(OWL_ERR_BAD_USAGE) ;
|
exit(OWL_ERR_BAD_USAGE) ;
|
||||||
|
@ -469,7 +470,7 @@ void print_configuration()
|
||||||
printf("Options:\n"
|
printf("Options:\n"
|
||||||
"\tDaemon: %s\n"
|
"\tDaemon: %s\n"
|
||||||
"\tVerbose: %s\n"
|
"\tVerbose: %s\n"
|
||||||
"\tDestination IP: %s\n"
|
"\tDestination host: %s\n"
|
||||||
"\tDestination port: %"PRIuFAST16"\n"
|
"\tDestination port: %"PRIuFAST16"\n"
|
||||||
"\tInterface: %s\n"
|
"\tInterface: %s\n"
|
||||||
"\tDelay (ms): %"PRIdFAST32"\n"
|
"\tDelay (ms): %"PRIdFAST32"\n"
|
||||||
|
@ -486,7 +487,7 @@ void print_configuration()
|
||||||
,
|
,
|
||||||
OWL_BOOL_TO_STRING(options.daemon),
|
OWL_BOOL_TO_STRING(options.daemon),
|
||||||
OWL_BOOL_TO_STRING(options.verbose),
|
OWL_BOOL_TO_STRING(options.verbose),
|
||||||
options.dest_ip,
|
options.dest_host,
|
||||||
options.dest_port,
|
options.dest_port,
|
||||||
options.iface,
|
options.iface,
|
||||||
options.delay,
|
options.delay,
|
||||||
|
@ -508,7 +509,7 @@ void print_configuration()
|
||||||
void create_socket()
|
void create_socket()
|
||||||
{
|
{
|
||||||
sockfd =
|
sockfd =
|
||||||
owl_create_trx_socket(options.dest_ip, options.dest_port,
|
owl_create_trx_socket(options.dest_host, options.dest_port,
|
||||||
&server, options.iface) ;
|
&server, options.iface) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -709,7 +710,7 @@ void print_usage()
|
||||||
"Localisation request:\n"
|
"Localisation request:\n"
|
||||||
"\t%s"
|
"\t%s"
|
||||||
" [-v | -q]"
|
" [-v | -q]"
|
||||||
" -i dest_ip"
|
" -i dest_host"
|
||||||
" [-p dest_port]"
|
" [-p dest_port]"
|
||||||
" [-I iface]"
|
" [-I iface]"
|
||||||
" [-t delay]"
|
" [-t delay]"
|
||||||
|
@ -722,7 +723,7 @@ void print_usage()
|
||||||
"Calibration request:\n"
|
"Calibration request:\n"
|
||||||
"\t%s"
|
"\t%s"
|
||||||
" [-v | -q]"
|
" [-v | -q]"
|
||||||
" -i dest_ip"
|
" -i dest_host"
|
||||||
" [-p dest_port]"
|
" [-p dest_port]"
|
||||||
" [-I iface]"
|
" [-I iface]"
|
||||||
" [-t delay]"
|
" [-t delay]"
|
||||||
|
@ -739,8 +740,8 @@ void print_usage()
|
||||||
"\t-v\t\tTurn on verbose mode (default).\n"
|
"\t-v\t\tTurn on verbose mode (default).\n"
|
||||||
"\t-q\t\tDo not print informational messages and some (less\n"
|
"\t-q\t\tDo not print informational messages and some (less\n"
|
||||||
"\t\t\timportant) warnings.\n"
|
"\t\t\timportant) warnings.\n"
|
||||||
"\t-i dest_ip\tDestination IP address of the localisation"
|
"\t-i dest_host\tName or IP address of the destination host of"
|
||||||
" request.\n"
|
" the\n\t\t\tlocalisation request.\n"
|
||||||
"\t-p dest_port\tDestination port of the localisation request"
|
"\t-p dest_port\tDestination port of the localisation request"
|
||||||
" (default:\n\t\t\t%d).\n"
|
" (default:\n\t\t\t%d).\n"
|
||||||
"\t-t delay\tTime between each packet transmission in"
|
"\t-t delay\tTime between each packet transmission in"
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include <pcap.h>
|
#include <pcap.h>
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#include <rpc/types.h> // for MAXHOSTNAMELEN
|
||||||
|
|
||||||
#ifdef __GLIBC__
|
#ifdef __GLIBC__
|
||||||
# include <endian.h>
|
# include <endian.h>
|
||||||
|
@ -77,6 +78,7 @@ enum {MODE_ACTIVE = 'a', MODE_PASSIVE = 'p', MODE_MIXED = 'm'} ;
|
||||||
#define DEFAULT_AUTOCALIBRATION_HELLO_DELAY 15 // seconds
|
#define DEFAULT_AUTOCALIBRATION_HELLO_DELAY 15 // seconds
|
||||||
#define DEFAULT_AUTOCALIBRATION_DELAY 25 // milliseconds
|
#define DEFAULT_AUTOCALIBRATION_DELAY 25 // milliseconds
|
||||||
#define DEFAULT_AUTOCALIBRATION_NBPKT 20
|
#define DEFAULT_AUTOCALIBRATION_NBPKT 20
|
||||||
|
#define DEFAULT_AGGREGATION_HOST "localhost"
|
||||||
|
|
||||||
|
|
||||||
/* Verbosity levels */
|
/* Verbosity levels */
|
||||||
|
@ -227,10 +229,10 @@ void print_version(void) ;
|
||||||
(cfg_setbool(cfg, "daemon", cfg_false))
|
(cfg_setbool(cfg, "daemon", cfg_false))
|
||||||
#define GET_DAEMON() \
|
#define GET_DAEMON() \
|
||||||
(cfg_getbool(cfg, "daemon"))
|
(cfg_getbool(cfg, "daemon"))
|
||||||
#define SET_AGGREGATION_IP(IP) \
|
#define SET_AGGREGATION_HOST(HOST) \
|
||||||
(cfg_setstr(cfg, "aggregation_ip", (IP)))
|
(cfg_setstr(cfg, "aggregation_host", (HOST)))
|
||||||
#define GET_AGGREGATION_IP() \
|
#define GET_AGGREGATION_HOST() \
|
||||||
(cfg_getstr(cfg, "aggregation_ip"))
|
(cfg_getstr(cfg, "aggregation_host"))
|
||||||
#ifdef OWLPS_LISTENER_KEEPS_MONITOR
|
#ifdef OWLPS_LISTENER_KEEPS_MONITOR
|
||||||
#define SET_KEEP_MONITOR() \
|
#define SET_KEEP_MONITOR() \
|
||||||
(cfg_setbool(cfg, "keep_monitor", cfg_true))
|
(cfg_setbool(cfg, "keep_monitor", cfg_true))
|
||||||
|
@ -267,10 +269,10 @@ void print_version(void) ;
|
||||||
(cfg_setbool(cfg, "autocalibration", cfg_false))
|
(cfg_setbool(cfg, "autocalibration", cfg_false))
|
||||||
#define GET_AUTOCALIBRATION() \
|
#define GET_AUTOCALIBRATION() \
|
||||||
(cfg_getbool(cfg, "autocalibration"))
|
(cfg_getbool(cfg, "autocalibration"))
|
||||||
#define SET_AUTOCALIBRATION_IP(IP) \
|
#define SET_AUTOCALIBRATION_HOST(HOST) \
|
||||||
(cfg_setstr(cfg, "autocalibration_ip", (IP)))
|
(cfg_setstr(cfg, "autocalibration_host", (HOST)))
|
||||||
#define GET_AUTOCALIBRATION_IP() \
|
#define GET_AUTOCALIBRATION_HOST() \
|
||||||
(cfg_getstr(cfg, "autocalibration_ip"))
|
(cfg_getstr(cfg, "autocalibration_host"))
|
||||||
#define SET_AUTOCALIBRATION_REQUEST_PORT(PORT) \
|
#define SET_AUTOCALIBRATION_REQUEST_PORT(PORT) \
|
||||||
(cfg_setint(cfg, "autocalibration_request_port", (PORT)))
|
(cfg_setint(cfg, "autocalibration_request_port", (PORT)))
|
||||||
#define GET_AUTOCALIBRATION_REQUEST_PORT() \
|
#define GET_AUTOCALIBRATION_REQUEST_PORT() \
|
||||||
|
@ -332,10 +334,10 @@ void print_version(void) ;
|
||||||
(options.mode = (MODE))
|
(options.mode = (MODE))
|
||||||
#define GET_MODE() \
|
#define GET_MODE() \
|
||||||
(options.mode)
|
(options.mode)
|
||||||
#define SET_AGGREGATION_IP(IP) \
|
#define SET_AGGREGATION_HOST(HOST) \
|
||||||
(strncpy(options.aggregation_ip, (IP), INET_ADDRSTRLEN))
|
(strncpy(options.aggregation_host, (HOST), MAXHOSTNAMELEN))
|
||||||
#define GET_AGGREGATION_IP() \
|
#define GET_AGGREGATION_HOST() \
|
||||||
(options.aggregation_ip)
|
(options.aggregation_host)
|
||||||
#ifdef OWLPS_LISTENER_KEEPS_MONITOR
|
#ifdef OWLPS_LISTENER_KEEPS_MONITOR
|
||||||
#define SET_KEEP_MONITOR() \
|
#define SET_KEEP_MONITOR() \
|
||||||
(options.keep_monitor = true)
|
(options.keep_monitor = true)
|
||||||
|
@ -379,10 +381,10 @@ void print_version(void) ;
|
||||||
(options.autocalibration = false)
|
(options.autocalibration = false)
|
||||||
#define GET_AUTOCALIBRATION() \
|
#define GET_AUTOCALIBRATION() \
|
||||||
(options.autocalibration)
|
(options.autocalibration)
|
||||||
#define SET_AUTOCALIBRATION_IP(IP) \
|
#define SET_AUTOCALIBRATION_HOST(HOST) \
|
||||||
(strncpy(options.autocalibration_ip, (IP), INET_ADDRSTRLEN))
|
(strncpy(options.autocalibration_host, (HOST), MAXHOSTNAMELEN))
|
||||||
#define GET_AUTOCALIBRATION_IP() \
|
#define GET_AUTOCALIBRATION_HOST() \
|
||||||
(options.autocalibration_ip)
|
(options.autocalibration_host)
|
||||||
#define SET_AUTOCALIBRATION_REQUEST_PORT(PORT) \
|
#define SET_AUTOCALIBRATION_REQUEST_PORT(PORT) \
|
||||||
(options.autocalibration_request_port = (PORT))
|
(options.autocalibration_request_port = (PORT))
|
||||||
#define GET_AUTOCALIBRATION_REQUEST_PORT() \
|
#define GET_AUTOCALIBRATION_REQUEST_PORT() \
|
||||||
|
|
|
@ -90,7 +90,7 @@ cfg_t *cfg = NULL ; // Configuration structure
|
||||||
struct {
|
struct {
|
||||||
bool daemon ;
|
bool daemon ;
|
||||||
char mode ;
|
char mode ;
|
||||||
char aggregation_ip[INET_ADDRSTRLEN] ;
|
char aggregation_host[MAXHOSTNAMELEN] ;
|
||||||
uint_fast16_t aggregation_port ;
|
uint_fast16_t aggregation_port ;
|
||||||
uint_fast16_t listening_port ;
|
uint_fast16_t listening_port ;
|
||||||
#ifdef OWLPS_LISTENER_KEEPS_MONITOR
|
#ifdef OWLPS_LISTENER_KEEPS_MONITOR
|
||||||
|
@ -101,7 +101,7 @@ struct {
|
||||||
char wifi_iface[IFNAMSIZ + 1] ;
|
char wifi_iface[IFNAMSIZ + 1] ;
|
||||||
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
||||||
bool autocalibration ;
|
bool autocalibration ;
|
||||||
char autocalibration_ip[INET_ADDRSTRLEN] ;
|
char autocalibration_host[MAXHOSTNAMELEN] ;
|
||||||
uint_fast16_t autocalibration_request_port ;
|
uint_fast16_t autocalibration_request_port ;
|
||||||
uint_fast16_t autocalibration_order_port ;
|
uint_fast16_t autocalibration_order_port ;
|
||||||
uint_fast16_t autocalibration_hello_port ;
|
uint_fast16_t autocalibration_hello_port ;
|
||||||
|
@ -117,7 +117,7 @@ struct {
|
||||||
} options = { // Initalise default options:
|
} options = { // Initalise default options:
|
||||||
false, // daemon
|
false, // daemon
|
||||||
MODE_ACTIVE, // mode
|
MODE_ACTIVE, // mode
|
||||||
"127.0.0.1", // aggregation_ip
|
DEFAULT_AGGREGATION_HOST, // aggregation_host
|
||||||
OWL_DEFAULT_LISTENER_PORT, // aggregation_port
|
OWL_DEFAULT_LISTENER_PORT, // aggregation_port
|
||||||
OWL_DEFAULT_REQUEST_PORT, // listening_port
|
OWL_DEFAULT_REQUEST_PORT, // listening_port
|
||||||
#ifdef OWLPS_LISTENER_KEEPS_MONITOR
|
#ifdef OWLPS_LISTENER_KEEPS_MONITOR
|
||||||
|
@ -128,7 +128,7 @@ struct {
|
||||||
"", // wifi_iface
|
"", // wifi_iface
|
||||||
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
||||||
false, // autocalibration
|
false, // autocalibration
|
||||||
"", // autocalibration_ip
|
"", // autocalibration_host
|
||||||
0, // autocalibration_request_port
|
0, // autocalibration_request_port
|
||||||
OWL_DEFAULT_AUTOCALIBRATION_ORDER_PORT, // autocalibration_order_port
|
OWL_DEFAULT_AUTOCALIBRATION_ORDER_PORT, // autocalibration_order_port
|
||||||
OWL_DEFAULT_AUTOCALIBRATION_HELLO_PORT, // autocalibration_hello_port
|
OWL_DEFAULT_AUTOCALIBRATION_HELLO_PORT, // autocalibration_hello_port
|
||||||
|
@ -361,8 +361,8 @@ int parse_config_file(int argc, char **argv)
|
||||||
// Listening mode: a for active, p for passive, m for mixed
|
// Listening mode: a for active, p for passive, m for mixed
|
||||||
// (default: a):
|
// (default: a):
|
||||||
CFG_INT("mode", MODE_ACTIVE, CFGF_NONE),
|
CFG_INT("mode", MODE_ACTIVE, CFGF_NONE),
|
||||||
// IP address of the aggregator (default: loopback):
|
// Aggregation server host (default: loopback):
|
||||||
CFG_STR("aggregation_ip", "127.0.0.1", CFGF_NONE),
|
CFG_STR("aggregation_host", DEFAULT_AGGREGATION_HOST, CFGF_NONE),
|
||||||
// Port on which the aggregator listens:
|
// Port on which the aggregator listens:
|
||||||
CFG_INT("aggregation_port", OWL_DEFAULT_LISTENER_PORT, CFGF_NONE),
|
CFG_INT("aggregation_port", OWL_DEFAULT_LISTENER_PORT, CFGF_NONE),
|
||||||
// Port to which mobiles send active requests:
|
// Port to which mobiles send active requests:
|
||||||
|
@ -382,9 +382,9 @@ int parse_config_file(int argc, char **argv)
|
||||||
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
||||||
// Autocalibration activated?
|
// Autocalibration activated?
|
||||||
CFG_BOOL("autocalibration", cfg_false, CFGF_NONE),
|
CFG_BOOL("autocalibration", cfg_false, CFGF_NONE),
|
||||||
// Destination IP address of the autocalibration requests (default:
|
// Destination host of the autocalibration requests (default:
|
||||||
// none, but will be set to aggregation_ip in the config check):
|
// none, but will be set to aggregation_ip in the config check):
|
||||||
CFG_STR("autocalibration_ip", "", CFGF_NONE),
|
CFG_STR("autocalibration_host", "", CFGF_NONE),
|
||||||
// Port to which autocalibration requests are sent (default: 0,
|
// Port to which autocalibration requests are sent (default: 0,
|
||||||
// but will be set to listening_port in the config check):
|
// but will be set to listening_port in the config check):
|
||||||
CFG_INT("autocalibration_request_port", 0, CFGF_NONE),
|
CFG_INT("autocalibration_request_port", 0, CFGF_NONE),
|
||||||
|
@ -563,11 +563,11 @@ int parse_main_options(int argc, char **argv)
|
||||||
#endif // OWLPS_LISTENER_USES_PTHREAD
|
#endif // OWLPS_LISTENER_USES_PTHREAD
|
||||||
break ;
|
break ;
|
||||||
case 'i' :
|
case 'i' :
|
||||||
SET_AGGREGATION_IP(optarg) ;
|
SET_AGGREGATION_HOST(optarg) ;
|
||||||
break ;
|
break ;
|
||||||
case 'I' :
|
case 'I' :
|
||||||
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
||||||
SET_AUTOCALIBRATION_IP(optarg) ;
|
SET_AUTOCALIBRATION_HOST(optarg) ;
|
||||||
#endif // OWLPS_LISTENER_USES_PTHREAD
|
#endif // OWLPS_LISTENER_USES_PTHREAD
|
||||||
break ;
|
break ;
|
||||||
case 'K' :
|
case 'K' :
|
||||||
|
@ -762,13 +762,13 @@ int check_configuration()
|
||||||
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
||||||
if (GET_AUTOCALIBRATION())
|
if (GET_AUTOCALIBRATION())
|
||||||
{
|
{
|
||||||
if (GET_AUTOCALIBRATION_IP()[0] == '\0')
|
if (GET_AUTOCALIBRATION_HOST()[0] == '\0')
|
||||||
{
|
{
|
||||||
if (VERBOSE_WARNING)
|
if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "No autocalibration IP specified, we will"
|
fprintf(stderr, "No autocalibration host specified, the"
|
||||||
" use the aggregation IP as the destination of"
|
" aggregation host will be used as the destination"
|
||||||
" autocalibration requests.\n") ;
|
" of autocalibration requests.\n") ;
|
||||||
SET_AUTOCALIBRATION_IP(GET_AGGREGATION_IP()) ;
|
SET_AUTOCALIBRATION_HOST(GET_AGGREGATION_HOST()) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GET_AUTOCALIBRATION_NBPKT() < 1)
|
if (GET_AUTOCALIBRATION_NBPKT() < 1)
|
||||||
|
@ -819,7 +819,7 @@ void print_configuration(FILE *stream)
|
||||||
#else // OWLPS_LISTENER_USES_CONFIG_FILE
|
#else // OWLPS_LISTENER_USES_CONFIG_FILE
|
||||||
fprintf(stream,
|
fprintf(stream,
|
||||||
"mode = %c\n"
|
"mode = %c\n"
|
||||||
"aggregation_ip = \"%s\"\n"
|
"aggregation_host = \"%s\"\n"
|
||||||
"aggregation_port = %"PRIuFAST16"\n"
|
"aggregation_port = %"PRIuFAST16"\n"
|
||||||
"listening_port = %"PRIuFAST16"\n"
|
"listening_port = %"PRIuFAST16"\n"
|
||||||
"rtap_iface = \"%s\"\n"
|
"rtap_iface = \"%s\"\n"
|
||||||
|
@ -829,7 +829,7 @@ void print_configuration(FILE *stream)
|
||||||
#endif // OWLPS_LISTENER_KEEPS_MONITOR
|
#endif // OWLPS_LISTENER_KEEPS_MONITOR
|
||||||
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
||||||
"autocalibration = %s\n"
|
"autocalibration = %s\n"
|
||||||
"autocalibration_ip = \"%s\"\n"
|
"autocalibration_host = \"%s\"\n"
|
||||||
"autocalibration_request_port = %"PRIuFAST16"\n"
|
"autocalibration_request_port = %"PRIuFAST16"\n"
|
||||||
"autocalibration_order_port = %"PRIuFAST16"\n"
|
"autocalibration_order_port = %"PRIuFAST16"\n"
|
||||||
"autocalibration_hello_port = %"PRIuFAST16"\n"
|
"autocalibration_hello_port = %"PRIuFAST16"\n"
|
||||||
|
@ -844,7 +844,7 @@ void print_configuration(FILE *stream)
|
||||||
"verbose = %"PRIuFAST8"\n"
|
"verbose = %"PRIuFAST8"\n"
|
||||||
,
|
,
|
||||||
GET_MODE(),
|
GET_MODE(),
|
||||||
GET_AGGREGATION_IP(),
|
GET_AGGREGATION_HOST(),
|
||||||
GET_AGGREGATION_PORT(),
|
GET_AGGREGATION_PORT(),
|
||||||
GET_LISTENING_PORT(),
|
GET_LISTENING_PORT(),
|
||||||
GET_RTAP_IFACE(),
|
GET_RTAP_IFACE(),
|
||||||
|
@ -854,7 +854,7 @@ void print_configuration(FILE *stream)
|
||||||
#endif // OWLPS_LISTENER_KEEPS_MONITOR
|
#endif // OWLPS_LISTENER_KEEPS_MONITOR
|
||||||
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
#ifdef OWLPS_LISTENER_USES_PTHREAD
|
||||||
OWL_BOOL_TO_STRING(GET_AUTOCALIBRATION()),
|
OWL_BOOL_TO_STRING(GET_AUTOCALIBRATION()),
|
||||||
GET_AUTOCALIBRATION_IP(),
|
GET_AUTOCALIBRATION_HOST(),
|
||||||
GET_AUTOCALIBRATION_REQUEST_PORT(),
|
GET_AUTOCALIBRATION_REQUEST_PORT(),
|
||||||
GET_AUTOCALIBRATION_ORDER_PORT(),
|
GET_AUTOCALIBRATION_ORDER_PORT(),
|
||||||
GET_AUTOCALIBRATION_HELLO_PORT(),
|
GET_AUTOCALIBRATION_HELLO_PORT(),
|
||||||
|
@ -970,7 +970,7 @@ int capture()
|
||||||
|
|
||||||
/* Open UDP socket to the aggregator */
|
/* Open UDP socket to the aggregator */
|
||||||
aggregation_sockfd =
|
aggregation_sockfd =
|
||||||
owl_create_trx_socket(GET_AGGREGATION_IP(), GET_AGGREGATION_PORT(),
|
owl_create_trx_socket(GET_AGGREGATION_HOST(), GET_AGGREGATION_PORT(),
|
||||||
&aggregation_server, NULL) ;
|
&aggregation_server, NULL) ;
|
||||||
|
|
||||||
while (owl_run)
|
while (owl_run)
|
||||||
|
@ -1545,7 +1545,7 @@ void* autocalibrate_hello(void *NULL_value)
|
||||||
fprintf(stderr, "Autocalibration Hello thread launched.\n") ;
|
fprintf(stderr, "Autocalibration Hello thread launched.\n") ;
|
||||||
|
|
||||||
send_sockfd =
|
send_sockfd =
|
||||||
owl_create_trx_socket(GET_AGGREGATION_IP(),
|
owl_create_trx_socket(GET_AGGREGATION_HOST(),
|
||||||
GET_AUTOCALIBRATION_HELLO_PORT(),
|
GET_AUTOCALIBRATION_HELLO_PORT(),
|
||||||
&serv, NULL) ;
|
&serv, NULL) ;
|
||||||
pthread_cleanup_push(&owl_close_fd, &send_sockfd) ;
|
pthread_cleanup_push(&owl_close_fd, &send_sockfd) ;
|
||||||
|
@ -1578,7 +1578,7 @@ void* autocalibrate(void *NULL_value)
|
||||||
|
|
||||||
// Socket to send autocalibration positioning requests
|
// Socket to send autocalibration positioning requests
|
||||||
autocalibration_send_sockfd =
|
autocalibration_send_sockfd =
|
||||||
owl_create_trx_socket(GET_AUTOCALIBRATION_IP(),
|
owl_create_trx_socket(GET_AUTOCALIBRATION_HOST(),
|
||||||
GET_AUTOCALIBRATION_REQUEST_PORT(),
|
GET_AUTOCALIBRATION_REQUEST_PORT(),
|
||||||
&autocalibration_send_server,
|
&autocalibration_send_server,
|
||||||
GET_WIFI_IFACE()) ;
|
GET_WIFI_IFACE()) ;
|
||||||
|
@ -1747,11 +1747,11 @@ void print_usage()
|
||||||
" [-m mode]"
|
" [-m mode]"
|
||||||
"\n\t"
|
"\n\t"
|
||||||
" [-l listening_port]"
|
" [-l listening_port]"
|
||||||
" [-i aggregation_ip]"
|
" [-i aggregation_host]"
|
||||||
" [-p aggregation_port]"
|
" [-p aggregation_port]"
|
||||||
"\n\t"
|
"\n\t"
|
||||||
" [-A]"
|
" [-A]"
|
||||||
" [-I autocalibration_ip]"
|
" [-I autocalibration_host]"
|
||||||
" [-P autocalibration_request_port]"
|
" [-P autocalibration_request_port]"
|
||||||
"\n\t"
|
"\n\t"
|
||||||
" [-O autocalibration_order_port]"
|
" [-O autocalibration_order_port]"
|
||||||
|
@ -1786,8 +1786,8 @@ void print_usage()
|
||||||
"\n\t\t\t\t(default: a).\n"
|
"\n\t\t\t\t(default: a).\n"
|
||||||
"\t-l listening_port\tPort to which explicit positioning"
|
"\t-l listening_port\tPort to which explicit positioning"
|
||||||
" requests are\n\t\t\t\tsent by the mobiles (default: %d).\n"
|
" requests are\n\t\t\t\tsent by the mobiles (default: %d).\n"
|
||||||
"\t-i aggregation_ip\tIP address of the aggregation server"
|
"\t-i aggregation_host\tHost name or IP address of the"
|
||||||
" (default:\n\t\t\t\t127.0.0.1).\n"
|
" aggregation\n\t\t\t\tserver (default: %s).\n"
|
||||||
"\t-p aggregation_port\tRequests are transmitted to the"
|
"\t-p aggregation_port\tRequests are transmitted to the"
|
||||||
" aggregation\n\t\t\t\tserver on this port (default: %d).\n"
|
" aggregation\n\t\t\t\tserver on this port (default: %d).\n"
|
||||||
"\t-r rtap_iface\t\tRadiotap-enabled capture interface.\n"
|
"\t-r rtap_iface\t\tRadiotap-enabled capture interface.\n"
|
||||||
|
@ -1800,8 +1800,9 @@ void print_usage()
|
||||||
" with support of\nthe POSIX threads and the adequate"
|
" with support of\nthe POSIX threads and the adequate"
|
||||||
" compilation-time option.)\n"
|
" compilation-time option.)\n"
|
||||||
"\t-A\t\t\tEnable autocalibration (default: disabled).\n"
|
"\t-A\t\t\tEnable autocalibration (default: disabled).\n"
|
||||||
"\t-I ac_ip\t\tDestination IP of the autocalibration"
|
"\t-I ac_host\t\tHost name or IP address of the destination"
|
||||||
" requests\n\t\t\t\t(default: aggregation_ip).\n"
|
" of\n\t\t\t\tthe autocalibration requests"
|
||||||
|
" (default:\n\t\t\t\taggregation_host).\n"
|
||||||
"\t-P ac_request_port\tPort to which autocalibration"
|
"\t-P ac_request_port\tPort to which autocalibration"
|
||||||
" requests are sent\n\t\t\t\t(default: listening_port).\n"
|
" requests are sent\n\t\t\t\t(default: listening_port).\n"
|
||||||
"\t-O ac_order_port\tPort on which autocalibration orders are"
|
"\t-O ac_order_port\tPort on which autocalibration orders are"
|
||||||
|
@ -1830,6 +1831,7 @@ void print_usage()
|
||||||
program_name,
|
program_name,
|
||||||
DEFAULT_CONFIG_FILE,
|
DEFAULT_CONFIG_FILE,
|
||||||
OWL_DEFAULT_REQUEST_PORT,
|
OWL_DEFAULT_REQUEST_PORT,
|
||||||
|
DEFAULT_AGGREGATION_HOST,
|
||||||
OWL_DEFAULT_LISTENER_PORT,
|
OWL_DEFAULT_LISTENER_PORT,
|
||||||
OWL_DEFAULT_AUTOCALIBRATION_ORDER_PORT,
|
OWL_DEFAULT_AUTOCALIBRATION_ORDER_PORT,
|
||||||
OWL_DEFAULT_AUTOCALIBRATION_HELLO_PORT,
|
OWL_DEFAULT_AUTOCALIBRATION_HELLO_PORT,
|
||||||
|
|
|
@ -359,7 +359,8 @@ void UserInterface::fill_output_options()
|
||||||
"Port on which the UDP data is sent (when output.medium = UDP).")
|
"Port on which the UDP data is sent (when output.medium = UDP).")
|
||||||
("output.tcpevaal-host",
|
("output.tcpevaal-host",
|
||||||
po::value<string>()->default_value(DEFAULT_TCPEVAAL_HOST),
|
po::value<string>()->default_value(DEFAULT_TCPEVAAL_HOST),
|
||||||
"Host to which the TCP data is sent (when output.medium = TCPEvAAL).")
|
"IP address of the host to which the TCP data is sent (when"
|
||||||
|
" output.medium = TCPEvAAL).")
|
||||||
("output.tcpevaal-port",
|
("output.tcpevaal-port",
|
||||||
po::value<int>()->default_value(DEFAULT_TCPEVAAL_PORT),
|
po::value<int>()->default_value(DEFAULT_TCPEVAAL_PORT),
|
||||||
"Port on which the TCP data is sent (when output.medium = TCPEvAAL).")
|
"Port on which the TCP data is sent (when output.medium = TCPEvAAL).")
|
||||||
|
@ -380,8 +381,8 @@ void UserInterface::fill_misc_options()
|
||||||
("replay",
|
("replay",
|
||||||
po::value<bool>()->default_value(false),
|
po::value<bool>()->default_value(false),
|
||||||
"\"Replay\" mode. With this option enabled, the current time is the"
|
"\"Replay\" mode. With this option enabled, the current time is the"
|
||||||
" emission timestamp of the most recent request; you will want to"
|
" transmission timestamp of the most recent request; you will want"
|
||||||
" enable this when reading inputs (requests) off-line to replay"
|
" to enable this when reading inputs (requests) offline to replay"
|
||||||
" scenarios, if time-related options are enabled (e.g."
|
" scenarios, if time-related options are enabled (e.g."
|
||||||
" \"positioning.calibration-requests-timeout\"). To be useful, this"
|
" \"positioning.calibration-requests-timeout\"). To be useful, this"
|
||||||
" option requires the listeners' clocks to be synchronised.")
|
" option requires the listeners' clocks to be synchronised.")
|
||||||
|
|
Loading…
Reference in New Issue