Warning, /include/rpcsvc/spray.x is written in an unsupported language. File is not indexed.
0001 /* @(#)spray.x 2.1 88/08/01 4.0 RPCSRC */
0002
0003 /*
0004 * Copyright (c) 2010, Oracle America, Inc.
0005 * Redistribution and use in source and binary forms, with or without
0006 * modification, are permitted provided that the following conditions are
0007 * met:
0008 *
0009 * * Redistributions of source code must retain the above copyright
0010 * notice, this list of conditions and the following disclaimer.
0011 * * Redistributions in binary form must reproduce the above
0012 * copyright notice, this list of conditions and the following
0013 * disclaimer in the documentation and/or other materials
0014 * provided with the distribution.
0015 * * Neither the name of the "Oracle America, Inc." nor the names of its
0016 * contributors may be used to endorse or promote products derived
0017 * from this software without specific prior written permission.
0018 *
0019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0020 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0021 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
0022 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
0023 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
0024 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0025 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
0026 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0027 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
0028 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0029 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0030 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0031 */
0032
0033 /*
0034 * Spray a server with packets
0035 * Useful for testing flakiness of network interfaces
0036 */
0037
0038 const SPRAYMAX = 8845; /* max amount can spray */
0039
0040 /*
0041 * GMT since 0:00, 1 January 1970
0042 */
0043 struct spraytimeval {
0044 unsigned int sec;
0045 unsigned int usec;
0046 };
0047
0048 /*
0049 * spray statistics
0050 */
0051 struct spraycumul {
0052 unsigned int counter;
0053 spraytimeval clock;
0054 };
0055
0056 /*
0057 * spray data
0058 */
0059 typedef opaque sprayarr<SPRAYMAX>;
0060
0061 program SPRAYPROG {
0062 version SPRAYVERS {
0063 /*
0064 * Just throw away the data and increment the counter
0065 * This call never returns, so the client should always
0066 * time it out.
0067 */
0068 void
0069 SPRAYPROC_SPRAY(sprayarr) = 1;
0070
0071 /*
0072 * Get the value of the counter and elapsed time since
0073 * last CLEAR.
0074 */
0075 spraycumul
0076 SPRAYPROC_GET(void) = 2;
0077
0078 /*
0079 * Clear the counter and reset the elapsed time
0080 */
0081 void
0082 SPRAYPROC_CLEAR(void) = 3;
0083 } = 1;
0084 } = 100012;