spray.x revision 1.4 1 1.1 jtc /*
2 1.1 jtc * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 1.1 jtc * unrestricted use provided that this legend is included on all tape
4 1.1 jtc * media and as a part of the software program in whole or part. Users
5 1.1 jtc * may copy or modify Sun RPC without charge, but are not authorized
6 1.1 jtc * to license or distribute it to anyone else except as part of a product or
7 1.1 jtc * program developed by the user.
8 1.4 simonb *
9 1.1 jtc * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 1.1 jtc * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11 1.1 jtc * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
12 1.4 simonb *
13 1.1 jtc * Sun RPC is provided with no support and without any obligation on the
14 1.1 jtc * part of Sun Microsystems, Inc. to assist in its use, correction,
15 1.1 jtc * modification or enhancement.
16 1.4 simonb *
17 1.1 jtc * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 1.1 jtc * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 1.1 jtc * OR ANY PART THEREOF.
20 1.4 simonb *
21 1.1 jtc * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 1.1 jtc * or profits or other special, indirect and consequential damages, even if
23 1.1 jtc * Sun has been advised of the possibility of such damages.
24 1.4 simonb *
25 1.1 jtc * Sun Microsystems, Inc.
26 1.1 jtc * 2550 Garcia Avenue
27 1.1 jtc * Mountain View, California 94043
28 1.1 jtc */
29 1.1 jtc
30 1.1 jtc /*
31 1.1 jtc * Spray a server with packets
32 1.1 jtc * Useful for testing flakiness of network interfaces
33 1.1 jtc */
34 1.1 jtc
35 1.1 jtc #ifndef RPC_HDR
36 1.3 lukem %#include <sys/cdefs.h>
37 1.1 jtc %#ifndef lint
38 1.1 jtc %/*static char sccsid[] = "from: @(#)spray.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
39 1.1 jtc %/*static char sccsid[] = "from: @(#)spray.x 2.1 88/08/01 4.0 RPCSRC";*/
40 1.4 simonb %__RCSID("$NetBSD: spray.x,v 1.4 1999/07/02 15:44:13 simonb Exp $");
41 1.1 jtc %#endif /* not lint */
42 1.1 jtc #endif
43 1.1 jtc
44 1.1 jtc #ifdef RPC_HDR
45 1.1 jtc %#ifndef _RPCSVC_SPRAY_H_
46 1.1 jtc %#define _RPCSVC_SPRAY_H_
47 1.1 jtc %
48 1.1 jtc #endif
49 1.1 jtc
50 1.1 jtc const SPRAYOVERHEAD = 86; /* size of rpc packet when size=0 */
51 1.1 jtc const SPRAYMAX = 8845; /* max amount can spray */
52 1.1 jtc
53 1.1 jtc
54 1.1 jtc /*
55 1.1 jtc * GMT since 0:00, 1 January 1970
56 1.1 jtc */
57 1.1 jtc struct spraytimeval {
58 1.1 jtc unsigned int sec;
59 1.1 jtc unsigned int usec;
60 1.1 jtc };
61 1.1 jtc
62 1.1 jtc /*
63 1.1 jtc * spray statistics
64 1.1 jtc */
65 1.1 jtc struct spraycumul {
66 1.1 jtc unsigned int counter;
67 1.1 jtc spraytimeval clock;
68 1.1 jtc };
69 1.1 jtc
70 1.1 jtc /*
71 1.1 jtc * spray data
72 1.1 jtc */
73 1.1 jtc typedef opaque sprayarr<SPRAYMAX>;
74 1.1 jtc
75 1.1 jtc program SPRAYPROG {
76 1.1 jtc version SPRAYVERS {
77 1.1 jtc /*
78 1.1 jtc * Just throw away the data and increment the counter
79 1.4 simonb * This call never returns, so the client should always
80 1.1 jtc * time it out.
81 1.1 jtc */
82 1.1 jtc void
83 1.1 jtc SPRAYPROC_SPRAY(sprayarr) = 1;
84 1.1 jtc
85 1.1 jtc /*
86 1.1 jtc * Get the value of the counter and elapsed time since
87 1.1 jtc * last CLEAR.
88 1.1 jtc */
89 1.4 simonb spraycumul
90 1.1 jtc SPRAYPROC_GET(void) = 2;
91 1.1 jtc
92 1.1 jtc /*
93 1.1 jtc * Clear the counter and reset the elapsed time
94 1.1 jtc */
95 1.1 jtc void
96 1.1 jtc SPRAYPROC_CLEAR(void) = 3;
97 1.1 jtc } = 1;
98 1.1 jtc } = 100012;
99 1.1 jtc
100 1.1 jtc
101 1.1 jtc #ifdef RPC_HDR
102 1.1 jtc %
103 1.1 jtc %#endif /* _RPCSVC_SPRAY_H_ */
104 1.1 jtc #endif
105