summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1998-02-11 23:01:22 +0000
committerlukem <lukem@NetBSD.org>1998-02-11 23:01:22 +0000
commit423e29d2ec1758723eb85e77cf3361838dcb829b (patch)
tree3affb6c62354fc913eac2a2f5e3806eba5323290 /include
parent88a058d32b4cddf29d25e7e30e7cf22b02f23378 (diff)
revert; we can't break the existing ABI and API
Diffstat (limited to 'include')
-rw-r--r--include/rpc/pmap_prot.h41
-rw-r--r--include/rpc/pmap_rmt.h16
-rw-r--r--include/rpc/rpc.h35
-rw-r--r--include/rpc/rpc_msg.h36
-rw-r--r--include/rpc/svc.h85
-rw-r--r--include/rpc/svc_auth.h4
-rw-r--r--include/rpc/types.h25
-rw-r--r--include/rpc/xdr.h99
-rw-r--r--include/rpcsvc/yp_prot.h76
-rw-r--r--include/rpcsvc/ypclnt.h4
10 files changed, 208 insertions, 213 deletions
diff --git a/include/rpc/pmap_prot.h b/include/rpc/pmap_prot.h
index fafbd01c2a2..cf6d8241f5c 100644
--- a/include/rpc/pmap_prot.h
+++ b/include/rpc/pmap_prot.h
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_prot.h,v 1.6 1998/02/10 03:52:16 lukem Exp $ */
+/* $NetBSD: pmap_prot.h,v 1.7 1998/02/11 23:01:22 lukem Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -51,7 +51,7 @@
* TRUE is success, FALSE is failure. Un-registers pair
* [prog, vers]. prot and port are ignored.
*
- * PMAPPROC_GETPORT(struct pmap) returns (u_int32_t).
+ * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
* 0 is failure. Otherwise returns the port number where the pair
* [prog, vers] is registered. It may lie!
*
@@ -59,12 +59,11 @@
*
* PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
* RETURNS (port, string<>);
- * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc,
- * encapsulatedargs);
+ * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
* Calls the procedure on the local machine. If it is not registered,
* this procedure is quite; ie it does not return error information!!!
- * This procedure only is supported on RPC/UDP and calls via
- * RPC/UDP. This routine only passes null authentication parameters.
+ * This procedure only is supported on rpc/udp and calls via
+ * rpc/udp. This routine only passes null authentication parameters.
* This file has no interface to xdr routines for PMAPPROC_CALLIT.
*
* The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
@@ -74,23 +73,23 @@
#define _RPC_PMAP_PROT_H_
#include <sys/cdefs.h>
-#define PMAPPORT ((in_port_t)111)
-#define PMAPPROG ((u_int32_t)100000)
-#define PMAPVERS ((u_int32_t)2)
-#define PMAPVERS_PROTO ((u_int32_t)2)
-#define PMAPVERS_ORIG ((u_int32_t)1)
-#define PMAPPROC_NULL ((u_int32_t)0)
-#define PMAPPROC_SET ((u_int32_t)1)
-#define PMAPPROC_UNSET ((u_int32_t)2)
-#define PMAPPROC_GETPORT ((u_int32_t)3)
-#define PMAPPROC_DUMP ((u_int32_t)4)
-#define PMAPPROC_CALLIT ((u_int32_t)5)
+#define PMAPPORT ((u_short)111)
+#define PMAPPROG ((u_long)100000)
+#define PMAPVERS ((u_long)2)
+#define PMAPVERS_PROTO ((u_long)2)
+#define PMAPVERS_ORIG ((u_long)1)
+#define PMAPPROC_NULL ((u_long)0)
+#define PMAPPROC_SET ((u_long)1)
+#define PMAPPROC_UNSET ((u_long)2)
+#define PMAPPROC_GETPORT ((u_long)3)
+#define PMAPPROC_DUMP ((u_long)4)
+#define PMAPPROC_CALLIT ((u_long)5)
struct pmap {
- u_int32_t pm_prog;
- u_int32_t pm_vers;
- u_int32_t pm_prot;
- u_int32_t pm_port;
+ long unsigned pm_prog;
+ long unsigned pm_vers;
+ long unsigned pm_prot;
+ long unsigned pm_port;
};
struct pmaplist {
diff --git a/include/rpc/pmap_rmt.h b/include/rpc/pmap_rmt.h
index aa140978b47..3ad9820103c 100644
--- a/include/rpc/pmap_rmt.h
+++ b/include/rpc/pmap_rmt.h
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_rmt.h,v 1.6 1998/02/10 03:52:17 lukem Exp $ */
+/* $NetBSD: pmap_rmt.h,v 1.7 1998/02/11 23:01:23 lukem Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -44,16 +44,16 @@
#include <sys/cdefs.h>
struct rmtcallargs {
- u_int32_t prog, vers, proc, arglen;
- caddr_t args_ptr;
- xdrproc_t xdr_args;
+ u_long prog, vers, proc, arglen;
+ caddr_t args_ptr;
+ xdrproc_t xdr_args;
};
struct rmtcallres {
- u_int32_t *port_ptr;
- u_int32_t resultslen;
- caddr_t results_ptr;
- xdrproc_t xdr_results;
+ u_long *port_ptr;
+ u_long resultslen;
+ caddr_t results_ptr;
+ xdrproc_t xdr_results;
};
__BEGIN_DECLS
diff --git a/include/rpc/rpc.h b/include/rpc/rpc.h
index a155fc5ebcd..d798aa01de5 100644
--- a/include/rpc/rpc.h
+++ b/include/rpc/rpc.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rpc.h,v 1.10 1998/02/10 03:52:17 lukem Exp $ */
+/* $NetBSD: rpc.h,v 1.11 1998/02/11 23:01:25 lukem Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -80,27 +80,24 @@
/* routines for parsing /etc/rpc */
struct rpcent {
- char *r_name; /* name of server for this RPC program */
- char **r_aliases; /* alias list */
- u_int32_t r_number; /* RPC program number */
+ 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 __P((const char *));
-extern struct rpcent *getrpcbynumber __P((u_int32_t));
-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((u_int32_t, u_int32_t, u_int32_t,
- char *(*) __P((char [UDPMSGSIZE])),
- xdrproc_t, xdrproc_t));
-extern int callrpc __P((const char *, u_int32_t, u_int32_t,
- u_int32_t, xdrproc_t, caddr_t,
- xdrproc_t , caddr_t));
-extern int getrpcport __P((const char *, u_int32_t,
- u_int32_t, int));
+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])),
+ xdrproc_t, xdrproc_t));
+extern int callrpc __P((char *, int, int, int, xdrproc_t, char *,
+ xdrproc_t , char *));
+extern int getrpcport __P((char *, int, int, int));
__END_DECLS
#endif /* !_RPC_RPC_H_ */
diff --git a/include/rpc/rpc_msg.h b/include/rpc/rpc_msg.h
index 8890568dcad..6990a397c8a 100644
--- a/include/rpc/rpc_msg.h
+++ b/include/rpc/rpc_msg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rpc_msg.h,v 1.8 1998/02/10 03:52:18 lukem Exp $ */
+/* $NetBSD: rpc_msg.h,v 1.9 1998/02/11 23:01:26 lukem Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -34,7 +34,7 @@
/*
* rpc_msg.h
- * RPC message definition
+ * rpc message definition
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
@@ -42,11 +42,11 @@
#ifndef _RPC_RPC_MSG_H_
#define _RPC_RPC_MSG_H_
-#define RPC_MSG_VERSION ((u_int32_t) 2)
-#define RPC_SERVICE_PORT ((in_port_t) 2048)
+#define RPC_MSG_VERSION ((u_long) 2)
+#define RPC_SERVICE_PORT ((u_short) 2048)
/*
- * Bottom up definition of an RPC message.
+ * Bottom up definition of an rpc message.
* NOTE: call and reply use the same overall stuct but
* different parts of unions within it.
*/
@@ -76,11 +76,11 @@ enum reject_stat {
};
/*
- * Reply part of an RPC exchange
+ * Reply part of an rpc exchange
*/
/*
- * Reply to an RPC request that was accepted by the server.
+ * Reply to an rpc request that was accepted by the server.
* Note: there could be an error even though the request was
* accepted.
*/
@@ -93,8 +93,8 @@ struct accepted_reply {
u_int32_t high;
} AR_versions;
struct {
- caddr_t where;
- xdrproc_t proc;
+ caddr_t where;
+ xdrproc_t proc;
} AR_results;
/* and many other null cases */
} ru;
@@ -103,7 +103,7 @@ struct accepted_reply {
};
/*
- * Reply to an RPC request that was rejected by the server.
+ * Reply to an rpc request that was rejected by the server.
*/
struct rejected_reply {
enum reject_stat rj_stat;
@@ -119,7 +119,7 @@ struct rejected_reply {
};
/*
- * Body of a reply to an RPC request.
+ * Body of a reply to an rpc request.
*/
struct reply_body {
enum reply_stat rp_stat;
@@ -132,7 +132,7 @@ struct reply_body {
};
/*
- * Body of an RPC request call.
+ * Body of an rpc request call.
*/
struct call_body {
u_int32_t cb_rpcvers; /* must be equal to two */
@@ -144,7 +144,7 @@ struct call_body {
};
/*
- * The RPC message
+ * The rpc message
*/
struct rpc_msg {
u_int32_t rm_xid;
@@ -161,7 +161,7 @@ struct rpc_msg {
__BEGIN_DECLS
/*
- * XDR routine to handle an RPC message.
+ * XDR routine to handle a rpc message.
* xdr_callmsg(xdrs, cmsg)
* XDR *xdrs;
* struct rpc_msg *cmsg;
@@ -169,7 +169,7 @@ __BEGIN_DECLS
extern bool_t xdr_callmsg __P((XDR *, struct rpc_msg *));
/*
- * XDR routine to pre-serialize the static part of an RPC message.
+ * XDR routine to pre-serialize the static part of a rpc message.
* xdr_callhdr(xdrs, cmsg)
* XDR *xdrs;
* struct rpc_msg *cmsg;
@@ -177,7 +177,7 @@ extern bool_t xdr_callmsg __P((XDR *, struct rpc_msg *));
extern bool_t xdr_callhdr __P((XDR *, struct rpc_msg *));
/*
- * XDR routine to handle an RPC reply.
+ * XDR routine to handle a rpc reply.
* xdr_replymsg(xdrs, rmsg)
* XDR *xdrs;
* struct rpc_msg *rmsg;
@@ -186,7 +186,7 @@ extern bool_t xdr_replymsg __P((XDR *, struct rpc_msg *));
/*
- * XDR routine to handle a accepted RPC reply.
+ * XDR routine to handle a accepted rpc reply.
* xdr_accepted_reply(xdrs, rej)
* XDR *xdrs;
* struct accepted_reply *rej;
@@ -194,7 +194,7 @@ extern bool_t xdr_replymsg __P((XDR *, struct rpc_msg *));
extern bool_t xdr_accepted_reply __P((XDR *, struct accepted_reply *));
/*
- * XDR routine to handle a rejected RPC reply.
+ * XDR routine to handle a rejected rpc reply.
* xdr_rejected_reply(xdrs, rej)
* XDR *xdrs;
* struct rejected_reply *rej;
diff --git a/include/rpc/svc.h b/include/rpc/svc.h
index 81a89055f19..ae2713694c1 100644
--- a/include/rpc/svc.h
+++ b/include/rpc/svc.h
@@ -1,4 +1,4 @@
-/* $NetBSD: svc.h,v 1.12 1998/02/10 03:52:19 lukem Exp $ */
+/* $NetBSD: svc.h,v 1.13 1998/02/11 23:01:27 lukem Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -45,7 +45,7 @@
/*
* This interface must manage two items concerning remote procedure calling:
*
- * 1) An arbitrary number of transport connections upon which RPC requests
+ * 1) An arbitrary number of transport connections upon which rpc requests
* are received. The two most notable transports are TCP and UDP; they are
* created and registered by routines in svc_tcp.c and svc_udp.c, respectively;
* they in turn call xprt_register and xprt_unregister.
@@ -56,9 +56,9 @@
* indicates whether or not the exported program should be registered with a
* local binder service; if true the program's number and version and the
* port number from the transport handle are registered with the binder.
- * These data are registered with the RPC svc system via svc_register.
+ * These data are registered with the rpc svc system via svc_register.
*
- * A service's dispatch function is called whenever an RPC request comes in
+ * A service's dispatch function is called whenever an rpc request comes in
* on a transport. The request's program and version numbers must match
* those of the registered service. The dispatch function is passed two
* parameters, struct svc_req * and SVCXPRT *, defined below.
@@ -75,7 +75,7 @@ enum xprt_stat {
*/
typedef struct __rpc_svcxprt {
int xp_sock;
- in_port_t xp_port; /* associated port number */
+ u_short xp_port; /* associated port number */
struct xp_ops {
/* receive incomming requests */
bool_t (*xp_recv) __P((struct __rpc_svcxprt *,
@@ -94,11 +94,11 @@ typedef struct __rpc_svcxprt {
/* destroy this struct */
void (*xp_destroy) __P((struct __rpc_svcxprt *));
} *xp_ops;
- int xp_addrlen; /* length of remote address */
- struct sockaddr_in xp_raddr; /* remote address */
- struct opaque_auth xp_verf; /* raw response verifier */
- caddr_t xp_p1; /* private */
- caddr_t xp_p2; /* private */
+ int xp_addrlen; /* length of remote address */
+ struct sockaddr_in xp_raddr; /* remote address */
+ struct opaque_auth xp_verf; /* raw response verifier */
+ caddr_t xp_p1; /* private */
+ caddr_t xp_p2; /* private */
} SVCXPRT;
/*
@@ -149,12 +149,12 @@ typedef struct __rpc_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 */
- caddr_t rq_clntcred; /* read only cooked cred */
- SVCXPRT *rq_xprt; /* associated transport */
+ 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 */
+ caddr_t rq_clntcred; /* read only cooked cred */
+ SVCXPRT *rq_xprt; /* associated transport */
};
@@ -162,26 +162,26 @@ struct svc_req {
* Service registration
*
* svc_register(xprt, prog, vers, dispatch, protocol)
- * SVCXPRT *xprt;
- * u_int32_t prog;
- * u_int32_t vers;
- * void (*dispatch) __P((struct svc_req *, SVCXPRT *));
- * int protocol; like TCP or UDP, zero means do not register
+ * 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_int32_t, u_int32_t,
- void (*) __P((struct svc_req *, SVCXPRT *)), int));
+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_int32_t prog;
- * u_int32_t vers;
+ * u_long prog;
+ * u_long vers;
*/
__BEGIN_DECLS
-extern void svc_unregister __P((u_int32_t, u_int32_t));
+extern void svc_unregister __P((u_long, u_long));
__END_DECLS
/*
@@ -220,12 +220,12 @@ __END_DECLS
* weak authentication parameters, svcerr_weakauth should be called.
* Note: do not confuse access-control failure with weak authentication!
*
- * NB: In pure implementations of RPC, the caller always waits for a reply
+ * NB: In pure implementations of rpc, the caller always waits for a reply
* msg. This message is sent when svc_sendreply is called.
* Therefore pure service implementations should always call
* svc_sendreply even if the function logically returns void; use
- * xdr.h - xdr_void for the xdr routine. HOWEVER, TCP based RPC allows
- * for the abuse of pure RPC via batched calling or pipelining. In the
+ * xdr.h - xdr_void for the xdr routine. HOWEVER, tcp based rpc allows
+ * for the abuse of pure rpc via batched calling or pipelining. In the
* case of a batched call, svc_sendreply should NOT be called since
* this would send a return message, which is what batching tries to avoid.
* It is the service/protocol writer's responsibility to know which calls are
@@ -238,7 +238,7 @@ 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_int32_t, u_int32_t));
+extern void svcerr_progvers __P((SVCXPRT *, u_long, u_long));
extern void svcerr_auth __P((SVCXPRT *, enum auth_stat));
extern void svcerr_noprog __P((SVCXPRT *));
extern void svcerr_systemerr __P((SVCXPRT *));
@@ -250,19 +250,22 @@ __END_DECLS
* service routine. The routine svc_run does infinite waiting; i.e.,
* svc_run never returns.
* Since another (co-existant) package may wish to selectively wait for
- * incoming calls or other events outside of the RPC architecture, the
+ * incoming calls or other events outside of the rpc architecture, the
* routine svc_getreq is provided. It must be passed readfds, the
* "in-place" results of a select system call (see select, section 2).
*/
/*
- * Global keeper of RPC service descriptors in use
+ * Global keeper of rpc service descriptors in use
* dynamic; must be inspected before each call to select
*/
-/* XXX: add poll() support ... */
extern int svc_maxfd;
+#ifdef FD_SETSIZE
extern fd_set svc_fdset;
#define svc_fds svc_fdset.fds_bits[0] /* compatibility */
+#else
+extern int svc_fds;
+#endif /* def FD_SETSIZE */
/*
* a small program implemented by the svc_rpc implementation itself;
@@ -286,7 +289,7 @@ __END_DECLS
*/
/*
- * Memory based RPC for testing and timing.
+ * Memory based rpc for testing and timing.
*/
__BEGIN_DECLS
extern SVCXPRT *svcraw_create __P((void));
@@ -294,27 +297,27 @@ __END_DECLS
/*
- * UDP based RPC.
+ * Udp based rpc.
*/
__BEGIN_DECLS
extern SVCXPRT *svcudp_create __P((int));
-extern SVCXPRT *svcudp_bufcreate __P((int, size_t, size_t));
-extern int svcudp_enablecache __P((SVCXPRT *, u_int32_t));
+extern SVCXPRT *svcudp_bufcreate __P((int, u_int, u_int));
+extern int svcudp_enablecache __P((SVCXPRT *, u_long));
__END_DECLS
/*
- * TCP based RPC.
+ * Tcp based rpc.
*/
__BEGIN_DECLS
-extern SVCXPRT *svctcp_create __P((int, size_t, size_t));
+extern SVCXPRT *svctcp_create __P((int, u_int, u_int));
__END_DECLS
/*
- * Fd based RPC.
+ * Fd based rpc.
*/
__BEGIN_DECLS
-extern SVCXPRT *svcfd_create __P((int, size_t, size_t));
+extern SVCXPRT *svcfd_create __P((int, u_int, u_int));
__END_DECLS
#endif /* !_RPC_SVC_H_ */
diff --git a/include/rpc/svc_auth.h b/include/rpc/svc_auth.h
index 7fc72a7ce14..30795224023 100644
--- a/include/rpc/svc_auth.h
+++ b/include/rpc/svc_auth.h
@@ -1,4 +1,4 @@
-/* $NetBSD: svc_auth.h,v 1.6 1998/02/10 03:52:19 lukem Exp $ */
+/* $NetBSD: svc_auth.h,v 1.7 1998/02/11 23:01:28 lukem Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -33,7 +33,7 @@
*/
/*
- * svc_auth.h, Service side of RPC authentication.
+ * svc_auth.h, Service side of rpc authentication.
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
diff --git a/include/rpc/types.h b/include/rpc/types.h
index 3447ea7ca4a..b068e8bb220 100644
--- a/include/rpc/types.h
+++ b/include/rpc/types.h
@@ -1,4 +1,4 @@
-/* $NetBSD: types.h,v 1.10 1998/02/10 03:52:20 lukem Exp $ */
+/* $NetBSD: types.h,v 1.11 1998/02/11 23:01:29 lukem Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -33,17 +33,13 @@
*/
/*
- * RPC additions to <sys/types.h>
+ * Rpc additions to <sys/types.h>
*/
-#ifndef _RPC_TYPES_H
-#define _RPC_TYPES_H
-
-#include <sys/types.h>
-#include <sys/time.h>
-
-typedef int32_t bool_t;
-typedef int32_t enum_t;
+#ifndef _RPC_TYPES_H_
+#define _RPC_TYPES_H_
+#define bool_t int32_t
+#define enum_t int32_t
#define __dontcare__ -1
#ifndef FALSE
@@ -57,6 +53,11 @@ typedef int32_t enum_t;
#endif
#define mem_alloc(bsize) malloc(bsize)
-#define mem_free(ptr, bsize) free((void *)ptr)
+#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>
-#endif /* !_RPC_TYPES_H */
+#endif /* !_RPC_TYPES_H_ */
diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h
index 6a7d6e1fda8..7f25093ae14 100644
--- a/include/rpc/xdr.h
+++ b/include/rpc/xdr.h
@@ -1,4 +1,4 @@
-/* $NetBSD: xdr.h,v 1.9 1998/02/10 03:52:21 lukem Exp $ */
+/* $NetBSD: xdr.h,v 1.10 1998/02/11 23:01:30 lukem Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -99,28 +99,26 @@ enum xdr_op {
typedef struct __rpc_xdr {
enum xdr_op x_op; /* operation; fast additional param */
struct xdr_ops {
- /* get an xdr long from underlying stream */
- bool_t (*x_getlong) __P((struct __rpc_xdr *, int32_t *));
- /* put an xdr long to underlying stream */
- bool_t (*x_putlong) __P((struct __rpc_xdr *, int32_t *));
- /* get some bytes from underlying stream */
- bool_t (*x_getbytes) __P((struct __rpc_xdr *, caddr_t,
- size_t));
- /* put some bytes to underlying stream */
- bool_t (*x_putbytes) __P((struct __rpc_xdr *, caddr_t,
- size_t));
- /* returns bytes offset from beginning */
- size_t (*x_getpostn) __P((struct __rpc_xdr *));
- /* lets you reposition the stream */
- bool_t (*x_setpostn) __P((struct __rpc_xdr *, size_t));
- /* buf quick ptr to buffered data */
- int32_t *(*x_inline) __P((struct __rpc_xdr *, size_t));
- /* free privates of this xdr_stream */
+ /* get a long from underlying stream */
+ bool_t (*x_getlong) __P((struct __rpc_xdr *, long *));
+ /* put a long to " */
+ bool_t (*x_putlong) __P((struct __rpc_xdr *, long *));
+ /* get some bytes from " */
+ bool_t (*x_getbytes) __P((struct __rpc_xdr *, caddr_t, u_int));
+ /* put some bytes to " */
+ bool_t (*x_putbytes) __P((struct __rpc_xdr *, caddr_t, u_int));
+ /* returns bytes off from beginning */
+ u_int (*x_getpostn) __P((struct __rpc_xdr *));
+ /* lets you reposition the stream */
+ bool_t (*x_setpostn) __P((struct __rpc_xdr *, u_int));
+ /* buf quick ptr to buffered data */
+ int32_t *(*x_inline) __P((struct __rpc_xdr *, u_int));
+ /* free privates of this xdr_stream */
void (*x_destroy) __P((struct __rpc_xdr *));
} *x_ops;
- caddr_t x_public; /* users' data */
+ caddr_t x_public; /* users' data */
caddr_t x_private; /* pointer to private data */
- caddr_t x_base; /* private used for position info */
+ caddr_t x_base; /* private used for position info */
int x_handy; /* extra private word */
} XDR;
@@ -134,16 +132,16 @@ typedef struct __rpc_xdr {
*
* XXX can't actually prototype it, because some take three args!!!
*/
-typedef bool_t (*xdrproc_t) __P((/* XDR *, caddr_t, size_t */));
+typedef bool_t (*xdrproc_t) __P((/* XDR *, void *, u_int */));
/*
* Operations defined on a XDR handle
*
* XDR *xdrs;
- * int32_t *longp;
+ * long *longp;
* caddr_t addr;
- * size_t len;
- * size_t pos;
+ * u_int len;
+ * u_int pos;
*/
#define XDR_GETLONG(xdrs, longp) \
(*(xdrs)->x_ops->x_getlong)(xdrs, longp)
@@ -218,20 +216,20 @@ struct xdr_discrim {
* N.B. and frozen for all time: each data type here uses 4 bytes
* of external representation.
*/
-#define IXDR_GET_LONG(buf) ((int32_t)ntohl((u_int32_t)*(buf)++))
-#define IXDR_PUT_LONG(buf, v) (*(buf)++ = (int32_t)htonl((u_int32_t)v))
+#define IXDR_GET_LONG(buf) ((long)ntohl((u_long)*(buf)++))
+#define IXDR_PUT_LONG(buf, v) (*(buf)++ = (long)htonl((u_long)v))
#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
-#define IXDR_GET_U_LONG(buf) ((u_int32_t)IXDR_GET_LONG(buf))
-#define IXDR_GET_SHORT(buf) ((int16_t)IXDR_GET_LONG(buf))
-#define IXDR_GET_U_SHORT(buf) ((u_int16_t)IXDR_GET_LONG(buf))
+#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf))
+#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf))
+#define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_LONG(buf))
-#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG((buf), ((int32_t)(v)))
-#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG((buf), ((int32_t)(v)))
-#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG((buf), ((int32_t)(v)))
-#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG((buf), ((int32_t)(v)))
-#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG((buf), ((int32_t)(v)))
+#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
+#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
+#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
+#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
+#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
/*
* These are the "generic" xdr routines.
@@ -250,32 +248,29 @@ extern bool_t xdr_int32_t __P((XDR *, int32_t *));
extern bool_t xdr_u_int32_t __P((XDR *, u_int32_t *));
extern bool_t xdr_bool __P((XDR *, bool_t *));
extern bool_t xdr_enum __P((XDR *, enum_t *));
-extern bool_t xdr_array __P((XDR *, caddr_t *, size_t *, size_t, size_t,
- xdrproc_t));
-extern bool_t xdr_bytes __P((XDR *, caddr_t *, size_t *, size_t));
-extern bool_t xdr_opaque __P((XDR *, caddr_t, size_t));
-extern bool_t xdr_string __P((XDR *, char **, size_t));
-extern bool_t xdr_union __P((XDR *, enum_t *, caddr_t,
- struct xdr_discrim *, xdrproc_t));
+extern bool_t xdr_array __P((XDR *, char **, u_int *, u_int, u_int, xdrproc_t));
+extern bool_t xdr_bytes __P((XDR *, char **, u_int *, u_int));
+extern bool_t xdr_opaque __P((XDR *, caddr_t, u_int));
+extern bool_t xdr_string __P((XDR *, char **, u_int));
+extern bool_t xdr_union __P((XDR *, enum_t *, char *, struct xdr_discrim *, xdrproc_t));
extern bool_t xdr_char __P((XDR *, char *));
extern bool_t xdr_u_char __P((XDR *, u_char *));
-extern bool_t xdr_vector __P((XDR *, caddr_t, size_t, size_t,
- xdrproc_t));
+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_reference __P((XDR *, caddr_t *, size_t, xdrproc_t));
-extern bool_t xdr_pointer __P((XDR *, caddr_t *, size_t, xdrproc_t));
+extern bool_t xdr_reference __P((XDR *, caddr_t *, u_int, xdrproc_t));
+extern bool_t xdr_pointer __P((XDR *, caddr_t *, u_int, xdrproc_t));
extern bool_t xdr_wrapstring __P((XDR *, char **));
-extern void xdr_free __P((xdrproc_t, caddr_t));
+extern void xdr_free __P((xdrproc_t, char *));
__END_DECLS
/*
- * Common opaque bytes objects used by many RPC protocols;
+ * Common opaque bytes objects used by many rpc protocols;
* declared here due to commonality.
*/
#define MAX_NETOBJ_SZ 1024
struct netobj {
- size_t n_len;
+ u_int n_len;
char *n_bytes;
};
typedef struct netobj netobj;
@@ -287,7 +282,7 @@ extern bool_t xdr_netobj __P((XDR *, struct netobj *));
*/
__BEGIN_DECLS
/* XDR using memory buffers */
-extern void xdrmem_create __P((XDR *, caddr_t, size_t, enum xdr_op));
+extern void xdrmem_create __P((XDR *, char *, u_int, enum xdr_op));
#ifdef _STDIO_H_
/* XDR using stdio library */
@@ -295,9 +290,9 @@ extern void xdrstdio_create __P((XDR *, FILE *, enum xdr_op));
#endif
/* XDR pseudo records for tcp */
-extern void xdrrec_create __P((XDR *, size_t, size_t, caddr_t,
- int (*) __P((caddr_t, caddr_t, size_t)),
- int (*) __P((caddr_t, caddr_t, size_t))));
+extern void xdrrec_create __P((XDR *, u_int, u_int, char *,
+ int (*) __P((caddr_t, caddr_t, int)),
+ int (*) __P((caddr_t, caddr_t, int))));
/* make end of xdr record */
extern bool_t xdrrec_endofrecord __P((XDR *, int));
diff --git a/include/rpcsvc/yp_prot.h b/include/rpcsvc/yp_prot.h
index b25efa3fbc2..020524c7904 100644
--- a/include/rpcsvc/yp_prot.h
+++ b/include/rpcsvc/yp_prot.h
@@ -1,4 +1,4 @@
-/* $NetBSD: yp_prot.h,v 1.10 1998/02/10 04:12:24 lukem Exp $ */
+/* $NetBSD: yp_prot.h,v 1.11 1998/02/11 23:07:40 lukem Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@fsa.ca>
@@ -76,9 +76,9 @@ typedef u_int bool;
/* Program and version symbols, magic numbers */
-#define YPPROG ((u_int32_t)100004)
-#define YPVERS ((u_int32_t)2)
-#define YPVERS_ORIG ((u_int32_t)1)
+#define YPPROG ((unsigned long)100004)
+#define YPVERS ((unsigned long)2)
+#define YPVERS_ORIG ((unsigned long)1)
#define YPMAXRECORD 1024
#define YPMAXDOMAIN 64
@@ -103,7 +103,7 @@ typedef struct {
struct ypmap_parms {
const char *domain;
const char *map;
- u_int32_t ordernum;
+ unsigned int ordernum;
char *owner;
};
@@ -120,9 +120,9 @@ struct ypreq_nokey {
struct ypreq_xfr {
struct ypmap_parms map_parms;
- u_int32_t transid;
- u_int32_t proto;
- u_int32_t port;
+ unsigned int transid;
+ unsigned int proto;
+ unsigned int port;
};
#define ypxfr_domain map_parms.domain
#define ypxfr_map map_parms.map
@@ -147,7 +147,7 @@ struct ypresp_master {
struct ypresp_order {
int status;
- u_int32_t ordernum;
+ unsigned int ordernum;
};
struct ypmaplist {
@@ -161,18 +161,18 @@ struct ypresp_maplist {
};
/* ypserv procedure numbers */
-#define YPPROC_NULL ((u_int32_t)0)
-#define YPPROC_DOMAIN ((u_int32_t)1)
-#define YPPROC_DOMAIN_NONACK ((u_int32_t)2)
-#define YPPROC_MATCH ((u_int32_t)3)
-#define YPPROC_FIRST ((u_int32_t)4)
-#define YPPROC_NEXT ((u_int32_t)5)
-#define YPPROC_XFR ((u_int32_t)6)
-#define YPPROC_CLEAR ((u_int32_t)7)
-#define YPPROC_ALL ((u_int32_t)8)
-#define YPPROC_MASTER ((u_int32_t)9)
-#define YPPROC_ORDER ((u_int32_t)10)
-#define YPPROC_MAPLIST ((u_int32_t)11)
+#define YPPROC_NULL ((unsigned long)0)
+#define YPPROC_DOMAIN ((unsigned long)1)
+#define YPPROC_DOMAIN_NONACK ((unsigned long)2)
+#define YPPROC_MATCH ((unsigned long)3)
+#define YPPROC_FIRST ((unsigned long)4)
+#define YPPROC_NEXT ((unsigned long)5)
+#define YPPROC_XFR ((unsigned long)6)
+#define YPPROC_CLEAR ((unsigned long)7)
+#define YPPROC_ALL ((unsigned long)8)
+#define YPPROC_MASTER ((unsigned long)9)
+#define YPPROC_ORDER ((unsigned long)10)
+#define YPPROC_MAPLIST ((unsigned long)11)
/* ypserv procedure return status values */
#define YP_TRUE ((int)1) /* general purpose success code */
@@ -203,11 +203,11 @@ struct dom_binding {
struct dom_binding *dom_pnext;
char dom_domain[YPMAXDOMAIN + 1];
struct sockaddr_in dom_server_addr;
- in_port_t dom_server_port;
+ u_short dom_server_port;
int dom_socket;
CLIENT *dom_client;
- in_port_t dom_local_port;
- u_int32_t dom_vers;
+ u_short dom_local_port;
+ long dom_vers;
};
/*
@@ -224,14 +224,14 @@ struct dom_binding {
* used by ypset.
*/
-#define YPBINDPROG ((u_int32_t)100007)
-#define YPBINDVERS ((u_int32_t)2)
-#define YPBINDVERS_ORIG ((u_int32_t)1)
+#define YPBINDPROG ((unsigned long)100007)
+#define YPBINDVERS ((unsigned long)2)
+#define YPBINDVERS_ORIG ((unsigned long)1)
/* ypbind procedure numbers */
-#define YPBINDPROC_NULL ((u_int32_t)0)
-#define YPBINDPROC_DOMAIN ((u_int32_t)1)
-#define YPBINDPROC_SETDOM ((u_int32_t)2)
+#define YPBINDPROC_NULL ((unsigned long)0)
+#define YPBINDPROC_DOMAIN ((unsigned long)1)
+#define YPBINDPROC_SETDOM ((unsigned long)2)
/* error code in ypbind_resp.ypbind_status */
enum ypbind_resptype {
@@ -248,7 +248,7 @@ struct ypbind_binding {
struct ypbind_resp {
enum ypbind_resptype ypbind_status;
union {
- u_int32_t ypbind_error;
+ unsigned int ypbind_error;
struct ypbind_binding ypbind_bindinfo;
} ypbind_respbody;
};
@@ -264,7 +264,7 @@ struct ypbind_resp {
struct ypbind_setdom {
char ypsetdom_domain[YPMAXDOMAIN + 1];
struct ypbind_binding ypsetdom_binding;
- u_int32_t ypsetdom_vers;
+ unsigned int ypsetdom_vers;
};
#define ypsetdom_addr ypsetdom_binding.ypbind_binding_addr
#define ypsetdom_port ypsetdom_binding.ypbind_binding_port
@@ -281,16 +281,16 @@ struct ypbind_setdom {
* This protocol is not implimented, naturally, because this YP
* implimentation only does the client side.
*/
-#define YPPUSHVERS ((u_int32_t)1)
-#define YPPUSHVERS_ORIG ((u_int32_t)1)
+#define YPPUSHVERS ((unsigned long)1)
+#define YPPUSHVERS_ORIG ((unsigned long)1)
/* yppush procedure numbers */
-#define YPPUSHPROC_NULL ((u_int32_t)0)
-#define YPPUSHPROC_XFRRESP ((u_int32_t)1)
+#define YPPUSHPROC_NULL ((unsigned long)0)
+#define YPPUSHPROC_XFRRESP ((unsigned long)1)
struct yppushresp_xfr {
- u_int32_t transid;
- u_int32_t status;
+ unsigned int transid;
+ unsigned int status;
};
/* yppush status value in yppushresp_xfr.status */
diff --git a/include/rpcsvc/ypclnt.h b/include/rpcsvc/ypclnt.h
index a45630f5487..b73da218b88 100644
--- a/include/rpcsvc/ypclnt.h
+++ b/include/rpcsvc/ypclnt.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ypclnt.h,v 1.10 1998/02/10 04:12:25 lukem Exp $ */
+/* $NetBSD: ypclnt.h,v 1.11 1998/02/11 23:07:41 lukem Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@fsa.ca>
@@ -85,7 +85,7 @@ int yp_order __P((const char *, const char *, int *));
int yp_all __P((const char *, const char *,
struct ypall_callback *));
char * yperr_string __P((int));
-int ypprot_err __P((u_int32_t));
+int ypprot_err __P((unsigned int));
__END_DECLS
#endif /* _RPCSVC_YPCLNT_H_ */