xref: /illumos-gate/usr/src/head/rpcsvc/spray.x (revision 0ccfe5834c3b867c1b6c273cae02ec8922bc0fd2)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 %/*
23 % * Copyright (c) 1987, 1991 by Sun Microsystems, Inc.
24 % */
25 
26 %/* from spray.x */
27 
28 /*
29  * Spray a server with packets
30  * Useful for testing flakiness of network interfaces
31  */
32 
33 const SPRAYMAX = 8845;	/* max amount can spray */
34 
35 /*
36  * GMT since 0:00, 1 January 1970
37  */
38 struct spraytimeval {
39 	unsigned int sec;
40 	unsigned int usec;
41 };
42 
43 /*
44  * spray statistics
45  */
46 struct spraycumul {
47 	unsigned int counter;
48 	spraytimeval clock;
49 };
50 
51 /*
52  * spray data
53  */
54 typedef opaque sprayarr<SPRAYMAX>;
55 
56 program SPRAYPROG {
57 	version SPRAYVERS {
58 		/*
59 		 * Just throw away the data and increment the counter
60 		 * This call never returns, so the client should always
61 		 * time it out.
62 		 */
63 		void
64 		SPRAYPROC_SPRAY(sprayarr) = 1;
65 
66 		/*
67 		 * Get the value of the counter and elapsed time  since
68 		 * last CLEAR.
69 		 */
70 		spraycumul
71 		SPRAYPROC_GET(void) = 2;
72 
73 		/*
74 		 * Clear the counter and reset the elapsed time
75 		 */
76 		void
77 		SPRAYPROC_CLEAR(void) = 3;
78 	} = 1;
79 } = 100012;
80