New headers for the new RPC code (based on TI-RPC from Sun).
This commit is contained in:
parent
03228642f7
commit
c257a3b3ea
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.85 2000/04/20 09:56:36 kleink Exp $
|
||||
# $NetBSD: Makefile,v 1.86 2000/06/02 22:57:54 fvdl Exp $
|
||||
# @(#)Makefile 8.2 (Berkeley) 1/4/94
|
||||
|
||||
SRCTOP= ..
|
||||
|
@ -14,7 +14,8 @@ INCS= a.out.h ar.h assert.h bitstring.h bm.h cpio.h ctype.h db.h dirent.h \
|
|||
iso646.h kvm.h langinfo.h libgen.h \
|
||||
limits.h link.h link_aout.h link_elf.h locale.h \
|
||||
login_cap.h malloc.h math.h md4.h \
|
||||
memory.h mpool.h ndbm.h netdb.h netgroup.h nlist.h nl_types.h \
|
||||
memory.h mpool.h ndbm.h netconfig.h netdb.h netgroup.h nlist.h \
|
||||
nl_types.h \
|
||||
nsswitch.h paths.h pwd.h ranlib.h re_comp.h regex.h regexp.h \
|
||||
resolv.h rmt.h search.h setjmp.h sgtty.h signal.h stab.h stddef.h \
|
||||
stdio.h stdlib.h string.h strings.h stringlist.h struct.h sysexits.h \
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
/* $NetBSD: netconfig.h,v 1.1 2000/06/02 22:57:54 fvdl Exp $ */
|
||||
|
||||
|
||||
#ifndef _NETCONFIG_H_
|
||||
#define _NETCONFIG_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#define NETCONFIG "/etc/netconfig"
|
||||
#define NETPATH "NETPATH"
|
||||
|
||||
struct netconfig {
|
||||
char *nc_netid; /* Network ID */
|
||||
unsigned long nc_semantics; /* Semantics (see below) */
|
||||
unsigned long nc_flag; /* Flags (see below) */
|
||||
char *nc_protofmly; /* Protocol family */
|
||||
char *nc_proto; /* Protocol name */
|
||||
char *nc_device; /* Network device pathname */
|
||||
unsigned long nc_nlookups; /* Number of directory lookup libs */
|
||||
char **nc_lookups; /* Names of the libraries */
|
||||
unsigned long nc_unused[9]; /* reserved */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct netconfig **nc_head;
|
||||
struct netconfig **nc_curr;
|
||||
} NCONF_HANDLE;
|
||||
|
||||
/*
|
||||
* nc_semantics values
|
||||
*/
|
||||
#define NC_TPI_CLTS 1
|
||||
#define NC_TPI_COTS 2
|
||||
#define NC_TPI_COTS_ORD 3
|
||||
#define NC_TPI_RAW 4
|
||||
|
||||
/*
|
||||
* nc_flag values
|
||||
*/
|
||||
#define NC_NOFLAG 0x00
|
||||
#define NC_VISIBLE 0x01
|
||||
#define NC_BROADCAST 0x02
|
||||
|
||||
/*
|
||||
* nc_protofmly values
|
||||
*/
|
||||
#define NC_NOPROTOFMLY "-"
|
||||
#define NC_LOOPBACK "loopback"
|
||||
#define NC_INET "inet"
|
||||
#define NC_INET6 "inet6"
|
||||
#define NC_IMPLINK "implink"
|
||||
#define NC_PUP "pup"
|
||||
#define NC_CHAOS "chaos"
|
||||
#define NC_NS "ns"
|
||||
#define NC_NBS "nbs"
|
||||
#define NC_ECMA "ecma"
|
||||
#define NC_DATAKIT "datakit"
|
||||
#define NC_CCITT "ccitt"
|
||||
#define NC_SNA "sna"
|
||||
#define NC_DECNET "decnet"
|
||||
#define NC_DLI "dli"
|
||||
#define NC_LAT "lat"
|
||||
#define NC_HYLINK "hylink"
|
||||
#define NC_APPLETALK "appletalk"
|
||||
#define NC_NIT "nit"
|
||||
#define NC_IEEE802 "ieee802"
|
||||
#define NC_OSI "osi"
|
||||
#define NC_X25 "x25"
|
||||
#define NC_OSINET "osinet"
|
||||
#define NC_GOSIP "gosip"
|
||||
|
||||
/*
|
||||
* nc_proto values
|
||||
*/
|
||||
#define NC_NOPROTO "-"
|
||||
#define NC_TCP "tcp"
|
||||
#define NC_UDP "udp"
|
||||
#define NC_ICMP "icmp"
|
||||
|
||||
__BEGIN_DECLS
|
||||
void *setnetconfig __P((void));
|
||||
struct netconfig *getnetconfig __P((void *));
|
||||
struct netconfig *getnetconfigent __P((char *));
|
||||
void freenetconfigent __P((struct netconfig *));
|
||||
int endnetconfig __P((void *));
|
||||
|
||||
void *setnetpath __P((void));
|
||||
struct netconfig *getnetpath __P((void *));
|
||||
int endnetpath(void *);
|
||||
|
||||
void nc_perror __P((const char *));
|
||||
char *nc_sperror __P((void));
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _NETCONFIG_H_ */
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: auth.h,v 1.14 1998/11/16 12:07:43 christos Exp $ */
|
||||
/* $NetBSD: auth.h,v 1.15 2000/06/02 22:57:55 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
|
@ -175,6 +175,9 @@ extern AUTH *authdes_create __P((char *, u_int,
|
|||
struct sockaddr_in *, des_block *));
|
||||
extern bool_t xdr_opaque_auth __P((XDR *, struct opaque_auth *));
|
||||
|
||||
#define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip))
|
||||
#define authsys_create_default() authunix_create_default()
|
||||
|
||||
struct svc_req;
|
||||
struct rpc_msg;
|
||||
enum auth_stat _svcauth_null __P((struct svc_req *, struct rpc_msg *));
|
||||
|
@ -184,7 +187,8 @@ __END_DECLS
|
|||
|
||||
#define AUTH_NONE 0 /* no authentication */
|
||||
#define AUTH_NULL 0 /* backward compatibility */
|
||||
#define AUTH_UNIX 1 /* unix style (uid, gids) */
|
||||
#define AUTH_SYS 1 /* unix style (uid, gids) */
|
||||
#define AUTH_UNIX AUTH_SYS /* backward compatibility */
|
||||
#define AUTH_SHORT 2 /* short hand unix style */
|
||||
#define AUTH_DES 3 /* des style (encrypted timestamps) */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: clnt.h,v 1.13 1998/11/16 12:07:43 christos Exp $ */
|
||||
/* $NetBSD: clnt.h,v 1.14 2000/06/02 22:57:55 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
|
@ -28,7 +28,7 @@
|
|||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)clnt.h 1.31 88/02/08 SMI
|
||||
* from: @(#)clnt.h 1.31 94/04/29 SMI
|
||||
* @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC
|
||||
*/
|
||||
|
||||
|
@ -42,6 +42,11 @@
|
|||
#define _RPC_CLNT_H_
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/*
|
||||
* Well-known IPV6 RPC broadcast address.
|
||||
*/
|
||||
#define RPCB_MULTICAST_ADDR "ff02::202"
|
||||
|
||||
/*
|
||||
* Rpc calls return an enum clnt_stat. This should be looked at more,
|
||||
* since each implementation is required to live with this (implementation
|
||||
|
@ -69,20 +74,36 @@ enum clnt_stat {
|
|||
RPC_SYSTEMERROR=12, /* generic "other problem" */
|
||||
|
||||
/*
|
||||
* callrpc & clnt_create errors
|
||||
* rpc_call & clnt_create errors
|
||||
*/
|
||||
RPC_UNKNOWNHOST=13, /* unknown host name */
|
||||
RPC_UNKNOWNPROTO=17, /* unkown protocol */
|
||||
RPC_UNKNOWNADDR = 19, /* Remote address unknown */
|
||||
RPC_NOBROADCAST = 21, /* Broadcasting not supported */
|
||||
|
||||
/*
|
||||
* _ create errors
|
||||
* rpcbind errors
|
||||
*/
|
||||
RPC_PMAPFAILURE=14, /* the pmapper failed in its call */
|
||||
RPC_RPCBFAILURE=14, /* the pmapper failed in its call */
|
||||
#define RPC_PMAPFAILURE RPC_RPCBFAILURE
|
||||
RPC_PROGNOTREGISTERED=15, /* remote program is not registered */
|
||||
RPC_N2AXLATEFAILURE = 22, /* name -> addr translation failed */
|
||||
|
||||
/*
|
||||
* Misc error in the TLI library (provided for compatibility)
|
||||
*/
|
||||
RPC_TLIERROR = 20,
|
||||
|
||||
/*
|
||||
* unspecified error
|
||||
*/
|
||||
RPC_FAILED=16
|
||||
RPC_FAILED=16,
|
||||
|
||||
/*
|
||||
* asynchronous errors
|
||||
*/
|
||||
RPC_INPROGRESS = 24,
|
||||
RPC_STALERACHANDLE = 25
|
||||
};
|
||||
|
||||
|
||||
|
@ -95,8 +116,8 @@ struct rpc_err {
|
|||
int RE_errno; /* related system error */
|
||||
enum auth_stat RE_why; /* why the auth error occurred */
|
||||
struct {
|
||||
u_int32_t low; /* lowest version supported */
|
||||
u_int32_t high; /* highest version supported */
|
||||
rpcvers_t low; /* lowest version supported */
|
||||
rpcvers_t high; /* highest version supported */
|
||||
} RE_vers;
|
||||
struct { /* maybe meaningful if RPC_FAILED */
|
||||
int32_t s1;
|
||||
|
@ -112,7 +133,7 @@ struct rpc_err {
|
|||
|
||||
/*
|
||||
* Client rpc handle.
|
||||
* Created by individual implementations, see e.g. rpc_udp.c.
|
||||
* Created by individual implementations
|
||||
* Client is responsible for initializing auth, see e.g. auth_none.c.
|
||||
*/
|
||||
typedef struct __rpc_client {
|
||||
|
@ -120,7 +141,7 @@ typedef struct __rpc_client {
|
|||
const struct clnt_ops {
|
||||
/* call remote procedure */
|
||||
enum clnt_stat (*cl_call) __P((struct __rpc_client *,
|
||||
u_long, xdrproc_t, caddr_t, xdrproc_t,
|
||||
rpcproc_t, xdrproc_t, caddr_t, xdrproc_t,
|
||||
caddr_t, struct timeval));
|
||||
/* abort a call */
|
||||
void (*cl_abort) __P((struct __rpc_client *));
|
||||
|
@ -137,9 +158,33 @@ typedef struct __rpc_client {
|
|||
char *));
|
||||
} *cl_ops;
|
||||
void *cl_private; /* private stuff */
|
||||
char *cl_netid; /* network token */
|
||||
char *cl_tp; /* device name */
|
||||
} CLIENT;
|
||||
|
||||
|
||||
/*
|
||||
* Timers used for the pseudo-transport protocol when using datagrams
|
||||
*/
|
||||
struct rpc_timers {
|
||||
u_short rt_srtt; /* smoothed round-trip time */
|
||||
u_short rt_deviate; /* estimated deviation */
|
||||
u_long rt_rtxcur; /* current (backed-off) rto */
|
||||
};
|
||||
|
||||
/*
|
||||
* Feedback values used for possible congestion and rate control
|
||||
*/
|
||||
#define FEEDBACK_REXMIT1 1 /* first retransmit */
|
||||
#define FEEDBACK_OK 2 /* no retransmits */
|
||||
|
||||
/* Used to set version of portmapper used in broadcast */
|
||||
|
||||
#define CLCR_SET_LOWVERS 3
|
||||
#define CLCR_GET_LOWVERS 4
|
||||
|
||||
#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */
|
||||
|
||||
/*
|
||||
* client side rpc interface ops
|
||||
*
|
||||
|
@ -151,7 +196,7 @@ typedef struct __rpc_client {
|
|||
* enum clnt_stat
|
||||
* CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
|
||||
* CLIENT *rh;
|
||||
* u_long proc;
|
||||
* rpcproc_t proc;
|
||||
* xdrproc_t xargs;
|
||||
* caddr_t argsp;
|
||||
* xdrproc_t xres;
|
||||
|
@ -205,11 +250,24 @@ typedef struct __rpc_client {
|
|||
/*
|
||||
* control operations that apply to both udp and tcp transports
|
||||
*/
|
||||
#define CLSET_TIMEOUT 1 /* set timeout (timeval) */
|
||||
#define CLGET_TIMEOUT 2 /* get timeout (timeval) */
|
||||
#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */
|
||||
#define CLSET_TIMEOUT 1 /* set timeout (timeval) */
|
||||
#define CLGET_TIMEOUT 2 /* get timeout (timeval) */
|
||||
#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */
|
||||
#define CLGET_FD 6 /* get connections file descriptor */
|
||||
#define CLGET_SVC_ADDR 7 /* get server's address (netbuf) */
|
||||
#define CLSET_FD_CLOSE 8 /* close fd while clnt_destroy */
|
||||
#define CLSET_FD_NCLOSE 9 /* Do not close fd while clnt_destroy */
|
||||
#define CLGET_XID 10 /* Get xid */
|
||||
#define CLSET_XID 11 /* Set xid */
|
||||
#define CLGET_VERS 12 /* Get version number */
|
||||
#define CLSET_VERS 13 /* Set version number */
|
||||
#define CLGET_PROG 14 /* Get program number */
|
||||
#define CLSET_PROG 15 /* Set program number */
|
||||
#define CLSET_SVC_ADDR 16 /* get server's address (netbuf) */
|
||||
#define CLSET_PUSH_TIMOD 17 /* push timod if not already present */
|
||||
#define CLSET_POP_TIMOD 18 /* pop timod */
|
||||
/*
|
||||
* udp only control operations
|
||||
* Connectionless only control operations
|
||||
*/
|
||||
#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */
|
||||
#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */
|
||||
|
@ -229,104 +287,130 @@ typedef struct __rpc_client {
|
|||
* and network administration.
|
||||
*/
|
||||
|
||||
#define RPCTEST_PROGRAM ((u_long)1)
|
||||
#define RPCTEST_VERSION ((u_long)1)
|
||||
#define RPCTEST_NULL_PROC ((u_long)2)
|
||||
#define RPCTEST_NULL_BATCH_PROC ((u_long)3)
|
||||
#define RPCTEST_PROGRAM ((rpcprog_t)1)
|
||||
#define RPCTEST_VERSION ((rpcvers_t)1)
|
||||
#define RPCTEST_NULL_PROC ((rpcproc_t)2)
|
||||
#define RPCTEST_NULL_BATCH_PROC ((rpcproc_t)3)
|
||||
|
||||
/*
|
||||
* By convention, procedure 0 takes null arguments and returns them
|
||||
*/
|
||||
|
||||
#define NULLPROC ((u_long)0)
|
||||
#define NULLPROC ((rpcproc_t)0)
|
||||
|
||||
/*
|
||||
* Below are the client handle creation routines for the various
|
||||
* implementations of client side rpc. They can return NULL if a
|
||||
* creation failure occurs.
|
||||
* implementations of client side rpc. They can return NULL if a
|
||||
* creation failure occurs.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Generic client creation routine. Supported protocols are those that
|
||||
* belong to the nettype namespace (/etc/netconfig).
|
||||
* CLIENT *
|
||||
* clnt_create(host, prog, vers, prot);
|
||||
* const char *host; -- hostname
|
||||
* const rpcprog_t prog; -- program number
|
||||
* const rpcvers_t vers; -- version number
|
||||
* const char *prot; -- protocol
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern CLIENT *clnt_create __P((const char *, const rpcprog_t, const rpcvers_t,
|
||||
const char *));
|
||||
/*
|
||||
*
|
||||
* const char *hostname; -- hostname
|
||||
* const rpcprog_t prog; -- program number
|
||||
* const rpcvers_t vers; -- version number
|
||||
* const char *nettype; -- network type
|
||||
*/
|
||||
|
||||
/*
|
||||
* Generic client creation routine. Supported protocols are which belong
|
||||
* to the nettype name space.
|
||||
*/
|
||||
extern CLIENT *clnt_create_vers __P((const char *, const rpcprog_t, rpcvers_t *,
|
||||
const rpcvers_t, const rpcvers_t,
|
||||
const char *));
|
||||
/*
|
||||
* const char *host; -- hostname
|
||||
* const rpcprog_t prog; -- program number
|
||||
* rpcvers_t *vers_out; -- servers highest available version
|
||||
* const rpcvers_t vers_low; -- low version number
|
||||
* const rpcvers_t vers_high; -- high version number
|
||||
* const char *nettype; -- network type
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Generic client creation routine. It takes a netconfig structure
|
||||
* instead of nettype
|
||||
*/
|
||||
extern CLIENT *clnt_tp_create __P((const char *, const rpcprog_t,
|
||||
const rpcvers_t, const struct netconfig *));
|
||||
/*
|
||||
* const char *hostname; -- hostname
|
||||
* const rpcprog_t prog; -- program number
|
||||
* const rpcvers_t vers; -- version number
|
||||
* const struct netconfig *netconf; -- network config structure
|
||||
*/
|
||||
|
||||
/*
|
||||
* Generic TLI create routine. Only provided for compatibility.
|
||||
*/
|
||||
|
||||
extern CLIENT *clnt_tli_create __P((const int, const struct netconfig *,
|
||||
const struct netbuf *, const rpcprog_t,
|
||||
const rpcvers_t, const u_int, const u_int));
|
||||
/*
|
||||
* const register int fd; -- fd
|
||||
* const struct netconfig *nconf; -- netconfig structure
|
||||
* const struct netbuf *svcaddr; -- servers address
|
||||
* const u_long prog; -- program number
|
||||
* const u_long vers; -- version number
|
||||
* const u_int sendsz; -- send size
|
||||
* const u_int recvsz; -- recv size
|
||||
*/
|
||||
|
||||
/*
|
||||
* Low level clnt create routine for connectionful transports, e.g. tcp.
|
||||
*/
|
||||
extern CLIENT *clnt_vc_create __P((const int, const struct netbuf *,
|
||||
const rpcprog_t, const rpcvers_t,
|
||||
const u_int, const u_int));
|
||||
/*
|
||||
* const int fd; -- open file descriptor
|
||||
* const struct netbuf *svcaddr; -- servers address
|
||||
* const rpcprog_t prog; -- program number
|
||||
* const rpcvers_t vers; -- version number
|
||||
* const u_int sendsz; -- buffer recv size
|
||||
* const u_int recvsz; -- buffer send size
|
||||
*/
|
||||
|
||||
/*
|
||||
* Low level clnt create routine for connectionless transports, e.g. udp.
|
||||
*/
|
||||
extern CLIENT *clnt_dg_create __P((const int, const struct netbuf *,
|
||||
const rpcprog_t, const rpcvers_t,
|
||||
const u_int, const u_int));
|
||||
/*
|
||||
* const int fd; -- open file descriptor
|
||||
* const struct netbuf *svcaddr; -- servers address
|
||||
* const rpcprog_t program; -- program number
|
||||
* const rpcvers_t version; -- version number
|
||||
* const u_int sendsz; -- buffer recv size
|
||||
* const u_int recvsz; -- buffer send size
|
||||
*/
|
||||
|
||||
/*
|
||||
* Memory based rpc (for speed check and testing)
|
||||
* CLIENT *
|
||||
* clntraw_create(prog, vers)
|
||||
* clnt_raw_create(prog, vers)
|
||||
* u_long prog;
|
||||
* u_long vers;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern CLIENT *clntraw_create __P((u_long, u_long));
|
||||
__END_DECLS
|
||||
extern CLIENT *clnt_raw_create __P((rpcprog_t, rpcvers_t));
|
||||
|
||||
|
||||
/*
|
||||
* Generic client creation routine. Supported protocols are "udp" and "tcp"
|
||||
* CLIENT *
|
||||
* clnt_create(host, prog, vers, prot);
|
||||
* char *host; -- hostname
|
||||
* u_long prog; -- program number
|
||||
* u_long vers; -- version number
|
||||
* char *prot; -- protocol
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern CLIENT *clnt_create __P((char *, u_long, u_long, char *));
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/*
|
||||
* TCP based rpc
|
||||
* CLIENT *
|
||||
* clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
||||
* struct sockaddr_in *raddr;
|
||||
* u_long prog;
|
||||
* u_long version;
|
||||
* register int *sockp;
|
||||
* u_int sendsz;
|
||||
* u_int recvsz;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern CLIENT *clnttcp_create __P((struct sockaddr_in *,
|
||||
u_long,
|
||||
u_long,
|
||||
int *,
|
||||
u_int,
|
||||
u_int));
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/*
|
||||
* UDP based rpc.
|
||||
* CLIENT *
|
||||
* clntudp_create(raddr, program, version, wait, sockp)
|
||||
* struct sockaddr_in *raddr;
|
||||
* u_long program;
|
||||
* u_long version;
|
||||
* struct timeval wait;
|
||||
* int *sockp;
|
||||
*
|
||||
* Same as above, but you specify max packet sizes.
|
||||
* CLIENT *
|
||||
* clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
|
||||
* struct sockaddr_in *raddr;
|
||||
* u_long program;
|
||||
* u_long version;
|
||||
* struct timeval wait;
|
||||
* int *sockp;
|
||||
* u_int sendsz;
|
||||
* u_int recvsz;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern CLIENT *clntudp_create __P((struct sockaddr_in *,
|
||||
u_long,
|
||||
u_long,
|
||||
struct timeval,
|
||||
int *));
|
||||
extern CLIENT *clntudp_bufcreate __P((struct sockaddr_in *,
|
||||
u_long,
|
||||
u_long,
|
||||
struct timeval,
|
||||
int *,
|
||||
u_int,
|
||||
u_int));
|
||||
__END_DECLS
|
||||
|
||||
|
||||
|
@ -363,10 +447,94 @@ struct rpc_createerr {
|
|||
struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
|
||||
};
|
||||
|
||||
#ifdef _REENTRANT
|
||||
__BEGIN_DECLS
|
||||
extern struct rpc_createerr *__rpc_createerr __P((void));
|
||||
__END_DECLS
|
||||
#define rpc_createerr (*(__rpc_createerr()))
|
||||
#else
|
||||
extern struct rpc_createerr rpc_createerr;
|
||||
#endif /* _REENTRANT */
|
||||
|
||||
/*
|
||||
* The simplified interface:
|
||||
* enum clnt_stat
|
||||
* rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype)
|
||||
* const char *host;
|
||||
* const rpcprog_t prognum;
|
||||
* const rpcvers_t versnum;
|
||||
* const rpcproc_t procnum;
|
||||
* const xdrproc_t inproc, outproc;
|
||||
* const char *in;
|
||||
* char *out;
|
||||
* const char *nettype;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern enum clnt_stat rpc_call __P((const char *, const rpcprog_t,
|
||||
const rpcvers_t, const rpcproc_t,
|
||||
const xdrproc_t, const char *,
|
||||
const xdrproc_t, char *, const char *));
|
||||
__END_DECLS
|
||||
|
||||
#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
|
||||
#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */
|
||||
/*
|
||||
* RPC broadcast interface
|
||||
* The call is broadcasted to all locally connected nets.
|
||||
*
|
||||
* extern enum clnt_stat
|
||||
* rpc_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp,
|
||||
* eachresult, nettype)
|
||||
* const rpcprog_t prog; -- program number
|
||||
* const rpcvers_t vers; -- version number
|
||||
* const rpcproc_t proc; -- procedure number
|
||||
* const xdrproc_t xargs; -- xdr routine for args
|
||||
* caddr_t argsp; -- pointer to args
|
||||
* const xdrproc_t xresults; -- xdr routine for results
|
||||
* caddr_t resultsp; -- pointer to results
|
||||
* const resultproc_t eachresult; -- call with each result
|
||||
* const char *nettype; -- Transport type
|
||||
*
|
||||
* For each valid response received, the procedure eachresult is called.
|
||||
* Its form is:
|
||||
* done = eachresult(resp, raddr, nconf)
|
||||
* bool_t done;
|
||||
* caddr_t resp;
|
||||
* struct netbuf *raddr;
|
||||
* struct netconfig *nconf;
|
||||
* where resp points to the results of the call and raddr is the
|
||||
* address if the responder to the broadcast. nconf is the transport
|
||||
* on which the response was received.
|
||||
*
|
||||
* extern enum clnt_stat
|
||||
* rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
|
||||
* eachresult, inittime, waittime, nettype)
|
||||
* const rpcprog_t prog; -- program number
|
||||
* const rpcvers_t vers; -- version number
|
||||
* const rpcproc_t proc; -- procedure number
|
||||
* const xdrproc_t xargs; -- xdr routine for args
|
||||
* caddr_t argsp; -- pointer to args
|
||||
* const xdrproc_t xresults; -- xdr routine for results
|
||||
* caddr_t resultsp; -- pointer to results
|
||||
* const resultproc_t eachresult; -- call with each result
|
||||
* const int inittime; -- how long to wait initially
|
||||
* const int waittime; -- maximum time to wait
|
||||
* const char *nettype; -- Transport type
|
||||
*/
|
||||
|
||||
typedef bool_t (*resultproc_t) __P((caddr_t, ...));
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern enum clnt_stat rpc_broadcast __P((const rpcprog_t, const rpcvers_t,
|
||||
const rpcproc_t, const xdrproc_t,
|
||||
caddr_t, const xdrproc_t, caddr_t,
|
||||
const resultproc_t, const char *));
|
||||
extern enum clnt_stat rpc_broadcast_exp __P((const rpcprog_t, const rpcvers_t,
|
||||
const rpcproc_t, const xdrproc_t,
|
||||
caddr_t, const xdrproc_t, caddr_t,
|
||||
const resultproc_t, const int,
|
||||
const int, const char *));
|
||||
__END_DECLS
|
||||
|
||||
/* For backward compatibility */
|
||||
#include <rpc/clnt_soc.h>
|
||||
|
||||
#endif /* !_RPC_CLNT_H_ */
|
||||
|
|
|
@ -0,0 +1,117 @@
|
|||
/* $NetBSD: clnt_soc.h,v 1.1 2000/06/02 22:57:55 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1984 - 1991 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* clnt.h - Client side remote procedure call interface.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_CLNT_SOC_H
|
||||
#define _RPC_CLNT_SOC_H
|
||||
|
||||
/* derived from clnt_soc.h 1.3 88/12/17 SMI */
|
||||
|
||||
/*
|
||||
* All the following declarations are only for backward compatibility
|
||||
* with TS-RPC.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
|
||||
|
||||
/*
|
||||
* TCP based rpc
|
||||
* CLIENT *
|
||||
* clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
||||
* struct sockaddr_in *raddr;
|
||||
* u_long prog;
|
||||
* u_long version;
|
||||
* register int *sockp;
|
||||
* u_int sendsz;
|
||||
* u_int recvsz;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern CLIENT *clnttcp_create __P((struct sockaddr_in *,
|
||||
u_long,
|
||||
u_long,
|
||||
int *,
|
||||
u_int,
|
||||
u_int));
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Raw (memory) rpc.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern CLIENT *clntraw_create __P((u_long, u_long));
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/*
|
||||
* UDP based rpc.
|
||||
* CLIENT *
|
||||
* clntudp_create(raddr, program, version, wait, sockp)
|
||||
* struct sockaddr_in *raddr;
|
||||
* u_long program;
|
||||
* u_long version;
|
||||
* struct timeval wait;
|
||||
* int *sockp;
|
||||
*
|
||||
* Same as above, but you specify max packet sizes.
|
||||
* CLIENT *
|
||||
* clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
|
||||
* struct sockaddr_in *raddr;
|
||||
* u_long program;
|
||||
* u_long version;
|
||||
* struct timeval wait;
|
||||
* int *sockp;
|
||||
* u_int sendsz;
|
||||
* u_int recvsz;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern CLIENT *clntudp_create __P((struct sockaddr_in *,
|
||||
u_long,
|
||||
u_long,
|
||||
struct timeval,
|
||||
int *));
|
||||
extern CLIENT *clntudp_bufcreate __P((struct sockaddr_in *,
|
||||
u_long,
|
||||
u_long,
|
||||
struct timeval,
|
||||
int *,
|
||||
u_int,
|
||||
u_int));
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _RPC_CLNT_SOC_H */
|
|
@ -0,0 +1,63 @@
|
|||
/* $NetBSD: nettype.h,v 1.1 2000/06/02 22:57:55 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* nettype.h, Nettype definitions.
|
||||
* All for the topmost layer of rpc
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _RPC_NETTYPE_H
|
||||
#define _RPC_NETTYPE_H
|
||||
|
||||
#include <netconfig.h>
|
||||
|
||||
#define _RPC_NONE 0
|
||||
#define _RPC_NETPATH 1
|
||||
#define _RPC_VISIBLE 2
|
||||
#define _RPC_CIRCUIT_V 3
|
||||
#define _RPC_DATAGRAM_V 4
|
||||
#define _RPC_CIRCUIT_N 5
|
||||
#define _RPC_DATAGRAM_N 6
|
||||
#define _RPC_TCP 7
|
||||
#define _RPC_UDP 8
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern void *__rpc_setconf __P((char *));
|
||||
extern void __rpc_endconf __P((void *));
|
||||
extern struct netconfig *__rpc_getconf __P((void *));
|
||||
extern struct netconfig *__rpc_getconfip __P((char *));
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_NETTYPE_H */
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pmap_clnt.h,v 1.8 1998/02/11 22:53:13 lukem Exp $ */
|
||||
/* $NetBSD: pmap_clnt.h,v 1.9 2000/06/02 22:57:55 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
|
@ -77,8 +77,7 @@ extern enum clnt_stat pmap_rmtcall __P((struct sockaddr_in *,
|
|||
extern enum clnt_stat clnt_broadcast __P((u_long, u_long, u_long,
|
||||
xdrproc_t, char *,
|
||||
xdrproc_t, char *,
|
||||
bool_t (*) __P((caddr_t,
|
||||
struct sockaddr_in *))));
|
||||
resultproc_t));
|
||||
extern u_short pmap_getport __P((struct sockaddr_in *,
|
||||
u_long, u_long, u_int));
|
||||
__END_DECLS
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pmap_prot.h,v 1.7 1998/02/11 23:01:22 lukem Exp $ */
|
||||
/* $NetBSD: pmap_prot.h,v 1.8 2000/06/02 22:57:55 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
|
@ -100,6 +100,7 @@ struct pmaplist {
|
|||
__BEGIN_DECLS
|
||||
extern bool_t xdr_pmap __P((XDR *, struct pmap *));
|
||||
extern bool_t xdr_pmaplist __P((XDR *, struct pmaplist **));
|
||||
extern bool_t xdr_pmaplist_ptr __P((XDR *, struct pmaplist *));
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_PMAP_PROT_H_ */
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
/* $NetBSD: raw.h,v 1.1 2000/06/02 22:57:56 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_RAW_H
|
||||
#define _RPC_RAW_H
|
||||
|
||||
/* #pragma ident "@(#)raw.h 1.11 94/04/25 SMI" */
|
||||
/* @(#)raw.h 1.2 88/10/25 SMI */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* raw.h
|
||||
*
|
||||
* Raw interface
|
||||
* The common memory area over which they will communicate
|
||||
*/
|
||||
extern char *__rpc_rawcombuf;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _RPC_RAW_H */
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rpc.h,v 1.12 2000/01/26 13:20:26 itojun Exp $ */
|
||||
/* $NetBSD: rpc.h,v 1.13 2000/06/02 22:57:56 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
|
@ -72,25 +72,11 @@
|
|||
#include <rpc/pmap_clnt.h>
|
||||
#include <rpc/pmap_prot.h>
|
||||
|
||||
/*
|
||||
* COMMENT OUT THE NEXT INCLUDE (or add to the #ifndef) IF RUNNING ON
|
||||
* A VERSION OF UNIX THAT USES SUN'S NFS SOURCE. These systems will
|
||||
* already have the structures defined by <rpc/netdb.h> included in <netdb.h>.
|
||||
*/
|
||||
/* routines for parsing /etc/rpc */
|
||||
#include <rpc/rpcb_clnt.h> /* rpcbind interface functions */
|
||||
|
||||
struct rpcent {
|
||||
char *r_name; /* name of server for this rpc program */
|
||||
char **r_aliases; /* alias list */
|
||||
int r_number; /* rpc program number */
|
||||
};
|
||||
#include <rpc/rpcent.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern struct rpcent *getrpcbyname __P((char *));
|
||||
extern struct rpcent *getrpcbynumber __P((int));
|
||||
extern struct rpcent *getrpcent __P((void));
|
||||
extern void setrpcent __P((int));
|
||||
extern void endrpcent __P((void));
|
||||
extern int get_myaddress __P((struct sockaddr_in *));
|
||||
extern int bindresvport __P((int, struct sockaddr_in *));
|
||||
extern int registerrpc __P((int, int, int, char *(*) __P((char [UDPMSGSIZE])),
|
||||
|
@ -99,8 +85,23 @@ extern int callrpc __P((char *, int, int, int, xdrproc_t, char *,
|
|||
xdrproc_t , char *));
|
||||
extern int getrpcport __P((char *, int, int, int));
|
||||
|
||||
char *taddr2uaddr __P((const struct netconfig *, const struct netbuf *));
|
||||
struct netbuf *uaddr2taddr __P((const struct netconfig *, const char *));
|
||||
|
||||
struct sockaddr;
|
||||
extern int bindresvport_sa __P((int, struct sockaddr *));
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* The following are not exported interfaces, they are for internal library
|
||||
* and rpcbind use only. Do not use, they may change without notice.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
int __rpc_nconf2fd __P((const struct netconfig *));
|
||||
int __rpc_nconf2sockinfo __P((const struct netconfig *,
|
||||
struct __rpc_sockinfo *));
|
||||
int __rpc_fd2sockinfo __P((int, struct __rpc_sockinfo *));
|
||||
u_int __rpc_get_t_size __P((int, int, int));
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_RPC_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rpc_msg.h,v 1.10 1998/02/13 04:36:15 lukem Exp $ */
|
||||
/* $NetBSD: rpc_msg.h,v 1.11 2000/06/02 22:57:56 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
|
@ -42,7 +42,7 @@
|
|||
#ifndef _RPC_RPC_MSG_H_
|
||||
#define _RPC_RPC_MSG_H_
|
||||
|
||||
#define RPC_MSG_VERSION ((u_long) 2)
|
||||
#define RPC_MSG_VERSION ((u_int32_t) 2)
|
||||
#define RPC_SERVICE_PORT ((u_short) 2048)
|
||||
|
||||
/*
|
||||
|
@ -89,8 +89,8 @@ struct accepted_reply {
|
|||
enum accept_stat ar_stat;
|
||||
union {
|
||||
struct {
|
||||
u_int32_t low;
|
||||
u_int32_t high;
|
||||
rpcvers_t low;
|
||||
rpcvers_t high;
|
||||
} AR_versions;
|
||||
struct {
|
||||
caddr_t where;
|
||||
|
@ -109,8 +109,8 @@ struct rejected_reply {
|
|||
enum reject_stat rj_stat;
|
||||
union {
|
||||
struct {
|
||||
u_int32_t low;
|
||||
u_int32_t high;
|
||||
rpcvers_t low;
|
||||
rpcvers_t high;
|
||||
} RJ_versions;
|
||||
enum auth_stat RJ_why; /* why authentication did not work */
|
||||
} ru;
|
||||
|
@ -135,10 +135,10 @@ struct reply_body {
|
|||
* Body of an rpc request call.
|
||||
*/
|
||||
struct call_body {
|
||||
u_int32_t cb_rpcvers; /* must be equal to two */
|
||||
u_int32_t cb_prog;
|
||||
u_int32_t cb_vers;
|
||||
u_int32_t cb_proc;
|
||||
rpcvers_t cb_rpcvers; /* must be equal to two */
|
||||
rpcprog_t cb_prog;
|
||||
rpcvers_t cb_vers;
|
||||
rpcproc_t cb_proc;
|
||||
struct opaque_auth cb_cred;
|
||||
struct opaque_auth cb_verf; /* protocol specific - provided by client */
|
||||
};
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
/* $NetBSD: rpcb_clnt.h,v 1.1 2000/06/02 22:57:56 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* rpcb_clnt.h
|
||||
* Supplies C routines to get to rpcbid services.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Usage:
|
||||
* success = rpcb_set(program, version, nconf, address);
|
||||
* success = rpcb_unset(program, version, nconf);
|
||||
* success = rpcb_getaddr(program, version, nconf, host);
|
||||
* head = rpcb_getmaps(nconf, host);
|
||||
* clnt_stat = rpcb_rmtcall(nconf, host, program, version, procedure,
|
||||
* xdrargs, argsp, xdrres, resp, tout, addr_ptr)
|
||||
* success = rpcb_gettime(host, timep)
|
||||
* uaddr = rpcb_taddr2uaddr(nconf, taddr);
|
||||
* taddr = rpcb_uaddr2uaddr(nconf, uaddr);
|
||||
*/
|
||||
|
||||
#ifndef _RPC_RPCB_CLNT_H
|
||||
#define _RPC_RPCB_CLNT_H
|
||||
|
||||
/* #pragma ident "@(#)rpcb_clnt.h 1.13 94/04/25 SMI" */
|
||||
/* rpcb_clnt.h 1.3 88/12/05 SMI */
|
||||
|
||||
#include <rpc/types.h>
|
||||
#include <rpc/rpcb_prot.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern bool_t rpcb_set __P((const rpcprog_t, const rpcvers_t,
|
||||
const struct netconfig *, const struct netbuf *));
|
||||
extern bool_t rpcb_unset __P((const rpcprog_t, const rpcvers_t,
|
||||
const struct netconfig *));
|
||||
extern rpcblist *rpcb_getmaps __P((const struct netconfig *, const char *));
|
||||
extern enum clnt_stat rpcb_rmtcall __P((const struct netconfig *,
|
||||
const char *, const rpcprog_t,
|
||||
const rpcvers_t, const rpcproc_t,
|
||||
const xdrproc_t, const caddr_t,
|
||||
const xdrproc_t, const caddr_t,
|
||||
const struct timeval,
|
||||
const struct netbuf *));
|
||||
extern bool_t rpcb_getaddr __P((const rpcprog_t, const rpcvers_t,
|
||||
const struct netconfig *, struct netbuf *,
|
||||
const char *));
|
||||
extern bool_t rpcb_gettime __P((const char *, time_t *));
|
||||
extern char *rpcb_taddr2uaddr __P((struct netconfig *, struct netbuf *));
|
||||
extern struct netbuf *rpcb_uaddr2taddr __P((struct netconfig *, char *));
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_RPCB_CLNT_H */
|
|
@ -0,0 +1,68 @@
|
|||
/* $NetBSD: rpcent.h,v 1.1 2000/06/02 22:57:56 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* rpcent.h,
|
||||
* For converting rpc program numbers to names etc.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _RPC_RPCENT_H
|
||||
#define _RPC_RPCENT_H
|
||||
|
||||
/* #pragma ident "@(#)rpcent.h 1.13 94/04/25 SMI" */
|
||||
/* @(#)rpcent.h 1.1 88/12/06 SMI */
|
||||
|
||||
|
||||
struct rpcent {
|
||||
char *r_name; /* name of server for this rpc program */
|
||||
char **r_aliases; /* alias list */
|
||||
int r_number; /* rpc program number */
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern struct rpcent *getrpcbyname_r __P((const char *, struct rpcent *,
|
||||
char *, int));
|
||||
extern struct rpcent *getrpcbynumber_r __P((int, struct rpcent *, char *, int));
|
||||
extern struct rpcent *getrpcent_r __P((struct rpcent *, char *, int));
|
||||
|
||||
/* Old interfaces that return a pointer to a static area; MT-unsafe */
|
||||
extern struct rpcent *getrpcbyname __P((char *));
|
||||
extern struct rpcent *getrpcbynumber __P((int));
|
||||
extern struct rpcent *getrpcent __P((void));
|
||||
extern void setrpcent __P((int));
|
||||
extern void endrpcent __P((void));
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_ENT_H_ */
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: svc.h,v 1.16 1999/01/31 19:45:25 christos Exp $ */
|
||||
/* $NetBSD: svc.h,v 1.17 2000/06/02 22:57:56 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
|
@ -28,14 +28,14 @@
|
|||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)svc.h 1.20 88/02/08 SMI
|
||||
* @(#)svc.h 2.2 88/07/29 4.0 RPCSRC
|
||||
* from: @(#)svc.h 1.35 88/12/17 SMI
|
||||
* @(#)svc.h 1.27 94/04/25 SMI
|
||||
*/
|
||||
|
||||
/*
|
||||
* svc.h, Server-side remote procedure call interface.
|
||||
*
|
||||
* Copyright (C) 1984, Sun Microsystems, Inc.
|
||||
* Copyright (C) 1986-1993 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_SVC_H_
|
||||
|
@ -64,6 +64,13 @@
|
|||
* parameters, struct svc_req * and SVCXPRT *, defined below.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Service control requests
|
||||
*/
|
||||
#define SVCGET_VERSQUIET 1
|
||||
#define SVCSET_VERSQUIET 2
|
||||
|
||||
|
||||
enum xprt_stat {
|
||||
XPRT_DIED,
|
||||
XPRT_MOREREQS,
|
||||
|
@ -74,7 +81,7 @@ enum xprt_stat {
|
|||
* Server side transport handle
|
||||
*/
|
||||
typedef struct __rpc_svcxprt {
|
||||
int xp_sock;
|
||||
int xp_fd;
|
||||
u_short xp_port; /* associated port number */
|
||||
const struct xp_ops {
|
||||
/* receive incomming requests */
|
||||
|
@ -95,16 +102,45 @@ typedef struct __rpc_svcxprt {
|
|||
void (*xp_destroy) __P((struct __rpc_svcxprt *));
|
||||
} *xp_ops;
|
||||
int xp_addrlen; /* length of remote address */
|
||||
struct sockaddr_in xp_raddr; /* remote address */
|
||||
struct sockaddr_in xp_raddr; /* rem. addr. (backward ABI compat) */
|
||||
/* XXX - fvdl stick this here for ABI backward compat reasons */
|
||||
const struct xp_ops2 {
|
||||
/* catch-all function */
|
||||
bool_t (*xp_control) __P((struct __rpc_svcxprt *, const u_int,
|
||||
void *));
|
||||
} *xp_ops2;
|
||||
char *xp_tp; /* transport provider device name */
|
||||
char *xp_netid; /* network token */
|
||||
struct netbuf xp_ltaddr; /* local transport address */
|
||||
struct netbuf xp_rtaddr; /* remote transport address */
|
||||
struct opaque_auth xp_verf; /* raw response verifier */
|
||||
void *xp_p1; /* private */
|
||||
void *xp_p2; /* private */
|
||||
void *xp_p1; /* private: for use by svc ops */
|
||||
void *xp_p2; /* private: for use by svc ops */
|
||||
void *xp_p3; /* private: for use by svc lib */
|
||||
int xp_type; /* transport type */
|
||||
} SVCXPRT;
|
||||
|
||||
/*
|
||||
* Service request
|
||||
*/
|
||||
struct svc_req {
|
||||
u_int32_t rq_prog; /* service program number */
|
||||
u_int32_t rq_vers; /* service protocol version */
|
||||
u_int32_t rq_proc; /* the desired procedure */
|
||||
struct opaque_auth rq_cred; /* raw creds from the wire */
|
||||
void *rq_clntcred; /* read only cooked cred */
|
||||
SVCXPRT *rq_xprt; /* associated transport */
|
||||
};
|
||||
|
||||
/*
|
||||
* Approved way of getting address of caller
|
||||
*/
|
||||
#define svc_getcaller(x) (&(x)->xp_raddr)
|
||||
#define svc_getrpccaller(x) (&(x)->xp_rtaddr)
|
||||
|
||||
/*
|
||||
* NetBSD-only definition to get the creds of the caller (AF_LOCAL).
|
||||
*/
|
||||
#define __svc_getcallercreds(x) ((struct sockcred *)(x)->xp_p2)
|
||||
|
||||
/*
|
||||
* Operations defined on an SVCXPRT handle
|
||||
|
@ -144,44 +180,36 @@ typedef struct __rpc_svcxprt {
|
|||
#define svc_destroy(xprt) \
|
||||
(*(xprt)->xp_ops->xp_destroy)(xprt)
|
||||
|
||||
|
||||
/*
|
||||
* Service request
|
||||
*/
|
||||
struct svc_req {
|
||||
u_int32_t rq_prog; /* service program number */
|
||||
u_int32_t rq_vers; /* service protocol version */
|
||||
u_int32_t rq_proc; /* the desired procedure */
|
||||
struct opaque_auth rq_cred; /* raw creds from the wire */
|
||||
void *rq_clntcred; /* read only cooked cred */
|
||||
SVCXPRT *rq_xprt; /* associated transport */
|
||||
};
|
||||
|
||||
#define SVC_CONTROL(xprt, rq, in) \
|
||||
(*(xprt)->xp_ops2->xp_control)((xprt), (rq), (in))
|
||||
|
||||
/*
|
||||
* Service registration
|
||||
*
|
||||
* svc_register(xprt, prog, vers, dispatch, protocol)
|
||||
* SVCXPRT *xprt;
|
||||
* u_long prog;
|
||||
* u_long vers;
|
||||
* void (*dispatch)();
|
||||
* int protocol; like TCP or UDP, zero means do not register
|
||||
* svc_reg(xprt, prog, vers, dispatch, nconf)
|
||||
* const SVCXPRT *xprt;
|
||||
* const rpcprog_t prog;
|
||||
* const rpcvers_t vers;
|
||||
* const void (*dispatch)();
|
||||
* const struct netconfig *nconf;
|
||||
*/
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern bool_t svc_register __P((SVCXPRT *, u_long, u_long,
|
||||
void (*) __P((struct svc_req *, SVCXPRT *)), int));
|
||||
extern bool_t svc_reg __P((SVCXPRT *, const rpcprog_t, const rpcvers_t,
|
||||
void (*) __P((struct svc_req *, SVCXPRT *)),
|
||||
const struct netconfig *));
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Service un-registration
|
||||
*
|
||||
* svc_unregister(prog, vers)
|
||||
* u_long prog;
|
||||
* u_long vers;
|
||||
* svc_unreg(prog, vers)
|
||||
* const rpcprog_t prog;
|
||||
* const rpcvers_t vers;
|
||||
*/
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern void svc_unregister __P((u_long, u_long));
|
||||
extern void svc_unreg __P((const rpcprog_t, const rpcvers_t));
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
|
@ -205,8 +233,6 @@ extern void xprt_unregister __P((SVCXPRT *));
|
|||
__END_DECLS
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* When the service routine is called, it must first check to see if it
|
||||
* knows about the procedure; if not, it should call svcerr_noproc
|
||||
|
@ -238,10 +264,13 @@ extern bool_t svc_sendreply __P((SVCXPRT *, xdrproc_t, char *));
|
|||
extern void svcerr_decode __P((SVCXPRT *));
|
||||
extern void svcerr_weakauth __P((SVCXPRT *));
|
||||
extern void svcerr_noproc __P((SVCXPRT *));
|
||||
extern void svcerr_progvers __P((SVCXPRT *, u_long, u_long));
|
||||
extern void svcerr_progvers __P((SVCXPRT *, rpcvers_t, rpcvers_t));
|
||||
extern void svcerr_auth __P((SVCXPRT *, enum auth_stat));
|
||||
extern void svcerr_noprog __P((SVCXPRT *));
|
||||
extern void svcerr_systemerr __P((SVCXPRT *));
|
||||
extern int rpc_reg __P((rpcprog_t, rpcvers_t, rpcproc_t,
|
||||
char *(*) __P((char *)), xdrproc_t, xdrproc_t,
|
||||
char *));
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
|
@ -278,48 +307,112 @@ __END_DECLS
|
|||
__BEGIN_DECLS
|
||||
extern void svc_getreq __P((int));
|
||||
extern void svc_getreqset __P((fd_set *));
|
||||
extern void svc_getreq_common __P((int));
|
||||
struct pollfd;
|
||||
extern void svc_getreq_poll __P((struct pollfd *, int));
|
||||
|
||||
extern void svc_run __P((void));
|
||||
extern void svc_exit __P((void));
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Socket to use on svcxxx_create call to get default socket
|
||||
*/
|
||||
#define RPC_ANYSOCK -1
|
||||
#define RPC_ANYFD RPC_ANYSOCK
|
||||
|
||||
/*
|
||||
* These are the existing service side transport implementations
|
||||
*/
|
||||
|
||||
/*
|
||||
* Memory based rpc for testing and timing.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern SVCXPRT *svcraw_create __P((void));
|
||||
__END_DECLS
|
||||
/*
|
||||
* Transport independent svc_create routine.
|
||||
*/
|
||||
extern int svc_create __P((void (*) __P((struct svc_req *, SVCXPRT *)),
|
||||
const rpcprog_t, const rpcvers_t, const char *));
|
||||
/*
|
||||
* void (*dispatch)(); -- dispatch routine
|
||||
* const rpcprog_t prognum; -- program number
|
||||
* const rpcvers_t versnum; -- version number
|
||||
* const char *nettype; -- network type
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Udp based rpc.
|
||||
* Generic server creation routine. It takes a netconfig structure
|
||||
* instead of a nettype.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern SVCXPRT *svcudp_create __P((int));
|
||||
extern SVCXPRT *svcudp_bufcreate __P((int, u_int, u_int));
|
||||
extern int svcudp_enablecache __P((SVCXPRT *, u_long));
|
||||
__END_DECLS
|
||||
|
||||
extern SVCXPRT *svc_tp_create __P((void (*) __P((struct svc_req *, SVCXPRT *)),
|
||||
const rpcprog_t, const rpcvers_t,
|
||||
const struct netconfig *));
|
||||
/*
|
||||
* void (*dispatch)(); -- dispatch routine
|
||||
* const rpcprog_t prognum; -- program number
|
||||
* const rpcvers_t versnum; -- version number
|
||||
* const struct netconfig *nconf; -- netconfig structure
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Tcp based rpc.
|
||||
* Generic TLI create routine
|
||||
*/
|
||||
extern SVCXPRT *svc_tli_create __P((const int, const struct netconfig *,
|
||||
const struct t_bind *, const u_int,
|
||||
const u_int));
|
||||
/*
|
||||
* const int fd; -- connection end point
|
||||
* const struct netconfig *nconf; -- netconfig structure for network
|
||||
* const struct t_bind *bindaddr; -- local bind address
|
||||
* const u_int sendsz; -- max sendsize
|
||||
* const u_int recvsz; -- max recvsize
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern SVCXPRT *svctcp_create __P((int, u_int, u_int));
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Fd based rpc.
|
||||
* Connectionless and connectionful create routines
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern SVCXPRT *svcfd_create __P((int, u_int, u_int));
|
||||
|
||||
extern SVCXPRT *svc_vc_create __P((const int, const u_int, const u_int));
|
||||
/*
|
||||
* const int fd; -- open connection end point
|
||||
* const u_int sendsize; -- max send size
|
||||
* const u_int recvsize; -- max recv size
|
||||
*/
|
||||
|
||||
extern SVCXPRT *svc_dg_create __P((const int, const u_int, const u_int));
|
||||
/*
|
||||
* const int fd; -- open connection
|
||||
* const u_int sendsize; -- max send size
|
||||
* const u_int recvsize; -- max recv size
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* the routine takes any *open* connection
|
||||
* descriptor as its first input and is used for open connections.
|
||||
*/
|
||||
extern SVCXPRT *svc_fd_create __P((const int, const u_int, const u_int));
|
||||
/*
|
||||
* const int fd; -- open connection end point
|
||||
* const u_int sendsize; -- max send size
|
||||
* const u_int recvsize; -- max recv size
|
||||
*/
|
||||
|
||||
/*
|
||||
* Memory based rpc (for speed check and testing)
|
||||
*/
|
||||
extern SVCXPRT *svc_raw_create __P((void));
|
||||
|
||||
/*
|
||||
* svc_dg_enable_cache() enables the cache on dg transports.
|
||||
*/
|
||||
int svc_dg_enablecache __P((SVCXPRT *, const u_int));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/* for backward compatibility */
|
||||
#include <rpc/svc_soc.h>
|
||||
|
||||
#endif /* !_RPC_SVC_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: svc_auth.h,v 1.7 1998/02/11 23:01:28 lukem Exp $ */
|
||||
/* $NetBSD: svc_auth.h,v 1.8 2000/06/02 22:57:57 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
|
@ -46,6 +46,9 @@
|
|||
*/
|
||||
__BEGIN_DECLS
|
||||
extern enum auth_stat _authenticate __P((struct svc_req *, struct rpc_msg *));
|
||||
extern int svc_auth_reg __P((int, enum auth_stat (*) __P((struct svc_req *,
|
||||
struct rpc_msg *))));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_SVC_AUTH_H_ */
|
||||
|
|
|
@ -0,0 +1,115 @@
|
|||
/* $NetBSD: svc_soc.h,v 1.1 2000/06/02 22:57:57 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* svc.h, Server-side remote procedure call interface.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_SVC_SOC_H
|
||||
#define _RPC_SVC_SOC_H
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/* #pragma ident "@(#)svc_soc.h 1.11 94/04/25 SMI" */
|
||||
/* svc_soc.h 1.8 89/05/01 SMI */
|
||||
|
||||
/*
|
||||
* All the following declarations are only for backward compatibility
|
||||
* with TS-RPC
|
||||
*/
|
||||
|
||||
/*
|
||||
* Approved way of getting address of caller
|
||||
*/
|
||||
#define svc_getcaller(x) (&(x)->xp_raddr)
|
||||
|
||||
/*
|
||||
* Service registration
|
||||
*
|
||||
* svc_register(xprt, prog, vers, dispatch, protocol)
|
||||
* SVCXPRT *xprt;
|
||||
* u_long prog;
|
||||
* u_long vers;
|
||||
* void (*dispatch)();
|
||||
* int protocol; like TCP or UDP, zero means do not register
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern bool_t svc_register __P((SVCXPRT *, u_long, u_long,
|
||||
void (*) __P((struct svc_req *, SVCXPRT *)), int));
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Service un-registration
|
||||
*
|
||||
* svc_unregister(prog, vers)
|
||||
* u_long prog;
|
||||
* u_long vers;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern void svc_unregister __P((u_long, u_long));
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/*
|
||||
* Memory based rpc for testing and timing.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern SVCXPRT *svcraw_create __P((void));
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/*
|
||||
* Udp based rpc.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern SVCXPRT *svcudp_create __P((int));
|
||||
extern SVCXPRT *svcudp_bufcreate __P((int, u_int, u_int));
|
||||
extern int svcudp_enablecache __P((SVCXPRT *, u_long));
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/*
|
||||
* Tcp based rpc.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern SVCXPRT *svctcp_create __P((int, u_int, u_int));
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Fd based rpc.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern SVCXPRT *svcfd_create __P((int, u_int, u_int));
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_SVC_SOC_H */
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: types.h,v 1.11 1998/02/11 23:01:29 lukem Exp $ */
|
||||
/* $NetBSD: types.h,v 1.12 2000/06/02 22:57:57 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
|
@ -38,8 +38,18 @@
|
|||
#ifndef _RPC_TYPES_H_
|
||||
#define _RPC_TYPES_H_
|
||||
|
||||
#define bool_t int32_t
|
||||
#define enum_t int32_t
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef int32_t bool_t;
|
||||
typedef int32_t enum_t;
|
||||
|
||||
typedef u_int32_t rpcprog_t;
|
||||
typedef u_int32_t rpcvers_t;
|
||||
typedef u_int32_t rpcproc_t;
|
||||
typedef u_int32_t rpcprot_t;
|
||||
typedef u_int32_t rpcport_t;
|
||||
typedef int32_t rpc_inline_t;
|
||||
|
||||
#define __dontcare__ -1
|
||||
|
||||
#ifndef FALSE
|
||||
|
@ -55,9 +65,43 @@
|
|||
#define mem_alloc(bsize) malloc(bsize)
|
||||
#define mem_free(ptr, bsize) free(ptr)
|
||||
|
||||
#ifndef makedev /* ie, we haven't already included it */
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
#include <netconfig.h>
|
||||
|
||||
/*
|
||||
* The netbuf structure is defined here, because NetBSD only uses it inside
|
||||
* the RPC code. It's in <xti.h> on SVR4, but it would be confusing to
|
||||
* have an xti.h, since NetBSD does not support XTI/TLI.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The netbuf structure is used for transport-independent address storage.
|
||||
*/
|
||||
struct netbuf {
|
||||
unsigned int maxlen;
|
||||
unsigned int len;
|
||||
void *buf;
|
||||
};
|
||||
|
||||
/*
|
||||
* The format of the addres and options arguments of the XTI t_bind call.
|
||||
* Only provided for compatibility, it should not be used.
|
||||
*/
|
||||
|
||||
struct t_bind {
|
||||
struct netbuf addr;
|
||||
unsigned int qlen;
|
||||
};
|
||||
|
||||
/*
|
||||
* Internal library and rpcbind use. This is not an exported interface, do
|
||||
* not use.
|
||||
*/
|
||||
struct __rpc_sockinfo {
|
||||
int si_af;
|
||||
int si_proto;
|
||||
int si_socktype;
|
||||
int si_alen;
|
||||
};
|
||||
|
||||
#endif /* !_RPC_TYPES_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: xdr.h,v 1.16 1999/12/01 18:34:21 thorpej Exp $ */
|
||||
/* $NetBSD: xdr.h,v 1.17 2000/06/02 22:57:57 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
|
@ -115,6 +115,7 @@ typedef struct __rpc_xdr {
|
|||
int32_t *(*x_inline) __P((struct __rpc_xdr *, u_int));
|
||||
/* free privates of this xdr_stream */
|
||||
void (*x_destroy) __P((struct __rpc_xdr *));
|
||||
bool_t (*x_control) __P((struct __rpc_xdr *, int, void *));
|
||||
} *x_ops;
|
||||
char * x_public; /* users' data */
|
||||
void * x_private; /* pointer to private data */
|
||||
|
@ -185,6 +186,21 @@ typedef bool_t (*xdrproc_t) __P((/* XDR *, void *, u_int */));
|
|||
if ((xdrs)->x_ops->x_destroy) \
|
||||
(*(xdrs)->x_ops->x_destroy)(xdrs)
|
||||
|
||||
#define XDR_CONTROL(xdrs, req, op) \
|
||||
if ((xdrs)->x_ops->x_control) \
|
||||
(*(xdrs)->x_ops->x_control)(xdrs, req, op)
|
||||
#define xdr_control(xdrs, req, op) XDR_CONTROL(xdrs, req, op)
|
||||
|
||||
/*
|
||||
* Solaris strips the '_t' from these types -- not sure why.
|
||||
* But, let's be compatible.
|
||||
*/
|
||||
#define xdr_rpcvers(xdrs, versp) xdr_u_int32(xdrs, versp)
|
||||
#define xdr_rpcprog(xdrs, progp) xdr_u_int32(xdrs, progp)
|
||||
#define xdr_rpcproc(xdrs, procp) xdr_u_int32(xdrs, procp)
|
||||
#define xdr_rpcprot(xdrs, protp) xdr_u_int32(xdrs, protp)
|
||||
#define xdr_rpcport(xdrs, portp) xdr_u_int32(xdrs, portp)
|
||||
|
||||
/*
|
||||
* Support struct for discriminated unions.
|
||||
* You create an array of xdrdiscrim structures, terminated with
|
||||
|
@ -260,6 +276,7 @@ extern bool_t xdr_u_char __P((XDR *, u_char *));
|
|||
extern bool_t xdr_vector __P((XDR *, char *, u_int, u_int, xdrproc_t));
|
||||
extern bool_t xdr_float __P((XDR *, float *));
|
||||
extern bool_t xdr_double __P((XDR *, double *));
|
||||
extern bool_t xdr_quadruple __P((XDR *, long double *));
|
||||
extern bool_t xdr_reference __P((XDR *, char **, u_int, xdrproc_t));
|
||||
extern bool_t xdr_pointer __P((XDR *, char **, u_int, xdrproc_t));
|
||||
extern bool_t xdr_wrapstring __P((XDR *, char **));
|
||||
|
@ -290,8 +307,8 @@ __BEGIN_DECLS
|
|||
/* XDR using memory buffers */
|
||||
extern void xdrmem_create __P((XDR *, char *, u_int, enum xdr_op));
|
||||
|
||||
#ifdef _STDIO_H_
|
||||
/* XDR using stdio library */
|
||||
#ifdef _STDIO_H_
|
||||
extern void xdrstdio_create __P((XDR *, FILE *, enum xdr_op));
|
||||
#endif
|
||||
|
||||
|
@ -308,6 +325,7 @@ extern bool_t xdrrec_skiprecord __P((XDR *));
|
|||
|
||||
/* true if no more input */
|
||||
extern bool_t xdrrec_eof __P((XDR *));
|
||||
extern u_int xdrrec_readbytes __P((XDR *, caddr_t, u_int));
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_XDR_H_ */
|
||||
|
|
Loading…
Reference in New Issue