ANSIize, staticize, and unsignedize; set WARNS=2.
Submitted by: Mike Barcroft <mike@q9media.com>
This commit is contained in:
parent
b15d61cf16
commit
789784547f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=78780
@ -1,6 +1,7 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
PROG= spray
|
PROG= spray
|
||||||
|
WARNS?= 2
|
||||||
MAN= spray.8
|
MAN= spray.8
|
||||||
DPADD= ${LIBRPCSVC}
|
DPADD= ${LIBRPCSVC}
|
||||||
LDADD= -lrpcsvc
|
LDADD= -lrpcsvc
|
||||||
|
@ -45,8 +45,8 @@ static const char rcsid[] =
|
|||||||
#define SPRAYOVERHEAD 86
|
#define SPRAYOVERHEAD 86
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void usage ();
|
static void usage(void);
|
||||||
void print_xferstats ();
|
static void print_xferstats(unsigned int, int, double);
|
||||||
|
|
||||||
/* spray buffer */
|
/* spray buffer */
|
||||||
char spray_buffer[SPRAYMAX];
|
char spray_buffer[SPRAYMAX];
|
||||||
@ -57,16 +57,14 @@ struct timeval ONE_WAY = { 0, 0 };
|
|||||||
struct timeval TIMEOUT = { 25, 0 };
|
struct timeval TIMEOUT = { 25, 0 };
|
||||||
|
|
||||||
int
|
int
|
||||||
main(argc, argv)
|
main(int argc, char *argv[])
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
{
|
{
|
||||||
spraycumul host_stats;
|
spraycumul host_stats;
|
||||||
sprayarr host_array;
|
sprayarr host_array;
|
||||||
CLIENT *cl;
|
CLIENT *cl;
|
||||||
int c;
|
int c;
|
||||||
int i;
|
u_int i;
|
||||||
int count = 0;
|
u_int count = 0;
|
||||||
int delay = 0;
|
int delay = 0;
|
||||||
int length = 0;
|
int length = 0;
|
||||||
double xmit_time; /* time to receive data */
|
double xmit_time; /* time to receive data */
|
||||||
@ -144,7 +142,8 @@ main(argc, argv)
|
|||||||
|
|
||||||
|
|
||||||
/* Spray server with packets */
|
/* 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);
|
fflush (stdout);
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
@ -187,11 +186,8 @@ main(argc, argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
static void
|
||||||
print_xferstats(packets, packetlen, xfertime)
|
print_xferstats(u_int packets, int packetlen, double xfertime)
|
||||||
int packets;
|
|
||||||
int packetlen;
|
|
||||||
double xfertime;
|
|
||||||
{
|
{
|
||||||
int datalen;
|
int datalen;
|
||||||
double pps; /* packets per second */
|
double pps; /* packets per second */
|
||||||
@ -213,7 +209,7 @@ print_xferstats(packets, packetlen, xfertime)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage ()
|
usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"usage: spray [-c count] [-l length] [-d delay] host\n");
|
"usage: spray [-c count] [-l length] [-d delay] host\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user