*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> spray (3n)              
Title
Content
Arch
Section
 

Contents


spray(3N)							     spray(3N)


NAME    [Toc]    [Back]

     spray - scatter data in order to check the	network

SYNOPSIS    [Toc]    [Back]

     #include <rpcsvc/spray.h>

DESCRIPTION    [Toc]    [Back]

     The spray protocol	sends packets to a given machine to test the speed and
     reliability of communications with	that machine.

     The spray protocol	is not a C function interface, per se, but can be
     accessed using the	generic	remote procedure calling interface clnt_call()
     [see rpc_clnt_calls(3N)].	The protocol sends a packet to the called
     host.  The	host acknowledges receipt of the packet.  The protocol counts
     the number	of acknowledgments and can return that count.

     The spray protocol	currently supports the following procedures, which
     should be called in the order given:

     SPRAYPROC_CLEAR
		 This procedure	clears the counter.

     SPRAYPROC_SPRAY
		 This procedure	sends the packet.

     SPRAYPROC_GET
		 This procedure	returns	the count and the amount of time since
		 the last SPRAYPROC_CLEAR.

     The following XDR routines	are available in librpcsvc:

     xdr_sprayarr
     xdr_spraycumul

EXAMPLE    [Toc]    [Back]

     The following code	fragment demonstrates how the spray protocol is	used:

     #include <rpc/rpc.h>
     #include <rpcsvc/spray.h>

      .	 .  .
	  spraycumul	 spray_result;
	  sprayarr  spray_data;
	  char	    buf[100];	   /* arbitrary	data */
	  int	    loop = 1000;
	  CLIENT    *clnt;
	  struct timeval timeout0 = {0,	0};
	  struct timeval timeout25 = {25, 0};

	  spray_data.sprayarr_len = (u_int)100;
	  spray_data.sprayarr_val = buf;

	  clnt = clnt_create("somehost", SPRAYPROG, SPRAYVERS, "netpath");


									Page 1






spray(3N)							     spray(3N)



	 if (clnt == (CLIENT *)NULL) {
	       /* handle this error */
	  }
	  if (clnt_call(clnt, SPRAYPROC_CLEAR,
	       xdr_void, NULL, xdr_void, NULL, timeout25)) {
		    /* handle this error */
	  }
	  while	(loop--	> 0) {
	       if (clnt_call(clnt, SPRAYPROC_SPRAY,
		    xdr_sprayarr, &spray_data, xdr_void, NULL, timeout0)) {
			 /* handle this	error */
	       }
	  }
	  if (clnt_call(clnt, SPRAYPROC_GET,
	       xdr_void, NULL, xdr_spraycumul, &spray_result, timeout25)) {
		    /* handle this error */
	  }
	  printf("Acknowledged %ld of 1000 packets in %d secs %d usecs\n",
	       spray_result.counter,
	       spray_result.clock.sec,
	       spray_result.clock.usec);

SEE ALSO    [Toc]    [Back]

      
      
     rpc_clnt_calls(3N), spray(1M), sprayd(1M)


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
htons Tru64 Convert an unsigned short (16-bit) integer from host byte order to network byte order
ntohl Tru64 Convert an unsigned 32-bit integer from Internet network byte order to host byte order
htonl NetBSD convert values between host and network byte order
htonl FreeBSD convert values between host and network byte order
byteorder FreeBSD convert values between host and network byte order
htons FreeBSD convert values between host and network byte order
ntohl FreeBSD convert values between host and network byte order
ntohs FreeBSD convert values between host and network byte order
ntohs NetBSD convert values between host and network byte order
ntohl NetBSD convert values between host and network byte order
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service