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

#ifndef _REX_H_RPCGEN
#define	_REX_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

#define	STRINGSIZE 1024

typedef char *rexstring;
#define	SIGINT 2
#define	REX_INTERACTIVE 1

struct rex_start {
	struct {
		u_int rst_cmd_len;
		rexstring *rst_cmd_val;
	} rst_cmd;
	rexstring rst_host;
	rexstring rst_fsname;
	rexstring rst_dirwithin;
	struct {
		u_int rst_env_len;
		rexstring *rst_env_val;
	} rst_env;
	u_int rst_port0;
	u_int rst_port1;
	u_int rst_port2;
	u_int rst_flags;
};
typedef struct rex_start rex_start;

struct rex_result {
	int rlt_stat;
	rexstring rlt_message;
};
typedef struct rex_result rex_result;

struct sgttyb {
	u_int four;
	char chars[4];
	u_int flags;
};
typedef struct sgttyb sgttyb;
#define	B0 0
#define	B50 1
#define	B75 2
#define	B110 3
#define	B134 4
#define	B150 5
#define	B200 6
#define	B300 7
#define	B600 8
#define	B1200 9
#define	B1800 10
#define	B2400 11
#define	B4800 12
#define	B9600 13
#define	B19200 14
#define	B38400 15
#define	TANDEM 0x00000001
#define	CBREAK 0x00000002
#define	LCASE 0x00000004
#define	ECHO 0x00000008
#define	CRMOD 0x00000010
#define	RAW 0x00000020
#define	ODDP 0x00000040
#define	EVENP 0x00000080
#define	ANYP 0x000000c0
#define	NLDELAY 0x00000300
#define	NL0 0x00000000
#define	NL1 0x00000100
#define	NL2 0x00000200
#define	NL3 0x00000300
#define	TBDELAY 0x00000c00
#define	TAB0 0x00000000
#define	TAB1 0x00000400
#define	TAB2 0x00000800
#define	XTABS 0x00000c00
#define	CRDELAY 0x00003000
#define	CR0 0x00000000
#define	CR1 0x00001000
#define	CR2 0x00002000
#define	CR3 0x00003000
#define	VTDELAY 0x00004000
#define	FF0 0x00000000
#define	FF1 0x00004000
#define	BSDELAY 0x00008000
#define	BS0 0x00000000
#define	BS1 0x00008000
#define	CRTBS 0x00010000
#define	PRTERA 0x00020000
#define	CRTERA 0x00040000
#define	TILDE 0x00080000
#define	MDMBUF 0x00100000
#define	LITOUT 0x00200000
#define	TOSTOP 0x00400000
#define	FLUSHO 0x00800000
#define	NOHANG 0x01000000
#define	L001000 0x02000000
#define	CRTKIL 0x04000000
#define	PASS8 0x08000000
#define	CTLECH 0x10000000
#define	PENDIN 0x20000000
#define	DECCTQ 0x40000000
#define	NOFLSH 0x80000000

struct tchars {
	u_int six;
	char chars[6];
};
typedef struct tchars tchars;

struct ltchars {
	u_int six;
	char chars[6];
	u_int mode;
};
typedef struct ltchars ltchars;

struct rex_ttysize {
	int ts_lines;
	int ts_cols;
};
typedef struct rex_ttysize rex_ttysize;

struct rex_ttymode {
	sgttyb basic;
	tchars more;
	ltchars yetmore;
	u_int andmore;
};
typedef struct rex_ttymode rex_ttymode;
#define	LCRTBS 0x0001
#define	LPRTERA 0x0002
#define	LCRTERA 0x0004
#define	LTILDE 0x0008
#define	LMDMBUF 0x0010
#define	LLITOUT 0x0020
#define	LTOSTOP 0x0040
#define	LFLUSHO 0x0080
#define	LNOHANG 0x0100
#define	LL001000 0x0200
#define	LCRTKIL 0x0400
#define	LPASS8 0x0800
#define	LCTLECH 0x1000
#define	LPENDIN 0x2000
#define	LDECCTQ 0x4000
#define	LNOFLSH 0x8000

#define	REXPROG ((unsigned long)(100017))
#define	REXVERS ((unsigned long)(1))

extern  void rexprog_1(struct svc_req *rqstp, SVCXPRT *transp);
#define	REXPROC_START ((unsigned long)(1))
extern  rex_result * rexproc_start_1(rex_start *, CLIENT *);
extern  rex_result * rexproc_start_1_svc(rex_start *, struct svc_req *);
#define	REXPROC_WAIT ((unsigned long)(2))
extern  rex_result * rexproc_wait_1(void *, CLIENT *);
extern  rex_result * rexproc_wait_1_svc(void *, struct svc_req *);
#define	REXPROC_MODES ((unsigned long)(3))
extern  void * rexproc_modes_1(rex_ttymode *, CLIENT *);
extern  void * rexproc_modes_1_svc(rex_ttymode *, struct svc_req *);
#define	REXPROC_WINCH ((unsigned long)(4))
extern  void * rexproc_winch_1(rex_ttysize *, CLIENT *);
extern  void * rexproc_winch_1_svc(rex_ttysize *, struct svc_req *);
#define	REXPROC_SIGNAL ((unsigned long)(5))
extern  void * rexproc_signal_1(int *, CLIENT *);
extern  void * rexproc_signal_1_svc(int *, struct svc_req *);
extern int rexprog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

/* the xdr functions */
extern  bool_t xdr_rexstring(XDR *, rexstring*);
extern  bool_t xdr_rex_start(XDR *, rex_start*);
extern  bool_t xdr_rex_result(XDR *, rex_result*);
extern  bool_t xdr_sgttyb(XDR *, sgttyb*);
extern  bool_t xdr_tchars(XDR *, tchars*);
extern  bool_t xdr_ltchars(XDR *, ltchars*);
extern  bool_t xdr_rex_ttysize(XDR *, rex_ttysize*);
extern  bool_t xdr_rex_ttymode(XDR *, rex_ttymode*);

#ifdef __cplusplus
}
#endif

#endif /* !_REX_H_RPCGEN */


code:
/*
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify Sun RPC without charge, but are not authorized
 * to license or distribute it to anyone else except as part of a product or
 * program developed by the user.
 *
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun RPC is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */

/*
 * Remote execution (rex) protocol specification
 */

#ifndef RPC_HDR
%#ifndef lint
%/*static char sccsid[] = "from: @(#)rex.x 1.3 87/09/18 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)rex.x	2.1 88/08/01 4.0 RPCSRC";*/
%#endif /* not lint */
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/rex.x 114629 2003-05-04 02:51:42Z obrien $");
#endif

const STRINGSIZE = 1024;
typedef string rexstring<1024>;

/*
 * values to pass to REXPROC_SIGNAL
 */
const SIGINT = 2;	/* interrupt */

/*
 * Values for rst_flags, below
 */
const REX_INTERACTIVE = 1;	/* interactive mode */

struct rex_start {
	rexstring rst_cmd<>;	/* list of command and args */
	rexstring rst_host;	/* working directory host name */
	rexstring rst_fsname;	/* working directory file system name */
	rexstring rst_dirwithin;/* working directory within file system */
	rexstring rst_env<>;	/* list of environment */
	unsigned int rst_port0;	/* port for stdin */
	unsigned int rst_port1;	/* port for stdout */
	unsigned int rst_port2;	/* port for stderr */
	unsigned int rst_flags;	/* options - see const above */
};

struct rex_result {
   	int rlt_stat;		/* integer status code */
	rexstring rlt_message;	/* string message for human consumption */
};

struct sgttyb {
	unsigned four;	/* always equals 4 */
	opaque chars[4];
	/* chars[0] == input speed */
	/* chars[1] == output speed */
	/* chars[2] == kill character */
	/* chars[3] == erase character */
	unsigned flags;
};
/* values for speeds above (baud rates)  */
const B0  = 0;
const B50 = 1;
const B75 = 2;
const B110 = 3;
const B134 = 4;
const B150 = 5;
const B200 = 6;
const B300 = 7;
const B600 = 8;
const B1200 = 9;
const B1800 = 10;
const B2400 = 11;
const B4800 = 12;
const B9600 = 13;
const B19200 = 14;
const B38400 = 15;

/* values for flags above */
const TANDEM = 0x00000001; /* send stopc on out q full */
const CBREAK = 0x00000002; /* half-cooked mode */
const LCASE = 0x00000004; /* simulate lower case */
const ECHO = 0x00000008; /* echo input */
const CRMOD = 0x00000010; /* map \r to \r\n on output */
const RAW = 0x00000020; /* no i/o processing */
const ODDP = 0x00000040; /* get/send odd parity */
const EVENP = 0x00000080; /* get/send even parity */
const ANYP = 0x000000c0; /* get any parity/send none */
const NLDELAY = 0x00000300; /* \n delay */
const  NL0 = 0x00000000;
const  NL1 = 0x00000100; /* tty 37 */
const  NL2 = 0x00000200; /* vt05 */
const  NL3 = 0x00000300;
const TBDELAY = 0x00000c00; /* horizontal tab delay */
const  TAB0 = 0x00000000;
const  TAB1 = 0x00000400; /* tty 37 */
const  TAB2 = 0x00000800;
const XTABS = 0x00000c00; /* expand tabs on output */
const CRDELAY = 0x00003000; /* \r delay */
const  CR0 = 0x00000000;
const  CR1 = 0x00001000; /* tn 300 */
const  CR2 = 0x00002000; /* tty 37 */
const  CR3 = 0x00003000; /* concept 100 */
const VTDELAY = 0x00004000; /* vertical tab delay */
const  FF0 = 0x00000000;
const  FF1 = 0x00004000; /* tty 37 */
const BSDELAY = 0x00008000; /* \b delay */
const  BS0 = 0x00000000;
const  BS1 = 0x00008000;
const CRTBS = 0x00010000; /* do backspacing for crt */
const PRTERA = 0x00020000; /* \ ... / erase */
const CRTERA = 0x00040000; /* " \b " to wipe out char */
const TILDE = 0x00080000; /* hazeltine tilde kludge */
const MDMBUF = 0x00100000; /* start/stop output on carrier intr */
const LITOUT = 0x00200000; /* literal output */
const TOSTOP = 0x00400000; /* SIGTTOU on background output */
const FLUSHO = 0x00800000; /* flush output to terminal */
const NOHANG = 0x01000000; /* no SIGHUP on carrier drop */
const L001000 = 0x02000000;
const CRTKIL = 0x04000000; /* kill line with " \b " */
const PASS8 = 0x08000000;
const CTLECH = 0x10000000; /* echo control chars as ^X */
const PENDIN = 0x20000000; /* tp->t_rawq needs reread */
const DECCTQ = 0x40000000; /* only ^Q starts after ^S */
const NOFLSH = 0x80000000; /* no output flush on signal */

struct tchars {
	unsigned six;	/* always equals 6 */
	opaque chars[6];
	/* chars[0] == interrupt char */
	/* chars[1] == quit char */
	/* chars[2] == start output char */
	/* chars[3] == stop output char */
	/* chars[4] == end-of-file char */
	/* chars[5] == input delimeter (like nl) */
};

struct ltchars {
	unsigned six;	/* always equals 6 */
	opaque chars[6];
	/* chars[0] == stop process signal */
	/* chars[1] == delayed stop process signal */
	/* chars[2] == reprint line */
	/* chars[3] == flush output */
	/* chars[4] == word erase */
	/* chars[5] == literal next character */
	unsigned mode;
};

struct rex_ttysize {
	int ts_lines;
	int ts_cols;
};

struct rex_ttymode {
    sgttyb basic;    /* standard unix tty flags */
    tchars more; /* interrupt, kill characters, etc. */
    ltchars yetmore; /* special Berkeley characters */
    unsigned andmore;     /* and Berkeley modes */
};

/* values for andmore above */
const LCRTBS = 0x0001;	/* do backspacing for crt */
const LPRTERA = 0x0002;	/* \ ... / erase */
const LCRTERA = 0x0004;	/* " \b " to wipe out char */
const LTILDE = 0x0008;	/* hazeltine tilde kludge */
const LMDMBUF = 0x0010;	/* start/stop output on carrier intr */
const LLITOUT = 0x0020;	/* literal output */
const LTOSTOP = 0x0040;	/* SIGTTOU on background output */
const LFLUSHO = 0x0080;	/* flush output to terminal */
const LNOHANG = 0x0100;	/* no SIGHUP on carrier drop */
const LL001000 = 0x0200;
const LCRTKIL = 0x0400;	/* kill line with " \b " */
const LPASS8 = 0x0800;
const LCTLECH = 0x1000;	/* echo control chars as ^X */
const LPENDIN = 0x2000;	/* needs reread */
const LDECCTQ = 0x4000;	/* only ^Q starts after ^S */
const LNOFLSH = 0x8000;	/* no output flush on signal */

