diff options
| author | cgd <cgd@NetBSD.org> | 1994-12-04 01:12:39 +0000 |
|---|---|---|
| committer | cgd <cgd@NetBSD.org> | 1994-12-04 01:12:39 +0000 |
| commit | 2e2a3a256ab09da73e5a75bb2c52a96680d195c2 (patch) | |
| tree | b2b9e1f32900c6831636cb0d968ba0eea28fa616 /include | |
| parent | 1c47e24828fc249347345a5679f44f624399c069 (diff) | |
be much more careful with types, and add prototype everything.
Diffstat (limited to 'include')
| -rw-r--r-- | include/rpc/auth.h | 23 | ||||
| -rw-r--r-- | include/rpc/clnt.h | 37 | ||||
| -rw-r--r-- | include/rpc/pmap_clnt.h | 5 | ||||
| -rw-r--r-- | include/rpc/svc.h | 31 | ||||
| -rw-r--r-- | include/rpc/xdr.h | 57 |
5 files changed, 98 insertions, 55 deletions
diff --git a/include/rpc/auth.h b/include/rpc/auth.h index 489d7c9bdd6..d889f6aa138 100644 --- a/include/rpc/auth.h +++ b/include/rpc/auth.h @@ -1,4 +1,4 @@ -/* $NetBSD: auth.h,v 1.5 1994/10/26 00:56:55 cgd Exp $ */ +/* $NetBSD: auth.h,v 1.6 1994/12/04 01:12:39 cgd Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -96,16 +96,21 @@ struct opaque_auth { /* * Auth handle, interface to client side authenticators. */ -typedef struct { +typedef struct __rpc_auth { struct opaque_auth ah_cred; struct opaque_auth ah_verf; union des_block ah_key; struct auth_ops { - void (*ah_nextverf)(); - int (*ah_marshal)(); /* nextverf & serialize */ - int (*ah_validate)(); /* validate varifier */ - int (*ah_refresh)(); /* refresh credentials */ - void (*ah_destroy)(); /* destroy this structure */ + void (*ah_nextverf) __P((struct __rpc_auth *)); + /* nextverf & serialize */ + int (*ah_marshal) __P((struct __rpc_auth *, XDR *)); + /* validate varifier */ + int (*ah_validate) __P((struct __rpc_auth *, + struct opaque_auth *)); + /* refresh credentials */ + int (*ah_refresh) __P((struct __rpc_auth *)); + /* destroy this structure */ + void (*ah_destroy) __P((struct __rpc_auth *)); } *ah_ops; caddr_t ah_private; } AUTH; @@ -162,10 +167,12 @@ extern struct opaque_auth _null_auth; * int *aup_gids; */ __BEGIN_DECLS +struct sockaddr_in; extern AUTH *authunix_create __P((char *, int, int, int, int *)); extern AUTH *authunix_create_default __P((void)); extern AUTH *authnone_create __P((void)); -extern AUTH *authdes_create(); +extern AUTH *authdes_create __P((char *, u_int, + struct sockaddr_in *, des_block *)); __END_DECLS #define AUTH_NONE 0 /* no authentication */ diff --git a/include/rpc/clnt.h b/include/rpc/clnt.h index f12b2ba054d..c562469136e 100644 --- a/include/rpc/clnt.h +++ b/include/rpc/clnt.h @@ -1,4 +1,4 @@ -/* $NetBSD: clnt.h,v 1.4 1994/10/26 00:56:57 cgd Exp $ */ +/* $NetBSD: clnt.h,v 1.5 1994/12/04 01:12:40 cgd Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -115,15 +115,26 @@ struct rpc_err { * Created by individual implementations, see e.g. rpc_udp.c. * Client is responsible for initializing auth, see e.g. auth_none.c. */ -typedef struct { +typedef struct __rpc_client { AUTH *cl_auth; /* authenticator */ struct clnt_ops { - enum clnt_stat (*cl_call)(); /* call remote procedure */ - void (*cl_abort)(); /* abort a call */ - void (*cl_geterr)(); /* get specific error code */ - bool_t (*cl_freeres)(); /* frees results */ - void (*cl_destroy)();/* destroy this structure */ - bool_t (*cl_control)();/* the ioctl() of rpc */ + /* call remote procedure */ + enum clnt_stat (*cl_call) __P((struct __rpc_client *, + u_long, xdrproc_t, caddr_t, xdrproc_t, + caddr_t, struct timeval)); + /* abort a call */ + void (*cl_abort) __P((struct __rpc_client *)); + /* get specific error code */ + void (*cl_geterr) __P((struct __rpc_client *, + struct rpc_err *)); + /* frees results */ + bool_t (*cl_freeres) __P((struct __rpc_client *, + xdrproc_t, caddr_t)); + /* destroy this structure */ + void (*cl_destroy) __P((struct __rpc_client *)); + /* the ioctl() of rpc */ + bool_t (*cl_control) __P((struct __rpc_client *, u_int, + char *)); } *cl_ops; caddr_t cl_private; /* private stuff */ } CLIENT; @@ -147,10 +158,12 @@ typedef struct { * caddr_t resp; * struct timeval timeout; */ -#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ - ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) -#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ - ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) +#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ + ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, (caddr_t)argsp, \ + xres, (caddr_t)resp, secs)) +#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ + ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, (caddr_t)argsp, \ + xres, (caddr_t)resp, secs)) /* * void diff --git a/include/rpc/pmap_clnt.h b/include/rpc/pmap_clnt.h index 1e31c672933..528fe2f5a08 100644 --- a/include/rpc/pmap_clnt.h +++ b/include/rpc/pmap_clnt.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_clnt.h,v 1.4 1994/10/26 00:56:58 cgd Exp $ */ +/* $NetBSD: pmap_clnt.h,v 1.5 1994/12/04 01:12:42 cgd Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -77,7 +77,8 @@ 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 (*)())); + bool_t (*) __P((caddr_t, + struct sockaddr_in *)))); extern u_short pmap_getport __P((struct sockaddr_in *, u_long, u_long, u_int)); __END_DECLS diff --git a/include/rpc/svc.h b/include/rpc/svc.h index c19db740d65..01f8dc74163 100644 --- a/include/rpc/svc.h +++ b/include/rpc/svc.h @@ -1,4 +1,4 @@ -/* $NetBSD: svc.h,v 1.4 1994/10/26 00:57:04 cgd Exp $ */ +/* $NetBSD: svc.h,v 1.5 1994/12/04 01:12:43 cgd Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -73,16 +73,26 @@ enum xprt_stat { /* * Server side transport handle */ -typedef struct { +typedef struct __rpc_svcxprt { int xp_sock; u_short xp_port; /* associated port number */ struct xp_ops { - bool_t (*xp_recv)(); /* receive incomming requests */ - enum xprt_stat (*xp_stat)(); /* get transport status */ - bool_t (*xp_getargs)(); /* get arguments */ - bool_t (*xp_reply)(); /* send reply */ - bool_t (*xp_freeargs)();/* free mem allocated for args */ - void (*xp_destroy)(); /* destroy this struct */ + /* receive incomming requests */ + bool_t (*xp_recv) __P((struct __rpc_svcxprt *, + struct rpc_msg *)); + /* get transport status */ + enum xprt_stat (*xp_stat) __P((struct __rpc_svcxprt *)); + /* get arguments */ + bool_t (*xp_getargs) __P((struct __rpc_svcxprt *, xdrproc_t, + caddr_t)); + /* send reply */ + bool_t (*xp_reply) __P((struct __rpc_svcxprt *, + struct rpc_msg *)); + /* free mem allocated for args */ + bool_t (*xp_freeargs) __P((struct __rpc_svcxprt *, xdrproc_t, + caddr_t)); + /* 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 */ @@ -159,7 +169,8 @@ struct svc_req { * 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 (*)(), int)); +extern bool_t svc_register __P((SVCXPRT *, u_long, u_long, + void (*) __P((struct svc_req *, SVCXPRT *)), int)); __END_DECLS /* @@ -259,7 +270,7 @@ extern int svc_fds; * a small program implemented by the svc_rpc implementation itself; * also see clnt.h for protocol numbers. */ -extern void rpctest_service(); +extern void rpctest_service(); /* XXX relic? */ __BEGIN_DECLS extern void svc_getreq __P((int)); diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h index 44f42c3aee1..a4e8452ef0b 100644 --- a/include/rpc/xdr.h +++ b/include/rpc/xdr.h @@ -1,4 +1,4 @@ -/* $NetBSD: xdr.h,v 1.5 1994/10/26 00:57:08 cgd Exp $ */ +/* $NetBSD: xdr.h,v 1.6 1994/12/04 01:12:44 cgd Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -91,33 +91,30 @@ enum xdr_op { * BYTES_PER_XDR_UNIT) /* - * A xdrproc_t exists for each data type which is to be encoded or decoded. - * - * The second argument to the xdrproc_t is a pointer to an opaque pointer. - * The opaque pointer generally points to a structure of the data type - * to be decoded. If this pointer is 0, then the type routines should - * allocate dynamic storage of the appropriate size and return it. - * bool_t (*xdrproc_t)(XDR *, caddr_t *); - */ -typedef bool_t (*xdrproc_t)(); - -/* * The XDR handle. * Contains operation which is being applied to the stream, * an operations vector for the paticular implementation (e.g. see xdr_mem.c), * and two private fields for the use of the particular impelementation. */ -typedef struct { +typedef struct __rpc_xdr { enum xdr_op x_op; /* operation; fast additional param */ struct xdr_ops { - bool_t (*x_getlong)(); /* get a long from underlying stream */ - bool_t (*x_putlong)(); /* put a long to " */ - bool_t (*x_getbytes)();/* get some bytes from " */ - bool_t (*x_putbytes)();/* put some bytes to " */ - u_int (*x_getpostn)();/* returns bytes off from beginning */ - bool_t (*x_setpostn)();/* lets you reposition the stream */ - long * (*x_inline)(); /* buf quick ptr to buffered data */ - void (*x_destroy)(); /* 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_private; /* pointer to private data */ @@ -126,6 +123,18 @@ typedef struct { } XDR; /* + * A xdrproc_t exists for each data type which is to be encoded or decoded. + * + * The second argument to the xdrproc_t is a pointer to an opaque pointer. + * The opaque pointer generally points to a structure of the data type + * to be decoded. If this pointer is 0, then the type routines should + * allocate dynamic storage of the appropriate size and return it. + * + * XXX can't actually prototype it, because some take three args!!! + */ +typedef bool_t (*xdrproc_t) __P((/* XDR *, void *, u_int */)); + +/* * Operations defined on a XDR handle * * XDR *xdrs; @@ -261,7 +270,7 @@ struct netobj { char *n_bytes; }; typedef struct netobj netobj; -extern bool_t xdr_netobj(); +extern bool_t xdr_netobj __P((XDR *, struct netobj *)); /* * These are the public routines for the various implementations of @@ -277,7 +286,9 @@ extern void xdrstdio_create __P((XDR *, FILE *, enum xdr_op)); #endif /* XDR pseudo records for tcp */ -extern void xdrrec_create __P((XDR *, u_int, u_int, char *, int (*)(), int (*)())); +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)); |
