diff options
| author | Dima Dorfman <dd@FreeBSD.org> | 2001-07-30 10:23:00 +0000 |
|---|---|---|
| committer | Dima Dorfman <dd@FreeBSD.org> | 2001-07-30 10:23:00 +0000 |
| commit | d78fafb19e52329fefd13c2ae0aef4d4a17f1e00 (patch) | |
| tree | 6ddbfeaed98752a26aff86de17bfb8f49cfd7815 /usr.sbin/spray | |
| parent | 4217d84e2e30f1cfbc09e1da305191bf3fcc12a2 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/spray')
| -rw-r--r-- | usr.sbin/spray/spray.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/usr.sbin/spray/spray.c b/usr.sbin/spray/spray.c index fd08e2d812a5..ab98c8558b1c 100644 --- a/usr.sbin/spray/spray.c +++ b/usr.sbin/spray/spray.c @@ -33,6 +33,7 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include <err.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -44,8 +45,8 @@ static const char rcsid[] = #define SPRAYOVERHEAD 86 #endif -static void usage (); -void print_xferstats (); +static void usage(void); +static void print_xferstats(unsigned int, int, double); /* spray buffer */ char spray_buffer[SPRAYMAX]; @@ -56,16 +57,14 @@ struct timeval ONE_WAY = { 0, 0 }; struct timeval TIMEOUT = { 25, 0 }; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { spraycumul host_stats; sprayarr host_array; CLIENT *cl; int c; - int i; - int count = 0; + u_int i; + u_int count = 0; int delay = 0; int length = 0; double xmit_time; /* time to receive data */ @@ -143,7 +142,8 @@ main(argc, argv) /* Spray server with packets */ - printf ("sending %d packets of lnth %d to %s ...", count, length, *argv); + printf ("sending %u packets of lnth %d to %s ...", count, length, + *argv); fflush (stdout); for (i = 0; i < count; i++) { @@ -186,11 +186,8 @@ main(argc, argv) } -void -print_xferstats(packets, packetlen, xfertime) - int packets; - int packetlen; - double xfertime; +static void +print_xferstats(u_int packets, int packetlen, double xfertime) { int datalen; double pps; /* packets per second */ @@ -212,7 +209,7 @@ print_xferstats(packets, packetlen, xfertime) static void -usage () +usage(void) { fprintf(stderr, "usage: spray [-c count] [-l length] [-d delay] host\n"); |
