[Aggregator] Add some debug messages

This commit is contained in:
Matteo Cypriani 2010-10-26 16:47:22 +02:00
parent 8fdfd6819e
commit ae3131c047
1 changed files with 20 additions and 5 deletions

View File

@ -756,6 +756,12 @@ ap_list* find_ap(unsigned char mac_addr_bytes[6])
*/ */
ap_list* add_ap_front(unsigned char mac_addr_bytes[6]) ap_list* add_ap_front(unsigned char mac_addr_bytes[6])
{ {
#ifdef DEBUG
char *mac = mac_bytes_to_string(mac_addr_bytes) ;
fprintf(stderr, "Creating AP with MAC address « %s »...\n", mac) ;
free(mac) ;
#endif // DEBUG
ap_list *ap = malloc(sizeof(ap_list)) ; ap_list *ap = malloc(sizeof(ap_list)) ;
memcpy(ap->mac_addr_bytes, mac_addr_bytes, 6) ; memcpy(ap->mac_addr_bytes, mac_addr_bytes, 6) ;
update_ap_seen(ap) ; update_ap_seen(ap) ;
@ -861,6 +867,13 @@ void delete_old_aps()
*/ */
void delete_ap(ap_list *ap) void delete_ap(ap_list *ap)
{ {
#ifdef DEBUG
assert(ap) ;
char *mac = mac_bytes_to_string(token_aps->mac_addr_bytes) ;
fprintf(stderr, "Deleting AP « %s »...\n", mac) ;
free(mac) ;
#endif // DEBUG
unlink_ap(ap) ; unlink_ap(ap) ;
free(ap) ; free(ap) ;
--nb_aps ; --nb_aps ;
@ -873,11 +886,13 @@ void delete_ap(ap_list *ap)
*/ */
void unlink_ap(ap_list *ap) void unlink_ap(ap_list *ap)
{ {
assert(ap) ;
ap_list ap_list
*ap_previous = ap->previous, *ap_previous,
*ap_next = ap->next ; *ap_next ;
assert(ap) ;
ap_previous = ap->previous ;
ap_next = ap->next ;
assert(ap_previous) ; assert(ap_previous) ;
assert(ap_next) ; assert(ap_next) ;
@ -1076,8 +1091,8 @@ void print_usage()
" requests (default\t%d microseconds).\n" " requests (default\t%d microseconds).\n"
"Autocalibration options:\n" "Autocalibration options:\n"
"\t-A\tEnable autocalibration (default: disabled).\n" "\t-A\t\t\tEnable autocalibration (default: disabled).\n"
"\t-a port\tPort on which autocalibration data" "\t-a port\t\t\tPort on which autocalibration data"
" are exchanged with the listeners (default: %d).\n" " are exchanged with the listeners (default: %d).\n"
"\t-K ap_keep_timeout\tInactive APs are kept during" "\t-K ap_keep_timeout\tInactive APs are kept during"
" 'ap_keep_timeout' seconds (default: %d s).\n" " 'ap_keep_timeout' seconds (default: %d s).\n"