program REXPROG {
	version REXVERS {

		/*
		 * Start remote execution
		 */
		rex_result
		REXPROC_START(rex_start) = 1;

		/*
		 * Wait for remote execution to terminate
		 */
		rex_result
		REXPROC_WAIT(void) = 2;

		/*
		 * Send tty modes
		 */
		void
		REXPROC_MODES(rex_ttymode) = 3;

		/*
		 * Send window size change
		 */
		void
		REXPROC_WINCH(rex_ttysize) = 4;

		/*
		 * Send other signal
		 */
		void
		REXPROC_SIGNAL(int) = 5;
	} = 1;
} = 100017;

repo_name: veiledmerc/mira

license: mit


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

#ifndef _RNUSERS_H_RPCGEN
#define	_RNUSERS_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

#define	MAXUSERS 100
#define	MAXUTLEN 256

struct utmp {
	char *ut_line;
	char *ut_name;
	char *ut_host;
	int ut_time;
};
typedef struct utmp utmp;

struct utmpidle {
	utmp ui_utmp;
	u_int ui_idle;
};
typedef struct utmpidle utmpidle;

typedef struct {
	u_int utmparr_len;
	utmp *utmparr_val;
} utmparr;

typedef struct {
	u_int utmpidlearr_len;
	utmpidle *utmpidlearr_val;
} utmpidlearr;
#define	RUSERS_MAXUSERLEN 32
#define	RUSERS_MAXLINELEN 32
#define	RUSERS_MAXHOSTLEN 257

struct rusers_utmp {
	char *ut_user;
	char *ut_line;
	char *ut_host;
	int ut_type;
	int ut_time;
	u_int ut_idle;
};
typedef struct rusers_utmp rusers_utmp;

typedef struct {
	u_int utmp_array_len;
	rusers_utmp *utmp_array_val;
} utmp_array;

#define	RUSERSPROG ((unsigned long)(100002))
#define	RUSERSVERS_ORIG ((unsigned long)(1))

extern  void rusersprog_1(struct svc_req *rqstp, SVCXPRT *transp);
#define	RUSERSPROC_NUM ((unsigned long)(1))
extern  int * rusersproc_num_1(void *, CLIENT *);
extern  int * rusersproc_num_1_svc(void *, struct svc_req *);
#define	RUSERSPROC_NAMES ((unsigned long)(2))
extern  utmparr * rusersproc_names_1(void *, CLIENT *);
extern  utmparr * rusersproc_names_1_svc(void *, struct svc_req *);
#define	RUSERSPROC_ALLNAMES ((unsigned long)(3))
extern  utmparr * rusersproc_allnames_1(void *, CLIENT *);
extern  utmparr * rusersproc_allnames_1_svc(void *, struct svc_req *);
extern int rusersprog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
#define	RUSERSVERS_IDLE ((unsigned long)(2))

extern  void rusersprog_2(struct svc_req *rqstp, SVCXPRT *transp);
extern  int * rusersproc_num_2(void *, CLIENT *);
extern  int * rusersproc_num_2_svc(void *, struct svc_req *);
extern  utmpidlearr * rusersproc_names_2(void *, CLIENT *);
extern  utmpidlearr * rusersproc_names_2_svc(void *, struct svc_req *);
extern  utmpidlearr * rusersproc_allnames_2(void *, CLIENT *);
extern  utmpidlearr * rusersproc_allnames_2_svc(void *, struct svc_req *);
extern int rusersprog_2_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
#define	RUSERSVERS_3 ((unsigned long)(3))

extern  void rusersprog_3(struct svc_req *rqstp, SVCXPRT *transp);
extern  int * rusersproc_num_3(void *, CLIENT *);
extern  int * rusersproc_num_3_svc(void *, struct svc_req *);
extern  utmp_array * rusersproc_names_3(void *, CLIENT *);
extern  utmp_array * rusersproc_names_3_svc(void *, struct svc_req *);
extern  utmp_array * rusersproc_allnames_3(void *, CLIENT *);
extern  utmp_array * rusersproc_allnames_3_svc(void *, struct svc_req *);
extern int rusersprog_3_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

/* the xdr functions */
extern  bool_t xdr_utmp(XDR *, utmp*);
extern  bool_t xdr_utmpidle(XDR *, utmpidle*);
extern  bool_t xdr_utmparr(XDR *, utmparr*);
extern  bool_t xdr_utmpidlearr(XDR *, utmpidlearr*);
extern  bool_t xdr_rusers_utmp(XDR *, rusers_utmp*);
extern  bool_t xdr_utmp_array(XDR *, utmp_array*);

#ifdef __cplusplus
}
#endif

#endif /* !_RNUSERS_H_RPCGEN */


code:
/*
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify Sun RPC without charge, but are not authorized
 * to license or distribute it to anyone else except as part of a product or
 * program developed by the user.
 *
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun RPC is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */

/*
 * Find out about remote users
 */

#ifndef RPC_HDR
%#ifndef lint
%/*static char sccsid[] = "from: @(#)rnusers.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)rnusers.x	2.1 88/08/01 4.0 RPCSRC";*/
%#endif /* not lint */
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/rnusers.x 114629 2003-05-04 02:51:42Z obrien $");
#endif

const MAXUSERS = 100;
const MAXUTLEN = 256;

struct utmp {
	string ut_line<MAXUTLEN>;
	string ut_name<MAXUTLEN>;
	string ut_host<MAXUTLEN>;
	int ut_time;
};

struct utmpidle {
	utmp ui_utmp;
	unsigned int ui_idle;
};

typedef utmp utmparr<MAXUSERS>;

typedef utmpidle utmpidlearr<MAXUSERS>;

const RUSERS_MAXUSERLEN = 32;
const RUSERS_MAXLINELEN = 32;
const RUSERS_MAXHOSTLEN = 257;

struct rusers_utmp {
	string ut_user<RUSERS_MAXUSERLEN>;	/* aka ut_name */
	string ut_line<RUSERS_MAXLINELEN>;	/* device */
	string ut_host<RUSERS_MAXHOSTLEN>;	/* host user logged on from */
	int ut_type;				/* type of entry */
	int ut_time;				/* time entry was made */
	unsigned int ut_idle;			/* minutes idle */
};

typedef rusers_utmp utmp_array<>;

program RUSERSPROG {
	/*
	 * Old version does not include idle information
	 */
	version RUSERSVERS_ORIG {
		int
		RUSERSPROC_NUM(void) = 1;

		utmparr
		RUSERSPROC_NAMES(void) = 2;

		utmparr
		RUSERSPROC_ALLNAMES(void) = 3;
	} = 1;

	/*
	 * Includes idle information
	 */
	version RUSERSVERS_IDLE {
		int
		RUSERSPROC_NUM(void) = 1;

		utmpidlearr
		RUSERSPROC_NAMES(void) = 2;

		utmpidlearr
		RUSERSPROC_ALLNAMES(void) = 3;
	} = 2;

	/*
	 * Version 3 rusers procedures (from Solaris).
	 * (Thanks a lot Sun.)
	 */
	version RUSERSVERS_3 {
		int
		RUSERSPROC_NUM(void) = 1;

		utmp_array
		RUSERSPROC_NAMES(void) = 2;

		utmp_array
		RUSERSPROC_ALLNAMES(void) = 3;
	} = 3;

} = 100002;


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

#ifndef _RQUOTA_H_RPCGEN
#define	_RQUOTA_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

#define	RQ_PATHLEN 1024

struct getquota_args {
	char *gqa_pathp;
	int gqa_uid;
};
typedef struct getquota_args getquota_args;

struct rquota {
	int rq_bsize;
	bool_t rq_active;
	u_int rq_bhardlimit;
	u_int rq_bsoftlimit;
	u_int rq_curblocks;
	u_int rq_fhardlimit;
	u_int rq_fsoftlimit;
	u_int rq_curfiles;
	u_int rq_btimeleft;
	u_int rq_ftimeleft;
};
typedef struct rquota rquota;

enum gqr_status {
	Q_OK = 1,
	Q_NOQUOTA = 2,
	Q_EPERM = 3
};
typedef enum gqr_status gqr_status;

struct getquota_rslt {
	gqr_status status;
	union {
		rquota gqr_rquota;
	} getquota_rslt_u;
};
typedef struct getquota_rslt getquota_rslt;

#define	RQUOTAPROG ((unsigned long)(100011))
#define	RQUOTAVERS ((unsigned long)(1))

extern  void rquotaprog_1(struct svc_req *rqstp, SVCXPRT *transp);
#define	RQUOTAPROC_GETQUOTA ((unsigned long)(1))
extern  getquota_rslt * rquotaproc_getquota_1(getquota_args *, CLIENT *);
extern  getquota_rslt * rquotaproc_getquota_1_svc(getquota_args *, struct svc_req *);
#define	RQUOTAPROC_GETACTIVEQUOTA ((unsigned long)(2))
extern  getquota_rslt * rquotaproc_getactivequota_1(getquota_args *, CLIENT *);
extern  getquota_rslt * rquotaproc_getactivequota_1_svc(getquota_args *, struct svc_req *);
extern int rquotaprog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

/* the xdr functions */
extern  bool_t xdr_getquota_args(XDR *, getquota_args*);
extern  bool_t xdr_rquota(XDR *, rquota*);
extern  bool_t xdr_gqr_status(XDR *, gqr_status*);
extern  bool_t xdr_getquota_rslt(XDR *, getquota_rslt*);

#ifdef __cplusplus
}
#endif

#endif /* !_RQUOTA_H_RPCGEN */


code:
/*
 * Remote quota protocol
 * Requires unix authentication
 */

#ifndef RPC_HDR
%#ifndef lint
%/*static char sccsid[] = "from: @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)rquota.x	2.1 88/08/01 4.0 RPCSRC";*/
%#endif /* not lint */
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/rquota.x 114629 2003-05-04 02:51:42Z obrien $");
#endif

const RQ_PATHLEN = 1024;

struct getquota_args {
	string gqa_pathp<RQ_PATHLEN>;  	/* path to filesystem of interest */
	int gqa_uid;	        	/* inquire about quota for uid */
};

/*
 * remote quota structure
 */
struct rquota {
	int rq_bsize;			/* block size for block counts */
	bool rq_active;  		/* indicates whether quota is active */
	unsigned int rq_bhardlimit;	/* absolute limit on disk blks alloc */
	unsigned int rq_bsoftlimit;	/* preferred limit on disk blks */
	unsigned int rq_curblocks;	/* current block count */
	unsigned int rq_fhardlimit;	/* absolute limit on allocated files */
	unsigned int rq_fsoftlimit;	/* preferred file limit */
	unsigned int rq_curfiles;	/* current # allocated files */
	unsigned int rq_btimeleft;	/* time left for excessive disk use */
	unsigned int rq_ftimeleft;	/* time left for excessive files */
};

enum gqr_status {
	Q_OK = 1,		/* quota returned */
	Q_NOQUOTA = 2,  	/* noquota for uid */
	Q_EPERM = 3		/* no permission to access quota */
};

union getquota_rslt switch (gqr_status status) {
case Q_OK:
	rquota gqr_rquota;	/* valid if status == Q_OK */
case Q_NOQUOTA:
	void;
case Q_EPERM:
	void;
};

program RQUOTAPROG {
	version RQUOTAVERS {
		/*
		 * Get all quotas
		 */
		getquota_rslt
		RQUOTAPROC_GETQUOTA(getquota_args) = 1;

		/*
	 	 * Get active quotas only
		 */
		getquota_rslt
		RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2;
	} = 1;
} = 100011;


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

#ifndef _RSTAT_H_RPCGEN
#define	_RSTAT_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef FSCALE
/*
 * Scale factor for scaled integers used to count load averages.
 */
#define FSHIFT 8 /* bits to right of fixed binary point */
#define FSCALE (1<<FSHIFT)

#endif /* ndef FSCALE */
#define	RSTAT_CPUSTATES 4
#define	RSTAT_DK_NDRIVE 4

struct rstat_timeval {
	u_int tv_sec;
	u_int tv_usec;
};
typedef struct rstat_timeval rstat_timeval;

struct statstime {
	int cp_time[RSTAT_CPUSTATES];
	int dk_xfer[RSTAT_DK_NDRIVE];
	u_int v_pgpgin;
	u_int v_pgpgout;
	u_int v_pswpin;
	u_int v_pswpout;
	u_int v_intr;
	int if_ipackets;
	int if_ierrors;
	int if_oerrors;
	int if_collisions;
	u_int v_swtch;
	int avenrun[3];
	rstat_timeval boottime;
	rstat_timeval curtime;
	int if_opackets;
};
typedef struct statstime statstime;

struct statsswtch {
	int cp_time[RSTAT_CPUSTATES];
	int dk_xfer[RSTAT_DK_NDRIVE];
	u_int v_pgpgin;
	u_int v_pgpgout;
	u_int v_pswpin;
	u_int v_pswpout;
	u_int v_intr;
	int if_ipackets;
	int if_ierrors;
	int if_oerrors;
	int if_collisions;
	u_int v_swtch;
	u_int avenrun[3];
	rstat_timeval boottime;
	int if_opackets;
};
typedef struct statsswtch statsswtch;

struct stats {
	int cp_time[RSTAT_CPUSTATES];
	int dk_xfer[RSTAT_DK_NDRIVE];
	u_int v_pgpgin;
	u_int v_pgpgout;
	u_int v_pswpin;
	u_int v_pswpout;
	u_int v_intr;
	int if_ipackets;
	int if_ierrors;
	int if_oerrors;
	int if_collisions;
	int if_opackets;
};
typedef struct stats stats;

