11832Swollman/* 21832Swollman * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 31832Swollman * unrestricted use provided that this legend is included on all tape 41832Swollman * media and as a part of the software program in whole or part. Users 51832Swollman * may copy or modify Sun RPC without charge, but are not authorized 61832Swollman * to license or distribute it to anyone else except as part of a product or 71832Swollman * program developed by the user. 81832Swollman * 91832Swollman * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 101832Swollman * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 111832Swollman * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 121832Swollman * 131832Swollman * Sun RPC is provided with no support and without any obligation on the 141832Swollman * part of Sun Microsystems, Inc. to assist in its use, correction, 151832Swollman * modification or enhancement. 161832Swollman * 171832Swollman * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 181832Swollman * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 191832Swollman * OR ANY PART THEREOF. 201832Swollman * 211832Swollman * In no event will Sun Microsystems, Inc. be liable for any lost revenue 221832Swollman * or profits or other special, indirect and consequential damages, even if 231832Swollman * Sun has been advised of the possibility of such damages. 241832Swollman * 251832Swollman * Sun Microsystems, Inc. 261832Swollman * 2550 Garcia Avenue 271832Swollman * Mountain View, California 94043 281832Swollman */ 291832Swollman 301832Swollman/* 311832Swollman * Spray a server with packets 321832Swollman * Useful for testing flakiness of network interfaces 331832Swollman */ 341832Swollman 351832Swollman#ifndef RPC_HDR 361832Swollman%#ifndef lint 371832Swollman%/*static char sccsid[] = "from: @(#)spray.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/ 381832Swollman%/*static char sccsid[] = "from: @(#)spray.x 2.1 88/08/01 4.0 RPCSRC";*/ 391832Swollman%#endif /* not lint */ 40114629Sobrien%#include <sys/cdefs.h> 41114629Sobrien%__FBSDID("$FreeBSD$"); 421832Swollman#endif 431832Swollman 441832Swollmanconst SPRAYMAX = 8845; /* max amount can spray */ 451832Swollman 461832Swollman/* 471832Swollman * GMT since 0:00, 1 January 1970 481832Swollman */ 491832Swollmanstruct spraytimeval { 501832Swollman unsigned int sec; 511832Swollman unsigned int usec; 521832Swollman}; 531832Swollman 541832Swollman/* 551832Swollman * spray statistics 561832Swollman */ 571832Swollmanstruct spraycumul { 581832Swollman unsigned int counter; 591832Swollman spraytimeval clock; 601832Swollman}; 611832Swollman 621832Swollman/* 631832Swollman * spray data 641832Swollman */ 651832Swollmantypedef opaque sprayarr<SPRAYMAX>; 661832Swollman 671832Swollmanprogram SPRAYPROG { 681832Swollman version SPRAYVERS { 691832Swollman /* 701832Swollman * Just throw away the data and increment the counter 711832Swollman * This call never returns, so the client should always 721832Swollman * time it out. 731832Swollman */ 741832Swollman void 751832Swollman SPRAYPROC_SPRAY(sprayarr) = 1; 761832Swollman 771832Swollman /* 781832Swollman * Get the value of the counter and elapsed time since 791832Swollman * last CLEAR. 801832Swollman */ 811832Swollman spraycumul 821832Swollman SPRAYPROC_GET(void) = 2; 831832Swollman 841832Swollman /* 851832Swollman * Clear the counter and reset the elapsed time 861832Swollman */ 871832Swollman void 881832Swollman SPRAYPROC_CLEAR(void) = 3; 891832Swollman } = 1; 901832Swollman} = 100012; 91