Fix usage in man page. Remove progname.
This commit is contained in:
parent
51fc70b565
commit
40d3f8a9fc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30598
@ -33,8 +33,6 @@
|
|||||||
.Op Fl d Ar delay
|
.Op Fl d Ar delay
|
||||||
.Op Fl l Ar length
|
.Op Fl l Ar length
|
||||||
.Ar host
|
.Ar host
|
||||||
\&...
|
|
||||||
.Ek
|
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
.Nm Spray
|
.Nm Spray
|
||||||
sends multiple RPC packets to
|
sends multiple RPC packets to
|
||||||
@ -65,9 +63,7 @@ rounds up to the nearest possible value.
|
|||||||
.Nm Spray
|
.Nm Spray
|
||||||
is intended for use in network testing, measurement, and management.
|
is intended for use in network testing, measurement, and management.
|
||||||
This command
|
This command
|
||||||
.Bf -emphasis
|
.Em "can be very hard on a network and should be used with caution" .
|
||||||
can be very hard on a network and should be used with caution.
|
|
||||||
.Ef
|
|
||||||
.Pp
|
.Pp
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr netstat 1 ,
|
.Xr netstat 1 ,
|
||||||
|
@ -26,10 +26,13 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef lint
|
||||||
|
static const char rcsid[] =
|
||||||
|
"$Id$";
|
||||||
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -41,7 +44,7 @@
|
|||||||
#define SPRAYOVERHEAD 86
|
#define SPRAYOVERHEAD 86
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void usage ();
|
static void usage ();
|
||||||
void print_xferstats ();
|
void print_xferstats ();
|
||||||
|
|
||||||
/* spray buffer */
|
/* spray buffer */
|
||||||
@ -57,7 +60,6 @@ main(argc, argv)
|
|||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
{
|
{
|
||||||
char *progname;
|
|
||||||
spraycumul host_stats;
|
spraycumul host_stats;
|
||||||
sprayarr host_array;
|
sprayarr host_array;
|
||||||
CLIENT *cl;
|
CLIENT *cl;
|
||||||
@ -68,7 +70,6 @@ main(argc, argv)
|
|||||||
int length = 0;
|
int length = 0;
|
||||||
double xmit_time; /* time to receive data */
|
double xmit_time; /* time to receive data */
|
||||||
|
|
||||||
progname = *argv;
|
|
||||||
while ((c = getopt(argc, argv, "c:d:l:")) != -1) {
|
while ((c = getopt(argc, argv, "c:d:l:")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'c':
|
case 'c':
|
||||||
@ -123,7 +124,7 @@ main(argc, argv)
|
|||||||
/* create connection with server */
|
/* create connection with server */
|
||||||
cl = clnt_create(*argv, SPRAYPROG, SPRAYVERS, "udp");
|
cl = clnt_create(*argv, SPRAYPROG, SPRAYVERS, "udp");
|
||||||
if (cl == NULL) {
|
if (cl == NULL) {
|
||||||
clnt_pcreateerror(progname);
|
clnt_pcreateerror("spray");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +141,7 @@ main(argc, argv)
|
|||||||
|
|
||||||
/* Clear server statistics */
|
/* Clear server statistics */
|
||||||
if (clnt_call(cl, SPRAYPROC_CLEAR, xdr_void, NULL, xdr_void, NULL, TIMEOUT) != RPC_SUCCESS) {
|
if (clnt_call(cl, SPRAYPROC_CLEAR, xdr_void, NULL, xdr_void, NULL, TIMEOUT) != RPC_SUCCESS) {
|
||||||
clnt_perror(cl, progname);
|
clnt_perror(cl, "spray");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,7 +161,7 @@ main(argc, argv)
|
|||||||
|
|
||||||
/* Collect statistics from server */
|
/* Collect statistics from server */
|
||||||
if (clnt_call(cl, SPRAYPROC_GET, xdr_void, NULL, xdr_spraycumul, &host_stats, TIMEOUT) != RPC_SUCCESS) {
|
if (clnt_call(cl, SPRAYPROC_GET, xdr_void, NULL, xdr_spraycumul, &host_stats, TIMEOUT) != RPC_SUCCESS) {
|
||||||
clnt_perror(cl, progname);
|
clnt_perror(cl, "spray");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,9 +217,10 @@ print_xferstats(packets, packetlen, xfertime)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
static void
|
||||||
usage ()
|
usage ()
|
||||||
{
|
{
|
||||||
fprintf(stderr, "usage: spray [-c count] [-l length] [-d delay] host\n");
|
fprintf(stderr,
|
||||||
|
"usage: spray [-c count] [-l length] [-d delay] host\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user