enum clnt_stat rstat(char *, struct statstime *);
int havedisk(char *);

#define	RSTATPROG ((unsigned long)(100001))
#define	RSTATVERS_TIME ((unsigned long)(3))

extern  void rstatprog_3(struct svc_req *rqstp, SVCXPRT *transp);
#define	RSTATPROC_STATS ((unsigned long)(1))
extern  statstime * rstatproc_stats_3(void *, CLIENT *);
extern  statstime * rstatproc_stats_3_svc(void *, struct svc_req *);
#define	RSTATPROC_HAVEDISK ((unsigned long)(2))
extern  u_int * rstatproc_havedisk_3(void *, CLIENT *);
extern  u_int * rstatproc_havedisk_3_svc(void *, struct svc_req *);
extern int rstatprog_3_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
#define	RSTATVERS_SWTCH ((unsigned long)(2))

extern  void rstatprog_2(struct svc_req *rqstp, SVCXPRT *transp);
extern  statsswtch * rstatproc_stats_2(void *, CLIENT *);
extern  statsswtch * rstatproc_stats_2_svc(void *, struct svc_req *);
extern  u_int * rstatproc_havedisk_2(void *, CLIENT *);
extern  u_int * rstatproc_havedisk_2_svc(void *, struct svc_req *);
extern int rstatprog_2_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
#define	RSTATVERS_ORIG ((unsigned long)(1))

extern  void rstatprog_1(struct svc_req *rqstp, SVCXPRT *transp);
extern  stats * rstatproc_stats_1(void *, CLIENT *);
extern  stats * rstatproc_stats_1_svc(void *, struct svc_req *);
extern  u_int * rstatproc_havedisk_1(void *, CLIENT *);
extern  u_int * rstatproc_havedisk_1_svc(void *, struct svc_req *);
extern int rstatprog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

/* the xdr functions */
extern  bool_t xdr_rstat_timeval(XDR *, rstat_timeval*);
extern  bool_t xdr_statstime(XDR *, statstime*);
extern  bool_t xdr_statsswtch(XDR *, statsswtch*);
extern  bool_t xdr_stats(XDR *, stats*);

#ifdef __cplusplus
}
#endif

#endif /* !_RSTAT_H_RPCGEN */


code:
/*
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify Sun RPC without charge, but are not authorized
 * to license or distribute it to anyone else except as part of a product or
 * program developed by the user.
 *
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun RPC is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */

/*
 * Gather statistics on remote machines
 */

#ifdef RPC_HDR

%#ifndef FSCALE
%/*
% * Scale factor for scaled integers used to count load averages.
% */
%#define FSHIFT  8               /* bits to right of fixed binary point */
%#define FSCALE  (1<<FSHIFT)
%
%#endif /* ndef FSCALE */

#else

%#ifndef lint
%/*static char sccsid[] = "from: @(#)rstat.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)rstat.x	2.2 88/08/01 4.0 RPCSRC";*/
%#endif /* not lint */
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/rstat.x 114629 2003-05-04 02:51:42Z obrien $");

#endif /* def RPC_HDR */

const RSTAT_CPUSTATES = 4;
const RSTAT_DK_NDRIVE = 4;

/*
 * GMT since 0:00, January 1, 1970
 */
struct rstat_timeval {
	unsigned int tv_sec;	/* seconds */
	unsigned int tv_usec;	/* and microseconds */
};

struct statstime {				/* RSTATVERS_TIME */
	int cp_time[RSTAT_CPUSTATES];
	int dk_xfer[RSTAT_DK_NDRIVE];
	unsigned int v_pgpgin;	/* these are cumulative sum */
	unsigned int v_pgpgout;
	unsigned int v_pswpin;
	unsigned int v_pswpout;
	unsigned int v_intr;
	int if_ipackets;
	int if_ierrors;
	int if_oerrors;
	int if_collisions;
	unsigned int v_swtch;
	int avenrun[3];         /* scaled by FSCALE */
	rstat_timeval boottime;
	rstat_timeval curtime;
	int if_opackets;
};

struct statsswtch {			/* RSTATVERS_SWTCH */
	int cp_time[RSTAT_CPUSTATES];
	int dk_xfer[RSTAT_DK_NDRIVE];
	unsigned int v_pgpgin;	/* these are cumulative sum */
	unsigned int v_pgpgout;
	unsigned int v_pswpin;
	unsigned int v_pswpout;
	unsigned int v_intr;
	int if_ipackets;
	int if_ierrors;
	int if_oerrors;
	int if_collisions;
	unsigned int v_swtch;
	unsigned int avenrun[3];/* scaled by FSCALE */
	rstat_timeval boottime;
	int if_opackets;
};

struct stats {				/* RSTATVERS_ORIG */
	int cp_time[RSTAT_CPUSTATES];
	int dk_xfer[RSTAT_DK_NDRIVE];
	unsigned int v_pgpgin;	/* these are cumulative sum */
	unsigned int v_pgpgout;
	unsigned int v_pswpin;
	unsigned int v_pswpout;
	unsigned int v_intr;
	int if_ipackets;
	int if_ierrors;
	int if_oerrors;
	int if_collisions;
	int if_opackets;
};

program RSTATPROG {
	/*
	 * Newest version includes current time and context switching info
	 */
	version RSTATVERS_TIME {
		statstime
		RSTATPROC_STATS(void) = 1;

		unsigned int
		RSTATPROC_HAVEDISK(void) = 2;
	} = 3;
	/*
	 * Does not have current time
	 */
	version RSTATVERS_SWTCH {
		statsswtch
		RSTATPROC_STATS(void) = 1;

		unsigned int
		RSTATPROC_HAVEDISK(void) = 2;
	} = 2;
	/*
	 * Old version has no info about current time or context switching
	 */
	version RSTATVERS_ORIG {
		stats
		RSTATPROC_STATS(void) = 1;

		unsigned int
		RSTATPROC_HAVEDISK(void) = 2;
	} = 1;
} = 100001;

#ifdef RPC_HDR
%
%enum clnt_stat rstat(char *, struct statstime *);
%int havedisk(char *);
%
#endif


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

#ifndef _RWALL_H_RPCGEN
#define	_RWALL_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify Sun RPC without charge, but are not authorized
 * to license or distribute it to anyone else except as part of a product or
 * program developed by the user or with the express written consent of
 * Sun Microsystems, Inc.
 *
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun RPC is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */
/*
 * Copyright (c) 1984, 1990 by Sun Microsystems, Inc.
 */

/* from @(#)rwall.x	1.6 91/03/11 TIRPC 1.0 */

#ifndef _rpcsvc_rwall_h
#define _rpcsvc_rwall_h

typedef char *wrapstring;

#endif /* ! _rpcsvc_rwall_h */

#define	WALLPROG ((unsigned long)(100008))
#define	WALLVERS ((unsigned long)(1))

extern  void wallprog_1(struct svc_req *rqstp, SVCXPRT *transp);
#define	WALLPROC_WALL ((unsigned long)(2))
extern  void * wallproc_wall_1(wrapstring *, CLIENT *);
extern  void * wallproc_wall_1_svc(wrapstring *, struct svc_req *);
extern int wallprog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

#ifdef __cplusplus
}
#endif

#endif /* !_RWALL_H_RPCGEN */


code:
%/*
% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
% * unrestricted use provided that this legend is included on all tape
% * media and as a part of the software program in whole or part.  Users
% * may copy or modify Sun RPC without charge, but are not authorized
% * to license or distribute it to anyone else except as part of a product or
% * program developed by the user or with the express written consent of
% * Sun Microsystems, Inc.
% *
% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
% *
% * Sun RPC is provided with no support and without any obligation on the
% * part of Sun Microsystems, Inc. to assist in its use, correction,
% * modification or enhancement.
% *
% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
% * OR ANY PART THEREOF.
% *
% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
% * or profits or other special, indirect and consequential damages, even if
% * Sun has been advised of the possibility of such damages.
% *
% * Sun Microsystems, Inc.
% * 2550 Garcia Avenue
% * Mountain View, California  94043
% */

%/*
% * Copyright (c) 1984, 1990 by Sun Microsystems, Inc.
% */
%
%/* from @(#)rwall.x	1.6 91/03/11 TIRPC 1.0 */

#ifdef RPC_HDR
%
%#ifndef _rpcsvc_rwall_h
%#define _rpcsvc_rwall_h
%
%typedef char *wrapstring;
%
#endif

program WALLPROG {
	version WALLVERS {
		void
		WALLPROC_WALL(wrapstring) = 2;

	} = 1;
} = 100008;

#ifdef RPC_HDR
%
%#endif /* ! _rpcsvc_rwall_h */
#endif


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

#ifndef _SM_INTER_H_RPCGEN
#define	_SM_INTER_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

#define	SM_MAXSTRLEN 1024

struct sm_name {
	char *mon_name;
};
typedef struct sm_name sm_name;

struct my_id {
	char *my_name;
	int my_prog;
	int my_vers;
	int my_proc;
};
typedef struct my_id my_id;

struct mon_id {
	char *mon_name;
	struct my_id my_id;
};
typedef struct mon_id mon_id;

struct mon {
	struct mon_id mon_id;
	char priv[16];
};
typedef struct mon mon;

struct stat_chge {
	char *mon_name;
	int state;
};
typedef struct stat_chge stat_chge;

struct sm_stat {
	int state;
};
typedef struct sm_stat sm_stat;

enum sm_res {
	stat_succ = 0,
	stat_fail = 1
};
typedef enum sm_res sm_res;

struct sm_stat_res {
	sm_res res_stat;
	int state;
};
typedef struct sm_stat_res sm_stat_res;

struct sm_status {
	char *mon_name;
	int state;
	char priv[16];
};
typedef struct sm_status sm_status;

#define	SM_PROG ((unsigned long)(100024))
#define	SM_VERS ((unsigned long)(1))

extern  void sm_prog_1(struct svc_req *rqstp, SVCXPRT *transp);
#define	SM_STAT ((unsigned long)(1))
extern  struct sm_stat_res * sm_stat_1(struct sm_name *, CLIENT *);
extern  struct sm_stat_res * sm_stat_1_svc(struct sm_name *, struct svc_req *);
#define	SM_MON ((unsigned long)(2))
extern  struct sm_stat_res * sm_mon_1(struct mon *, CLIENT *);
extern  struct sm_stat_res * sm_mon_1_svc(struct mon *, struct svc_req *);
#define	SM_UNMON ((unsigned long)(3))
extern  struct sm_stat * sm_unmon_1(struct mon_id *, CLIENT *);
extern  struct sm_stat * sm_unmon_1_svc(struct mon_id *, struct svc_req *);
#define	SM_UNMON_ALL ((unsigned long)(4))
extern  struct sm_stat * sm_unmon_all_1(struct my_id *, CLIENT *);
extern  struct sm_stat * sm_unmon_all_1_svc(struct my_id *, struct svc_req *);
#define	SM_SIMU_CRASH ((unsigned long)(5))
extern  void * sm_simu_crash_1(void *, CLIENT *);
extern  void * sm_simu_crash_1_svc(void *, struct svc_req *);
#define	SM_NOTIFY ((unsigned long)(6))
extern  void * sm_notify_1(struct stat_chge *, CLIENT *);
extern  void * sm_notify_1_svc(struct stat_chge *, struct svc_req *);
extern int sm_prog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

/* the xdr functions */
extern  bool_t xdr_sm_name(XDR *, sm_name*);
extern  bool_t xdr_my_id(XDR *, my_id*);
extern  bool_t xdr_mon_id(XDR *, mon_id*);
extern  bool_t xdr_mon(XDR *, mon*);
extern  bool_t xdr_stat_chge(XDR *, stat_chge*);
extern  bool_t xdr_sm_stat(XDR *, sm_stat*);
extern  bool_t xdr_sm_res(XDR *, sm_res*);
extern  bool_t xdr_sm_stat_res(XDR *, sm_stat_res*);
extern  bool_t xdr_sm_status(XDR *, sm_status*);

#ifdef __cplusplus
}
#endif

#endif /* !_SM_INTER_H_RPCGEN */


code:
/* @(#)sm_inter.x	2.2 88/08/01 4.0 RPCSRC */
/* @(#)sm_inter.x 1.7 87/06/24 Copyr 1987 Sun Micro */

/*
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify Sun RPC without charge, but are not authorized
 * to license or distribute it to anyone else except as part of a product or
 * program developed by the user.
 *
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun RPC is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */

/*
 * Status monitor protocol specification
 * Copyright (C) 1986 Sun Microsystems, Inc.
 *
 */

#ifndef RPC_HDR
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/sm_inter.x 114629 2003-05-04 02:51:42Z obrien $");
#endif

