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