parent
6536805578
commit
d6f337dbf2
|
@ -7,8 +7,6 @@
|
||||||
|
|
||||||
#include <owlps.h>
|
#include <owlps.h>
|
||||||
|
|
||||||
#define DEBUG
|
|
||||||
|
|
||||||
|
|
||||||
/* Arguments & program configuration */
|
/* Arguments & program configuration */
|
||||||
#define OPTIONS "Aa:c:C:f:hi:k:K:l:o:p:t:vV" // getopt string
|
#define OPTIONS "Aa:c:C:f:hi:k:K:l:o:p:t:vV" // getopt string
|
||||||
|
@ -21,6 +19,14 @@
|
||||||
#define POSITIONER_DEFAULT_IP "127.0.0.1"
|
#define POSITIONER_DEFAULT_IP "127.0.0.1"
|
||||||
|
|
||||||
|
|
||||||
|
/* Verbosity levels */
|
||||||
|
#define VERBOSE_QUIET cfg_getint(cfg, "verbose") == 0
|
||||||
|
#define VERBOSE_WARNING cfg_getint(cfg, "verbose") >= 1
|
||||||
|
#define VERBOSE_INFO cfg_getint(cfg, "verbose") >= 2
|
||||||
|
#define VERBOSE_CHATTERBOX cfg_getint(cfg, "verbose") >= 3
|
||||||
|
#define VERBOSE_REQUESTS cfg_getint(cfg, "verbose") >= 4
|
||||||
|
|
||||||
|
|
||||||
/* Error codes */
|
/* Error codes */
|
||||||
#define ERR_NO_MESSAGE_RECEIVED 1 // Error when reading the socket
|
#define ERR_NO_MESSAGE_RECEIVED 1 // Error when reading the socket
|
||||||
#define ERR_CREATING_SOCKET 2 // Erreur when creating listening socket
|
#define ERR_CREATING_SOCKET 2 // Erreur when creating listening socket
|
||||||
|
|
|
@ -103,34 +103,38 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
/* Wait for the threads to terminate */
|
/* Wait for the threads to terminate */
|
||||||
|
|
||||||
fprintf(stderr, "Waiting for the monitor thread... ") ;
|
if (VERBOSE_WARNING)
|
||||||
|
fprintf(stderr, "Waiting for the monitor thread... ") ;
|
||||||
if (pthread_join(monitor_thread, NULL) != 0)
|
if (pthread_join(monitor_thread, NULL) != 0)
|
||||||
perror("Cannot join monitor thread") ;
|
perror("Cannot join monitor thread") ;
|
||||||
else
|
else if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "OK.\n") ;
|
fprintf(stderr, "OK.\n") ;
|
||||||
|
|
||||||
if (cfg_getbool(cfg, "autocalibration"))
|
if (cfg_getbool(cfg, "autocalibration"))
|
||||||
{
|
{
|
||||||
// We must cancel this thread because it can be blocked on the
|
// We must cancel this thread because it can be blocked on the
|
||||||
// recvfrom() call:
|
// recvfrom() call:
|
||||||
fprintf(stderr,
|
if (VERBOSE_WARNING)
|
||||||
"Cancelling the autocalibration hello thread... ") ;
|
fprintf(stderr,
|
||||||
|
"Cancelling the autocalibration hello thread... ") ;
|
||||||
if (pthread_cancel(autocalibration_hello_thread) != 0)
|
if (pthread_cancel(autocalibration_hello_thread) != 0)
|
||||||
perror("Cannot cancel autocalibration hello thread") ;
|
perror("Cannot cancel autocalibration hello thread") ;
|
||||||
else
|
else if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "OK.\n") ;
|
fprintf(stderr, "OK.\n") ;
|
||||||
|
|
||||||
fprintf(stderr,
|
if (VERBOSE_WARNING)
|
||||||
"Waiting for the autocalibration hello thread... ") ;
|
fprintf(stderr,
|
||||||
|
"Waiting for the autocalibration hello thread... ") ;
|
||||||
if (pthread_join(autocalibration_hello_thread, NULL) != 0)
|
if (pthread_join(autocalibration_hello_thread, NULL) != 0)
|
||||||
perror("Cannot join autocalibration hello thread") ;
|
perror("Cannot join autocalibration hello thread") ;
|
||||||
else
|
else if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "OK.\n") ;
|
fprintf(stderr, "OK.\n") ;
|
||||||
|
|
||||||
fprintf(stderr, "Waiting for the monitor APs thread... ") ;
|
if (VERBOSE_WARNING)
|
||||||
|
fprintf(stderr, "Waiting for the monitor APs thread... ") ;
|
||||||
if (pthread_join(monitor_aps_thread, NULL) != 0)
|
if (pthread_join(monitor_aps_thread, NULL) != 0)
|
||||||
perror("Cannot join monitor APs thread") ;
|
perror("Cannot join monitor APs thread") ;
|
||||||
else
|
else if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "OK.\n") ;
|
fprintf(stderr, "OK.\n") ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,11 +160,12 @@ void initialise_configuration(int argc, char **argv)
|
||||||
parse_command_line(argc, argv) ;
|
parse_command_line(argc, argv) ;
|
||||||
check_configuration() ;
|
check_configuration() ;
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
/* Configuration printing */
|
/* Configuration printing */
|
||||||
fprintf(stderr, "Configuration:\n") ;
|
if (VERBOSE_INFO)
|
||||||
cfg_print(cfg, stderr) ;
|
{
|
||||||
#endif // DEBUG
|
fprintf(stderr, "Configuration:\n") ;
|
||||||
|
cfg_print(cfg, stderr) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -327,10 +332,9 @@ void check_configuration()
|
||||||
if (cfg_getint(cfg, "listening_port") < 1 ||
|
if (cfg_getint(cfg, "listening_port") < 1 ||
|
||||||
cfg_getint(cfg, "listening_port") > 65535)
|
cfg_getint(cfg, "listening_port") > 65535)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "Warning! Bad listening_port:"
|
fprintf(stderr, "Warning! Bad listening_port:"
|
||||||
" failing back to the default value.\n") ;
|
" failing back to the default value.\n") ;
|
||||||
#endif // DEBUG
|
|
||||||
cfg_setint(cfg, "listening_port", AGGREGATE_DEFAULT_PORT) ;
|
cfg_setint(cfg, "listening_port", AGGREGATE_DEFAULT_PORT) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,10 +342,9 @@ void check_configuration()
|
||||||
if (cfg_getint(cfg, "positioner_port") < 1 ||
|
if (cfg_getint(cfg, "positioner_port") < 1 ||
|
||||||
cfg_getint(cfg, "positioner_port") > 65535)
|
cfg_getint(cfg, "positioner_port") > 65535)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "Warning! Bad positioner_port:"
|
fprintf(stderr, "Warning! Bad positioner_port:"
|
||||||
" failing back to the default value.\n") ;
|
" failing back to the default value.\n") ;
|
||||||
#endif // DEBUG
|
|
||||||
cfg_setint(cfg, "positioner_port", POSITIONER_DEFAULT_PORT) ;
|
cfg_setint(cfg, "positioner_port", POSITIONER_DEFAULT_PORT) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,50 +360,45 @@ void check_configuration()
|
||||||
// aggregate_timeout //
|
// aggregate_timeout //
|
||||||
if (cfg_getint(cfg, "aggregate_timeout") < 0)
|
if (cfg_getint(cfg, "aggregate_timeout") < 0)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "Warning! aggregate_timeout cannot be negative:"
|
fprintf(stderr, "Warning! aggregate_timeout cannot be negative:"
|
||||||
" failing back to the default value.\n") ;
|
" failing back to the default value.\n") ;
|
||||||
#endif // DEBUG
|
|
||||||
cfg_setint(cfg, "aggregate_timeout", DEFAULT_AGGREGATE_TIMEOUT) ;
|
cfg_setint(cfg, "aggregate_timeout", DEFAULT_AGGREGATE_TIMEOUT) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// keep_timeout //
|
// keep_timeout //
|
||||||
if (cfg_getint(cfg, "keep_timeout") < 0)
|
if (cfg_getint(cfg, "keep_timeout") < 0)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "Warning! keep_timeout cannot be negative:"
|
fprintf(stderr, "Warning! keep_timeout cannot be negative:"
|
||||||
" failing back to the default value.\n") ;
|
" failing back to the default value.\n") ;
|
||||||
#endif // DEBUG
|
|
||||||
cfg_setint(cfg, "keep_timeout", DEFAULT_KEEP_TIMEOUT) ;
|
cfg_setint(cfg, "keep_timeout", DEFAULT_KEEP_TIMEOUT) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check_interval //
|
// check_interval //
|
||||||
if (cfg_getint(cfg, "check_interval") < 0)
|
if (cfg_getint(cfg, "check_interval") < 0)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "Warning! check_interval cannot be negative:"
|
fprintf(stderr, "Warning! check_interval cannot be negative:"
|
||||||
" failing back to the default value.\n") ;
|
" failing back to the default value.\n") ;
|
||||||
#endif // DEBUG
|
|
||||||
cfg_setint(cfg, "check_interval", DEFAULT_CHECK_INTERVAL) ;
|
cfg_setint(cfg, "check_interval", DEFAULT_CHECK_INTERVAL) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ap_keep_timeout //
|
// ap_keep_timeout //
|
||||||
if (cfg_getint(cfg, "ap_keep_timeout") < 0)
|
if (cfg_getint(cfg, "ap_keep_timeout") < 0)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "Warning! ap_keep_timeout cannot be negative:"
|
fprintf(stderr, "Warning! ap_keep_timeout cannot be negative:"
|
||||||
" failing back to the default value.\n") ;
|
" failing back to the default value.\n") ;
|
||||||
#endif // DEBUG
|
|
||||||
cfg_setint(cfg, "ap_keep_timeout", DEFAULT_AP_KEEP_TIMEOUT) ;
|
cfg_setint(cfg, "ap_keep_timeout", DEFAULT_AP_KEEP_TIMEOUT) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ap_check_interval //
|
// ap_check_interval //
|
||||||
if (cfg_getint(cfg, "ap_check_interval") < 0)
|
if (cfg_getint(cfg, "ap_check_interval") < 0)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "Warning! ap_check_interval cannot be negative:"
|
fprintf(stderr, "Warning! ap_check_interval cannot be negative:"
|
||||||
" failing back to the default value.\n") ;
|
" failing back to the default value.\n") ;
|
||||||
#endif // DEBUG
|
|
||||||
cfg_setint(cfg, "ap_check_interval", DEFAULT_AP_CHECK_INTERVAL) ;
|
cfg_setint(cfg, "ap_check_interval", DEFAULT_AP_CHECK_INTERVAL) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -445,7 +443,7 @@ int read_loop(int sockfd)
|
||||||
request.y_position = owl_ntohf(request.y_position) ;
|
request.y_position = owl_ntohf(request.y_position) ;
|
||||||
request.z_position = owl_ntohf(request.z_position) ;
|
request.z_position = owl_ntohf(request.z_position) ;
|
||||||
|
|
||||||
if (cfg_getint(cfg, "verbose"))
|
if (VERBOSE_REQUESTS)
|
||||||
{
|
{
|
||||||
inet_ntop(AF_INET, &request.mobile_ip_addr_bytes,
|
inet_ntop(AF_INET, &request.mobile_ip_addr_bytes,
|
||||||
mobile_ip_str, INET_ADDRSTRLEN) ;
|
mobile_ip_str, INET_ADDRSTRLEN) ;
|
||||||
|
@ -480,11 +478,9 @@ int read_loop(int sockfd)
|
||||||
request.direction
|
request.direction
|
||||||
) ;
|
) ;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
else if (VERBOSE_CHATTERBOX)
|
||||||
else
|
|
||||||
fprintf(stderr, "Request received from AP « %s ».\n",
|
fprintf(stderr, "Request received from AP « %s ».\n",
|
||||||
owl_mac_bytes_to_string(request.ap_mac_addr_bytes)) ;
|
owl_mac_bytes_to_string(request.ap_mac_addr_bytes)) ;
|
||||||
#endif // DEBUG
|
|
||||||
|
|
||||||
got_request(request) ;
|
got_request(request) ;
|
||||||
}
|
}
|
||||||
|
@ -519,9 +515,8 @@ void* monitor_requests(void *NULL_value)
|
||||||
owl_request_info info;
|
owl_request_info info;
|
||||||
int sockfd;
|
int sockfd;
|
||||||
|
|
||||||
#ifdef DEBUG
|
if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "Monitor requests thread launched.\n") ;
|
fprintf(stderr, "Monitor requests thread launched.\n") ;
|
||||||
#endif // DEBUG
|
|
||||||
|
|
||||||
sockfd =
|
sockfd =
|
||||||
owl_create_udp_trx_socket(cfg_getstr(cfg, "positioner_ip"),
|
owl_create_udp_trx_socket(cfg_getstr(cfg, "positioner_ip"),
|
||||||
|
@ -565,14 +560,10 @@ void* monitor_requests(void *NULL_value)
|
||||||
// If the timeout is reached
|
// If the timeout is reached
|
||||||
if (sub > aggregate_timeout)
|
if (sub > aggregate_timeout)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "* Timeout reached.") ;
|
if (VERBOSE_CHATTERBOX)
|
||||||
#ifdef DEBUG
|
fprintf(stderr, "* Aggregate timeout reached:"
|
||||||
fprintf(stderr, " sub=%"PRIuFAST32" >"
|
" %"PRIuFAST32" > %"PRIuFAST32"\n",
|
||||||
" aggregate_timeout=%"PRIuFAST32"\n",
|
sub, aggregate_timeout) ;
|
||||||
sub, aggregate_timeout) ;
|
|
||||||
#else // DEBUG
|
|
||||||
putc('\n', stderr) ;
|
|
||||||
#endif // DEBUG
|
|
||||||
|
|
||||||
// Print mobile MAC address to the output file
|
// Print mobile MAC address to the output file
|
||||||
owl_mac_bytes_to_string_r(request_ptr->
|
owl_mac_bytes_to_string_r(request_ptr->
|
||||||
|
@ -657,14 +648,10 @@ void* monitor_requests(void *NULL_value)
|
||||||
{
|
{
|
||||||
request_list *request_tmp = request_ptr ;
|
request_list *request_tmp = request_ptr ;
|
||||||
|
|
||||||
fprintf(stderr, "* Keep timeout reached.") ;
|
if (VERBOSE_CHATTERBOX)
|
||||||
#ifdef DEBUG
|
fprintf(stderr, "* Keep timeout reached:"
|
||||||
fprintf(stderr, " sub=%"PRIuFAST32" >"
|
" %"PRIuFAST32" > %"PRIuFAST32"\n",
|
||||||
" keep_timeout=%"PRIuFAST32"\n",
|
sub, keep_timeout) ;
|
||||||
sub, keep_timeout) ;
|
|
||||||
#else // DEBUG
|
|
||||||
putc('\n', stderr) ;
|
|
||||||
#endif // DEBUG
|
|
||||||
|
|
||||||
request_ptr = request_ptr->next ;
|
request_ptr = request_ptr->next ;
|
||||||
|
|
||||||
|
@ -723,7 +710,9 @@ void got_request(owl_captured_request request)
|
||||||
tmp_request = requests ;
|
tmp_request = requests ;
|
||||||
if (requests == NULL) // If the request list does not exist,
|
if (requests == NULL) // If the request list does not exist,
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Creating request list.\n") ;
|
if (VERBOSE_INFO)
|
||||||
|
fprintf(stderr, "Creating request list with AP « %s ».\n",
|
||||||
|
owl_mac_bytes_to_string(request.ap_mac_addr_bytes)) ;
|
||||||
tmp_request = malloc(sizeof(request_list)) ; // create it.
|
tmp_request = malloc(sizeof(request_list)) ; // create it.
|
||||||
tmp_request->type = request.type ;
|
tmp_request->type = request.type ;
|
||||||
memcpy(tmp_request->mobile_mac_addr_bytes,
|
memcpy(tmp_request->mobile_mac_addr_bytes,
|
||||||
|
@ -781,7 +770,9 @@ void got_request(owl_captured_request request)
|
||||||
|
|
||||||
if (tmp_request == NULL) // The request does not exist in the list
|
if (tmp_request == NULL) // The request does not exist in the list
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Create new request.\n") ;
|
if (VERBOSE_INFO)
|
||||||
|
fprintf(stderr, "Create new request from AP « %s ».\n",
|
||||||
|
owl_mac_bytes_to_string(request.ap_mac_addr_bytes)) ;
|
||||||
tmp_request = malloc(sizeof(request_list)) ; // create it
|
tmp_request = malloc(sizeof(request_list)) ; // create it
|
||||||
tmp_request->type = request.type ;
|
tmp_request->type = request.type ;
|
||||||
memcpy(tmp_request->mobile_mac_addr_bytes,
|
memcpy(tmp_request->mobile_mac_addr_bytes,
|
||||||
|
@ -809,12 +800,14 @@ void got_request(owl_captured_request request)
|
||||||
{
|
{
|
||||||
if (tmp_request->info == NULL)
|
if (tmp_request->info == NULL)
|
||||||
{ // We already sent to the server data for this request
|
{ // We already sent to the server data for this request
|
||||||
fprintf(stderr, "Request already treated.\n") ;
|
if (VERBOSE_CHATTERBOX)
|
||||||
|
fprintf(stderr, "Request already treated.\n") ;
|
||||||
free(tmp_info) ;
|
free(tmp_info) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Add information to the request.\n") ;
|
if (VERBOSE_CHATTERBOX)
|
||||||
|
fprintf(stderr, "Add information to the request.\n") ;
|
||||||
tmp_info->next = tmp_request->info ; // Add data
|
tmp_info->next = tmp_request->info ; // Add data
|
||||||
tmp_request->info = tmp_info ;
|
tmp_request->info = tmp_info ;
|
||||||
}
|
}
|
||||||
|
@ -864,9 +857,8 @@ void* listen_for_aps(void *NULL_value)
|
||||||
owl_autocalibration_hello message ;
|
owl_autocalibration_hello message ;
|
||||||
char ap_ip_addr[INET_ADDRSTRLEN] ;
|
char ap_ip_addr[INET_ADDRSTRLEN] ;
|
||||||
|
|
||||||
#ifdef DEBUG
|
if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "Autocalibration Hello thread launched.\n") ;
|
fprintf(stderr, "Autocalibration Hello thread launched.\n") ;
|
||||||
#endif // DEBUG
|
|
||||||
|
|
||||||
listen_sockfd =
|
listen_sockfd =
|
||||||
owl_create_udp_listening_socket(cfg_getint(cfg,
|
owl_create_udp_listening_socket(cfg_getint(cfg,
|
||||||
|
@ -893,10 +885,9 @@ void* listen_for_aps(void *NULL_value)
|
||||||
|
|
||||||
strncpy(ap_ip_addr, inet_ntoa(client.sin_addr), INET_ADDRSTRLEN) ;
|
strncpy(ap_ip_addr, inet_ntoa(client.sin_addr), INET_ADDRSTRLEN) ;
|
||||||
|
|
||||||
#ifdef DEBUG
|
if (VERBOSE_INFO)
|
||||||
fprintf(stderr, "Got a Hello message from « %s »\n",
|
fprintf(stderr,
|
||||||
ap_ip_addr) ;
|
"Got a Hello message from « %s »\n", ap_ip_addr) ;
|
||||||
#endif // DEBUG
|
|
||||||
|
|
||||||
sem_wait(&lock_aps) ;
|
sem_wait(&lock_aps) ;
|
||||||
update_ap(message.ap_mac_addr_bytes, ap_ip_addr) ;
|
update_ap(message.ap_mac_addr_bytes, ap_ip_addr) ;
|
||||||
|
@ -960,11 +951,13 @@ ap_list* find_ap(uint8_t mac_addr_bytes[ETHER_ADDR_LEN])
|
||||||
*/
|
*/
|
||||||
ap_list* add_ap_front(uint8_t mac_addr_bytes[ETHER_ADDR_LEN])
|
ap_list* add_ap_front(uint8_t mac_addr_bytes[ETHER_ADDR_LEN])
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
if (VERBOSE_INFO)
|
||||||
char mac_str[OWL_ETHER_ADDR_STRLEN] ;
|
{
|
||||||
owl_mac_bytes_to_string_r(mac_addr_bytes, mac_str) ;
|
char mac_str[OWL_ETHER_ADDR_STRLEN] ;
|
||||||
fprintf(stderr, "Creating AP with MAC address « %s »...\n", mac_str) ;
|
owl_mac_bytes_to_string_r(mac_addr_bytes, mac_str) ;
|
||||||
#endif // DEBUG
|
fprintf(stderr,
|
||||||
|
"Creating AP with MAC address « %s »...\n", mac_str) ;
|
||||||
|
}
|
||||||
|
|
||||||
ap_list *ap = malloc(sizeof(ap_list)) ;
|
ap_list *ap = malloc(sizeof(ap_list)) ;
|
||||||
memcpy(ap->mac_addr_bytes, mac_addr_bytes, ETHER_ADDR_LEN) ;
|
memcpy(ap->mac_addr_bytes, mac_addr_bytes, ETHER_ADDR_LEN) ;
|
||||||
|
@ -1026,9 +1019,8 @@ void push_ap(ap_list *ap)
|
||||||
*/
|
*/
|
||||||
void* monitor_aps(void *NULL_value)
|
void* monitor_aps(void *NULL_value)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
if (VERBOSE_WARNING)
|
||||||
fprintf(stderr, "Monitor AP thread launched.\n") ;
|
fprintf(stderr, "Monitor AP thread launched.\n") ;
|
||||||
#endif // DEBUG
|
|
||||||
|
|
||||||
while (owl_run)
|
while (owl_run)
|
||||||
{
|
{
|
||||||
|
@ -1079,12 +1071,13 @@ void delete_old_aps()
|
||||||
*/
|
*/
|
||||||
void delete_ap(ap_list *ap)
|
void delete_ap(ap_list *ap)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
if (VERBOSE_INFO)
|
||||||
assert(ap) ;
|
{
|
||||||
char mac_str[OWL_ETHER_ADDR_STRLEN] ;
|
char mac_str[OWL_ETHER_ADDR_STRLEN] ;
|
||||||
owl_mac_bytes_to_string_r(token_aps->mac_addr_bytes, mac_str) ;
|
assert(ap) ;
|
||||||
fprintf(stderr, "Deleting AP « %s »...\n", mac_str) ;
|
owl_mac_bytes_to_string_r(ap->mac_addr_bytes, mac_str) ;
|
||||||
#endif // DEBUG
|
fprintf(stderr, "Deleting AP « %s »...\n", mac_str) ;
|
||||||
|
}
|
||||||
|
|
||||||
unlink_ap(ap) ;
|
unlink_ap(ap) ;
|
||||||
free(ap) ;
|
free(ap) ;
|
||||||
|
@ -1134,9 +1127,8 @@ void order_send(ap_list *ap)
|
||||||
int sockfd ;
|
int sockfd ;
|
||||||
ssize_t nsent ;
|
ssize_t nsent ;
|
||||||
|
|
||||||
#ifdef DEBUG
|
if (VERBOSE_INFO)
|
||||||
fprintf(stderr, "Sending an order to %s...\n", ap->ip_addr) ;
|
fprintf(stderr, "Sending an order to %s...\n", ap->ip_addr) ;
|
||||||
#endif // DEBUG
|
|
||||||
|
|
||||||
sockfd =
|
sockfd =
|
||||||
owl_create_udp_trx_socket(ap->ip_addr,
|
owl_create_udp_trx_socket(ap->ip_addr,
|
||||||
|
@ -1272,8 +1264,8 @@ void print_usage()
|
||||||
printf("Usage:\n"
|
printf("Usage:\n"
|
||||||
"\t%s"
|
"\t%s"
|
||||||
" [-f config_file]"
|
" [-f config_file]"
|
||||||
" [-v]"
|
" [-v[v[v[v]]]]"
|
||||||
" [-o output_file]"
|
" -o output_file"
|
||||||
" [-i positionner_ip]"
|
" [-i positionner_ip]"
|
||||||
" [-p positioner_port]"
|
" [-p positioner_port]"
|
||||||
" [-l listening_port]"
|
" [-l listening_port]"
|
||||||
|
@ -1293,8 +1285,10 @@ void print_usage()
|
||||||
"\t-V\t\tShow version information.\n"
|
"\t-V\t\tShow version information.\n"
|
||||||
"\t-f config_file\tUse 'config_file' instead of the default"
|
"\t-f config_file\tUse 'config_file' instead of the default"
|
||||||
" configuration file (%s).\n"
|
" configuration file (%s).\n"
|
||||||
"\t-v\t\tBe verbose (you can use this option several times to"
|
"\t-v\t\tBe verbose. You can use this option up to 4 times to"
|
||||||
" increase the level of verbosity).\n"
|
" increase the level of verbosity (1 = warnings, 2 = useful"
|
||||||
|
" information, 3 = too much information, 4 = displays the"
|
||||||
|
" detail of each and every received request).\n"
|
||||||
|
|
||||||
"Output options:\n"
|
"Output options:\n"
|
||||||
"\t-o output_file\t\tAggregated requests will be appended to"
|
"\t-o output_file\t\tAggregated requests will be appended to"
|
||||||
|
|
Loading…
Reference in New Issue