program SM_PROG {
	version SM_VERS  {
		/* res_stat = stat_succ if status monitor agrees to monitor */
		/* res_stat = stat_fail if status monitor cannot monitor */
		/* if res_stat == stat_succ, state = state number of site sm_name */
		struct sm_stat_res			 SM_STAT(struct sm_name) = 1;

		/* res_stat = stat_succ if status monitor agrees to monitor */
		/* res_stat = stat_fail if status monitor cannot monitor */
		/* stat consists of state number of local site */
		struct sm_stat_res			 SM_MON(struct mon) = 2;

		/* stat consists of state number of local site */
		struct sm_stat				 SM_UNMON(struct mon_id) = 3;

		/* stat consists of state number of local site */
		struct sm_stat				 SM_UNMON_ALL(struct my_id) = 4;

		void					 SM_SIMU_CRASH(void) = 5;
		void					 SM_NOTIFY(struct stat_chge) = 6;

	} = 1;
} = 100024;

const	SM_MAXSTRLEN = 1024;

struct sm_name {
	string mon_name<SM_MAXSTRLEN>;
};

struct my_id {
	string	 my_name<SM_MAXSTRLEN>;		/* name of the site iniates the monitoring request*/
	int	my_prog;			/* rpc program # of the requesting process */
	int	my_vers;			/* rpc version # of the requesting process */
	int	my_proc;			/* rpc procedure # of the requesting process */
};

struct mon_id {
	string	mon_name<SM_MAXSTRLEN>;		/* name of the site to be monitored */
	struct my_id my_id;
};

struct mon{
	struct mon_id mon_id;
	opaque priv[16]; 		/* private information to store at monitor for requesting process */
};

struct stat_chge {
	string  mon_name<SM_MAXSTRLEN>;         /* name of the site that had the state change */
	int state;
};

/*
 * state # of status monitor monitonically increases each time
 * status of the site changes:
 * an even number (>= 0) indicates the site is down and
 * an odd number (> 0) indicates the site is up;
 */
struct sm_stat {
	int state;		/* state # of status monitor */
};

enum sm_res {
	stat_succ = 0,		/* status monitor agrees to monitor */
	stat_fail = 1		/* status monitor cannot monitor */
};

struct sm_stat_res {
	sm_res res_stat;
	int state;
};

/*
 * structure of the status message sent back by the status monitor
 * when monitor site status changes
 */
struct sm_status {
	string mon_name<SM_MAXSTRLEN>;
	int state;
	opaque priv[16];		/* stored private information */
};


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

#ifndef _SPRAY_H_RPCGEN
#define	_SPRAY_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

#define	SPRAYMAX 8845

struct spraytimeval {
	u_int sec;
	u_int usec;
};
typedef struct spraytimeval spraytimeval;

struct spraycumul {
	u_int counter;
	spraytimeval clock;
};
typedef struct spraycumul spraycumul;

typedef struct {
	u_int sprayarr_len;
	char *sprayarr_val;
} sprayarr;

#define	SPRAYPROG ((unsigned long)(100012))
#define	SPRAYVERS ((unsigned long)(1))

extern  void sprayprog_1(struct svc_req *rqstp, SVCXPRT *transp);
#define	SPRAYPROC_SPRAY ((unsigned long)(1))
extern  void * sprayproc_spray_1(sprayarr *, CLIENT *);
extern  void * sprayproc_spray_1_svc(sprayarr *, struct svc_req *);
#define	SPRAYPROC_GET ((unsigned long)(2))
extern  spraycumul * sprayproc_get_1(void *, CLIENT *);
extern  spraycumul * sprayproc_get_1_svc(void *, struct svc_req *);
#define	SPRAYPROC_CLEAR ((unsigned long)(3))
extern  void * sprayproc_clear_1(void *, CLIENT *);
extern  void * sprayproc_clear_1_svc(void *, struct svc_req *);
extern int sprayprog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

/* the xdr functions */
extern  bool_t xdr_spraytimeval(XDR *, spraytimeval*);
extern  bool_t xdr_spraycumul(XDR *, spraycumul*);
extern  bool_t xdr_sprayarr(XDR *, sprayarr*);

#ifdef __cplusplus
}
#endif

#endif /* !_SPRAY_H_RPCGEN */


code:
/*
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify Sun RPC without charge, but are not authorized
 * to license or distribute it to anyone else except as part of a product or
 * program developed by the user.
 *
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun RPC is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */

/*
 * Spray a server with packets
 * Useful for testing flakiness of network interfaces
 */

#ifndef RPC_HDR
%#ifndef lint
%/*static char sccsid[] = "from: @(#)spray.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)spray.x	2.1 88/08/01 4.0 RPCSRC";*/
%#endif /* not lint */
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/spray.x 114629 2003-05-04 02:51:42Z obrien $");
#endif

const SPRAYMAX = 8845;	/* max amount can spray */

/*
 * GMT since 0:00, 1 January 1970
 */
struct spraytimeval {
	unsigned int sec;
	unsigned int usec;
};

/*
 * spray statistics
 */
struct spraycumul {
	unsigned int counter;
	spraytimeval clock;
};

/*
 * spray data
 */
typedef opaque sprayarr<SPRAYMAX>;

program SPRAYPROG {
	version SPRAYVERS {
		/*
		 * Just throw away the data and increment the counter
		 * This call never returns, so the client should always
		 * time it out.
		 */
		void
		SPRAYPROC_SPRAY(sprayarr) = 1;

		/*
		 * Get the value of the counter and elapsed time  since
		 * last CLEAR.
		 */
		spraycumul
		SPRAYPROC_GET(void) = 2;

		/*
		 * Clear the counter and reset the elapsed time
		 */
		void
		SPRAYPROC_CLEAR(void) = 3;
	} = 1;
} = 100012;


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

#ifndef _YP_H_RPCGEN
#define	_YP_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

#define	YPMAXRECORD 1024
#define	YPMAXDOMAIN 64
#define	YPMAXMAP 64
#define	YPMAXPEER 64

enum ypstat {
	YP_TRUE = 1,
	YP_NOMORE = 2,
	YP_FALSE = 0,
	YP_NOMAP = -1,
	YP_NODOM = -2,
	YP_NOKEY = -3,
	YP_BADOP = -4,
	YP_BADDB = -5,
	YP_YPERR = -6,
	YP_BADARGS = -7,
	YP_VERS = -8
};
typedef enum ypstat ypstat;

enum ypxfrstat {
	YPXFR_SUCC = 1,
	YPXFR_AGE = 2,
	YPXFR_NOMAP = -1,
	YPXFR_NODOM = -2,
	YPXFR_RSRC = -3,
	YPXFR_RPC = -4,
	YPXFR_MADDR = -5,
	YPXFR_YPERR = -6,
	YPXFR_BADARGS = -7,
	YPXFR_DBM = -8,
	YPXFR_FILE = -9,
	YPXFR_SKEW = -10,
	YPXFR_CLEAR = -11,
	YPXFR_FORCE = -12,
	YPXFR_XFRERR = -13,
	YPXFR_REFUSED = -14
};
typedef enum ypxfrstat ypxfrstat;

typedef char *domainname;

typedef char *mapname;

typedef char *peername;

typedef struct {
	u_int keydat_len;
	char *keydat_val;
} keydat;

typedef struct {
	u_int valdat_len;
	char *valdat_val;
} valdat;

struct ypmap_parms {
	domainname domain;
	mapname map;
	u_int ordernum;
	peername peer;
};
typedef struct ypmap_parms ypmap_parms;

struct ypreq_key {
	domainname domain;
	mapname map;
	keydat key;
};
typedef struct ypreq_key ypreq_key;

struct ypreq_nokey {
	domainname domain;
	mapname map;
};
typedef struct ypreq_nokey ypreq_nokey;

struct ypreq_xfr {
	ypmap_parms map_parms;
	u_int transid;
	u_int prog;
	u_int port;
};
typedef struct ypreq_xfr ypreq_xfr;

struct ypresp_val {
	ypstat stat;
	valdat val;
};
typedef struct ypresp_val ypresp_val;

struct ypresp_key_val {
	ypstat stat;
	valdat val;
	keydat key;
};
typedef struct ypresp_key_val ypresp_key_val;

struct ypresp_master {
	ypstat stat;
	peername peer;
};
typedef struct ypresp_master ypresp_master;

struct ypresp_order {
	ypstat stat;
	u_int ordernum;
};
typedef struct ypresp_order ypresp_order;

struct ypresp_all {
	bool_t more;
	union {
		ypresp_key_val val;
	} ypresp_all_u;
};
typedef struct ypresp_all ypresp_all;

struct ypresp_xfr {
	u_int transid;
	ypxfrstat xfrstat;
};
typedef struct ypresp_xfr ypresp_xfr;

struct ypmaplist {
	mapname map;
	struct ypmaplist *next;
};
typedef struct ypmaplist ypmaplist;

struct ypresp_maplist {
	ypstat stat;
	ypmaplist *maps;
};
typedef struct ypresp_maplist ypresp_maplist;

enum yppush_status {
	YPPUSH_SUCC = 1,
	YPPUSH_AGE = 2,
	YPPUSH_NOMAP = -1,
	YPPUSH_NODOM = -2,
	YPPUSH_RSRC = -3,
	YPPUSH_RPC = -4,
	YPPUSH_MADDR = -5,
	YPPUSH_YPERR = -6,
	YPPUSH_BADARGS = -7,
	YPPUSH_DBM = -8,
	YPPUSH_FILE = -9,
	YPPUSH_SKEW = -10,
	YPPUSH_CLEAR = -11,
	YPPUSH_FORCE = -12,
	YPPUSH_XFRERR = -13,
	YPPUSH_REFUSED = -14
};
typedef enum yppush_status yppush_status;

struct yppushresp_xfr {
	u_int transid;
	yppush_status status;
};
typedef struct yppushresp_xfr yppushresp_xfr;

enum ypbind_resptype {
	YPBIND_SUCC_VAL = 1,
	YPBIND_FAIL_VAL = 2
};
typedef enum ypbind_resptype ypbind_resptype;

struct ypbind_binding {
	char ypbind_binding_addr[4];
	char ypbind_binding_port[2];
};
typedef struct ypbind_binding ypbind_binding;

struct ypbind_resp {
	ypbind_resptype ypbind_status;
	union {
		u_int ypbind_error;
		ypbind_binding ypbind_bindinfo;
	} ypbind_resp_u;
};
typedef struct ypbind_resp ypbind_resp;
#define	YPBIND_ERR_ERR 1
#define	YPBIND_ERR_NOSERV 2
#define	YPBIND_ERR_RESC 3

struct ypbind_setdom {
	domainname ypsetdom_domain;
	ypbind_binding ypsetdom_binding;
	u_int ypsetdom_vers;
};
typedef struct ypbind_setdom ypbind_setdom;

enum ypreqtype {
	YPREQ_KEY = 1,
	YPREQ_NOKEY = 2,
	YPREQ_MAP_PARMS = 3
};
typedef enum ypreqtype ypreqtype;

enum ypresptype {
	YPRESP_VAL = 1,
	YPRESP_KEY_VAL = 2,
	YPRESP_MAP_PARMS = 3
};
typedef enum ypresptype ypresptype;

struct yprequest {
	ypreqtype yp_reqtype;
	union {
		ypreq_key yp_req_keytype;
		ypreq_nokey yp_req_nokeytype;
		ypmap_parms yp_req_map_parmstype;
	} yprequest_u;
};
typedef struct yprequest yprequest;

struct ypresponse {
	ypresptype yp_resptype;
	union {
		ypresp_val yp_resp_valtype;
		ypresp_key_val yp_resp_key_valtype;
		ypmap_parms yp_resp_map_parmstype;
	} ypresponse_u;
};
typedef struct ypresponse ypresponse;

#define	YPPROG ((unsigned long)(100004))
#define	YPOLDVERS ((unsigned long)(1))

extern  void ypprog_1(struct svc_req *rqstp, SVCXPRT *transp);
#define	YPOLDPROC_NULL ((unsigned long)(0))
extern  void * ypoldproc_null_1(void *, CLIENT *);
extern  void * ypoldproc_null_1_svc(void *, struct svc_req *);
#define	YPOLDPROC_DOMAIN ((unsigned long)(1))
extern  bool_t * ypoldproc_domain_1(domainname *, CLIENT *);
extern  bool_t * ypoldproc_domain_1_svc(domainname *, struct svc_req *);
#define	YPOLDPROC_DOMAIN_NONACK ((unsigned long)(2))
extern  bool_t * ypoldproc_domain_nonack_1(domainname *, CLIENT *);
extern  bool_t * ypoldproc_domain_nonack_1_svc(domainname *, struct svc_req *);
#define	YPOLDPROC_MATCH ((unsigned long)(3))
extern  ypresponse * ypoldproc_match_1(yprequest *, CLIENT *);
extern  ypresponse * ypoldproc_match_1_svc(yprequest *, struct svc_req *);
#define	YPOLDPROC_FIRST ((unsigned long)(4))
extern  ypresponse * ypoldproc_first_1(yprequest *, CLIENT *);
extern  ypresponse * ypoldproc_first_1_svc(yprequest *, struct svc_req *);
#define	YPOLDPROC_NEXT ((unsigned long)(5))
extern  ypresponse * ypoldproc_next_1(yprequest *, CLIENT *);
extern  ypresponse * ypoldproc_next_1_svc(yprequest *, struct svc_req *);
#define	YPOLDPROC_POLL ((unsigned long)(6))
extern  ypresponse * ypoldproc_poll_1(yprequest *, CLIENT *);
extern  ypresponse * ypoldproc_poll_1_svc(yprequest *, struct svc_req *);
#define	YPOLDPROC_PUSH ((unsigned long)(7))
extern  ypresponse * ypoldproc_push_1(yprequest *, CLIENT *);
extern  ypresponse * ypoldproc_push_1_svc(yprequest *, struct svc_req *);
#define	YPOLDPROC_PULL ((unsigned long)(8))
extern  ypresponse * ypoldproc_pull_1(yprequest *, CLIENT *);
extern  ypresponse * ypoldproc_pull_1_svc(yprequest *, struct svc_req *);
#define	YPOLDPROC_GET ((unsigned long)(9))
extern  ypresponse * ypoldproc_get_1(yprequest *, CLIENT *);
extern  ypresponse * ypoldproc_get_1_svc(yprequest *, struct svc_req *);
extern int ypprog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
#define	YPVERS ((unsigned long)(2))

