/*
 * $Id: bench.h,v 1.1.1.1 2003/02/28 17:19:52 fedorova Exp $
 */
#include        <stdio.h>
#include        <unistd.h>
#include        <sys/types.h>
#include        <signal.h>
#include        <errno.h>

#ifdef	NO_PORTMAPPER
#define	TCP_XACT	3962
#define	TCP_CONTROL	3963
#define	TCP_DATA	3964
#define	TCP_CONNECT	3965
#else
#define	TCP_XACT	(u_long)404039	/* XXX - unregistered */
#define	TCP_CONTROL	(u_long)404040	/* XXX - unregistered */
#define	TCP_DATA	(u_long)404041	/* XXX - unregistered */
#define	TCP_CONNECT	(u_long)404042	/* XXX - unregistered */
#define	UDP_XACT 	(u_long)404032	/* XXX - unregistered */
#define	UDP_DATA 	(u_long)404033	/* XXX - unregistered */
#define	VERS		(u_long)1
#endif

/*
 * socket send/recv buffer optimizations
 */
#define	SOCKOPT_READ	0
#define	SOCKOPT_WRITE	1
#define	SOCKOPT_RDWR	2
#define	SOCKOPT_NONE	4

#define	SOCKBUF		(1024*1024)
#define	SOCKSTEP	(16*1024)

#ifdef SYS5
#define	bzero(b, len)	memset(b, 0, len)
#define	bcopy(s, d, l)	memcpy(d, s, l)
#define	rindex(s, c)	strrchr(s, c)
#endif

#define	ulong	unsigned long
#define	GO_AWAY	signal(SIGALRM, exit); alarm(60 * 60);

char	last();
int 	parse_bytes();

void		init_timing();
unsigned int	gen_iterations();

void	output_bandwidth();

void	centeravg_reset();
void	centeravg_add();
void 	centeravg_done();

void	exit();
void	start();
void	adjust();
void	rusage();
void	bandwidth();
void	kb();
void	mb();
void	micro();
void	milli();
void	ptime();
void	tvsub();

void	timeit();

/*
 * Generated from msg.x which is included here:

	program XACT_PROG {
	    version XACT_VERS {
		char
		RPC_XACT(char) = 1;
    	} = 1;
	} = 3970;

 * Please do not edit this file.
 * It was generated using rpcgen.
 */

#include <rpc/types.h>

#define XACT_PROG ((u_long)3970)
#define XACT_VERS ((u_long)1)
#define RPC_XACT ((u_long)1)
#define RPC_EXIT ((u_long)2)
extern char *rpc_xact_1();
extern char *client_rpc_xact_1();
