Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ spray(3N) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

spray(1M)

sprayd(1M)

spray(3N)                                                         spray(3N)

NAME
     spray - scatter data in order to check the network

SYNOPSIS
     #include <rpcsvc/spray.h>

DESCRIPTION
     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
     clntcall() [see rpcclntcalls(3N)]. The protocol sends a packet to
     the called host. The host acknowledges receipt of the packet. The pro-
     tocol 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:

     SPRAYPROCCLEAR
          This procedure clears the counter.

     SPRAYPROCSPRAY
          This procedure sends the packet.

     SPRAYPROCGET
          This procedure returns the count and the amount of time since the
          last SPRAYPROCCLEAR.

     The following XDR routines are available in librpcsvc:

     xdrsprayarr
     xdrspraycumul






















Page 1                       Reliant UNIX 5.44                Printed 11/98

spray(3N)                                                         spray(3N)

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

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

      ...
             spraycumul      sprayresult;
             sprayarr        spraydata;
             char            buf[100];              /* arbitrary data */
             int             loop = 1000;

             CLIENT  *clnt;
             struct timeval timeout0 = {0, 0};
             struct timeval timeout25 = {25, 0};

             spraydata.sprayarrlen = (uint)100;
             spraydata.sprayarrval = buf;

             clnt = clntcreate("somehost", SPRAYPROG,
             SPRAYVERS, "netpath");
             if (clnt == (CLIENT *)NULL) {
                     /* handle this error */
             }
             if (clntcall(clnt, SPRAYPROCCLEAR,
                     xdrvoid, NULL, xdrvoid, NULL,
                     timeout25)) {
                             /* handle this error */
             }
             while (loop-- > 0) {
                     if (clntcall(clnt, SPRAYPROCSPRAY,
                             xdrsprayarr, &spraydata,
                             xdrvoid, NULL, timeout0)) {
                                     /* handle this error */
                     }
             }
             if (clntcall(clnt, SPRAYPROCGET,
                     xdrvoid, NULL, xdrspraycumul,
                     &sprayresult, timeout25)) {
                             /* handle this error */
             }
             printf("Acknowledged %ld of 1000 packets \
                     in %d secs %d usecs\n",
                     sprayresult.counter,
                     sprayresult.clock.sec,
                     sprayresult.clock.usec);

SEE ALSO
     spray(1M), sprayd(1M), rpcclntcalls(3N).




Page 2                       Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026