[Listener] Get rid of the last indent tabs

This commit is contained in:
Matteo Cypriani 2011-02-23 18:10:47 +01:00
parent 7b5600881d
commit e2963e676b
1 changed files with 53 additions and 53 deletions

View File

@ -264,12 +264,12 @@ void parse_command_line(int argc, char **argv)
while ((opt = getopt(argc, argv, OPTIONS)) != -1)
{
switch (opt)
{
{
case 'A' :
#ifdef USE_PTHREAD
SET_AUTOCALIBRATION() ;
#else // USE_PTHREAD
fprintf(stderr, "Warning! The program was compiled without"
fprintf(stderr, "Warning! The program was compiled without"
" support of POSIX threads, so -A (autocalibration)"
" is not available and will be ignored. All other"
" autocalibration-related options will also be"
@ -284,14 +284,14 @@ void parse_command_line(int argc, char **argv)
case 'c' :
SET_DISPLAY_CAPTURED() ;
break ;
case 'd' :
SET_AGGREGATION_IP(optarg) ;
break ;
case 'd' :
SET_AGGREGATION_IP(optarg) ;
break ;
case 'D' :
SET_AUTOCALIBRATION_IP(optarg) ;
break ;
case 'f' : // Config file
break ; // (already parsed)
case 'f' : // Config file
break ; // (already parsed)
case 'h' : // Usage
break ; // (already parsed)
case 'H' :
@ -299,30 +299,30 @@ void parse_command_line(int argc, char **argv)
SET_AUTOCALIBRATION_HELLO_DELAY(strtol(optarg, NULL, 0)) ;
#endif // USE_PTHREAD
break ;
case 'k' :
case 'k' :
#ifdef USE_PTHREAD
SET_KEEP_MONITOR() ;
SET_KEEP_MONITOR() ;
#else // USE_PTHREAD
fprintf(stderr, "Warning! The program was compiled without"
fprintf(stderr, "Warning! The program was compiled without"
" support of POSIX threads, so -k (monitor mode"
" keeping-up) is not available and will be ignored."
"\n") ;
#endif // USE_PTHREAD
break ;
case 'l' :
SET_LISTENING_PORT(strtol(optarg, NULL, 0)) ;
break ;
case 'm' :
break ;
case 'l' :
SET_LISTENING_PORT(strtol(optarg, NULL, 0)) ;
break ;
case 'm' :
SET_MODE(optarg[0]) ;
break ;
break ;
case 'n' :
#ifdef USE_PTHREAD
SET_AUTOCALIBRATION_NBPKT(strtol(optarg, NULL, 0)) ;
#endif // USE_PTHREAD
break ;
case 'p' :
SET_AGGREGATION_PORT(strtol(optarg, NULL, 0)) ;
break ;
case 'p' :
SET_AGGREGATION_PORT(strtol(optarg, NULL, 0)) ;
break ;
case 'P' :
#ifdef USE_PTHREAD
SET_AUTOCALIBRATION_REQUEST_PORT(strtol(optarg, NULL, 0)) ;
@ -334,9 +334,9 @@ void parse_command_line(int argc, char **argv)
case 'Q' :
UNSET_DISPLAY_CAPTURED() ;
break ;
case 'r' :
SET_RTAP_IFACE(optarg) ;
break ;
case 'r' :
SET_RTAP_IFACE(optarg) ;
break ;
case 't' :
#ifdef USE_PTHREAD
SET_AUTOCALIBRATION_DELAY(strtol(optarg, NULL, 0)) ;
@ -347,13 +347,13 @@ void parse_command_line(int argc, char **argv)
break ;
case 'V' : // Version
break ; // (already parsed)
case 'w' :
SET_WIFI_IFACE(optarg) ;
break ;
default :
print_usage() ;
exit(ERR_BAD_USAGE) ;
}
case 'w' :
SET_WIFI_IFACE(optarg) ;
break ;
default :
print_usage() ;
exit(ERR_BAD_USAGE) ;
}
}
}
@ -385,7 +385,7 @@ void check_configuration()
{
if (GET_VERBOSE())
fprintf(stderr, "No Wi-Fi interface was specified. Failing back"
" to the radiotap interface (%s) instead.\n",
" to the radiotap interface (%s) instead.\n",
GET_RTAP_IFACE()) ;
SET_WIFI_IFACE(GET_RTAP_IFACE()) ;
}
@ -430,9 +430,9 @@ void print_configuration()
,
GET_MODE(),
GET_AGGREGATION_IP(),
GET_AGGREGATION_PORT(),
GET_LISTENING_PORT(),
GET_RTAP_IFACE(),
GET_AGGREGATION_PORT(),
GET_LISTENING_PORT(),
GET_RTAP_IFACE(),
GET_WIFI_IFACE(),
#ifdef USE_PTHREAD
BOOL_TO_STRING(GET_KEEP_MONITOR()),
@ -646,34 +646,34 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
data[rtap_bytes + ieee80211_header_size + LLC_HEADER_SIZE
+ sizeof(struct iphdr) + sizeof(struct udphdr)] ;
switch(packet_type)
{
case PACKET_TYPE_NORMAL :
if (GET_VERBOSE())
printf("\nExplicit packet received.\n") ;
break ;
{
case PACKET_TYPE_NORMAL :
if (GET_VERBOSE())
printf("\nExplicit packet received.\n") ;
break ;
case PACKET_TYPE_CALIBRATION :
if (GET_VERBOSE())
printf("\nExplicit calibration packet received.\n") ;
couple.direction =
case PACKET_TYPE_CALIBRATION :
if (GET_VERBOSE())
printf("\nExplicit calibration packet received.\n") ;
couple.direction =
data[rtap_bytes + ieee80211_header_size + LLC_HEADER_SIZE
+ sizeof(struct iphdr) + sizeof(struct udphdr) + 9];
memcpy(&couple.x_position,
memcpy(&couple.x_position,
&data[rtap_bytes + ieee80211_header_size
+ LLC_HEADER_SIZE + sizeof(struct iphdr)
+ sizeof(struct udphdr) + 10], sizeof(float)) ;
memcpy(&couple.y_position,
memcpy(&couple.y_position,
&data[rtap_bytes + ieee80211_header_size
+ LLC_HEADER_SIZE + sizeof(struct iphdr)
+ sizeof(struct udphdr) + 14], sizeof(float)) ;
memcpy(&couple.z_position,
memcpy(&couple.z_position,
&data[rtap_bytes + ieee80211_header_size
+ LLC_HEADER_SIZE + sizeof(struct iphdr)
+ sizeof(struct udphdr) + 18], sizeof(float)) ;
break ;
break ;
case PACKET_TYPE_AUTOCALIBRATION :
if (GET_VERBOSE())
if (GET_VERBOSE())
{
printf("\nAutocalibration packet received.") ;
if (uses_autocalibration_request_port)
@ -682,20 +682,20 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
}
break ;
default :
if (GET_VERBOSE())
printf("\nStrange explicit packet received\n") ;
fprintf(stderr,
default :
if (GET_VERBOSE())
printf("\nStrange explicit packet received\n") ;
fprintf(stderr,
"Error! Unknown packet type (%d).\n", packet_type) ;
is_explicit_packet = FALSE ;
}
}
if (! is_explicit_packet)
{
if (GET_MODE() == MODE_ACTIVE)
return ;
else if (GET_VERBOSE())
printf("\nThis strange explicit packet will be handled as"
printf("\nThis strange explicit packet will be handled as"
" an implicit one.\n") ;
}
else