extern  void ypprog_2(struct svc_req *rqstp, SVCXPRT *transp);
#define	YPPROC_NULL ((unsigned long)(0))
extern  void * ypproc_null_2(void *, CLIENT *);
extern  void * ypproc_null_2_svc(void *, struct svc_req *);
#define	YPPROC_DOMAIN ((unsigned long)(1))
extern  bool_t * ypproc_domain_2(domainname *, CLIENT *);
extern  bool_t * ypproc_domain_2_svc(domainname *, struct svc_req *);
#define	YPPROC_DOMAIN_NONACK ((unsigned long)(2))
extern  bool_t * ypproc_domain_nonack_2(domainname *, CLIENT *);
extern  bool_t * ypproc_domain_nonack_2_svc(domainname *, struct svc_req *);
#define	YPPROC_MATCH ((unsigned long)(3))
extern  ypresp_val * ypproc_match_2(ypreq_key *, CLIENT *);
extern  ypresp_val * ypproc_match_2_svc(ypreq_key *, struct svc_req *);
#define	YPPROC_FIRST ((unsigned long)(4))
extern  ypresp_key_val * ypproc_first_2(ypreq_nokey *, CLIENT *);
extern  ypresp_key_val * ypproc_first_2_svc(ypreq_nokey *, struct svc_req *);
#define	YPPROC_NEXT ((unsigned long)(5))
extern  ypresp_key_val * ypproc_next_2(ypreq_key *, CLIENT *);
extern  ypresp_key_val * ypproc_next_2_svc(ypreq_key *, struct svc_req *);
#define	YPPROC_XFR ((unsigned long)(6))
extern  ypresp_xfr * ypproc_xfr_2(ypreq_xfr *, CLIENT *);
extern  ypresp_xfr * ypproc_xfr_2_svc(ypreq_xfr *, struct svc_req *);
#define	YPPROC_CLEAR ((unsigned long)(7))
extern  void * ypproc_clear_2(void *, CLIENT *);
extern  void * ypproc_clear_2_svc(void *, struct svc_req *);
#define	YPPROC_ALL ((unsigned long)(8))
extern  ypresp_all * ypproc_all_2(ypreq_nokey *, CLIENT *);
extern  ypresp_all * ypproc_all_2_svc(ypreq_nokey *, struct svc_req *);
#define	YPPROC_MASTER ((unsigned long)(9))
extern  ypresp_master * ypproc_master_2(ypreq_nokey *, CLIENT *);
extern  ypresp_master * ypproc_master_2_svc(ypreq_nokey *, struct svc_req *);
#define	YPPROC_ORDER ((unsigned long)(10))
extern  ypresp_order * ypproc_order_2(ypreq_nokey *, CLIENT *);
extern  ypresp_order * ypproc_order_2_svc(ypreq_nokey *, struct svc_req *);
#define	YPPROC_MAPLIST ((unsigned long)(11))
extern  ypresp_maplist * ypproc_maplist_2(domainname *, CLIENT *);
extern  ypresp_maplist * ypproc_maplist_2_svc(domainname *, struct svc_req *);
extern int ypprog_2_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

#define	YPPUSH_XFRRESPPROG ((unsigned long)(0x40000000))
#define	YPPUSH_XFRRESPVERS ((unsigned long)(1))

extern  void yppush_xfrrespprog_1(struct svc_req *rqstp, SVCXPRT *transp);
#define	YPPUSHPROC_NULL ((unsigned long)(0))
extern  void * yppushproc_null_1(void *, CLIENT *);
extern  void * yppushproc_null_1_svc(void *, struct svc_req *);
#define	YPPUSHPROC_XFRRESP ((unsigned long)(1))
extern  void * yppushproc_xfrresp_1(yppushresp_xfr *, CLIENT *);
extern  void * yppushproc_xfrresp_1_svc(yppushresp_xfr *, struct svc_req *);
extern int yppush_xfrrespprog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

#define	YPBINDPROG ((unsigned long)(100007))
#define	YPBINDVERS ((unsigned long)(2))

extern  void ypbindprog_2(struct svc_req *rqstp, SVCXPRT *transp);
#define	YPBINDPROC_NULL ((unsigned long)(0))
extern  void * ypbindproc_null_2(void *, CLIENT *);
extern  void * ypbindproc_null_2_svc(void *, struct svc_req *);
#define	YPBINDPROC_DOMAIN ((unsigned long)(1))
extern  ypbind_resp * ypbindproc_domain_2(domainname *, CLIENT *);
extern  ypbind_resp * ypbindproc_domain_2_svc(domainname *, struct svc_req *);
#define	YPBINDPROC_SETDOM ((unsigned long)(2))
extern  void * ypbindproc_setdom_2(ypbind_setdom *, CLIENT *);
extern  void * ypbindproc_setdom_2_svc(ypbind_setdom *, struct svc_req *);
extern int ypbindprog_2_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

/* the xdr functions */
extern  bool_t xdr_ypstat(XDR *, ypstat*);
extern  bool_t xdr_ypxfrstat(XDR *, ypxfrstat*);
extern  bool_t xdr_domainname(XDR *, domainname*);
extern  bool_t xdr_mapname(XDR *, mapname*);
extern  bool_t xdr_peername(XDR *, peername*);
extern  bool_t xdr_keydat(XDR *, keydat*);
extern  bool_t xdr_valdat(XDR *, valdat*);
extern  bool_t xdr_ypmap_parms(XDR *, ypmap_parms*);
extern  bool_t xdr_ypreq_key(XDR *, ypreq_key*);
extern  bool_t xdr_ypreq_nokey(XDR *, ypreq_nokey*);
extern  bool_t xdr_ypreq_xfr(XDR *, ypreq_xfr*);
extern  bool_t xdr_ypresp_val(XDR *, ypresp_val*);
extern  bool_t xdr_ypresp_key_val(XDR *, ypresp_key_val*);
extern  bool_t xdr_ypresp_master(XDR *, ypresp_master*);
extern  bool_t xdr_ypresp_order(XDR *, ypresp_order*);
extern  bool_t xdr_ypresp_all(XDR *, ypresp_all*);
extern  bool_t xdr_ypresp_xfr(XDR *, ypresp_xfr*);
extern  bool_t xdr_ypmaplist(XDR *, ypmaplist*);
extern  bool_t xdr_ypresp_maplist(XDR *, ypresp_maplist*);
extern  bool_t xdr_yppush_status(XDR *, yppush_status*);
extern  bool_t xdr_yppushresp_xfr(XDR *, yppushresp_xfr*);
extern  bool_t xdr_ypbind_resptype(XDR *, ypbind_resptype*);
extern  bool_t xdr_ypbind_binding(XDR *, ypbind_binding*);
extern  bool_t xdr_ypbind_resp(XDR *, ypbind_resp*);
extern  bool_t xdr_ypbind_setdom(XDR *, ypbind_setdom*);
extern  bool_t xdr_ypreqtype(XDR *, ypreqtype*);
extern  bool_t xdr_ypresptype(XDR *, ypresptype*);
extern  bool_t xdr_yprequest(XDR *, yprequest*);
extern  bool_t xdr_ypresponse(XDR *, ypresponse*);

#ifdef __cplusplus
}
#endif

#endif /* !_YP_H_RPCGEN */


code:
/* @(#)yp.x	2.1 88/08/01 4.0 RPCSRC */

/*
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify Sun RPC without charge, but are not authorized
 * to license or distribute it to anyone else except as part of a product or
 * program developed by the user.
 *
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun RPC is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */

/*
 * Protocol description file for the Yellow Pages Service
 */

#ifndef RPC_HDR
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/yp.x 114629 2003-05-04 02:51:42Z obrien $");
#endif

const YPMAXRECORD = 1024;
const YPMAXDOMAIN = 64;
const YPMAXMAP = 64;
const YPMAXPEER = 64;

enum ypstat {
	YP_TRUE		=  1,
	YP_NOMORE	=  2,
	YP_FALSE	=  0,
	YP_NOMAP	= -1,
	YP_NODOM	= -2,
	YP_NOKEY	= -3,
	YP_BADOP	= -4,
	YP_BADDB	= -5,
	YP_YPERR	= -6,
	YP_BADARGS	= -7,
	YP_VERS		= -8
};

enum ypxfrstat {
	YPXFR_SUCC	=  1,
	YPXFR_AGE	=  2,
	YPXFR_NOMAP	= -1,
	YPXFR_NODOM	= -2,
	YPXFR_RSRC	= -3,
	YPXFR_RPC	= -4,
	YPXFR_MADDR	= -5,
	YPXFR_YPERR	= -6,
	YPXFR_BADARGS	= -7,
	YPXFR_DBM	= -8,
	YPXFR_FILE	= -9,
	YPXFR_SKEW	= -10,
	YPXFR_CLEAR	= -11,
	YPXFR_FORCE	= -12,
	YPXFR_XFRERR	= -13,
	YPXFR_REFUSED	= -14
};

typedef string domainname<YPMAXDOMAIN>;
typedef string mapname<YPMAXMAP>;
typedef string peername<YPMAXPEER>;
typedef opaque keydat<YPMAXRECORD>;
typedef opaque valdat<YPMAXRECORD>;

struct ypmap_parms {
	domainname domain;
	mapname map;
	unsigned int ordernum;
	peername peer;
};

struct ypreq_key {
	domainname domain;
	mapname map;
	keydat key;
};

struct ypreq_nokey {
	domainname domain;
	mapname map;
};

struct ypreq_xfr {
	ypmap_parms map_parms;
	unsigned int transid;
	unsigned int prog;
	unsigned int port;
};

struct ypresp_val {
	ypstat stat;
	valdat val;
};

struct ypresp_key_val {
	ypstat stat;
#ifdef STUPID_SUN_BUG /* These are backwards */
	keydat key;
	valdat val;
#else
	valdat val;
	keydat key;
#endif
};

struct ypresp_master {
	ypstat stat;
	peername peer;
};

struct ypresp_order {
	ypstat stat;
	unsigned int ordernum;
};

union ypresp_all switch (bool more) {
case TRUE:
	ypresp_key_val val;
case FALSE:
	void;
};

struct ypresp_xfr {
	unsigned int transid;
	ypxfrstat xfrstat;
};

struct ypmaplist {
	mapname map;
	ypmaplist *next;
};

struct ypresp_maplist {
	ypstat stat;
	ypmaplist *maps;
};

enum yppush_status {
	YPPUSH_SUCC	=  1,	/* Success */
	YPPUSH_AGE 	=  2,	/* Master's version not newer */
	YPPUSH_NOMAP	= -1,	/* Can't find server for map */
	YPPUSH_NODOM	= -2,	/* Domain not supported */
	YPPUSH_RSRC	= -3,	/* Local resource alloc failure */
	YPPUSH_RPC	= -4,	/* RPC failure talking to server */
	YPPUSH_MADDR 	= -5,	/* Can't get master address */
	YPPUSH_YPERR	= -6,	/* YP server/map db error */
	YPPUSH_BADARGS	= -7,	/* Request arguments bad */
	YPPUSH_DBM	= -8,	/* Local dbm operation failed */
	YPPUSH_FILE	= -9,	/* Local file I/O operation failed */
	YPPUSH_SKEW	= -10,	/* Map version skew during transfer */
	YPPUSH_CLEAR	= -11,	/* Can't send "Clear" req to local ypserv */
	YPPUSH_FORCE	= -12,	/* No local order number in map  use -f flag. */
	YPPUSH_XFRERR 	= -13,	/* ypxfr error */
	YPPUSH_REFUSED	= -14 	/* Transfer request refused by ypserv */
};

struct yppushresp_xfr {
	unsigned transid;
	yppush_status status;
};

/*
 * Response structure and overall result status codes.  Success and failure
 * represent two separate response message types.
 */

enum ypbind_resptype {
	YPBIND_SUCC_VAL = 1,
	YPBIND_FAIL_VAL = 2
};

struct ypbind_binding {
    opaque ypbind_binding_addr[4]; /* In network order */
    opaque ypbind_binding_port[2]; /* In network order */
};

