home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume39 / rperf / part01 < prev    next >
Encoding:
Text File  |  1993-08-30  |  56.2 KB  |  2,177 lines

  1. Newsgroups: comp.sources.misc
  2. From: fitz@rpi.edu (Brian P. Fitzgerald)
  3. Subject: v39i069:  rperf - performance monitoring of network hosts, v2.1, Part01/03
  4. Message-ID: <csm-v39i069=rperf.161619@sparky.Sterling.COM>
  5. X-Md4-Signature: 07434db7da1ed7a35bd1b3e8f403bc1a
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Rensselaer Polytechnic Institute, Troy NY
  8. Date: Mon, 30 Aug 1993 21:16:46 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: fitz@rpi.edu (Brian P. Fitzgerald)
  12. Posting-number: Volume 39, Issue 69
  13. Archive-name: rperf/part01
  14. Environment: UNIX
  15.  
  16. rperf is similar to xmeter, or SunView perfmeter, but is intended for
  17. use on ascii terminals or for logging.  rperf obtains system statistics
  18. from one or more network hosts and prints them to the standard output
  19. at periodic intervals, in a format similar to rup, vmstat, and
  20. netstat.  rperf reports on cpu load, disk activity, network interace
  21. activity, and virtual memory activity.
  22.  
  23. If invoked as "rup", it prints the uptime and system load.
  24.  
  25. Building:
  26.  
  27. Type "./configure", then "make".
  28.  
  29. Running:
  30.  
  31. Try "rperf" or "rperf <host>"
  32. Every monitored host must run rstatd.  Check with:
  33. rpcinfo -u <host> rstatd
  34.  
  35. Send bug reports and fixes to fitz@rpi.edu.
  36.  
  37. Runs on Sun, IBM, NeXT, HP, Alliant, IRIS, SCO.  If it runs on your
  38. machine, please tell me!
  39.  
  40. Brian
  41.  
  42. #! /bin/sh
  43. # This is a shell archive.  Remove anything before this line, then unpack
  44. # it by saving it into a file and typing "sh file".  To overwrite existing
  45. # files, type "sh file -c".  You can also feed this as standard input via
  46. # unshar, or by typing "sh <file", e.g..  The tool that generated this
  47. # shell archive is called "shar", and is available by anonymous ftp
  48. # from ftp.uu.net in subdirectory /usenet/comp.sources.unix, and from many
  49. # other places. Check 'archie' for the latest locations.  If this archive
  50. # is complete, you will see the following message at the end:
  51. #        "End of archive 1 (of 3)."
  52. # Contents:  README FAQ configure.in configure MANIFEST Makefile.in
  53. #   rstat.x rstat.h rstat_xdr.ed rstat_xdr.c rperf.8 strdup.c
  54. #   pathnames.h autoconf.1.3.patch PORTING
  55. # Wrapped by fitzgb@mml0.meche.rpi.edu on Mon Aug 30 15:01:20 1993
  56. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  57. if test -f 'README' -a "${1}" != "-c" ; then 
  58.   echo shar: Will not clobber existing file \"'README'\"
  59. else
  60. echo shar: Extracting \"'README'\" \(2959 characters\)
  61. sed "s/^X//" >'README' <<'END_OF_FILE'
  62. Xrperf README file
  63. X----- ------ ----
  64. X
  65. Xrperf is similar to xmeter, or SunView perfmeter, but is intended for
  66. Xuse on ascii terminals or for logging.  rperf obtains system statistics
  67. Xfrom one or more network hosts and prints them to the standard output
  68. Xat periodic intervals, in a format similar to rup, vmstat, and
  69. Xnetstat.  rperf reports on cpu load, disk activity, network interface
  70. Xactivity, and virtual memory activity.
  71. X
  72. XIf installed as rup, the program prints the hostname, uptime, and load
  73. Xaverage once, then exits.  A hard or symbolic link to rperf may be used
  74. Xfor the installation.
  75. X
  76. XBUILDING:
  77. X--------
  78. XType "./configure", then type "make".
  79. X
  80. XHINTS:
  81. X-----
  82. X-  Copious syntax errors:  you may need to force K&R style
  83. Xcompilation.  In the Makefile, try modifying CFLAGS appropriately for
  84. Xyour compiler.
  85. X
  86. X-  on many systems, the symbols _xdr_* and _clnt_* are defined in
  87. Xthe C library.  On other systems, the needed objects are in other
  88. Xlibraries, and must be specified on the link command line.
  89. X
  90. X-  If the symbols are not defined in any library on your system, you
  91. Xcan obtain the RPC library by anonymous ftp from wuarchive.wustl.edu in
  92. X/systems/sun/sun-exchange/rpc4.0
  93. X
  94. X-  if the client stubs provided do not compile on your machine, but you
  95. Xhave rpcgen (usually /bin/rpcgen), type "make gen" first.
  96. X
  97. X-  if your system needs rpc.rstatd, you may obtain it from wuarchive in
  98. Xthe rpcsvc subdirectory of the rpc4.0 package listed above.  You will
  99. Xneed rstat_proc.c, rstat.x, and Makefile.
  100. X
  101. XI would appreciate receiving patches from anyone who needed to modify
  102. Xthe sources or the Makefile to make the program compile on their
  103. Xmachine.  Patches should be sent to fitz@rpi.edu.
  104. X
  105. XRUNNING:
  106. X-------
  107. X
  108. Xtype "rperf" to monitor all hosts on the local net, or "rperf host ..."
  109. Xto monitor a particular list of hosts.
  110. X
  111. XEvery monitored host must run rstatd.  Check with:
  112. X
  113. Xrpcinfo -u <host> rstatd
  114. X
  115. XIf rstatd is not registered, uncomment rstatd from /etc/inetd.conf on
  116. Xthe host to be monitored, and send the inetd process a SIGHUP, as
  117. Xfollows:
  118. X
  119. Xps axc | grep inetd (note pid of inetd)
  120. Xkill -HUP <pid>
  121. X
  122. Xrs6000 users check your manual for the appropriate smit command.
  123. X
  124. XKNOWN PROBLEMS:
  125. X----- ---------
  126. X
  127. XThe first rstat reply from a newly started rpc.rstatd daemon on aix3.1
  128. Xis often incorrect.  As a result, the first cpu states display will be
  129. Xincorrect.
  130. X
  131. XBus Error.  On some systems, object code generated by gcc version 1.xx
  132. Xmay be incompatible with system libraries.  In particular, the use of
  133. Xgcc version 1 on sparc stations will result in a bus error in
  134. Xclntudp_create().  For sparcstations, use to cc to compile, or a more
  135. Xrecent version of gcc.
  136. X
  137. XBUG REPORTS:
  138. X-----------
  139. X
  140. XSend bug reports, fixes, comments, and suggestions to fitz@rpi.edu.
  141. X
  142. XPLATFORMS:
  143. X---------
  144. X
  145. XAlliant
  146. XAmiga
  147. XESIX
  148. XHP
  149. XIBM
  150. XIRIS
  151. XMIPS
  152. XNeXT
  153. XSCO
  154. XSun
  155. XUltrix ...
  156. X
  157. XIf it runs on your machine, please tell me!
  158. X
  159. XBrian P. Fitzgerald
  160. XMechanics of Materials Laboratory
  161. XRensselaer Polytechnic Institute
  162. XTroy, New York
  163. END_OF_FILE
  164. if test 2959 -ne `wc -c <'README'`; then
  165.     echo shar: \"'README'\" unpacked with wrong size!
  166. fi
  167. # end of 'README'
  168. fi
  169. if test -f 'FAQ' -a "${1}" != "-c" ; then 
  170.   echo shar: Will not clobber existing file \"'FAQ'\"
  171. else
  172. echo shar: Extracting \"'FAQ'\" \(630 characters\)
  173. sed "s/^X//" >'FAQ' <<'END_OF_FILE'
  174. XAnswers to frequently asked questions about rperf
  175. X
  176. X1)  Could rperf report additional kernel statistics?
  177. X
  178. XIt could be done.  rperf queries rpc.rstatd, the network kernel
  179. Xstatistics daemon.  Currently, rpc.rstatd reports the statistics listed
  180. Xin /usr/rpcsvc/rstat.x.  You could extend rstat.x and then modify
  181. Xrpc.rstatd and rperf
  182. X
  183. X2)  Can rperf broadcast on just one network interface?
  184. X
  185. XNot easily.  The rperf broadcast mode uses the clnt_broadcast() routine
  186. Xin the RPC library.  clnt_broadcast() does not broadcast on a single
  187. Xinterface.  To confine the broadcast to a single network, run rperf
  188. Xfrom a host other than the gateway.
  189. END_OF_FILE
  190. if test 630 -ne `wc -c <'FAQ'`; then
  191.     echo shar: \"'FAQ'\" unpacked with wrong size!
  192. fi
  193. # end of 'FAQ'
  194. fi
  195. if test -f 'configure.in' -a "${1}" != "-c" ; then 
  196.   echo shar: Will not clobber existing file \"'configure.in'\"
  197. else
  198. echo shar: Extracting \"'configure.in'\" \(1331 characters\)
  199. sed "s/^X//" >'configure.in' <<'END_OF_FILE'
  200. Xdnl Process this file with autoconf to produce a configure script.
  201. XAC_INIT(configure.in)
  202. X
  203. X# configure.in for rperf
  204. X#
  205. X# This program may be copied, redistributed in any form, source or 
  206. X# binary, and used for any purpose, provided this copyright notice is 
  207. X# retained. 
  208. X# 
  209. X#    @(#)configure.in    2.1 8/30/93 (c) Copyright Brian P. Fitzgerald 
  210. X#    Rensselaer Polytechnic Institute 
  211. X
  212. XAC_SUBST(PROGS)
  213. XAC_SUBST(LIBPROGS)
  214. XAC_SUBST(LIBC)
  215. XAC_SUBST(CLNT_LIBS)
  216. XAC_SUBST(CFLAGS)
  217. X
  218. XAC_PROG_CC
  219. Xgccv1=`${CC-cc} -v  2>&1 | grep 'gcc version 1'`
  220. Xif test -n "$gccv1" ; then
  221. X    echo "Caution:  $gccv1 detected."
  222. X    echo "Some system library objects may be incompatible."
  223. X    echo "Using cc"
  224. X    CC=cc
  225. Xfi
  226. XAC_PROG_CPP
  227. XAC_PROG_RANLIB
  228. Xdnl AC_GCC_TRADITIONAL
  229. XAC_AIX
  230. XAC_MINIX
  231. XAC_SCO_INTL
  232. XAC_ISC_POSIX
  233. XAC_STDC_HEADERS
  234. X
  235. XAC_RETSIGTYPE
  236. XAC_UNISTD_H
  237. XAC_TIMEZONE
  238. X
  239. XAC_HAVE_HEADERS(sys/termio.h sys/bsd_tty.h)
  240. X
  241. XAC_HAVE_LIBRARY(rpc)
  242. XAC_HAVE_LIBRARY(inet)
  243. XAC_HAVE_LIBRARY(socket)
  244. XAC_HAVE_LIBRARY(c_s)
  245. XAC_HAVE_LIBRARY(termcap,
  246. X[   DEFS="$DEFS -DHAVE_LIBTERMCAP=1"
  247. X   LIBS="${LIBS} -ltermcap"],
  248. X[LIBOBJS="$LIBOBJS termcap.o"])
  249. X
  250. XAC_REPLACE_FUNCS(strftime strdup)
  251. Xif test -n "$LIBOBJS" ; then
  252. X    LIBC="libc.a"
  253. Xfi
  254. XAC_HAVE_FUNCS(setlinebuf)
  255. X
  256. XAC_IRIX_SUN    dnl -lsun
  257. XAC_OUTPUT(Makefile)
  258. Xecho ""
  259. Xecho "Configuration complete."
  260. Xecho ""
  261. Xecho "Now type 'make' to build rperf."
  262. END_OF_FILE
  263. if test 1331 -ne `wc -c <'configure.in'`; then
  264.     echo shar: \"'configure.in'\" unpacked with wrong size!
  265. fi
  266. # end of 'configure.in'
  267. fi
  268. if test -f 'configure' -a "${1}" != "-c" ; then 
  269.   echo shar: Will not clobber existing file \"'configure'\"
  270. else
  271. echo shar: Extracting \"'configure'\" \(15061 characters\)
  272. sed "s/^X//" >'configure' <<'END_OF_FILE'
  273. X#!/bin/sh
  274. X# Guess values for system-dependent variables and create Makefiles.
  275. X# Generated automatically using autoconf.
  276. X# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  277. X
  278. X# This program is free software; you can redistribute it and/or modify
  279. X# it under the terms of the GNU General Public License as published by
  280. X# the Free Software Foundation; either version 2, or (at your option)
  281. X# any later version.
  282. X
  283. X# This program is distributed in the hope that it will be useful,
  284. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  285. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  286. X# GNU General Public License for more details.
  287. X
  288. X# You should have received a copy of the GNU General Public License
  289. X# along with this program; if not, write to the Free Software
  290. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  291. X
  292. X# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  293. X#        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  294. X# Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  295. X# --with-PACKAGE unless this script has special code to handle it.
  296. X
  297. X
  298. Xfor arg
  299. Xdo
  300. X  # Handle --exec-prefix with a space before the argument.
  301. X  if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  302. X  # Handle --host with a space before the argument.
  303. X  elif test x$next_host = xyes; then next_host=
  304. X  # Handle --prefix with a space before the argument.
  305. X  elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  306. X  # Handle --srcdir with a space before the argument.
  307. X  elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  308. X  else
  309. X    case $arg in
  310. X     # For backward compatibility, also recognize exact --exec_prefix.
  311. X     -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  312. X    exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  313. X     -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  314. X    next_exec_prefix=yes ;;
  315. X
  316. X     -gas | --gas | --ga | --g) ;;
  317. X
  318. X     -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  319. X     -host | --host | --hos | --ho | --h)
  320. X    next_host=yes ;;
  321. X
  322. X     -nfp | --nfp | --nf) ;;
  323. X
  324. X     -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  325. X        no_create=1 ;;
  326. X
  327. X     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  328. X    prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  329. X     -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  330. X    next_prefix=yes ;;
  331. X
  332. X     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  333. X    srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  334. X     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  335. X    next_srcdir=yes ;;
  336. X
  337. X     -with-* | --with-*)
  338. X       package=`echo $arg|sed 's/-*with-//'`
  339. X       # Delete all the valid chars; see if any are left.
  340. X       if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  341. X         echo "configure: $package: invalid package name" >&2; exit 1
  342. X       fi
  343. X       eval "with_`echo $package|sed s/-/_/g`=1" ;;
  344. X
  345. X     *) ;;
  346. X    esac
  347. X  fi
  348. Xdone
  349. X
  350. Xtrap 'rm -f conftest* core; exit 1' 1 3 15
  351. X
  352. Xrm -f conftest*
  353. Xcompile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  354. X
  355. X# A filename unique to this package, relative to the directory that
  356. X# configure is in, which we can look for to find out if srcdir is correct.
  357. Xunique_file=configure.in
  358. X
  359. X# Find the source files, if location was not specified.
  360. Xif test -z "$srcdir"; then
  361. X  srcdirdefaulted=yes
  362. X  # Try the directory containing this script, then `..'.
  363. X  prog=$0
  364. X  confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  365. X  test "X$confdir" = "X$prog" && confdir=.
  366. X  srcdir=$confdir
  367. X  if test ! -r $srcdir/$unique_file; then
  368. X    srcdir=..
  369. X  fi
  370. Xfi
  371. Xif test ! -r $srcdir/$unique_file; then
  372. X  if test x$srcdirdefaulted = xyes; then
  373. X    echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  374. X  else
  375. X    echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  376. X  fi
  377. X  exit 1
  378. Xfi
  379. X# Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  380. X# But we can't avoid them for `..', to make subdirectories work.
  381. Xcase $srcdir in
  382. X  .|/*|~*) ;;
  383. X  *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  384. Xesac
  385. X
  386. X
  387. X# configure.in for rperf
  388. X#
  389. X# This program may be copied, redistributed in any form, source or 
  390. X# binary, and used for any purpose, provided this copyright notice is 
  391. X# retained. 
  392. X# 
  393. X#    @(#)configure.in    2.1 8/30/93 (c) Copyright Brian P. Fitzgerald 
  394. X#    Rensselaer Polytechnic Institute 
  395. X
  396. X
  397. X
  398. X
  399. X
  400. X
  401. X
  402. Xif test -z "$CC"; then
  403. X  echo checking for gcc
  404. X  saveifs="$IFS"; IFS="${IFS}:"
  405. X  for dir in $PATH; do
  406. X    test -z "$dir" && dir=.
  407. X    if test -f $dir/gcc; then
  408. X      CC="gcc"
  409. X      break
  410. X    fi
  411. X  done
  412. X  IFS="$saveifs"
  413. Xfi
  414. Xtest -z "$CC" && CC="cc"
  415. X
  416. X# Find out if we are using GNU C, under whatever name.
  417. Xcat > conftest.c <<EOF
  418. X#ifdef __GNUC__
  419. X  yes
  420. X#endif
  421. XEOF
  422. X${CC-cc} -E conftest.c > conftest.out 2>&1
  423. Xif egrep yes conftest.out >/dev/null 2>&1; then
  424. X  GCC=1 # For later tests.
  425. Xfi
  426. Xrm -f conftest*
  427. X
  428. Xgccv1=`${CC-cc} -v  2>&1 | grep 'gcc version 1'`
  429. Xif test -n "$gccv1" ; then
  430. X    echo "Caution:  $gccv1 detected."
  431. X    echo "Some system library objects may be incompatible."
  432. X    echo "Using cc"
  433. X    CC=cc
  434. Xfi
  435. Xecho checking how to run the C preprocessor
  436. Xif test -z "$CPP"; then
  437. X  CPP='${CC-cc} -E'
  438. X  cat > conftest.c <<EOF
  439. X#include <stdio.h>
  440. XEOF
  441. Xerr=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  442. Xif test -z "$err"; then
  443. X  :
  444. Xelse
  445. X  CPP=/lib/cpp
  446. Xfi
  447. Xrm -f conftest*
  448. Xfi
  449. X
  450. Xif test -z "$RANLIB"; then
  451. X  echo checking for ranlib
  452. X  saveifs="$IFS"; IFS="${IFS}:"
  453. X  for dir in $PATH; do
  454. X    test -z "$dir" && dir=.
  455. X    if test -f $dir/ranlib; then
  456. X      RANLIB="ranlib"
  457. X      break
  458. X    fi
  459. X  done
  460. X  IFS="$saveifs"
  461. Xfi
  462. Xtest -z "$RANLIB" && RANLIB="@:"
  463. X
  464. Xecho checking for AIX
  465. Xcat > conftest.c <<EOF
  466. X#ifdef _AIX
  467. X  yes
  468. X#endif
  469. X
  470. XEOF
  471. Xeval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  472. Xif egrep "yes" conftest.out >/dev/null 2>&1; then
  473. X  DEFS="$DEFS -D_ALL_SOURCE=1"
  474. Xfi
  475. Xrm -f conftest*
  476. X
  477. X
  478. Xecho checking for minix/config.h
  479. Xcat > conftest.c <<EOF
  480. X#include <minix/config.h>
  481. XEOF
  482. Xerr=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  483. Xif test -z "$err"; then
  484. X  MINIX=1
  485. Xfi
  486. Xrm -f conftest*
  487. X
  488. X# The Minix shell can't assign to the same variable on the same line!
  489. Xif test -n "$MINIX"; then
  490. X  DEFS="$DEFS -D_POSIX_SOURCE=1"
  491. X  DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  492. X  DEFS="$DEFS -D_MINIX=1"
  493. Xfi
  494. X
  495. Xecho checking for SCO UNIX libintl
  496. Xcat > conftest.c <<EOF
  497. X#if defined(M_UNIX)
  498. X  yes
  499. X#endif
  500. X
  501. XEOF
  502. Xeval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  503. Xif egrep "yes" conftest.out >/dev/null 2>&1; then
  504. X  SCO_UNIX=1
  505. Xfi
  506. Xrm -f conftest*
  507. X
  508. Xtest -n "$SCO_UNIX" && test -f /lib/libintl.a &&
  509. X  LIBS="$LIBS -lintl" # For strftime.
  510. X
  511. Xecho checking for POSIXized ISC
  512. Xif test -d /etc/conf/kconfig.d &&
  513. X  grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  514. Xthen
  515. X  ISC=1 # If later tests want to check for ISC.
  516. X  DEFS="$DEFS -D_POSIX_SOURCE=1"
  517. X  if test -n "$GCC"; then
  518. X    CC="$CC -posix"
  519. X  else
  520. X    CC="$CC -Xp"
  521. X  fi
  522. Xfi
  523. X
  524. Xecho checking for ANSI C header files
  525. Xcat > conftest.c <<EOF
  526. X#include <stdlib.h>
  527. X#include <stdarg.h>
  528. X#include <string.h>
  529. X#include <float.h>
  530. XEOF
  531. Xerr=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  532. Xif test -z "$err"; then
  533. X  # SunOS string.h does not declare mem*, contrary to ANSI.
  534. Xecho '#include <string.h>' > conftest.c
  535. Xeval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  536. Xif egrep "memchr" conftest.out >/dev/null 2>&1; then
  537. X  # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  538. Xcat > conftest.c <<EOF
  539. X#include <ctype.h>
  540. X#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  541. X#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  542. X#define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  543. Xint main () { int i; for (i = 0; i < 256; i++)
  544. Xif (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  545. Xexit (0); }
  546. X
  547. XEOF
  548. Xeval $compile
  549. Xif test -s conftest && (./conftest; exit) 2>/dev/null; then
  550. X  DEFS="$DEFS -DSTDC_HEADERS=1"
  551. Xfi
  552. Xrm -f conftest*
  553. Xfi
  554. Xrm -f conftest*
  555. X
  556. Xfi
  557. Xrm -f conftest*
  558. X
  559. X
  560. Xecho checking for return type of signal handlers
  561. Xcat > conftest.c <<EOF
  562. X#include <sys/types.h>
  563. X#include <signal.h>
  564. X#ifdef signal
  565. X#undef signal
  566. X#endif
  567. Xextern void (*signal ()) ();
  568. Xmain() { exit(0); } 
  569. Xt() { int i; }
  570. XEOF
  571. Xif eval $compile; then
  572. X  DEFS="$DEFS -DRETSIGTYPE=void"
  573. Xelse
  574. X  DEFS="$DEFS -DRETSIGTYPE=int"
  575. Xfi
  576. Xrm -f conftest*
  577. X
  578. X
  579. Xecho checking for unistd.h
  580. Xcat > conftest.c <<EOF
  581. X#include <unistd.h>
  582. XEOF
  583. Xerr=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  584. Xif test -z "$err"; then
  585. X  DEFS="$DEFS -DHAVE_UNISTD_H=1"
  586. Xfi
  587. Xrm -f conftest*
  588. X
  589. Xecho checking for struct tm in time.h
  590. Xcat > conftest.c <<EOF
  591. X#include <sys/types.h>
  592. X#include <time.h>
  593. Xmain() { exit(0); } 
  594. Xt() { struct tm *tp; }
  595. XEOF
  596. Xif eval $compile; then
  597. X  :
  598. Xelse
  599. X  DEFS="$DEFS -DTM_IN_SYS_TIME=1"
  600. Xfi
  601. Xrm -f conftest*
  602. X
  603. Xdecl='#include <sys/types.h>
  604. X'
  605. Xcase "$DEFS" in
  606. X  *TM_IN_SYS_TIME*) decl="$decl#include <sys/time.h>
  607. X" ;;
  608. X  *) decl="$decl#include <time.h>
  609. X" ;;
  610. Xesac
  611. Xecho checking for tm_zone in struct tm
  612. Xcat > conftest.c <<EOF
  613. X$decl
  614. Xmain() { exit(0); } 
  615. Xt() { struct tm tm; tm.tm_zone; }
  616. XEOF
  617. Xif eval $compile; then
  618. X  DEFS="$DEFS -DHAVE_TM_ZONE=1"
  619. Xelse
  620. X  no_tm_zone=1
  621. Xfi
  622. Xrm -f conftest*
  623. X
  624. Xif test -n "$no_tm_zone"; then
  625. Xecho checking for tzname
  626. Xcat > conftest.c <<EOF
  627. X#include <time.h>
  628. X#ifndef tzname /* For SGI.  */
  629. Xchangequote(,)dnl
  630. Xextern char *tzname[]; /* RS6000 and others want it this way.  */
  631. Xchangequote([,])dnl
  632. X#endif
  633. Xmain() { exit(0); } 
  634. Xt() { atoi(*tzname); }
  635. XEOF
  636. Xif eval $compile; then
  637. X  DEFS="$DEFS -DHAVE_TZNAME=1"
  638. Xfi
  639. Xrm -f conftest*
  640. X
  641. Xfi
  642. X
  643. X
  644. Xfor hdr in sys/termio.h sys/bsd_tty.h
  645. Xdo
  646. Xtrhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  647. Xecho checking for ${hdr}
  648. Xcat > conftest.c <<EOF
  649. X#include <${hdr}>
  650. XEOF
  651. Xerr=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  652. Xif test -z "$err"; then
  653. X  DEFS="$DEFS -D${trhdr}=1"
  654. Xfi
  655. Xrm -f conftest*
  656. Xdone
  657. X
  658. X
  659. Xlibname=`echo "rpc" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
  660. XLIBS_save="${LIBS}"
  661. XLIBS="${LIBS} -l${libname}"
  662. Xhave_lib=""
  663. Xecho checking for -lrpc
  664. Xcat > conftest.c <<EOF
  665. X
  666. Xmain() { exit(0); } 
  667. Xt() { main(); }
  668. XEOF
  669. Xif eval $compile; then
  670. X  have_lib="1"
  671. Xfi
  672. Xrm -f conftest*
  673. XLIBS="${LIBS_save}"
  674. Xif test -n "${have_lib}"; then
  675. X      deflibname=`echo "${libname}" | tr '[a-z]' '[A-Z]'`
  676. X      DEFS="$DEFS -DHAVE_LIB${deflibname}=1"
  677. X   LIBS="${LIBS} -l${libname}"
  678. Xfi
  679. X
  680. Xlibname=`echo "inet" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
  681. XLIBS_save="${LIBS}"
  682. XLIBS="${LIBS} -l${libname}"
  683. Xhave_lib=""
  684. Xecho checking for -linet
  685. Xcat > conftest.c <<EOF
  686. X
  687. Xmain() { exit(0); } 
  688. Xt() { main(); }
  689. XEOF
  690. Xif eval $compile; then
  691. X  have_lib="1"
  692. Xfi
  693. Xrm -f conftest*
  694. XLIBS="${LIBS_save}"
  695. Xif test -n "${have_lib}"; then
  696. X      deflibname=`echo "${libname}" | tr '[a-z]' '[A-Z]'`
  697. X      DEFS="$DEFS -DHAVE_LIB${deflibname}=1"
  698. X   LIBS="${LIBS} -l${libname}"
  699. Xfi
  700. X
  701. Xlibname=`echo "socket" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
  702. XLIBS_save="${LIBS}"
  703. XLIBS="${LIBS} -l${libname}"
  704. Xhave_lib=""
  705. Xecho checking for -lsocket
  706. Xcat > conftest.c <<EOF
  707. X
  708. Xmain() { exit(0); } 
  709. Xt() { main(); }
  710. XEOF
  711. Xif eval $compile; then
  712. X  have_lib="1"
  713. Xfi
  714. Xrm -f conftest*
  715. XLIBS="${LIBS_save}"
  716. Xif test -n "${have_lib}"; then
  717. X      deflibname=`echo "${libname}" | tr '[a-z]' '[A-Z]'`
  718. X      DEFS="$DEFS -DHAVE_LIB${deflibname}=1"
  719. X   LIBS="${LIBS} -l${libname}"
  720. Xfi
  721. X
  722. Xlibname=`echo "c_s" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
  723. XLIBS_save="${LIBS}"
  724. XLIBS="${LIBS} -l${libname}"
  725. Xhave_lib=""
  726. Xecho checking for -lc_s
  727. Xcat > conftest.c <<EOF
  728. X
  729. Xmain() { exit(0); } 
  730. Xt() { main(); }
  731. XEOF
  732. Xif eval $compile; then
  733. X  have_lib="1"
  734. Xfi
  735. Xrm -f conftest*
  736. XLIBS="${LIBS_save}"
  737. Xif test -n "${have_lib}"; then
  738. X      deflibname=`echo "${libname}" | tr '[a-z]' '[A-Z]'`
  739. X      DEFS="$DEFS -DHAVE_LIB${deflibname}=1"
  740. X   LIBS="${LIBS} -l${libname}"
  741. Xfi
  742. X
  743. Xlibname=`echo "termcap" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
  744. XLIBS_save="${LIBS}"
  745. XLIBS="${LIBS} -l${libname}"
  746. Xhave_lib=""
  747. Xecho checking for -ltermcap
  748. Xcat > conftest.c <<EOF
  749. X
  750. Xmain() { exit(0); } 
  751. Xt() { main(); }
  752. XEOF
  753. Xif eval $compile; then
  754. X  have_lib="1"
  755. Xfi
  756. Xrm -f conftest*
  757. XLIBS="${LIBS_save}"
  758. Xif test -n "${have_lib}"; then
  759. X   :;    DEFS="$DEFS -DHAVE_LIBTERMCAP=1"
  760. X   LIBS="${LIBS} -ltermcap"
  761. Xelse
  762. X   :; LIBOBJS="$LIBOBJS termcap.o"
  763. Xfi
  764. X
  765. X
  766. Xfor func in strftime strdup
  767. Xdo
  768. Xecho checking for ${func}
  769. Xcat > conftest.c <<EOF
  770. X
  771. Xmain() { exit(0); } 
  772. Xt() { 
  773. X/* Override any gcc2 internal prototype to avoid an error.  */
  774. Xextern char ${func}(); ${func}(); }
  775. XEOF
  776. Xif eval $compile; then
  777. X  :
  778. Xelse
  779. X  LIBOBJS="$LIBOBJS ${func}.o"
  780. Xfi
  781. Xrm -f conftest*
  782. X
  783. Xdone
  784. X
  785. Xif test -n "$LIBOBJS" ; then
  786. X    LIBC="libc.a"
  787. Xfi
  788. Xfor func in setlinebuf
  789. Xdo
  790. Xtrfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  791. Xecho checking for ${func}
  792. Xcat > conftest.c <<EOF
  793. X#include <stdio.h>
  794. Xmain() { exit(0); } 
  795. Xt() { 
  796. X#ifdef __stub_${func}
  797. Xchoke me
  798. X#else
  799. X/* Override any gcc2 internal prototype to avoid an error.  */
  800. Xextern char ${func}(); ${func}();
  801. X#endif
  802. X }
  803. XEOF
  804. Xif eval $compile; then
  805. X  DEFS="$DEFS -D${trfunc}=1"
  806. Xfi
  807. Xrm -f conftest*
  808. X#endif
  809. Xdone
  810. X
  811. X
  812. Xecho checking for IRIX libsun
  813. Xif test -f /usr/lib/libsun.a; then
  814. X  LIBS="$LIBS -lsun"
  815. Xfi
  816. X    if test -n "$prefix"; then
  817. X  test -z "$exec_prefix" && exec_prefix='${prefix}'
  818. X  prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  819. Xfi
  820. Xif test -n "$exec_prefix"; then
  821. X  prsub="$prsub
  822. Xs%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  823. Xexec_prefix\\1=\\2$exec_prefix%"
  824. Xfi
  825. X
  826. Xtrap 'rm -f config.status; exit 1' 1 3 15
  827. Xecho creating config.status
  828. Xrm -f config.status
  829. Xcat > config.status <<EOF
  830. X#!/bin/sh
  831. X# Generated automatically by configure.
  832. X# Run this file to recreate the current configuration.
  833. X# This directory was configured as follows,
  834. X# on host `(hostname || uname -n) 2>/dev/null`:
  835. X#
  836. X# $0 $*
  837. X
  838. Xfor arg
  839. Xdo
  840. X  case "\$arg" in
  841. X    -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  842. X    exec /bin/sh $0 $* ;;
  843. X    *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  844. X  esac
  845. Xdone
  846. X
  847. Xtrap 'rm -f Makefile; exit 1' 1 3 15
  848. XPROGS='$PROGS'
  849. XLIBPROGS='$LIBPROGS'
  850. XLIBC='$LIBC'
  851. XCLNT_LIBS='$CLNT_LIBS'
  852. XCFLAGS='$CFLAGS'
  853. XCC='$CC'
  854. XCPP='$CPP'
  855. XRANLIB='$RANLIB'
  856. XLIBOBJS='$LIBOBJS'
  857. XLIBS='$LIBS'
  858. Xsrcdir='$srcdir'
  859. XDEFS='$DEFS'
  860. Xprefix='$prefix'
  861. Xexec_prefix='$exec_prefix'
  862. Xprsub='$prsub'
  863. XEOF
  864. Xcat >> config.status <<\EOF
  865. X
  866. Xtop_srcdir=$srcdir
  867. Xfor file in .. Makefile; do if [ "x$file" != "x.." ]; then
  868. X  srcdir=$top_srcdir
  869. X  # Remove last slash and all that follows it.  Not all systems have dirname.
  870. X  dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  871. X  if test "$dir" != "$file"; then
  872. X    test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  873. X    test ! -d $dir && mkdir $dir
  874. X  fi
  875. X  echo creating $file
  876. X  rm -f $file
  877. X  echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  878. X  sed -e "
  879. X$prsub
  880. Xs%@PROGS@%$PROGS%g
  881. Xs%@LIBPROGS@%$LIBPROGS%g
  882. Xs%@LIBC@%$LIBC%g
  883. Xs%@CLNT_LIBS@%$CLNT_LIBS%g
  884. Xs%@CFLAGS@%$CFLAGS%g
  885. Xs%@CC@%$CC%g
  886. Xs%@CPP@%$CPP%g
  887. Xs%@RANLIB@%$RANLIB%g
  888. Xs%@LIBOBJS@%$LIBOBJS%g
  889. Xs%@LIBS@%$LIBS%g
  890. Xs%@srcdir@%$srcdir%g
  891. Xs%@DEFS@%$DEFS%
  892. X" $top_srcdir/${file}.in >> $file
  893. Xfi; done
  894. X
  895. XEOF
  896. Xchmod +x config.status
  897. Xtest -n "$no_create" || ./config.status
  898. X
  899. Xecho ""
  900. Xecho "Configuration complete."
  901. Xecho ""
  902. Xecho "Now type 'make' to build rperf."
  903. END_OF_FILE
  904. if test 15061 -ne `wc -c <'configure'`; then
  905.     echo shar: \"'configure'\" unpacked with wrong size!
  906. fi
  907. chmod +x 'configure'
  908. # end of 'configure'
  909. fi
  910. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  911.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  912. else
  913. echo shar: Extracting \"'MANIFEST'\" \(803 characters\)
  914. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  915. X   File Name        Archive #    Description
  916. X-----------------------------------------------------------
  917. X README                     1    
  918. X FAQ                        1    
  919. X configure.in               1    
  920. X configure                  1    Type "sh ./configure".  Then "make"
  921. X MANIFEST                   1    This shipping list
  922. X Makefile.in                1    
  923. X rstat.x                    1    
  924. X rstat.h                    1    
  925. X rstat_xdr.ed               1    
  926. X rstat_xdr.c                1    
  927. X rperf.8                    1    
  928. X rperf.c                    2    
  929. X strdup.c                   1    Not found on all systems
  930. X strftime.c                 3    Not found on all systems
  931. X termcap.c                  2    Not found on all systems
  932. X pathnames.h                1    Not found on all systems
  933. X autoconf.1.3.patch         1    
  934. X PORTING                    1    
  935. END_OF_FILE
  936. if test 803 -ne `wc -c <'MANIFEST'`; then
  937.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  938. fi
  939. # end of 'MANIFEST'
  940. fi
  941. if test -f 'Makefile.in' -a "${1}" != "-c" ; then 
  942.   echo shar: Will not clobber existing file \"'Makefile.in'\"
  943. else
  944. echo shar: Extracting \"'Makefile.in'\" \(2991 characters\)
  945. sed "s/^X//" >'Makefile.in' <<'END_OF_FILE'
  946. X# Makefile for rperf
  947. X#
  948. X# This program may be copied, redistributed in any form, source or 
  949. X# binary, and used for any purpose, provided this copyright notice is 
  950. X# retained. 
  951. X# 
  952. X#    @(#)Makefile.in    2.1 8/30/93 (c) Copyright Brian P. Fitzgerald 
  953. X#    Rensselaer Polytechnic Institute 
  954. X
  955. XCLNT_PROG    = rperf
  956. XCLNT_SRCS    = rperf.c rstat_xdr.c
  957. XCLNT_OBJS    = rperf.o rstat_xdr.o
  958. XCLNT_LIBS    = @CLNT_LIBS@
  959. X
  960. XLIBS        = @LIBC@ @LIBS@
  961. X
  962. XGEN_SRCS    = rstat_clnt.c rstat_svc.c rstat_xdr.c rstat.h
  963. XGEN_OBJS    = rstat_xdr.o
  964. X
  965. XDBG_OBJS    = /usr/lib/debug/malloc.o /usr/lib/debug/mallocmap.o
  966. X
  967. XDEFS        = @DEFS@
  968. X
  969. XCFLAGS        = -g $(DEFS) @CFLAGS@
  970. XCFLAGS        = -O $(DEFS) @CFLAGS@
  971. X
  972. X# Caution:  On some systems, object code generated by gcc version 1.xx
  973. X# may be incompatible with system libraries.  In particular, the use
  974. X# of gcc version 1 on sparc stastions will result in a bus error in
  975. X# clntudp_create().
  976. X
  977. XCC        = @CC@
  978. XCOMPILE.c    = $(CC) $(CFLAGS) $(CPPFLAGS) -c
  979. XLINK.c        = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
  980. XRM        = rm -f
  981. XMAKE        = make
  982. X
  983. Xprefix        = /depot/rperf
  984. Xexec_prefix    = $(prefix)
  985. X
  986. XBIN        = $(exec_prefix)/arch/bin
  987. XMAN        = $(prefix)/man
  988. X
  989. X$(CLNT_PROG): $(CLNT_OBJS) @LIBC@
  990. X    $(LINK.c) -o $@ $(CLNT_OBJS) $(LIBS) $(CLNT_LIBS)
  991. X
  992. Xall: $(CLNT_PROG)
  993. X
  994. X
  995. Xlibc.a:    @LIBOBJS@
  996. X    ar rv libc.a @LIBOBJS@
  997. X    @RANLIB@ libc.a
  998. X
  999. X# usage: make dbg
  1000. X#     make TARGET=all dbg
  1001. X# etc..
  1002. Xdbg: 
  1003. X    $(MAKE) $(TARGET) "DEFS=$(DEFS) -DDEBUG" "CLNT_OBJS=$(CLNT_OBJS) $(DBG_OBJS)" "LIBS=$(LIBS) /depot/rpc/arch/lib/librpclib.a"
  1004. X
  1005. X# force K&R compilation
  1006. Xiris: 
  1007. X    $(MAKE) $(TARGET) "CFLAGS=$(CFLAGS) -cckr"
  1008. X
  1009. Xamiga:
  1010. X    $(MAKE) $(TARGET) "LIBS=$(LIBS) -ltermcap -lnsl -lsocket -lc -lucb"
  1011. X
  1012. Xesix:
  1013. X    $(MAKE) $(TARGET) "CC=PATH=/usr/ucb:${PATH} cc"
  1014. X
  1015. X# compile with the AIX stdc compiler
  1016. Xstdc: 
  1017. X    $(MAKE) $(TARGET) "CFLAGS=$(CFLAGS) -qlanglvl=ansi"
  1018. X
  1019. Xinstall:
  1020. X    cp $(CLNT_PROG) $(BIN)
  1021. X    cp rperf.8 $(MAN)/man8
  1022. X    tbl $(MAN)/man8/rperf.8 | nroff -man > $(MAN)/cat8/rperf.8
  1023. X
  1024. X# this will fail if rpcgen does not exist, or if -I is not supported
  1025. XRPCGEN_OK= @echo Checking that you can replace rpcgen output ; \
  1026. X    rpcgen -I -s udp rstat.x > /dev/null 2>&1
  1027. X
  1028. Xgen: rstat.x
  1029. X    $(RPCGEN_OK)
  1030. X    rpcgen -I rstat.x
  1031. X    ed < rstat_xdr.ed rstat_xdr.c
  1032. X
  1033. XMakefile: Makefile.in config.status
  1034. X    sh ./config.status
  1035. X
  1036. Xconfigure: configure.in
  1037. X    autoconf
  1038. X
  1039. Xconfig.status: configure
  1040. X    sh ./configure
  1041. X
  1042. Xshar: configure rstat_xdr.c rstat.h
  1043. X    makekit -p -npart -m -t "Now do 'sh ./configure'"
  1044. X
  1045. Xmc:    mostlyclean
  1046. Xmostlyclean:
  1047. X    $(RM) a.out $(CLNT_PROG) *.BAK typescript
  1048. X
  1049. Xclean: mostlyclean
  1050. X    $(RM) *.ln *.o core libc.a
  1051. X
  1052. Xdistclean: clean
  1053. X    $(RM) Makefile config.status *part* tags
  1054. X
  1055. Xwayclean: distclean
  1056. X    $(RM) configure
  1057. X    $(RPCGEN_OK)
  1058. X    $(RM) $(GEN_SRCS)
  1059. X
  1060. X# development
  1061. X
  1062. XLINTFLAGS    = $(DEFS)
  1063. XLINT        = lint
  1064. XLINT.c        = $(LINT) $(LINTFLAGS) $(CPPFLAGS)
  1065. XCLNT_LNS    = rperf.ln strftime.ln strdup.ln rstat_xdr.ln termcap.ln
  1066. XGEN_LNS        = rstat_xdr.ln
  1067. X
  1068. Xlint: $(CLNT_LNS)
  1069. X    $(LINT.c) $(CLNT_LNS) $(CLNT_LIBS)
  1070. X
  1071. X# deps
  1072. Xrperf.o:    rstat.h
  1073. Xrperf.ln:    rstat.h
  1074. Xrstat_xdr.o:    rstat_xdr.ed
  1075. X$(GEN_OBJS):    rstat.h
  1076. X$(GEN_LNS):    rstat.h
  1077. Xtermcap.o:    pathnames.h
  1078. Xtermcap.ln:    pathnames.h
  1079. END_OF_FILE
  1080. if test 2991 -ne `wc -c <'Makefile.in'`; then
  1081.     echo shar: \"'Makefile.in'\" unpacked with wrong size!
  1082. fi
  1083. # end of 'Makefile.in'
  1084. fi
  1085. if test -f 'rstat.x' -a "${1}" != "-c" ; then 
  1086.   echo shar: Will not clobber existing file \"'rstat.x'\"
  1087. else
  1088. echo shar: Extracting \"'rstat.x'\" \(4394 characters\)
  1089. sed "s/^X//" >'rstat.x' <<'END_OF_FILE'
  1090. X/* @(#)rstat.x    2.2 88/08/01 4.0 RPCSRC */
  1091. X/* @(#)rstat.x 1.2 87/09/18 Copyr 1987 Sun Micro */
  1092. X
  1093. X/*
  1094. X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  1095. X * unrestricted use provided that this legend is included on all tape
  1096. X * media and as a part of the software program in whole or part.  Users
  1097. X * may copy or modify Sun RPC without charge, but are not authorized
  1098. X * to license or distribute it to anyone else except as part of a product or
  1099. X * program developed by the user.
  1100. X * 
  1101. X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  1102. X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  1103. X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  1104. X * 
  1105. X * Sun RPC is provided with no support and without any obligation on the
  1106. X * part of Sun Microsystems, Inc. to assist in its use, correction,
  1107. X * modification or enhancement.
  1108. X * 
  1109. X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  1110. X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  1111. X * OR ANY PART THEREOF.
  1112. X * 
  1113. X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  1114. X * or profits or other special, indirect and consequential damages, even if
  1115. X * Sun has been advised of the possibility of such damages.
  1116. X * 
  1117. X * Sun Microsystems, Inc.
  1118. X * 2550 Garcia Avenue
  1119. X * Mountain View, California  94043
  1120. X */
  1121. X
  1122. X/*
  1123. X * Gather statistics on remote machines
  1124. X */
  1125. X
  1126. X#ifdef RPC_HDR
  1127. X
  1128. X%#ifndef FSCALE
  1129. X%/*
  1130. X% * Scale factor for scaled integers used to count load averages.
  1131. X% */
  1132. X%#define FSHIFT  8               /* bits to right of fixed binary point */
  1133. X%#define FSCALE  (1<<FSHIFT)
  1134. X%
  1135. X%#endif /* ndef FSCALE */
  1136. X
  1137. X#endif /* def RPC_HDR */
  1138. X
  1139. Xconst CPUSTATES_ORIG = 4;
  1140. Xconst CPUSTATES_VAR = 4;
  1141. Xconst DK_NDRIVE_ORIG = 4;    /* max drives for rstatprog versions 1-3 */
  1142. Xconst DK_NDRIVE_VAR = 32;    /* max drives for rstatprog version 4 */
  1143. X
  1144. X/*
  1145. X * GMT since 0:00, January 1, 1970
  1146. X */
  1147. Xstruct rstat_timeval {
  1148. X    unsigned int tv_sec;    /* seconds */
  1149. X    unsigned int tv_usec;    /* and microseconds */
  1150. X};
  1151. X
  1152. Xstruct statsvar {                /* version 4 */
  1153. X    int cp_time<CPUSTATES_VAR>;
  1154. X    int dk_xfer<DK_NDRIVE_VAR>;
  1155. X    u_int v_pgpgin;
  1156. X    u_int v_pgpgout;
  1157. X    u_int v_pswpin;
  1158. X    u_int v_pswpout;
  1159. X    u_int v_intr;
  1160. X    int if_ipackets;
  1161. X    int if_ierrors;
  1162. X    int if_opackets;
  1163. X    int if_oerrors;
  1164. X    int if_collisions;
  1165. X    u_int v_swtch;
  1166. X    long avenrun[3];
  1167. X    rstat_timeval boottime;
  1168. X    rstat_timeval curtime;
  1169. X};
  1170. X
  1171. Xstruct statstime {                /* RSTATVERS_TIME */
  1172. X    int cp_time[CPUSTATES_ORIG];
  1173. X    int dk_xfer[DK_NDRIVE_ORIG];
  1174. X    unsigned int v_pgpgin;    /* these are cumulative sum */
  1175. X    unsigned int v_pgpgout;
  1176. X    unsigned int v_pswpin;
  1177. X    unsigned int v_pswpout;
  1178. X    unsigned int v_intr;
  1179. X    int if_ipackets;
  1180. X    int if_ierrors;
  1181. X    int if_oerrors;
  1182. X    int if_collisions;
  1183. X    unsigned int v_swtch;
  1184. X    int avenrun[3];         /* scaled by FSCALE */
  1185. X    rstat_timeval boottime;
  1186. X    rstat_timeval curtime;
  1187. X    int if_opackets;
  1188. X};
  1189. X
  1190. Xstruct statsswtch {            /* RSTATVERS_SWTCH */
  1191. X    int cp_time[CPUSTATES_ORIG];
  1192. X    int dk_xfer[DK_NDRIVE_ORIG];
  1193. X    unsigned int v_pgpgin;    /* these are cumulative sum */
  1194. X    unsigned int v_pgpgout;
  1195. X    unsigned int v_pswpin;
  1196. X    unsigned int v_pswpout;
  1197. X    unsigned int v_intr;
  1198. X    int if_ipackets;
  1199. X    int if_ierrors;
  1200. X    int if_oerrors;
  1201. X    int if_collisions;
  1202. X    unsigned int v_swtch;
  1203. X    unsigned int avenrun[3];/* scaled by FSCALE */
  1204. X    rstat_timeval boottime;
  1205. X    int if_opackets;
  1206. X};
  1207. X
  1208. Xstruct stats {                /* RSTATVERS_ORIG */
  1209. X    int cp_time[CPUSTATES_ORIG];
  1210. X    int dk_xfer[DK_NDRIVE_ORIG];
  1211. X    unsigned int v_pgpgin;    /* these are cumulative sum */
  1212. X    unsigned int v_pgpgout;
  1213. X    unsigned int v_pswpin;
  1214. X    unsigned int v_pswpout;
  1215. X    unsigned int v_intr;
  1216. X    int if_ipackets;
  1217. X    int if_ierrors;
  1218. X    int if_oerrors;
  1219. X    int if_collisions;
  1220. X    int if_opackets;
  1221. X};
  1222. X
  1223. X
  1224. Xprogram RSTATPROG {
  1225. X    /*
  1226. X     * variable number of disks and cpu states
  1227. X     */
  1228. X    version RSTATVERS_VAR {
  1229. X        statsvar
  1230. X        RSTATPROC_STATS(void) = 1;
  1231. X
  1232. X        unsigned int
  1233. X        RSTATPROC_HAVEDISK(void) = 2;
  1234. X    } = 4;
  1235. X    /*
  1236. X     * version includes current time and context switching info
  1237. X     */
  1238. X    version RSTATVERS_TIME {
  1239. X        statstime
  1240. X        RSTATPROC_STATS(void) = 1;
  1241. X
  1242. X        unsigned int
  1243. X        RSTATPROC_HAVEDISK(void) = 2;
  1244. X    } = 3;
  1245. X    /*
  1246. X     * Does not have current time
  1247. X     */
  1248. X    version RSTATVERS_SWTCH {
  1249. X        statsswtch
  1250. X        RSTATPROC_STATS(void) = 1;
  1251. X
  1252. X        unsigned int
  1253. X        RSTATPROC_HAVEDISK(void) = 2;
  1254. X    } = 2;
  1255. X    /*
  1256. X     * Old version has no info about current time or context switching
  1257. X     */
  1258. X    version RSTATVERS_ORIG {
  1259. X        stats
  1260. X        RSTATPROC_STATS(void) = 1;
  1261. X
  1262. X        unsigned int
  1263. X        RSTATPROC_HAVEDISK(void) = 2;
  1264. X    } = 1;
  1265. X} = 100001;
  1266. END_OF_FILE
  1267. if test 4394 -ne `wc -c <'rstat.x'`; then
  1268.     echo shar: \"'rstat.x'\" unpacked with wrong size!
  1269. fi
  1270. # end of 'rstat.x'
  1271. fi
  1272. if test -f 'rstat.h' -a "${1}" != "-c" ; then 
  1273.   echo shar: Will not clobber existing file \"'rstat.h'\"
  1274. else
  1275. echo shar: Extracting \"'rstat.h'\" \(2645 characters\)
  1276. sed "s/^X//" >'rstat.h' <<'END_OF_FILE'
  1277. X/*
  1278. X * Please do not edit this file.
  1279. X * It was generated using rpcgen.
  1280. X */
  1281. X
  1282. X#include <rpc/types.h>
  1283. X
  1284. X#ifndef FSCALE
  1285. X/*
  1286. X * Scale factor for scaled integers used to count load averages.
  1287. X */
  1288. X#define FSHIFT  8               /* bits to right of fixed binary point */
  1289. X#define FSCALE  (1<<FSHIFT)
  1290. X
  1291. X#endif /* ndef FSCALE */
  1292. X#define CPUSTATES_ORIG 4
  1293. X#define CPUSTATES_VAR 4
  1294. X#define DK_NDRIVE_ORIG 4
  1295. X#define DK_NDRIVE_VAR 32
  1296. X
  1297. Xstruct rstat_timeval {
  1298. X    u_int tv_sec;
  1299. X    u_int tv_usec;
  1300. X};
  1301. Xtypedef struct rstat_timeval rstat_timeval;
  1302. Xbool_t xdr_rstat_timeval();
  1303. X
  1304. Xstruct statsvar {
  1305. X    struct {
  1306. X        u_int cp_time_len;
  1307. X        int *cp_time_val;
  1308. X    } cp_time;
  1309. X    struct {
  1310. X        u_int dk_xfer_len;
  1311. X        int *dk_xfer_val;
  1312. X    } dk_xfer;
  1313. X    u_int v_pgpgin;
  1314. X    u_int v_pgpgout;
  1315. X    u_int v_pswpin;
  1316. X    u_int v_pswpout;
  1317. X    u_int v_intr;
  1318. X    int if_ipackets;
  1319. X    int if_ierrors;
  1320. X    int if_opackets;
  1321. X    int if_oerrors;
  1322. X    int if_collisions;
  1323. X    u_int v_swtch;
  1324. X    long avenrun[3];
  1325. X    rstat_timeval boottime;
  1326. X    rstat_timeval curtime;
  1327. X};
  1328. Xtypedef struct statsvar statsvar;
  1329. Xbool_t xdr_statsvar();
  1330. X
  1331. Xstruct statstime {
  1332. X    int cp_time[CPUSTATES_ORIG];
  1333. X    int dk_xfer[DK_NDRIVE_ORIG];
  1334. X    u_int v_pgpgin;
  1335. X    u_int v_pgpgout;
  1336. X    u_int v_pswpin;
  1337. X    u_int v_pswpout;
  1338. X    u_int v_intr;
  1339. X    int if_ipackets;
  1340. X    int if_ierrors;
  1341. X    int if_oerrors;
  1342. X    int if_collisions;
  1343. X    u_int v_swtch;
  1344. X    int avenrun[3];
  1345. X    rstat_timeval boottime;
  1346. X    rstat_timeval curtime;
  1347. X    int if_opackets;
  1348. X};
  1349. Xtypedef struct statstime statstime;
  1350. Xbool_t xdr_statstime();
  1351. X
  1352. Xstruct statsswtch {
  1353. X    int cp_time[CPUSTATES_ORIG];
  1354. X    int dk_xfer[DK_NDRIVE_ORIG];
  1355. X    u_int v_pgpgin;
  1356. X    u_int v_pgpgout;
  1357. X    u_int v_pswpin;
  1358. X    u_int v_pswpout;
  1359. X    u_int v_intr;
  1360. X    int if_ipackets;
  1361. X    int if_ierrors;
  1362. X    int if_oerrors;
  1363. X    int if_collisions;
  1364. X    u_int v_swtch;
  1365. X    u_int avenrun[3];
  1366. X    rstat_timeval boottime;
  1367. X    int if_opackets;
  1368. X};
  1369. Xtypedef struct statsswtch statsswtch;
  1370. Xbool_t xdr_statsswtch();
  1371. X
  1372. Xstruct stats {
  1373. X    int cp_time[CPUSTATES_ORIG];
  1374. X    int dk_xfer[DK_NDRIVE_ORIG];
  1375. X    u_int v_pgpgin;
  1376. X    u_int v_pgpgout;
  1377. X    u_int v_pswpin;
  1378. X    u_int v_pswpout;
  1379. X    u_int v_intr;
  1380. X    int if_ipackets;
  1381. X    int if_ierrors;
  1382. X    int if_oerrors;
  1383. X    int if_collisions;
  1384. X    int if_opackets;
  1385. X};
  1386. Xtypedef struct stats stats;
  1387. Xbool_t xdr_stats();
  1388. X
  1389. X#define RSTATPROG ((u_long)100001)
  1390. X#define RSTATVERS_VAR ((u_long)4)
  1391. X#define RSTATPROC_STATS ((u_long)1)
  1392. Xextern statsvar *rstatproc_stats_4();
  1393. X#define RSTATPROC_HAVEDISK ((u_long)2)
  1394. Xextern u_int *rstatproc_havedisk_4();
  1395. X#define RSTATVERS_TIME ((u_long)3)
  1396. Xextern statstime *rstatproc_stats_3();
  1397. Xextern u_int *rstatproc_havedisk_3();
  1398. X#define RSTATVERS_SWTCH ((u_long)2)
  1399. Xextern statsswtch *rstatproc_stats_2();
  1400. Xextern u_int *rstatproc_havedisk_2();
  1401. X#define RSTATVERS_ORIG ((u_long)1)
  1402. Xextern stats *rstatproc_stats_1();
  1403. Xextern u_int *rstatproc_havedisk_1();
  1404. END_OF_FILE
  1405. if test 2645 -ne `wc -c <'rstat.h'`; then
  1406.     echo shar: \"'rstat.h'\" unpacked with wrong size!
  1407. fi
  1408. # end of 'rstat.h'
  1409. fi
  1410. if test -f 'rstat_xdr.ed' -a "${1}" != "-c" ; then 
  1411.   echo shar: Will not clobber existing file \"'rstat_xdr.ed'\"
  1412. else
  1413. echo shar: Extracting \"'rstat_xdr.ed'\" \(493 characters\)
  1414. sed "s/^X//" >'rstat_xdr.ed' <<'END_OF_FILE'
  1415. X/^xdr_statstime(/g\
  1416. X/if_opackets/+1c
  1417. X        /**
  1418. X         * workaround for servers that
  1419. X         * do not report if_opackets
  1420. X        **/
  1421. X        objp->if_opackets = 0;
  1422. X        /* return (FALSE); */
  1423. X.
  1424. X/^xdr_statsswtch(/g\
  1425. X/if_opackets/+1c
  1426. X        /**
  1427. X         * workaround for servers that
  1428. X         * do not report if_opackets
  1429. X        **/
  1430. X        objp->if_opackets = 0;
  1431. X        /* return (FALSE); */
  1432. X.
  1433. X/^xdr_stats(/g\
  1434. X/if_opackets/+1c
  1435. X        /**
  1436. X         * workaround for servers that
  1437. X         * do not report if_opackets
  1438. X        **/
  1439. X        objp->if_opackets = 0;
  1440. X        /* return (FALSE); */
  1441. X.
  1442. Xw
  1443. Xq
  1444. END_OF_FILE
  1445. if test 493 -ne `wc -c <'rstat_xdr.ed'`; then
  1446.     echo shar: \"'rstat_xdr.ed'\" unpacked with wrong size!
  1447. fi
  1448. # end of 'rstat_xdr.ed'
  1449. fi
  1450. if test -f 'rstat_xdr.c' -a "${1}" != "-c" ; then 
  1451.   echo shar: Will not clobber existing file \"'rstat_xdr.c'\"
  1452. else
  1453. echo shar: Extracting \"'rstat_xdr.c'\" \(5311 characters\)
  1454. sed "s/^X//" >'rstat_xdr.c' <<'END_OF_FILE'
  1455. X/*
  1456. X * Please do not edit this file.
  1457. X * It was generated using rpcgen.
  1458. X */
  1459. X
  1460. X#include <rpc/rpc.h>
  1461. X#include "rstat.h"
  1462. X
  1463. Xbool_t
  1464. Xxdr_rstat_timeval(xdrs, objp)
  1465. X    XDR *xdrs;
  1466. X    rstat_timeval *objp;
  1467. X{
  1468. X    if (!xdr_u_int(xdrs, &objp->tv_sec)) {
  1469. X        return (FALSE);
  1470. X    }
  1471. X    if (!xdr_u_int(xdrs, &objp->tv_usec)) {
  1472. X        return (FALSE);
  1473. X    }
  1474. X    return (TRUE);
  1475. X}
  1476. X
  1477. Xbool_t
  1478. Xxdr_statsvar(xdrs, objp)
  1479. X    XDR *xdrs;
  1480. X    statsvar *objp;
  1481. X{
  1482. X    if (!xdr_array(xdrs, (char **)&objp->cp_time.cp_time_val, (u_int *)&objp->cp_time.cp_time_len, CPUSTATES_VAR, sizeof(int), xdr_int)) {
  1483. X        return (FALSE);
  1484. X    }
  1485. X    if (!xdr_array(xdrs, (char **)&objp->dk_xfer.dk_xfer_val, (u_int *)&objp->dk_xfer.dk_xfer_len, DK_NDRIVE_VAR, sizeof(int), xdr_int)) {
  1486. X        return (FALSE);
  1487. X    }
  1488. X    if (!xdr_u_int(xdrs, &objp->v_pgpgin)) {
  1489. X        return (FALSE);
  1490. X    }
  1491. X    if (!xdr_u_int(xdrs, &objp->v_pgpgout)) {
  1492. X        return (FALSE);
  1493. X    }
  1494. X    if (!xdr_u_int(xdrs, &objp->v_pswpin)) {
  1495. X        return (FALSE);
  1496. X    }
  1497. X    if (!xdr_u_int(xdrs, &objp->v_pswpout)) {
  1498. X        return (FALSE);
  1499. X    }
  1500. X    if (!xdr_u_int(xdrs, &objp->v_intr)) {
  1501. X        return (FALSE);
  1502. X    }
  1503. X    if (!xdr_int(xdrs, &objp->if_ipackets)) {
  1504. X        return (FALSE);
  1505. X    }
  1506. X    if (!xdr_int(xdrs, &objp->if_ierrors)) {
  1507. X        return (FALSE);
  1508. X    }
  1509. X    if (!xdr_int(xdrs, &objp->if_opackets)) {
  1510. X        return (FALSE);
  1511. X    }
  1512. X    if (!xdr_int(xdrs, &objp->if_oerrors)) {
  1513. X        return (FALSE);
  1514. X    }
  1515. X    if (!xdr_int(xdrs, &objp->if_collisions)) {
  1516. X        return (FALSE);
  1517. X    }
  1518. X    if (!xdr_u_int(xdrs, &objp->v_swtch)) {
  1519. X        return (FALSE);
  1520. X    }
  1521. X    if (!xdr_vector(xdrs, (char *)objp->avenrun, 3, sizeof(long), xdr_long)) {
  1522. X        return (FALSE);
  1523. X    }
  1524. X    if (!xdr_rstat_timeval(xdrs, &objp->boottime)) {
  1525. X        return (FALSE);
  1526. X    }
  1527. X    if (!xdr_rstat_timeval(xdrs, &objp->curtime)) {
  1528. X        return (FALSE);
  1529. X    }
  1530. X    return (TRUE);
  1531. X}
  1532. X
  1533. Xbool_t
  1534. Xxdr_statstime(xdrs, objp)
  1535. X    XDR *xdrs;
  1536. X    statstime *objp;
  1537. X{
  1538. X    if (!xdr_vector(xdrs, (char *)objp->cp_time, CPUSTATES_ORIG, sizeof(int), xdr_int)) {
  1539. X        return (FALSE);
  1540. X    }
  1541. X    if (!xdr_vector(xdrs, (char *)objp->dk_xfer, DK_NDRIVE_ORIG, sizeof(int), xdr_int)) {
  1542. X        return (FALSE);
  1543. X    }
  1544. X    if (!xdr_u_int(xdrs, &objp->v_pgpgin)) {
  1545. X        return (FALSE);
  1546. X    }
  1547. X    if (!xdr_u_int(xdrs, &objp->v_pgpgout)) {
  1548. X        return (FALSE);
  1549. X    }
  1550. X    if (!xdr_u_int(xdrs, &objp->v_pswpin)) {
  1551. X        return (FALSE);
  1552. X    }
  1553. X    if (!xdr_u_int(xdrs, &objp->v_pswpout)) {
  1554. X        return (FALSE);
  1555. X    }
  1556. X    if (!xdr_u_int(xdrs, &objp->v_intr)) {
  1557. X        return (FALSE);
  1558. X    }
  1559. X    if (!xdr_int(xdrs, &objp->if_ipackets)) {
  1560. X        return (FALSE);
  1561. X    }
  1562. X    if (!xdr_int(xdrs, &objp->if_ierrors)) {
  1563. X        return (FALSE);
  1564. X    }
  1565. X    if (!xdr_int(xdrs, &objp->if_oerrors)) {
  1566. X        return (FALSE);
  1567. X    }
  1568. X    if (!xdr_int(xdrs, &objp->if_collisions)) {
  1569. X        return (FALSE);
  1570. X    }
  1571. X    if (!xdr_u_int(xdrs, &objp->v_swtch)) {
  1572. X        return (FALSE);
  1573. X    }
  1574. X    if (!xdr_vector(xdrs, (char *)objp->avenrun, 3, sizeof(int), xdr_int)) {
  1575. X        return (FALSE);
  1576. X    }
  1577. X    if (!xdr_rstat_timeval(xdrs, &objp->boottime)) {
  1578. X        return (FALSE);
  1579. X    }
  1580. X    if (!xdr_rstat_timeval(xdrs, &objp->curtime)) {
  1581. X        return (FALSE);
  1582. X    }
  1583. X    if (!xdr_int(xdrs, &objp->if_opackets)) {
  1584. X        /**
  1585. X         * workaround for servers that
  1586. X         * do not report if_opackets
  1587. X        **/
  1588. X        objp->if_opackets = 0;
  1589. X        /* return (FALSE); */
  1590. X    }
  1591. X    return (TRUE);
  1592. X}
  1593. X
  1594. Xbool_t
  1595. Xxdr_statsswtch(xdrs, objp)
  1596. X    XDR *xdrs;
  1597. X    statsswtch *objp;
  1598. X{
  1599. X    if (!xdr_vector(xdrs, (char *)objp->cp_time, CPUSTATES_ORIG, sizeof(int), xdr_int)) {
  1600. X        return (FALSE);
  1601. X    }
  1602. X    if (!xdr_vector(xdrs, (char *)objp->dk_xfer, DK_NDRIVE_ORIG, sizeof(int), xdr_int)) {
  1603. X        return (FALSE);
  1604. X    }
  1605. X    if (!xdr_u_int(xdrs, &objp->v_pgpgin)) {
  1606. X        return (FALSE);
  1607. X    }
  1608. X    if (!xdr_u_int(xdrs, &objp->v_pgpgout)) {
  1609. X        return (FALSE);
  1610. X    }
  1611. X    if (!xdr_u_int(xdrs, &objp->v_pswpin)) {
  1612. X        return (FALSE);
  1613. X    }
  1614. X    if (!xdr_u_int(xdrs, &objp->v_pswpout)) {
  1615. X        return (FALSE);
  1616. X    }
  1617. X    if (!xdr_u_int(xdrs, &objp->v_intr)) {
  1618. X        return (FALSE);
  1619. X    }
  1620. X    if (!xdr_int(xdrs, &objp->if_ipackets)) {
  1621. X        return (FALSE);
  1622. X    }
  1623. X    if (!xdr_int(xdrs, &objp->if_ierrors)) {
  1624. X        return (FALSE);
  1625. X    }
  1626. X    if (!xdr_int(xdrs, &objp->if_oerrors)) {
  1627. X        return (FALSE);
  1628. X    }
  1629. X    if (!xdr_int(xdrs, &objp->if_collisions)) {
  1630. X        return (FALSE);
  1631. X    }
  1632. X    if (!xdr_u_int(xdrs, &objp->v_swtch)) {
  1633. X        return (FALSE);
  1634. X    }
  1635. X    if (!xdr_vector(xdrs, (char *)objp->avenrun, 3, sizeof(u_int), xdr_u_int)) {
  1636. X        return (FALSE);
  1637. X    }
  1638. X    if (!xdr_rstat_timeval(xdrs, &objp->boottime)) {
  1639. X        return (FALSE);
  1640. X    }
  1641. X    if (!xdr_int(xdrs, &objp->if_opackets)) {
  1642. X        /**
  1643. X         * workaround for servers that
  1644. X         * do not report if_opackets
  1645. X        **/
  1646. X        objp->if_opackets = 0;
  1647. X        /* return (FALSE); */
  1648. X    }
  1649. X    return (TRUE);
  1650. X}
  1651. X
  1652. Xbool_t
  1653. Xxdr_stats(xdrs, objp)
  1654. X    XDR *xdrs;
  1655. X    stats *objp;
  1656. X{
  1657. X    if (!xdr_vector(xdrs, (char *)objp->cp_time, CPUSTATES_ORIG, sizeof(int), xdr_int)) {
  1658. X        return (FALSE);
  1659. X    }
  1660. X    if (!xdr_vector(xdrs, (char *)objp->dk_xfer, DK_NDRIVE_ORIG, sizeof(int), xdr_int)) {
  1661. X        return (FALSE);
  1662. X    }
  1663. X    if (!xdr_u_int(xdrs, &objp->v_pgpgin)) {
  1664. X        return (FALSE);
  1665. X    }
  1666. X    if (!xdr_u_int(xdrs, &objp->v_pgpgout)) {
  1667. X        return (FALSE);
  1668. X    }
  1669. X    if (!xdr_u_int(xdrs, &objp->v_pswpin)) {
  1670. X        return (FALSE);
  1671. X    }
  1672. X    if (!xdr_u_int(xdrs, &objp->v_pswpout)) {
  1673. X        return (FALSE);
  1674. X    }
  1675. X    if (!xdr_u_int(xdrs, &objp->v_intr)) {
  1676. X        return (FALSE);
  1677. X    }
  1678. X    if (!xdr_int(xdrs, &objp->if_ipackets)) {
  1679. X        return (FALSE);
  1680. X    }
  1681. X    if (!xdr_int(xdrs, &objp->if_ierrors)) {
  1682. X        return (FALSE);
  1683. X    }
  1684. X    if (!xdr_int(xdrs, &objp->if_oerrors)) {
  1685. X        return (FALSE);
  1686. X    }
  1687. X    if (!xdr_int(xdrs, &objp->if_collisions)) {
  1688. X        return (FALSE);
  1689. X    }
  1690. X    if (!xdr_int(xdrs, &objp->if_opackets)) {
  1691. X        /**
  1692. X         * workaround for servers that
  1693. X         * do not report if_opackets
  1694. X        **/
  1695. X        objp->if_opackets = 0;
  1696. X        /* return (FALSE); */
  1697. X    }
  1698. X    return (TRUE);
  1699. X}
  1700. END_OF_FILE
  1701. if test 5311 -ne `wc -c <'rstat_xdr.c'`; then
  1702.     echo shar: \"'rstat_xdr.c'\" unpacked with wrong size!
  1703. fi
  1704. # end of 'rstat_xdr.c'
  1705. fi
  1706. if test -f 'rperf.8' -a "${1}" != "-c" ; then 
  1707.   echo shar: Will not clobber existing file \"'rperf.8'\"
  1708. else
  1709. echo shar: Extracting \"'rperf.8'\" \(5427 characters\)
  1710. sed "s/^X//" >'rperf.8' <<'END_OF_FILE'
  1711. X.\" t
  1712. X.\" This program may be copied, redistributed in any form, source or
  1713. X.\" binary, and used for any purpose, provided this copyright notice is
  1714. X.\" retained.
  1715. X.\"
  1716. X.\"    "@(#)rperf.8    2.1 8/30/93 (c) Copyright Brian P. Fitzgerald",
  1717. X.\"    "Rensselaer Polytechnic Institute"
  1718. X.\"
  1719. X.TH RPERF 8 "8 May 1992"
  1720. X.SH NAME
  1721. Xrperf \- report statistics from network hosts
  1722. X.SH SYNOPSIS
  1723. X.B rperf
  1724. X[
  1725. X.B \-acdivhnSTsbBDr
  1726. X] [
  1727. X.I interval
  1728. X[
  1729. X.I count
  1730. X] ] [
  1731. X.I +sortkey
  1732. X] [
  1733. X.I host ...
  1734. X]
  1735. X
  1736. X.B rup
  1737. X[
  1738. X.B \-hltn
  1739. X] [
  1740. X.I interval
  1741. X] [
  1742. X.I host ...
  1743. X]
  1744. X.SH DESCRIPTION
  1745. X.IX  "rperf command"  ""  "\fLrperf\fP \(em report statistics from network hosts"
  1746. X.B rperf
  1747. Xobtains system statistics from network hosts and prints them to the
  1748. Xstandard output at regular intervals.
  1749. X.B rperf
  1750. Xis similar to xmeter, or SunView perfmeter, but is intended for use on
  1751. Xascii terminals, or for logging.
  1752. X.LP
  1753. XWithout options,
  1754. X.B rperf
  1755. Xbroadcasts to the local network,
  1756. Xprints the uptime for each host that responds, then displays kernel statistics 
  1757. Xfor these hosts at 10 second intervals until the program is terminated.  If
  1758. X.I interval
  1759. Xis specified,
  1760. X.B rperf
  1761. Xsummarizes activity every
  1762. X.I interval
  1763. Xseconds.  If a
  1764. X.I count
  1765. Xis given, the statistics are repeated
  1766. X.I count
  1767. Xtimes.  If one or more
  1768. X.I hosts
  1769. Xare specified,
  1770. X.B rperf
  1771. Xqueries those hosts.
  1772. X
  1773. XIf invoked as
  1774. X.B rup,
  1775. Xthe program prints the hostname, uptime, and the load average once, and exits.
  1776. X.SH OPTIONS
  1777. X.TP
  1778. X.B \-c
  1779. X.SM CPU.
  1780. XReport relative cpu utilization (user, nice, system, and idle),
  1781. Xsimilar to 
  1782. X.B vmstat.
  1783. XAlso, the average number of jobs in the run queue (load average) over
  1784. Xthe past 1, 5, and 15 minutes is displayed, a` la
  1785. X.B rup.
  1786. X.TP
  1787. X.B \-d
  1788. XDisk activity, in events per second.  Report operations on disks sd0
  1789. Xthrough sd3, similar to
  1790. X.B vmstat.
  1791. X.TP
  1792. X.B \-i
  1793. XNetwork interface activity, in events per second.  Report incoming and
  1794. Xoutgoing packets transferred, errors, and collisions; similar to
  1795. X.B netstat.
  1796. X.TP
  1797. X.B \-v
  1798. XVirtual memory activity, in events per second.  Report pages paged
  1799. Xin/out, pages swapped in/out, context switches, and interrupts; similar
  1800. Xto
  1801. X.B vmstat.
  1802. X.TP
  1803. X.B \-a
  1804. XAll.  Report all of the above.  (The default if only one host is being
  1805. Xmonitored.)
  1806. X.TP
  1807. X.B \-n
  1808. XDo not resolve host names.  Print the internet address instead.
  1809. X.TP
  1810. X.B \-h
  1811. XSort by hostname.  By default, rperf sorts by address.
  1812. X.TP
  1813. X.B +sortkey
  1814. XSort the output by this field, highest value first.
  1815. XAbbreviations are acceptable.
  1816. XThe sort keys are:
  1817. X
  1818. X.TS
  1819. Xl l l l l l.
  1820. Xloadavg    user    pgpgin    disk0    boottime    ipackets
  1821. Xav1    nice    pgpgout    disk1    uptime    ierrors
  1822. Xav5    sys    pswpin    disk2        oerrors
  1823. Xav15    idle    pswpout    disk3        opackets
  1824. X        intr            collisions
  1825. X        swtch
  1826. X.TE
  1827. X.TP
  1828. X.B \-r
  1829. XSort in ascending order, lowest value first.
  1830. X.LP
  1831. XIf more than one host is monitored, but no option flags are specified,
  1832. Xeach hostname is printed at left, and the disk activity report is
  1833. Xomitted, but this can be overridden by specifying options on the
  1834. Xcommand line.
  1835. X.SS Time Format Options
  1836. X.LP
  1837. XThe following options are useful for time stamping the output data.
  1838. X.TP
  1839. X.B \-S
  1840. XSeconds since 00:00 Jan 1, 1970, GMT (Unix time).  This format is
  1841. Xappropriate if the time value is to be used for further analysis or
  1842. Xdisplay plotting.
  1843. X.TP
  1844. X.B \-T
  1845. XDate and local time, in standard format.
  1846. X.TP
  1847. X.B \-s
  1848. XElapsed time, in seconds.
  1849. X.SS Miscellaneous Options
  1850. X.TP
  1851. X.B \-B
  1852. XBare.  Do not print headers or uptime data.
  1853. X.TP
  1854. X.B \-b
  1855. XBroadcast continuously.  In broadcast mode without this option, rperf
  1856. Xbroadcasts to the local network once, and from then on calls the hosts
  1857. Xthat responded.  With the -b option, rperf broadcasts continuously.
  1858. XContinuous broadcasting is preferable to calling individual hosts
  1859. Xbecause network and system load are lower.  AIX 3.1 users may find that
  1860. Xcontinuous broadcasting will hang the machine.
  1861. X.TP
  1862. X.B \-D
  1863. XDebug.
  1864. X.SS Rup Options
  1865. X.TP
  1866. X.B \-t
  1867. Xsort by uptime.
  1868. X.TP
  1869. X.B \-l
  1870. Xsort my (one minute) load average.
  1871. X.TP
  1872. XSee also -h and -n, above.
  1873. X.SH EXAMPLES
  1874. X.LP
  1875. XUsually just:
  1876. X.LP
  1877. X.B rperf
  1878. X.I host1 host2 ...
  1879. X.LP
  1880. Xor
  1881. X.LP
  1882. X.B rperf -b
  1883. X(continuous broadcast mode)
  1884. X.LP
  1885. X.LP
  1886. XYou can use rperf to log data for later analysis or plotting.
  1887. XFor example, 
  1888. X.LP
  1889. X.B rperf -sBd 900
  1890. X.I host > file1
  1891. X.LP
  1892. Xstores disk activity statistics on
  1893. X.I host
  1894. Xin a "bare" file (no header) every 15 minutes along with time, in
  1895. Xseconds since rperf was started.  The activity on disk 0 may then be
  1896. Xplotted
  1897. X.I vs.
  1898. Xhours with:
  1899. X.LP
  1900. X.B awk
  1901. X'{print $1/3600, $2}'
  1902. X.I file1 > file2
  1903. X.LP
  1904. Xgnuplot> plot
  1905. X.I 'file2'
  1906. X.LP
  1907. XThe command
  1908. X.LP
  1909. X.B rperf
  1910. X-a +system
  1911. X.LP
  1912. Xgives all available statistics for all hosts on the local broadcast
  1913. Xnetwork, sorted by system load, and repeats evert 10 seconds.
  1914. X.SH NOTES
  1915. X.LP
  1916. XIf the output alternates between nonzero numbers and zeros, it is
  1917. Xpossible that rstatd on the remote host samples the kernel over a
  1918. Xlonger interval than you have chosen.  Try running
  1919. X.B rperf
  1920. Xwith a longer
  1921. X.I interval.
  1922. X.SH DIAGNOSTICS
  1923. X.LP
  1924. X.B RPC: Program not registered.
  1925. XThe remote host is not running rstatd.  On some systems, rstatd is 
  1926. Xstarted by uncommenting it in /etc/inetd.conf, and sending the inetd
  1927. Xprocess a SIGHUP.
  1928. X.LP
  1929. X.B RPC: Remote system error - Too many open files.
  1930. XMisleading.  In practice, it may be that the local rperf process has
  1931. Xtoo many open files because too many hosts were specified.  To find out
  1932. Xyour limit, type
  1933. X.B % limit descriptors
  1934. Xor
  1935. X.B bash$ ulimit -n
  1936. X.SH AUTHOR
  1937. XBrian P. Fitzgerald, Mechanics of Materials Laboratory, Rensselaer
  1938. XPolytechnic Institute, Troy, New York.  Send bug reports and fixes to
  1939. Xfitz@rpi.edu.
  1940. END_OF_FILE
  1941. if test 5427 -ne `wc -c <'rperf.8'`; then
  1942.     echo shar: \"'rperf.8'\" unpacked with wrong size!
  1943. fi
  1944. # end of 'rperf.8'
  1945. fi
  1946. if test -f 'strdup.c' -a "${1}" != "-c" ; then 
  1947.   echo shar: Will not clobber existing file \"'strdup.c'\"
  1948. else
  1949. echo shar: Extracting \"'strdup.c'\" \(707 characters\)
  1950. sed "s/^X//" >'strdup.c' <<'END_OF_FILE'
  1951. X#ifndef lint
  1952. Xstatic char    *RCSid = "$Header: /src/common/usc/lib/libgen/RCS/strdup.c,v 1.2 1992/04/16 01:28:02 mcooper Exp $";
  1953. X#endif
  1954. X
  1955. X/*
  1956. X * $Log: strdup.c,v $ Revision 1.2  1992/04/16  01:28:02  mcooper Some
  1957. X * de-linting.
  1958. X * 
  1959. X * Revision 1.2  1992/04/16  01:28:02  mcooper Some de-linting.
  1960. X * 
  1961. X * Revision 1.1  1992/03/21  02:48:11  mcooper Initial revision
  1962. X * 
  1963. X */
  1964. X
  1965. X
  1966. X#include <stdio.h>
  1967. X
  1968. X/*
  1969. X * Most systems don't have this (yet)
  1970. X */
  1971. Xchar           *
  1972. Xstrdup(str)
  1973. X    char           *str;
  1974. X{
  1975. X    char           *p;
  1976. X    extern char    *malloc();
  1977. X    extern char    *strcpy();
  1978. X
  1979. X    if ((p = malloc((unsigned) strlen(str) + 1)) == NULL)
  1980. X    return ((char *) NULL);
  1981. X
  1982. X    (void) strcpy(p, str);
  1983. X
  1984. X    return (p);
  1985. X}
  1986. END_OF_FILE
  1987. if test 707 -ne `wc -c <'strdup.c'`; then
  1988.     echo shar: \"'strdup.c'\" unpacked with wrong size!
  1989. fi
  1990. # end of 'strdup.c'
  1991. fi
  1992. if test -f 'pathnames.h' -a "${1}" != "-c" ; then 
  1993.   echo shar: Will not clobber existing file \"'pathnames.h'\"
  1994. else
  1995. echo shar: Extracting \"'pathnames.h'\" \(1911 characters\)
  1996. sed "s/^X//" >'pathnames.h' <<'END_OF_FILE'
  1997. X/*
  1998. X * Copyright (c) 1989 The Regents of the University of California.
  1999. X * All rights reserved.
  2000. X *
  2001. X * Redistribution and use in source and binary forms, with or without
  2002. X * modification, are permitted provided that the following conditions
  2003. X * are met:
  2004. X * 1. Redistributions of source code must retain the above copyright
  2005. X *    notice, this list of conditions and the following disclaimer.
  2006. X * 2. Redistributions in binary form must reproduce the above copyright
  2007. X *    notice, this list of conditions and the following disclaimer in the
  2008. X *    documentation and/or other materials provided with the distribution.
  2009. X * 3. All advertising materials mentioning features or use of this software
  2010. X *    must display the following acknowledgement:
  2011. X *    This product includes software developed by the University of
  2012. X *    California, Berkeley and its contributors.
  2013. X * 4. Neither the name of the University nor the names of its contributors
  2014. X *    may be used to endorse or promote products derived from this software
  2015. X *    without specific prior written permission.
  2016. X *
  2017. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  2018. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  2019. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  2020. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  2021. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  2022. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  2023. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  2024. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  2025. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  2026. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  2027. X * SUCH DAMAGE.
  2028. X *
  2029. X *    @(#)pathnames.h    5.2 (Berkeley) 6/1/90
  2030. X */
  2031. X
  2032. X#define    _PATH_DEF    ".termcap /etc/termcap"
  2033. END_OF_FILE
  2034. if test 1911 -ne `wc -c <'pathnames.h'`; then
  2035.     echo shar: \"'pathnames.h'\" unpacked with wrong size!
  2036. fi
  2037. # end of 'pathnames.h'
  2038. fi
  2039. if test -f 'autoconf.1.3.patch' -a "${1}" != "-c" ; then 
  2040.   echo shar: Will not clobber existing file \"'autoconf.1.3.patch'\"
  2041. else
  2042. echo shar: Extracting \"'autoconf.1.3.patch'\" \(626 characters\)
  2043. sed "s/^X//" >'autoconf.1.3.patch' <<'END_OF_FILE'
  2044. X*** acspecific.m4.old    Thu Jan 14 16:59:13 1993
  2045. X--- acspecific.m4    Sun Jan 31 13:49:48 1993
  2046. X***************
  2047. X*** 521,529 ****
  2048. X  [AC_REQUIRE([AC_STRUCT_TM])decl='#include <sys/types.h>
  2049. X  '
  2050. X  case "$DEFS" in
  2051. X!   *TM_IN_SYS_TIME*) decl="$decl #include <sys/time.h>
  2052. X  " ;;
  2053. X!   *) decl="$decl #include <time.h>
  2054. X  " ;;
  2055. X  esac
  2056. X  AC_COMPILE_CHECK([tm_zone in struct tm], $decl,
  2057. X--- 521,529 ----
  2058. X  [AC_REQUIRE([AC_STRUCT_TM])decl='#include <sys/types.h>
  2059. X  '
  2060. X  case "$DEFS" in
  2061. X!   *TM_IN_SYS_TIME*) decl="$decl#include <sys/time.h>
  2062. X  " ;;
  2063. X!   *) decl="$decl#include <time.h>
  2064. X  " ;;
  2065. X  esac
  2066. X  AC_COMPILE_CHECK([tm_zone in struct tm], $decl,
  2067. END_OF_FILE
  2068. if test 626 -ne `wc -c <'autoconf.1.3.patch'`; then
  2069.     echo shar: \"'autoconf.1.3.patch'\" unpacked with wrong size!
  2070. fi
  2071. # end of 'autoconf.1.3.patch'
  2072. fi
  2073. if test -f 'PORTING' -a "${1}" != "-c" ; then 
  2074.   echo shar: Will not clobber existing file \"'PORTING'\"
  2075. else
  2076. echo shar: Extracting \"'PORTING'\" \(2295 characters\)
  2077. sed "s/^X//" >'PORTING' <<'END_OF_FILE'
  2078. XPORTING for rperf
  2079. X------- --- -----
  2080. X
  2081. XAll ports for rperf will be greatly appreciated.
  2082. X
  2083. Xautoconf
  2084. X--------
  2085. X
  2086. XConfiguration is handled with gnu autoconf.  If you would like to help
  2087. Xport the configuration script, you will need gnu autoconf.
  2088. X
  2089. XOn the other hand, if you just want to send me ported C code, and leave
  2090. Xthe "configure" script up to others, that's fine, too.
  2091. X
  2092. X"autoconf" requires gnu m4.  The standard m4 will not work with
  2093. Xautoconf.  I found out the hard way. :-( autoconf and m4 are available
  2094. Xfrom the places listed at the end.
  2095. X
  2096. Xautoconf 1.3 has a bug which requires a patch, which I have provided.
  2097. X
  2098. X"It would be nice if" the code itself had very few #ifdefs for specific
  2099. Xarchitectures, and instead, everything could be determined by "generic"
  2100. Xdefined discovered by the configuration script.
  2101. X
  2102. XSGI IRIX:
  2103. X
  2104. XI am told that -cckr flag must be used to compile my code, to permit
  2105. Xcertain K&R-ism's.  Can someone out there provide me of a minimal
  2106. Xprogram that fails to compile on SGI machines unless the -cckr flag is
  2107. Xused?  The test code will be added to configure.in.
  2108. X
  2109. XBrian
  2110. X
  2111. XAUTOCONF SITES:
  2112. X-------- -----
  2113. X
  2114. XHost quepasa.cs.tu-berlin.de
  2115. X
  2116. X    Location: /.3/pub/gnu
  2117. X      DIRECTORY drwxrwxr-x        512  Jan 22 03:45  autoconf
  2118. X      DIRECTORY drwxrwxr-x        512  Dec 22 03:42  m4
  2119. X
  2120. XHost reseq.regent.e-technik.tu-muenchen.de
  2121. X
  2122. X    Location: /informatik.public/comp/gnu
  2123. X      DIRECTORY drwxrwxr-x        512  Jan  5 20:08  autoconf
  2124. X      DIRECTORY drwxrwxr-x        512  Dec 20 06:06  m4
  2125. X
  2126. XHost ftp.uni-kl.de
  2127. X
  2128. X    Location: /pub1/packages/gnu
  2129. X      DIRECTORY drwxrwxr-x        512  Oct 28 07:50  autoconf
  2130. X    Location: /pub2/packages/gnu
  2131. X      DIRECTORY drwxr-xr-x        512  Oct 16 11:48  autoconf
  2132. X      DIRECTORY drwxr-xr-x        512  Apr 10 1992  m4
  2133. X
  2134. XHost minnie.zdv.uni-mainz.de
  2135. X
  2136. X    Location: /pub0/pub/gnu
  2137. X      DIRECTORY drwxr-xr-x        512  Oct 15 09:46  autoconf
  2138. X      DIRECTORY drwxr-xr-x        512  Dec 21 07:37  m4
  2139. X
  2140. XHost archive.cis.ohio-state.edu
  2141. X
  2142. X    Location: /n/archive/0/extra-ftp/gnu
  2143. X      DIRECTORY drwxrwxr-x        512  Oct 16 05:45  autoconf
  2144. X      DIRECTORY drwxrwxr-x        512  Jun 12 00:00  m4
  2145. X
  2146. XHost saqqara.cis.ohio-state.edu
  2147. X
  2148. X    Location: /gnu
  2149. X      DIRECTORY drwxrwxr-x        512  Oct 16 01:45  autoconf
  2150. X      DIRECTORY drwxrwxr-x        512  Jun 12 00:00  m4
  2151. END_OF_FILE
  2152. if test 2295 -ne `wc -c <'PORTING'`; then
  2153.     echo shar: \"'PORTING'\" unpacked with wrong size!
  2154. fi
  2155. # end of 'PORTING'
  2156. fi
  2157. echo shar: End of archive 1 \(of 3\).
  2158. cp /dev/null ark1isdone
  2159. MISSING=""
  2160. for I in 1 2 3 ; do
  2161.     if test ! -f ark${I}isdone ; then
  2162.     MISSING="${MISSING} ${I}"
  2163.     fi
  2164. done
  2165. if test "${MISSING}" = "" ; then
  2166.     echo You have unpacked all 3 archives.
  2167.     echo "Now do 'sh ./configure'"
  2168.     rm -f ark[1-9]isdone
  2169. else
  2170.     echo You still need to unpack the following archives:
  2171.     echo "        " ${MISSING}
  2172. fi
  2173. ##  End of shell archive.
  2174. exit 0
  2175.  
  2176. exit 0 # Just in case...
  2177.