remove trailing whitespace

pull/89/merge
David Schweikert 8 years ago
parent 9adb9a8480
commit 9d2daa77c8

@ -1,4 +1,4 @@
/* /*
* fping: fast-ping, file-ping, favorite-ping, funky-ping * fping: fast-ping, file-ping, favorite-ping, funky-ping
* *
* Ping a list of target hosts in a round robin fashion. * Ping a list of target hosts in a round robin fashion.
@ -22,8 +22,8 @@
* duplicated in all such forms and that any documentation, * duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such * advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed * distribution and use acknowledge that the software was developed
* by Stanford University. The name of the University may not be used * by Stanford University. The name of the University may not be used
* to endorse or promote products derived from this software without * to endorse or promote products derived from this software without
* specific prior written permission. * specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
@ -258,7 +258,7 @@ unsigned int debugging = 0;
/* times get *100 because all times are calculated in 10 usec units, not ms */ /* times get *100 because all times are calculated in 10 usec units, not ms */
unsigned int retry = DEFAULT_RETRY; unsigned int retry = DEFAULT_RETRY;
unsigned int timeout = DEFAULT_TIMEOUT * 100; unsigned int timeout = DEFAULT_TIMEOUT * 100;
unsigned int interval = DEFAULT_INTERVAL * 100; unsigned int interval = DEFAULT_INTERVAL * 100;
unsigned int perhost_interval = DEFAULT_PERHOST_INTERVAL * 100; unsigned int perhost_interval = DEFAULT_PERHOST_INTERVAL * 100;
float backoff = DEFAULT_BACKOFF_FACTOR; float backoff = DEFAULT_BACKOFF_FACTOR;
@ -291,7 +291,7 @@ int num_timeout = 0, /* number of times select timed out */
num_othericmprcvd = 0; /* total non-echo-reply ICMP received */ num_othericmprcvd = 0; /* total non-echo-reply ICMP received */
struct timeval current_time; /* current time (pseudo) */ struct timeval current_time; /* current time (pseudo) */
struct timeval start_time; struct timeval start_time;
struct timeval end_time; struct timeval end_time;
struct timeval last_send_time; /* time last ping was sent */ struct timeval last_send_time; /* time last ping was sent */
struct timeval next_report_time; /* time next -Q report is expected */ struct timeval next_report_time; /* time next -Q report is expected */
@ -354,7 +354,7 @@ int addr_cmp(struct sockaddr *a, struct sockaddr *b);
Inputs: int argc, char** argv Inputs: int argc, char** argv
Description: Description:
Main program entry point Main program entry point
************************************************************/ ************************************************************/
@ -364,7 +364,7 @@ int main( int argc, char **argv )
int c, i, n; int c, i, n;
char *buf; char *buf;
uid_t uid; uid_t uid;
int tos = 0; int tos = 0;
HOST_ENTRY *cursor; HOST_ENTRY *cursor;
prog = argv[0]; prog = argv[0];
@ -475,7 +475,7 @@ int main( int argc, char **argv )
netdata_flag = 1; netdata_flag = 1;
break; break;
case 'd': case 'd':
case 'n': case 'n':
name_flag = 1; name_flag = 1;
break; break;
@ -515,10 +515,10 @@ int main( int argc, char **argv )
alive_flag = 1; alive_flag = 1;
break; break;
case 'H': case 'H':
if( !( ttl = ( u_int )atoi( optarg ) )) if( !( ttl = ( u_int )atoi( optarg ) ))
usage(1); usage(1);
break; break;
#if defined( DEBUG ) || defined( _DEBUG ) #if defined( DEBUG ) || defined( _DEBUG )
case 'z': case 'z':
@ -533,7 +533,7 @@ int main( int argc, char **argv )
printf( "%s: comments to %s\n", argv[0], EMAIL ); printf( "%s: comments to %s\n", argv[0], EMAIL );
exit( 0 ); exit( 0 );
case 'f': case 'f':
filename = optarg; filename = optarg;
break; break;
@ -594,9 +594,9 @@ int main( int argc, char **argv )
/* validate various option settings */ /* validate various option settings */
if (ttl > 255) { if (ttl > 255) {
fprintf(stderr, "ttl %u out of range\n", ttl); fprintf(stderr, "ttl %u out of range\n", ttl);
exit(1); exit(1);
} }
if( unreachable_flag && alive_flag ) if( unreachable_flag && alive_flag )
{ {
@ -613,7 +613,7 @@ int main( int argc, char **argv )
}/* IF */ }/* IF */
if( ( interval < MIN_INTERVAL * 100 || if( ( interval < MIN_INTERVAL * 100 ||
perhost_interval < MIN_PERHOST_INTERVAL * 100 ) perhost_interval < MIN_PERHOST_INTERVAL * 100 )
&& getuid() ) && getuid() )
{ {
fprintf( stderr, "%s: these options are too risky for mere mortals.\n", prog ); fprintf( stderr, "%s: these options are too risky for mere mortals.\n", prog );
@ -728,7 +728,7 @@ int main( int argc, char **argv )
} }
} }
#if HAVE_SO_TIMESTAMP #if HAVE_SO_TIMESTAMP
{ {
int opt = 1; int opt = 1;
if (setsockopt(s, SOL_SOCKET, SO_TIMESTAMP, &opt, sizeof(opt))) { if (setsockopt(s, SOL_SOCKET, SO_TIMESTAMP, &opt, sizeof(opt))) {
@ -864,7 +864,7 @@ int main( int argc, char **argv )
last_send_time.tv_sec = current_time.tv_sec - 10000; last_send_time.tv_sec = current_time.tv_sec - 10000;
#if defined( DEBUG ) || defined( _DEBUG ) #if defined( DEBUG ) || defined( _DEBUG )
if( randomly_lose_flag ) if( randomly_lose_flag )
srandom( start_time.tv_usec ); srandom( start_time.tv_usec );
#endif /* DEBUG || _DEBUG */ #endif /* DEBUG || _DEBUG */
@ -881,7 +881,7 @@ int main( int argc, char **argv )
void add_cidr(char *addr) void add_cidr(char *addr)
{ {
char *addr_end; char *addr_end;
char *mask_str; char *mask_str;
unsigned long mask; unsigned long mask;
unsigned long bitmask; unsigned long bitmask;
int ret; int ret;
@ -1171,7 +1171,7 @@ void finish()
{ {
printf( "%s", h->host ); printf( "%s", h->host );
if( verbose_flag ) if( verbose_flag )
printf( " is unreachable" ); printf( " is unreachable" );
printf( "\n" ); printf( "\n" );
@ -1193,7 +1193,7 @@ void finish()
if( num_noaddress ) if( num_noaddress )
exit( 2 ); exit( 2 );
else if( num_alive != num_hosts ) else if( num_alive != num_hosts )
exit( 1 ); exit( 1 );
exit(0); exit(0);
@ -1629,7 +1629,7 @@ int receive_packet(int socket,
return 0; return 0;
} }
#if HAVE_SO_TIMESTAMP #if HAVE_SO_TIMESTAMP
// ancilliary data // ancilliary data
struct cmsghdr *cmsg; struct cmsghdr *cmsg;
for(cmsg = CMSG_FIRSTHDR(&recv_msghdr); for(cmsg = CMSG_FIRSTHDR(&recv_msghdr);
@ -1795,7 +1795,7 @@ int decode_icmp_ipv6(
getnameinfo((struct sockaddr *)&response_addr, sizeof(response_addr), buf, INET6_ADDRSTRLEN, NULL, 0, NI_NUMERICHOST); getnameinfo((struct sockaddr *)&response_addr, sizeof(response_addr), buf, INET6_ADDRSTRLEN, NULL, 0, NI_NUMERICHOST);
printf( "received packet too short for ICMP (%d bytes from %s)\n", (int) reply_buf_len, buf); printf( "received packet too short for ICMP (%d bytes from %s)\n", (int) reply_buf_len, buf);
} }
return 0; /* too short */ return 0; /* too short */
} }
icp = (struct icmp6_hdr *) reply_buf; icp = (struct icmp6_hdr *) reply_buf;
@ -1988,7 +1988,7 @@ int wait_for_reply(long wait_time)
h->num_recv_total++; h->num_recv_total++;
#if defined( DEBUG ) || defined( _DEBUG ) #if defined( DEBUG ) || defined( _DEBUG )
if( trace_flag ) if( trace_flag )
printf( "received [%d] from %s\n", this_count, h->host ); printf( "received [%d] from %s\n", this_count, h->host );
#endif /* DEBUG || _DEBUG */ #endif /* DEBUG || _DEBUG */
@ -2135,7 +2135,7 @@ void add_name( char *name )
if(!quiet_flag) if(!quiet_flag)
print_warning("%s: %s\n", name, gai_strerror(ret_ga)); print_warning("%s: %s\n", name, gai_strerror(ret_ga));
num_noaddress++; num_noaddress++;
return; return;
} }
// NOTE: we could/should loop with res on all addresses like this: // NOTE: we could/should loop with res on all addresses like this:
@ -2157,7 +2157,7 @@ void add_name( char *name )
print_warning("%s: %s\n", name, gai_strerror(ret_ga)); print_warning("%s: %s\n", name, gai_strerror(ret_ga));
} }
num_noaddress++; num_noaddress++;
return; return;
} }
printname = namebuf; printname = namebuf;
} }
@ -2172,7 +2172,7 @@ void add_name( char *name )
print_warning("%s: %s\n", name, gai_strerror(ret_ga)); print_warning("%s: %s\n", name, gai_strerror(ret_ga));
} }
num_noaddress++; num_noaddress++;
return; return;
} }
if(name_flag) { if(name_flag) {
@ -2377,7 +2377,7 @@ void print_warning(char *format, ...) {
Description: Description:
timeval_diff now returns result in hundredths of milliseconds timeval_diff now returns result in hundredths of milliseconds
ie, tens of microseconds ie, tens of microseconds
************************************************************/ ************************************************************/
@ -2585,7 +2585,7 @@ void ev_enqueue(HOST_ENTRY *h)
i = ev_last; i = ev_last;
while(1) { while(1) {
i_prev = i->ev_prev; i_prev = i->ev_prev;
if(i_prev == NULL || if(i_prev == NULL ||
h->ev_time.tv_sec > i_prev->ev_time.tv_sec || h->ev_time.tv_sec > i_prev->ev_time.tv_sec ||
(h->ev_time.tv_sec == i_prev->ev_time.tv_sec && (h->ev_time.tv_sec == i_prev->ev_time.tv_sec &&
h->ev_time.tv_usec >= i_prev->ev_time.tv_usec)) h->ev_time.tv_usec >= i_prev->ev_time.tv_usec))
@ -2668,7 +2668,7 @@ void usage(int is_error)
fprintf(out, " -A show targets by address\n" ); fprintf(out, " -A show targets by address\n" );
fprintf(out, " -b n amount of ping data to send, in bytes (default %d)\n", DEFAULT_PING_DATA_SIZE); fprintf(out, " -b n amount of ping data to send, in bytes (default %d)\n", DEFAULT_PING_DATA_SIZE);
fprintf(out, " -B f set exponential backoff factor to f\n" ); fprintf(out, " -B f set exponential backoff factor to f\n" );
fprintf(out, " -c n count of pings to send to each target (default %d)\n", count ); fprintf(out, " -c n count of pings to send to each target (default %d)\n", count );
fprintf(out, " -C n same as -c, report results in verbose format\n" ); fprintf(out, " -C n same as -c, report results in verbose format\n" );
fprintf(out, " -D print timestamp before each output line\n" ); fprintf(out, " -D print timestamp before each output line\n" );
fprintf(out, " -e show elapsed time on return packets\n" ); fprintf(out, " -e show elapsed time on return packets\n" );

Loading…
Cancel
Save