union ypbind_resp switch (ypbind_resptype ypbind_status) {
case YPBIND_FAIL_VAL:
        unsigned ypbind_error;
case YPBIND_SUCC_VAL:
        ypbind_binding ypbind_bindinfo;
};

/* Detailed failure reason codes for response field ypbind_error*/

const YPBIND_ERR_ERR    = 1;	/* Internal error */
const YPBIND_ERR_NOSERV = 2;	/* No bound server for passed domain */
const YPBIND_ERR_RESC   = 3;	/* System resource allocation failure */

/*
 * Request data structure for ypbind "Set domain" procedure.
 */
struct ypbind_setdom {
	domainname ypsetdom_domain;
	ypbind_binding ypsetdom_binding;
	unsigned ypsetdom_vers;
};

/*
 * NIS v1 support for backwards compatibility
 */
enum ypreqtype {
	YPREQ_KEY = 1,
	YPREQ_NOKEY = 2,
	YPREQ_MAP_PARMS = 3
};

enum ypresptype {
	YPRESP_VAL = 1,
	YPRESP_KEY_VAL = 2,
	YPRESP_MAP_PARMS = 3
};

union yprequest switch (ypreqtype yp_reqtype) {
case YPREQ_KEY:
	ypreq_key yp_req_keytype;
case YPREQ_NOKEY:
	ypreq_nokey yp_req_nokeytype;
case YPREQ_MAP_PARMS:
	ypmap_parms yp_req_map_parmstype;
};

union ypresponse switch (ypresptype yp_resptype) {
case YPRESP_VAL:
	ypresp_val yp_resp_valtype;
case YPRESP_KEY_VAL:
	ypresp_key_val yp_resp_key_valtype;
case YPRESP_MAP_PARMS:
	ypmap_parms yp_resp_map_parmstype;
};

#if !defined(YPBIND_ONLY) && !defined(YPPUSH_ONLY)
/*
 * YP access protocol
 */
program YPPROG {
/*
 * NIS v1 support for backwards compatibility
 */
	version YPOLDVERS {
		void
		YPOLDPROC_NULL(void) = 0;

		bool
		YPOLDPROC_DOMAIN(domainname) = 1;

		bool
		YPOLDPROC_DOMAIN_NONACK(domainname) = 2;

		ypresponse
		YPOLDPROC_MATCH(yprequest) = 3;

		ypresponse
		YPOLDPROC_FIRST(yprequest) = 4;

		ypresponse
		YPOLDPROC_NEXT(yprequest) = 5;

		ypresponse
		YPOLDPROC_POLL(yprequest) = 6;

		ypresponse
		YPOLDPROC_PUSH(yprequest) = 7;

		ypresponse
		YPOLDPROC_PULL(yprequest) = 8;

		ypresponse
		YPOLDPROC_GET(yprequest) = 9;
	} = 1;

	version YPVERS {
		void
		YPPROC_NULL(void) = 0;

		bool
		YPPROC_DOMAIN(domainname) = 1;

		bool
		YPPROC_DOMAIN_NONACK(domainname) = 2;

		ypresp_val
		YPPROC_MATCH(ypreq_key) = 3;

		ypresp_key_val
#ifdef STUPID_SUN_BUG /* should be ypreq_nokey */
		YPPROC_FIRST(ypreq_key) = 4;
#else
		YPPROC_FIRST(ypreq_nokey) = 4;
#endif
		ypresp_key_val
		YPPROC_NEXT(ypreq_key) = 5;

		ypresp_xfr
		YPPROC_XFR(ypreq_xfr) = 6;

		void
		YPPROC_CLEAR(void) = 7;

		ypresp_all
		YPPROC_ALL(ypreq_nokey) = 8;

		ypresp_master
		YPPROC_MASTER(ypreq_nokey) = 9;

		ypresp_order
		YPPROC_ORDER(ypreq_nokey) = 10;

		ypresp_maplist
		YPPROC_MAPLIST(domainname) = 11;
	} = 2;
} = 100004;
#endif
#if !defined(YPSERV_ONLY) && !defined(YPBIND_ONLY)
/*
 * YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR
 */
program YPPUSH_XFRRESPPROG {
	version YPPUSH_XFRRESPVERS {
		void
		YPPUSHPROC_NULL(void) = 0;
#ifdef STUPID_SUN_BUG /* argument and return value are backwards */
		yppushresp_xfr
		YPPUSHPROC_XFRRESP(void) = 1;
#else
		void
		YPPUSHPROC_XFRRESP(yppushresp_xfr) = 1;
#endif
	} = 1;
} = 0x40000000;	/* transient: could be anything up to 0x5fffffff */
#endif
#if !defined(YPSERV_ONLY) && !defined(YPPUSH_ONLY)
/*
 * YP binding protocol
 */
program YPBINDPROG {
	version YPBINDVERS {
		void
		YPBINDPROC_NULL(void) = 0;

		ypbind_resp
		YPBINDPROC_DOMAIN(domainname) = 1;

		void
		YPBINDPROC_SETDOM(ypbind_setdom) = 2;
	} = 2;
} = 100007;

#endif


code:
/*
 * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote
 *    products derived from this software without specific prior written
 *    permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * $FreeBSD: release/9.0.0/include/rpcsvc/yp_prot.h 153149 2005-12-06 02:01:06Z peter $
 */

#ifndef _RPCSVC_YP_PROT_H_
#define _RPCSVC_YP_PROT_H_

/*
 * YPSERV PROTOCOL:
 *
 * ypserv supports the following procedures:
 *
 * YPPROC_NULL		takes (void), returns (void).
 * 			called to check if server is alive.
 * YPPROC_DOMAIN	takes (char *), returns (bool_t).
 * 			true if ypserv serves the named domain.
 * YPPROC_DOMAIN_NOACK	takes (char *), returns (bool_t).
 * 			true if ypserv serves the named domain.
 *			used for broadcasts, does not ack if ypserv
 *			doesn't handle named domain.
 * YPPROC_MATCH		takes (struct ypreq_key), returns (struct ypresp_val)
 * 			does a lookup.
 * YPPROC_FIRST		takes (struct ypreq_nokey) returns (ypresp_key_val).
 * 			gets the first key/datum from the map.
 * YPPROC_NEXT		takes (struct ypreq_key) returns (ypresp_key_val).
 * 			gets the next key/datum from the map.
 * YPPROC_XFR		takes (struct ypreq_xfr), returns (void).
 * 			tells ypserv to check if there is a new version of
 *			the map.
 * YPPROC_CLEAR		takes (void), returns (void).
 * 			tells ypserv to flush it's file cache, so that
 *			newly transferred files will get read.
 * YPPROC_ALL		takes (struct ypreq_nokey), returns (bool_t and
 *			struct ypresp_key_val).
 * 			returns an array of data, with the bool_t being
 * 			false on the last datum. read the source, it's
 *			convoluted.
 * YPPROC_MASTER	takes (struct ypreq_nokey), returns (ypresp_master).
 * YPPROC_ORDER		takes (struct ypreq_nokey), returns (ypresp_order).
 * YPPROC_MAPLIST	takes (char *), returns (struct ypmaplist *).
 */

#ifndef BOOL_DEFINED
typedef u_int bool;
#define BOOL_DEFINED
#endif

/* Program and version symbols, magic numbers */

#define YPPROG		((u_long)100004)
#define YPVERS		((u_long)2)
#define YPVERS_ORIG	((u_long)1)
#define YPMAXRECORD	((u_long)1024)
#define YPMAXDOMAIN	((u_long)64)
#define YPMAXMAP	((u_long)64)
#define YPMAXPEER	((u_long)256)

/*
 * I don't know if anything of sun's depends on this, or if they
 * simply defined it so that their own code wouldn't try to send
 * packets over the ethernet MTU. This YP code doesn't use it.
 */
#define YPMSGSZ		1600

#ifndef DATUM
typedef struct {
	char	*dptr;
	int	dsize;
} datum;
#define DATUM
#endif

struct ypmap_parms {
	char *domain;
	char *map;
	u_int ordernum;
	char *owner;
};

struct ypreq_key {
	char *domain;
	char *map;
	datum keydat;
};

struct ypreq_nokey {
	char *domain;
	char *map;
};

struct ypreq_xfr {
	struct ypmap_parms map_parms;
	u_int transid;
	u_int proto;
	u_int port;
};
#define ypxfr_domain	map_parms.domain
#define ypxfr_map	map_parms.map
#define ypxfr_ordernum	map_parms.ordernum
#define ypxfr_owner	map_parms.owner

struct ypresp_val {
	u_int status;
	datum valdat;
};

struct ypresp_key_val {
	u_int status;
	datum keydat;
	datum valdat;
};

struct ypresp_master {
	u_int status;
	char *master;
};

struct ypresp_order {
	u_int status;
	u_int ordernum;
};

struct ypmaplist {
	char *ypml_name;
	struct ypmaplist *ypml_next;
};

struct ypresp_maplist {
	u_int status;
	struct ypmaplist *list;
};

/* ypserv procedure numbers */
#define YPPROC_NULL		((u_long)0)
#define YPPROC_DOMAIN		((u_long)1)
#define YPPROC_DOMAIN_NONACK	((u_long)2)
#define YPPROC_MATCH		((u_long)3)
#define YPPROC_FIRST		((u_long)4)
#define YPPROC_NEXT		((u_long)5)
#define YPPROC_XFR		((u_long)6)
#define YPPROC_CLEAR		((u_long)7)
#define YPPROC_ALL		((u_long)8)
#define YPPROC_MASTER		((u_long)9)
#define YPPROC_ORDER		((u_long)10)
#define YPPROC_MAPLIST		((u_long)11)

/* ypserv procedure return status values */
#define YP_TRUE	 	((long)1)	/* general purpose success code */
#define YP_NOMORE 	((long)2)	/* no more entries in map */
#define YP_FALSE 	((long)0)	/* general purpose failure code */
#define YP_NOMAP 	((long)-1)	/* no such map in domain */
#define YP_NODOM 	((long)-2)	/* domain not supported */
#define YP_NOKEY 	((long)-3)	/* no such key in map */
#define YP_BADOP 	((long)-4)	/* invalid operation */
#define YP_BADDB 	((long)-5)	/* server data base is bad */
#define YP_YPERR 	((long)-6)	/* YP server error */
#define YP_BADARGS 	((long)-7)	/* request arguments bad */
#define YP_VERS		((long)-8)	/* YP server version mismatch */

/*
 * Sun's header file says:
 * "Domain binding data structure, used by ypclnt package and ypserv modules.
 * Users of the ypclnt package (or of this protocol) don't HAVE to know about
 * it, but it must be available to users because _yp_dobind is a public
 * interface."
 *
 * This is totally bogus! Nowhere else does Sun state that _yp_dobind() is
 * a public interface, and I don't know any reason anyone would want to call
 * it. But, just in case anyone does actually expect it to be available..
 * we provide this.. exactly as Sun wants it.
 */
struct dom_binding {
	struct dom_binding *dom_pnext;
	char dom_domain[YPMAXDOMAIN + 1];
	struct sockaddr_in dom_server_addr;
	u_short dom_server_port;
	int dom_socket;
	CLIENT *dom_client;
	u_short dom_local_port;
	long dom_vers;
};

/*
 * YPBIND PROTOCOL:
 *
 * ypbind supports the following procedures:
 *
 * YPBINDPROC_NULL	takes (void), returns (void).
 *			to check if ypbind is running.
 * YPBINDPROC_DOMAIN	takes (char *), returns (struct ypbind_resp).
 *			requests that ypbind start to serve the
 *			named domain (if it doesn't already)
 * YPBINDPROC_SETDOM	takes (struct ypbind_setdom), returns (void).
 *			used by ypset.
 */

#define YPBINDPROG		((u_long)100007)
#define YPBINDVERS		((u_long)2)
#define YPBINDVERS_ORIG		((u_long)1)

/* ypbind procedure numbers */
#define YPBINDPROC_NULL		((u_long)0)
#define YPBINDPROC_DOMAIN	((u_long)1)
#define YPBINDPROC_SETDOM	((u_long)2)

/* error code in ypbind_resp.ypbind_status */
enum ypbind_resptype {
	YPBIND_SUCC_VAL = 1,
	YPBIND_FAIL_VAL = 2
};

/* network order, of course */
struct ypbind_binding {
	struct in_addr	ypbind_binding_addr;
	u_short		ypbind_binding_port;
};

struct ypbind_resp {
	enum ypbind_resptype	ypbind_status;
	union {
		u_int			ypbind_error;
		struct ypbind_binding	ypbind_bindinfo;
	} ypbind_respbody;
};

/* error code in ypbind_resp.ypbind_respbody.ypbind_error */
#define YPBIND_ERR_ERR		1	/* internal error */
#define YPBIND_ERR_NOSERV	2	/* no bound server for passed domain */
#define YPBIND_ERR_RESC		3	/* system resource allocation failure */

/*
 * Request data structure for ypbind "Set domain" procedure.
 */
