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