xref: /illumos-gate/usr/src/head/rpcsvc/spray.x (revision 581cede61ac9c14d8d4ea452562a567189eead78)
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 #ifdef RPC_HDR
29 %
30 %#pragma ident	"%Z%%M%	%I%	%E% SMI"
31 %
32 #endif
33 
34 /*
35  * Spray a server with packets
36  * Useful for testing flakiness of network interfaces
37  */
38 
39 const SPRAYMAX = 8845;	/* max amount can spray */
40 
41 /*
42  * GMT since 0:00, 1 January 1970
43  */
44 struct spraytimeval {
45 	unsigned int sec;
46 	unsigned int usec;
47 };
48 
49 /*
50  * spray statistics
51  */
52 struct spraycumul {
53 	unsigned int counter;
54 	spraytimeval clock;
55 };
56 
57 /*
58  * spray data
59  */
60 typedef opaque sprayarr<SPRAYMAX>;
61 
62 program SPRAYPROG {
63 	version SPRAYVERS {
64 		/*
65 		 * Just throw away the data and increment the counter
66 		 * This call never returns, so the client should always
67 		 * time it out.
68 		 */
69 		void
70 		SPRAYPROC_SPRAY(sprayarr) = 1;
71 
72 		/*
73 		 * Get the value of the counter and elapsed time  since
74 		 * last CLEAR.
75 		 */
76 		spraycumul
77 		SPRAYPROC_GET(void) = 2;
78 
79 		/*
80 		 * Clear the counter and reset the elapsed time
81 		 */
82 		void
83 		SPRAYPROC_CLEAR(void) = 3;
84 	} = 1;
85 } = 100012;
86