struct ypbind_setdom {
	char ypsetdom_domain[YPMAXDOMAIN + 1];
	struct ypbind_binding ypsetdom_binding;
	u_int ypsetdom_vers;
};
#define ypsetdom_addr ypsetdom_binding.ypbind_binding_addr
#define ypsetdom_port ypsetdom_binding.ypbind_binding_port

/*
 * YPPUSH PROTOCOL:
 *
 * Sun says:
 * "Protocol between clients (ypxfr, only) and yppush
 *  yppush speaks a protocol in the transient range, which
 *  is supplied to ypxfr as a command-line parameter when it
 *  is activated by ypserv."
 *
 * This protocol is not implemented, naturally, because this YP
 * implementation only does the client side.
 */
#define YPPUSHVERS		((u_long)1)
#define YPPUSHVERS_ORIG		((u_long)1)

/* yppush procedure numbers */
#define YPPUSHPROC_NULL		((u_long)0)
#define YPPUSHPROC_XFRRESP	((u_long)1)

struct yppushresp_xfr {
	u_int	transid;
	u_int	status;
};

/* yppush status value in yppushresp_xfr.status */
#define YPPUSH_SUCC	((long)1)	/* Success */
#define YPPUSH_AGE	((long)2)	/* Master's version not newer */
#define YPPUSH_NOMAP 	((long)-1)	/* Can't find server for map */
#define YPPUSH_NODOM 	((long)-2)	/* Domain not supported */
#define YPPUSH_RSRC 	((long)-3)	/* Local resource alloc failure */
#define YPPUSH_RPC 	((long)-4)	/* RPC failure talking to server */
#define YPPUSH_MADDR	((long)-5)	/* Can't get master address */
#define YPPUSH_YPERR 	((long)-6)	/* YP server/map db error */
#define YPPUSH_BADARGS 	((long)-7)	/* Request arguments bad */
#define YPPUSH_DBM	((long)-8)	/* Local dbm operation failed */
#define YPPUSH_FILE	((long)-9)	/* Local file I/O operation failed */
#define YPPUSH_SKEW	((long)-10)	/* Map version skew during transfer */
#define YPPUSH_CLEAR	((long)-11)	/* Can't send "Clear" req to local ypserv */
#define YPPUSH_FORCE	((long)-12)	/* No local order number in map - use -f */
#define YPPUSH_XFRERR	((long)-13)	/* ypxfr error */
#define YPPUSH_REFUSED	((long)-14)	/* Transfer request refused by ypserv */

struct inaddr;
__BEGIN_DECLS
bool_t	xdr_datum(XDR *, datum *);
bool_t	xdr_ypreq_key(XDR *, struct ypreq_key *);
bool_t	xdr_ypreq_nokey(XDR *, struct ypreq_nokey *);
bool_t	xdr_ypreq_xfr(XDR *, struct ypreq_xfr *);
bool_t	xdr_ypresp_val(XDR *, struct ypresp_val *);
bool_t	xdr_ypresp_key_val(XDR *, struct ypresp_key_val *);
bool_t	xdr_ypbind_resp(XDR *, struct ypbind_resp *);
bool_t	xdr_ypbind_setdom(XDR *, struct ypbind_setdom *);
bool_t	xdr_yp_inaddr(XDR *, struct inaddr *);
bool_t	xdr_ypmap_parms(XDR *, struct ypmap_parms *);
bool_t	xdr_yppushresp_xfr(XDR *, struct yppushresp_xfr *);
bool_t	xdr_ypresp_order(XDR *, struct ypresp_order *);
bool_t	xdr_ypresp_master(XDR *, struct ypresp_master *);
bool_t	xdr_ypresp_maplist(XDR *, struct ypresp_maplist *);
__END_DECLS

#endif /* _RPCSVC_YP_PROT_H_ */


code:
/*
 * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote
 *    products derived from this software without specific prior written
 *    permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * $FreeBSD: release/9.0.0/include/rpcsvc/ypclnt.h 121577 2003-10-26 16:35:11Z peter $
 */

#ifndef _RPCSVC_YPCLNT_H_
#define _RPCSVC_YPCLNT_H_

#include <sys/cdefs.h>

#define YPERR_BADARGS	1		/* args to function are bad */
#define YPERR_RPC	2		/* RPC failure */
#define YPERR_DOMAIN	3		/* can't bind to a server for domain */
#define YPERR_MAP	4		/* no such map in server's domain */
#define YPERR_KEY	5		/* no such key in map */
#define YPERR_YPERR	6		/* some internal YP server or client error */
#define YPERR_RESRC	7		/* local resource allocation failure */
#define YPERR_NOMORE	8		/* no more records in map database */
#define YPERR_PMAP	9		/* can't communicate with portmapper */
#define YPERR_YPBIND	10		/* can't communicate with ypbind */
#define YPERR_YPSERV	11		/* can't communicate with ypserv */
#define YPERR_NODOM	12		/* local domain name not set */
#define YPERR_BADDB	13		/* YP data base is bad */
#define YPERR_VERS	14		/* YP version mismatch */
#define YPERR_ACCESS	15		/* access violation */
#define YPERR_BUSY	16		/* database is busy */

/*
 * Types of update operations
 */
#define YPOP_CHANGE	1		/* change, do not add */
#define YPOP_INSERT	2		/* add, do not change */
#define YPOP_DELETE	3		/* delete this entry */
#define YPOP_STORE 	4		/* add, or change */

struct ypall_callback {
	/* return non-0 to stop getting called */
	int (*foreach)(unsigned long, char *, int, char *, int, void *);
	char *data;		/* opaque pointer for use of callback fn */
};

struct dom_binding;
struct ypmaplist;
struct ypall_callback;

__BEGIN_DECLS
int	yp_bind(char *dom);
int	_yp_dobind(char *dom, struct dom_binding **ypdb);
void	yp_unbind(char *dom);
int	yp_get_default_domain(char **domp);
int	yp_match(char *indomain, char *inmap, const char *inkey, int inkeylen,
	    char **outval, int *outvallen);
int	yp_first(char *indomain, char *inmap, char **outkey, int *outkeylen,
	    char **outval, int *outvallen);
int	yp_next(char *indomain, char *inmap, char *inkey, int inkeylen,
	    char **outkey, int *outkeylen, char **outval, int *outvallen);
int	yp_maplist(char *indomain, struct ypmaplist **outmaplist);
int	yp_master(char *indomain, char *inmap, char **outname);
int	yp_order(char *indomain, char *inmap, int *outorder);
int	yp_all(char *indomain, char *inmap, struct ypall_callback *incallback);
const char *yperr_string(int incode);
const char *ypbinderr_string(int incode);
int	ypprot_err(unsigned int incode);
__END_DECLS

#endif /* _RPCSVC_YPCLNT_H_ */


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

#ifndef _YPPASSWD_H_RPCGEN
#define	_YPPASSWD_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

struct x_passwd {
	char *pw_name;
	char *pw_passwd;
	int pw_uid;
	int pw_gid;
	char *pw_gecos;
	char *pw_dir;
	char *pw_shell;
};
typedef struct x_passwd x_passwd;

struct yppasswd {
	char *oldpass;
	x_passwd newpw;
};
typedef struct yppasswd yppasswd;
#include <sys/cdefs.h>
extern int _yppasswd( char * , struct x_passwd * );
#define yppasswd(x,y) _yppasswd(x,y)

#define	YPPASSWDPROG ((unsigned long)(100009))
#define	YPPASSWDVERS ((unsigned long)(1))

extern  void yppasswdprog_1(struct svc_req *rqstp, SVCXPRT *transp);
#define	YPPASSWDPROC_UPDATE ((unsigned long)(1))
extern  int * yppasswdproc_update_1(yppasswd *, CLIENT *);
extern  int * yppasswdproc_update_1_svc(yppasswd *, struct svc_req *);
extern int yppasswdprog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

/* the xdr functions */
extern  bool_t xdr_x_passwd(XDR *, x_passwd*);
extern  bool_t xdr_yppasswd(XDR *, yppasswd*);

#ifdef __cplusplus
}
#endif

#endif /* !_YPPASSWD_H_RPCGEN */


code:
/*
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify Sun RPC without charge, but are not authorized
 * to license or distribute it to anyone else except as part of a product or
 * program developed by the user.
 *
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun RPC is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */

/*
 * YP password update protocol
 * Requires unix authentication
 */

#ifndef RPC_HDR
%#ifndef lint
%/*static char sccsid[] = "from: @(#)yppasswd.x 1.1 87/04/13 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)yppasswd.x	2.1 88/08/01 4.0 RPCSRC";*/
%#endif /* not lint */
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/yppasswd.x 114629 2003-05-04 02:51:42Z obrien $");
#endif

program YPPASSWDPROG {
	version YPPASSWDVERS {
		/*
		 * Update my passwd entry
		 */
		int
		YPPASSWDPROC_UPDATE(yppasswd) = 1;
	} = 1;
} = 100009;

struct x_passwd {
	string pw_name<>;	/* username */
	string pw_passwd<>;	/* encrypted password */
	int pw_uid;		/* user id */
	int pw_gid;		/* group id */
	string pw_gecos<>;	/* in real life name */
	string pw_dir<>;	/* home directory */
	string pw_shell<>;	/* default shell */
};

struct yppasswd {
	string oldpass<>;	/* unencrypted old password */
	x_passwd newpw;		/* new passwd entry */
};

#ifdef RPC_HDR
%#include <sys/cdefs.h>
%extern int _yppasswd( char * , struct x_passwd * );
%#define yppasswd(x,y) _yppasswd(x,y)
#endif


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

#ifndef _YPUPDATE_PROT_H_RPCGEN
#define	_YPUPDATE_PROT_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify Sun RPC without charge, but are not authorized
 * to license or distribute it to anyone else except as part of a product or
 * program developed by the user or with the express written consent of
 * Sun Microsystems, Inc.
 *
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun RPC is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */
/*
 * Copyright (c) 1986, 1990 by Sun Microsystems, Inc.
 */

/* from @(#)ypupdate_prot.x	1.3 91/03/11 TIRPC 1.0 */

/*
 * Compiled from ypupdate_prot.x using rpcgen
 * This is NOT source code!
 * DO NOT EDIT THIS FILE!
 */

#ifndef _rpcsvc_ypupdate_prot_h
#define _rpcsvc_ypupdate_prot_h

#define	MAXMAPNAMELEN 255
#define	MAXYPDATALEN 1023
#define	MAXERRMSGLEN 255

typedef struct {
	u_int yp_buf_len;
	char *yp_buf_val;
} yp_buf;

struct ypupdate_args {
	char *mapname;
	yp_buf key;
	yp_buf datum;
};
typedef struct ypupdate_args ypupdate_args;

struct ypdelete_args {
	char *mapname;
	yp_buf key;
};
typedef struct ypdelete_args ypdelete_args;

#endif /* !_rpcsvc_ypupdate_prot_h */

#define	YPU_PROG ((unsigned long)(100028))
#define	YPU_VERS ((unsigned long)(1))

extern  void ypu_prog_1(struct svc_req *rqstp, SVCXPRT *transp);
#define	YPU_CHANGE ((unsigned long)(1))
extern  u_int * ypu_change_1(ypupdate_args *, CLIENT *);
extern  u_int * ypu_change_1_svc(ypupdate_args *, struct svc_req *);
#define	YPU_INSERT ((unsigned long)(2))
extern  u_int * ypu_insert_1(ypupdate_args *, CLIENT *);
extern  u_int * ypu_insert_1_svc(ypupdate_args *, struct svc_req *);
#define	YPU_DELETE ((unsigned long)(3))
extern  u_int * ypu_delete_1(ypdelete_args *, CLIENT *);
extern  u_int * ypu_delete_1_svc(ypdelete_args *, struct svc_req *);
#define	YPU_STORE ((unsigned long)(4))
extern  u_int * ypu_store_1(ypupdate_args *, CLIENT *);
extern  u_int * ypu_store_1_svc(ypupdate_args *, struct svc_req *);
extern int ypu_prog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

/* the xdr functions */
extern  bool_t xdr_yp_buf(XDR *, yp_buf*);
extern  bool_t xdr_ypupdate_args(XDR *, ypupdate_args*);
extern  bool_t xdr_ypdelete_args(XDR *, ypdelete_args*);

#ifdef __cplusplus
}
#endif

#endif /* !_YPUPDATE_PROT_H_RPCGEN */


code:
%/*
% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
% * unrestricted use provided that this legend is included on all tape
% * media and as a part of the software program in whole or part.  Users
% * may copy or modify Sun RPC without charge, but are not authorized
% * to license or distribute it to anyone else except as part of a product or
% * program developed by the user or with the express written consent of
% * Sun Microsystems, Inc.
% *
% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
% *
% * Sun RPC is provided with no support and without any obligation on the
% * part of Sun Microsystems, Inc. to assist in its use, correction,
% * modification or enhancement.
% *
% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
% * OR ANY PART THEREOF.
% *
% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
% * or profits or other special, indirect and consequential damages, even if
% * Sun has been advised of the possibility of such damages.
% *
% * Sun Microsystems, Inc.
% * 2550 Garcia Avenue
% * Mountain View, California  94043
% */

%/*
% * Copyright (c) 1986, 1990 by Sun Microsystems, Inc.
% */
%
%/* from @(#)ypupdate_prot.x	1.3 91/03/11 TIRPC 1.0 */
#ifndef RPC_HDR
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/ypupdate_prot.x 114629 2003-05-04 02:51:42Z obrien $");
#endif
%
%/*
% * Compiled from ypupdate_prot.x using rpcgen
% * This is NOT source code!
% * DO NOT EDIT THIS FILE!
% */

/*
 * YP update service protocol
 */
#ifdef RPC_HDR
%
%#ifndef _rpcsvc_ypupdate_prot_h
%#define _rpcsvc_ypupdate_prot_h
%
#endif

const MAXMAPNAMELEN = 255;
const MAXYPDATALEN  = 1023;
const MAXERRMSGLEN  = 255;

program YPU_PROG {
	version YPU_VERS {
		u_int YPU_CHANGE(ypupdate_args) = 1;
		u_int YPU_INSERT(ypupdate_args) = 2;
		u_int YPU_DELETE(ypdelete_args) = 3;
		u_int YPU_STORE(ypupdate_args)  = 4;
	} = 1;
} = 100028;

typedef opaque yp_buf<MAXYPDATALEN>;

struct ypupdate_args {
	string mapname<MAXMAPNAMELEN>;
	yp_buf key;
	yp_buf datum;
};

struct ypdelete_args {
	string mapname<MAXMAPNAMELEN>;
	yp_buf key;
};

#ifdef RPC_HDR
%
%#endif /* !_rpcsvc_ypupdate_prot_h */
#endif


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

#ifndef _YPXFRD_H_RPCGEN
#define	_YPXFRD_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

#define	_YPMAXRECORD 1024
#define	_YPMAXDOMAIN 64
#define	_YPMAXMAP 64
#define	_YPMAXPEER 64
#define	YPXFRBLOCK 32767

enum xfrstat {
	XFR_REQUEST_OK = 1,
	XFR_DENIED = 2,
	XFR_NOFILE = 3,
	XFR_ACCESS = 4,
	XFR_BADDB = 5,
	XFR_READ_OK = 6,
	XFR_READ_ERR = 7,
	XFR_DONE = 8,
	XFR_DB_ENDIAN_MISMATCH = 9,
	XFR_DB_TYPE_MISMATCH = 10
};
typedef enum xfrstat xfrstat;

enum xfr_db_type {
	XFR_DB_ASCII = 1,
	XFR_DB_BSD_HASH = 2,
	XFR_DB_BSD_BTREE = 3,
	XFR_DB_BSD_RECNO = 4,
	XFR_DB_BSD_MPOOL = 5,
	XFR_DB_BSD_NDBM = 6,
	XFR_DB_GNU_GDBM = 7,
	XFR_DB_DBM = 8,
	XFR_DB_NDBM = 9,
	XFR_DB_OPAQUE = 10,
	XFR_DB_ANY = 11,
	XFR_DB_UNKNOWN = 12
};
typedef enum xfr_db_type xfr_db_type;

enum xfr_byte_order {
	XFR_ENDIAN_BIG = 1,
	XFR_ENDIAN_LITTLE = 2,
	XFR_ENDIAN_ANY = 3
};
typedef enum xfr_byte_order xfr_byte_order;

typedef char *xfrdomain;

typedef char *xfrmap;

typedef char *xfrmap_filename;

struct ypxfr_mapname {
	xfrmap xfrmap;
	xfrdomain xfrdomain;
	xfrmap_filename xfrmap_filename;
	xfr_db_type xfr_db_type;
	xfr_byte_order xfr_byte_order;
};
typedef struct ypxfr_mapname ypxfr_mapname;

struct xfr {
	bool_t ok;
	union {
		struct {
			u_int xfrblock_buf_len;
			char *xfrblock_buf_val;
		} xfrblock_buf;
		xfrstat xfrstat;
	} xfr_u;
};
typedef struct xfr xfr;

#define	YPXFRD_FREEBSD_PROG ((unsigned long)(600100069))
#define	YPXFRD_FREEBSD_VERS ((unsigned long)(1))

extern  void ypxfrd_freebsd_prog_1(struct svc_req *rqstp, SVCXPRT *transp);
#define	YPXFRD_GETMAP ((unsigned long)(1))
extern  struct xfr * ypxfrd_getmap_1(ypxfr_mapname *, CLIENT *);
extern  struct xfr * ypxfrd_getmap_1_svc(ypxfr_mapname *, struct svc_req *);
extern int ypxfrd_freebsd_prog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

/* the xdr functions */
extern  bool_t xdr_xfrstat(XDR *, xfrstat*);
extern  bool_t xdr_xfr_db_type(XDR *, xfr_db_type*);
extern  bool_t xdr_xfr_byte_order(XDR *, xfr_byte_order*);
extern  bool_t xdr_xfrdomain(XDR *, xfrdomain*);
extern  bool_t xdr_xfrmap(XDR *, xfrmap*);
extern  bool_t xdr_xfrmap_filename(XDR *, xfrmap_filename*);
extern  bool_t xdr_ypxfr_mapname(XDR *, ypxfr_mapname*);
extern  bool_t xdr_xfr(XDR *, xfr*);

#ifdef __cplusplus
}
#endif

#endif /* !_YPXFRD_H_RPCGEN */


code:
/*
 * Copyright (c) 1995, 1996
 *	Bill Paul <wpaul@ctr.columbia.edu>.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by Bill Paul.
 * 4. Neither the name of the author nor the names of any co-contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

/*
 * This protocol definition file describes a file transfer
 * system used to very quickly move NIS maps from one host to
 * another. This is similar to what Sun does with their ypxfrd
 * protocol, but it must be stressed that this protocol is _NOT_
 * compatible with Sun's. There are a couple of reasons for this:
 *
 * 1) Sun's protocol is proprietary. The protocol definition is
 *    not freely available in any of the SunRPC source distributions,
 *    even though the NIS v2 protocol is.
 *
 * 2) The idea here is to transfer entire raw files rather than
 *    sending just the records. Sun uses ndbm for its NIS map files,
 *    while FreeBSD uses Berkeley DB. Both are hash databases, but the
 *    formats are incompatible, making it impossible for them to
 *    use each others' files. Even if FreeBSD adopted ndbm for its
 *    database format, FreeBSD/i386 is a little-endian OS and
 *    SunOS/SPARC is big-endian; ndbm is byte-order sensitive and
 *    not very smart about it, which means an attempt to read a
 *    database on a little-endian box that was created on a big-endian
 *    box (or vice-versa) can cause the ndbm code to eat itself.
 *    Luckily, Berkeley DB is able to deal with this situation in
 *    a more graceful manner.
 *
 * While the protocol is incompatible, the idea is the same: we just open
 * up a TCP pipe to the client and transfer the raw map database
 * from the master server to the slave. This is many times faster than
 * the standard yppush/ypxfr transfer method since it saves us from
 * having to recreate the map databases via the DB library each time.
 * For example: creating a passwd database with 30,000 entries with yp_mkdb
 * can take a couple of minutes, but to just copy the file takes only a few
 * seconds.
 */

#ifndef RPC_HDR
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/ypxfrd.x 114629 2003-05-04 02:51:42Z obrien $");
#endif

/* XXX cribbed from yp.x */
const _YPMAXRECORD = 1024;
const _YPMAXDOMAIN = 64;
const _YPMAXMAP = 64;
const _YPMAXPEER = 64;

/* Suggested default -- not necesarrily the one used. */
const YPXFRBLOCK = 32767;

/*
 * Possible return codes from the remote server.
 */
enum xfrstat {
	XFR_REQUEST_OK	= 1,	/* Transfer request granted */
	XFR_DENIED	= 2,	/* Transfer request denied */
	XFR_NOFILE	= 3,	/* Requested map file doesn't exist */
	XFR_ACCESS	= 4,	/* File exists, but I couldn't access it */
	XFR_BADDB	= 5,	/* File is not a hash database */
	XFR_READ_OK	= 6,	/* Block read successfully */
	XFR_READ_ERR	= 7,	/* Read error during transfer */
	XFR_DONE	= 8,	/* Transfer completed */
	XFR_DB_ENDIAN_MISMATCH	= 9,	/* Database byte order mismatch */
	XFR_DB_TYPE_MISMATCH	= 10	/* Database type mismatch */
};

/*
 * Database type specifications. The client can use this to ask
 * the server for a particular type of database or just take whatever
 * the server has to offer.
 */
enum xfr_db_type {
	XFR_DB_ASCII		= 1,	/* Flat ASCII text */
	XFR_DB_BSD_HASH		= 2,	/* Berkeley DB, hash method */
	XFR_DB_BSD_BTREE	= 3,	/* Berkeley DB, btree method */
	XFR_DB_BSD_RECNO	= 4,	/* Berkeley DB, recno method */
	XFR_DB_BSD_MPOOL	= 5,	/* Berkeley DB, mpool method */
	XFR_DB_BSD_NDBM		= 6,	/* Berkeley DB, hash, ndbm compat */
	XFR_DB_GNU_GDBM		= 7,	/* GNU GDBM */
	XFR_DB_DBM		= 8,	/* Old, deprecated dbm format */
	XFR_DB_NDBM		= 9,	/* ndbm format (used by Sun's NISv2) */
	XFR_DB_OPAQUE		= 10,	/* Mystery format -- just pass along */
	XFR_DB_ANY		= 11,	/* I'll take any format you've got */
	XFR_DB_UNKNOWN		= 12	/* Unknown format */
};

/*
 * Machine byte order specification. This allows the client to check
 * that it's copying a map database from a machine of similar byte sex.
 * This is necessary for handling database libraries that are fatally
 * byte order sensitive.
 *
 * The XFR_ENDIAN_ANY type is for use with the Berkeley DB database
 * formats; Berkeley DB is smart enough to make up for byte order
 * differences, so byte sex isn't important.
 */
enum xfr_byte_order {
	XFR_ENDIAN_BIG		= 1,	/* We want big endian */
	XFR_ENDIAN_LITTLE	= 2,	/* We want little endian */
	XFR_ENDIAN_ANY		= 3	/* We'll take whatever you got */
};

typedef string xfrdomain<_YPMAXDOMAIN>;
typedef string xfrmap<_YPMAXMAP>;
typedef string xfrmap_filename<_YPMAXMAP>;	/* actual name of map file */

/*
 * Ask the remote ypxfrd for a map using this structure.
 * Note: we supply both a map name and a map file name. These are not
 * the same thing. In the case of ndbm, maps are stored in two files:
 * map.bykey.pag and may.bykey.dir. We may also have to deal with
 * file extensions (on the off chance that the remote server is supporting
 * multiple DB formats). To handle this, we tell the remote server both
 * what map we want and, in the case of ndbm, whether we want the .dir
 * or the .pag part. This name should not be a fully qualified path:
 * it's up to the remote server to decide which directories to look in.
 */
struct ypxfr_mapname {
	xfrmap xfrmap;
	xfrdomain xfrdomain;
	xfrmap_filename xfrmap_filename;
	xfr_db_type xfr_db_type;
	xfr_byte_order xfr_byte_order;
};

/* Read response using this structure. */
union xfr switch (bool ok) {
case TRUE:
	opaque xfrblock_buf<>;
case FALSE:
	xfrstat xfrstat;
};

program YPXFRD_FREEBSD_PROG {
	version YPXFRD_FREEBSD_VERS {
		union xfr
		YPXFRD_GETMAP(ypxfr_mapname) = 1;
	} = 1;
} = 600100069;	/* 100069 + 60000000 -- 100069 is the Sun ypxfrd prog number */


code:
/*
 * Copyright (c)1996-2002 by Hartmut Brandt
 *	All rights reserved.
 *
 * Author: Hartmut Brandt
 *
 * Redistribution of this software and documentation and use in source and
 * binary forms, with or without modification, are permitted provided that
 * the following conditions are met:
 *
 * 1. Redistributions of source code or documentation must retain the above
 *   copyright notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE AUTHOR
 * AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
 * THE AUTHOR OR ITS CONTRIBUTORS  BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
/*
 * $Begemot: libbegemot/rpoll.h,v 1.5 2004/09/21 15:49:26 brandt Exp $
 */
# ifndef rpoll_h_
# define rpoll_h_

# ifdef __cplusplus
extern "C" {
# endif

typedef void (*poll_f)(int fd, int mask, void *arg);
typedef void (*timer_f)(int, void *);

int	poll_register(int fd, poll_f func, void *arg, int mask);
void	poll_unregister(int);
void	poll_dispatch(int wait);
int	poll_start_timer(u_int msecs, int repeat, timer_f func, void *arg);
int	poll_start_utimer(unsigned long long usecs, int repeat, timer_f func,
    void *arg);
void	poll_stop_timer(int);

# if defined(POLL_IN)
#  undef POLL_IN
# endif
# if defined(POLL_OUT)
#  undef POLL_OUT
# endif

# define POLL_IN	1
# define POLL_OUT	2
# define POLL_EXCEPT	4

extern int	rpoll_policy;
extern int	rpoll_trace;

# ifdef __cplusplus
}
# endif

# endif