diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-10-31 12:13:49 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-10-31 12:13:49 +0000 |
commit | a1129917d77757941eded59e574f5fc9199284cb (patch) | |
tree | f934658661b419f0fe5a2508a15b982a78e4003c /sunrpc | |
parent | 655b26bb758d9acb15e4870c1c541bb25c36cdd1 (diff) | |
download | glibc-a1129917d77757941eded59e574f5fc9199284cb.tar.gz glibc-a1129917d77757941eded59e574f5fc9199284cb.tar.xz glibc-a1129917d77757941eded59e574f5fc9199284cb.zip |
Update.
1998-10-30 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * sunrpc/Versions: Add xdr_uint32_t and xdr_int32_t. * sunrpc/pmap_rmt.c: Initialize clnt_stat variable. * sunrpc/rpc/auth_des.h: Use uint32_t for time values. * sunrpc/rpc/xdr.h: Add INT32 support. * sunrpc/xdr.c: Implement xdr_int32_t and xdr_uint32_t . * nis/nis_call.c: Changes for new 64bit clean NIS+ interface. * nis/nis_callback.c: Likewise. * nis/nis_creategroup.c: Likewise. * nis/nis_defaults.c: Likewise. * nis/nis_intern.h: Likewise. * nis/nis_lookup.c: Likewise. * nis/nis_ping.c: Likewise. * nis/nis_print.c: Likewise. * nis/nis_table.c: Likewise. * nis/nis_util.c: Likewise. * nis/nis_xdr.c: Likewise. * nis/rpcsvc/nis.h: Likewise. * nis/rpcsvc/nis.x: Likewise. * nis/rpcsvc/nis_callback.h: Likewise. * nis/rpcsvc/nis_object.x: Likewise. * nis/rpcsvc/nislib.h: Likewise. * nis/rpcsvc/yp.h: Remove casts to (u_long). * nis/rpcsvc/yp_prot.h: Likewise. * nis/rpcsvc/ypupd.h: Likewise. * nis/ypclnt.c: Change %ld to %d in sprintf.
Diffstat (limited to 'sunrpc')
-rw-r--r-- | sunrpc/Versions | 5 | ||||
-rw-r--r-- | sunrpc/pmap_rmt.c | 2 | ||||
-rw-r--r-- | sunrpc/rpc/auth_des.h | 6 | ||||
-rw-r--r-- | sunrpc/rpc/xdr.h | 86 | ||||
-rw-r--r-- | sunrpc/xdr.c | 62 |
5 files changed, 101 insertions, 60 deletions
diff --git a/sunrpc/Versions b/sunrpc/Versions index 98dfbbc79f..b840939a04 100644 --- a/sunrpc/Versions +++ b/sunrpc/Versions @@ -96,7 +96,8 @@ libc { # x* xdecrypt; xdr_authdes_cred; xdr_authdes_verf; xdr_cryptkeyarg; xdr_cryptkeyarg2; xdr_cryptkeyres; xdr_des_block; - xdr_getcredres; xdr_key_netstarg; xdr_key_netstres; - xdr_keybuf; xdr_keystatus; xdr_netnamestr; xdr_sizeof; xdr_unixcred; + xdr_getcredres; xdr_int32_t; xdr_key_netstarg; xdr_key_netstres; + xdr_keybuf; xdr_keystatus; xdr_netnamestr; xdr_sizeof; xdr_uint32_t; + xdr_unixcred; } } diff --git a/sunrpc/pmap_rmt.c b/sunrpc/pmap_rmt.c index 768387c798..ced817d809 100644 --- a/sunrpc/pmap_rmt.c +++ b/sunrpc/pmap_rmt.c @@ -233,7 +233,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) caddr_t resultsp; /* pointer to results */ resultproc_t eachresult; /* call with each result obtained */ { - enum clnt_stat stat; + enum clnt_stat stat = RPC_FAILED; AUTH *unix_auth = authunix_create_default (); XDR xdr_stream; XDR *xdrs = &xdr_stream; diff --git a/sunrpc/rpc/auth_des.h b/sunrpc/rpc/auth_des.h index c53c221552..7bb3c59b8e 100644 --- a/sunrpc/rpc/auth_des.h +++ b/sunrpc/rpc/auth_des.h @@ -37,7 +37,7 @@ struct authdes_fullname { char *name; /* network name of client, up to MAXNETNAMELEN */ des_block key; /* conversation key */ - u_long window; /* associated window */ + uint32_t window; /* associated window */ }; /* A credential */ @@ -45,7 +45,7 @@ struct authdes_cred { enum authdes_namekind adc_namekind; struct authdes_fullname adc_fullname; - u_long adc_nickname; + uint32_t adc_nickname; }; /* A des authentication verifier */ @@ -57,7 +57,7 @@ struct authdes_verf des_block adv_xtime; /* crypt time */ } adv_time_u; - u_long adv_int_u; + uint32_t adv_int_u; }; /* des authentication verifier: client variety diff --git a/sunrpc/rpc/xdr.h b/sunrpc/rpc/xdr.h index a4e66c9fc2..fe72abb7d8 100644 --- a/sunrpc/rpc/xdr.h +++ b/sunrpc/rpc/xdr.h @@ -117,23 +117,23 @@ struct XDR enum xdr_op x_op; /* operation; fast additional param */ struct xdr_ops { - bool_t (*x_getlong) __PMT ((XDR * __xdrs, long *__lp)); + bool_t (*x_getlong) __PMT ((XDR *__xdrs, long *__lp)); /* get a long from underlying stream */ - bool_t (*x_putlong) __PMT ((XDR * __xdrs, __const long *__lp)); + bool_t (*x_putlong) __PMT ((XDR *__xdrs, __const long *__lp)); /* put a long to " */ - bool_t (*x_getbytes) __PMT ((XDR * __xdrs, caddr_t __addr, + bool_t (*x_getbytes) __PMT ((XDR *__xdrs, caddr_t __addr, u_int __len)); /* get some bytes from " */ - bool_t (*x_putbytes) __PMT ((XDR * __xdrs, __const char *__addr, + bool_t (*x_putbytes) __PMT ((XDR *__xdrs, __const char *__addr, u_int __len)); /* put some bytes to " */ - u_int (*x_getpostn) __PMT ((__const XDR * __xdrs)); + u_int (*x_getpostn) __PMT ((__const XDR *__xdrs)); /* returns bytes off from beginning */ - bool_t (*x_setpostn) __PMT ((XDR * __xdrs, u_int pos)); + bool_t (*x_setpostn) __PMT ((XDR *__xdrs, u_int pos)); /* lets you reposition the stream */ - long *(*x_inline) __PMT ((XDR * __xdrs, int len)); + long *(*x_inline) __PMT ((XDR *__xdrs, int len)); /* buf quick ptr to buffered data */ - void (*x_destroy) __PMT ((XDR * __xdrs)); + void (*x_destroy) __PMT ((XDR *__xdrs)); /* free privates of this xdr_stream */ } *x_ops; @@ -163,6 +163,16 @@ typedef bool_t (*xdrproc_t) __PMT ((XDR *, void *,...)); * u_int len; * u_int pos; */ +#define XDR_GETINT32(xdrs, int32p) \ + (*(xdrs)->x_ops->x_getlong)(xdrs, (long *)int32p) +#define xdr_getint32(xdrs, int32p) \ + (*(xdrs)->x_ops->x_getlong)(xdrs, (long *)int32p) + +#define XDR_PUTINT32(xdrs, int32p) \ + (*(xdrs)->x_ops->x_putlong)(xdrs, (long *)int32p) +#define xdr_putint32(xdrs, int32p) \ + (*(xdrs)->x_ops->x_putlong)(xdrs, (long *)int32p) + #define XDR_GETLONG(xdrs, longp) \ (*(xdrs)->x_ops->x_getlong)(xdrs, longp) #define xdr_getlong(xdrs, longp) \ @@ -259,35 +269,37 @@ struct xdr_discrim * also, the XDR structure is always updated by some of these calls. */ extern bool_t xdr_void __P ((void)); -extern bool_t xdr_int __P ((XDR * __xdrs, int *__ip)); -extern bool_t xdr_u_int __P ((XDR * __xdrs, u_int * __up)); -extern bool_t xdr_long __P ((XDR * __xdrs, long *__lp)); -extern bool_t xdr_u_long __P ((XDR * __xdrs, u_long * __ulp)); -extern bool_t xdr_short __P ((XDR * __xdrs, short *__sp)); -extern bool_t xdr_u_short __P ((XDR * __xdrs, u_short * __usp)); -extern bool_t xdr_bool __P ((XDR * __xdrs, bool_t * __bp)); -extern bool_t xdr_enum __P ((XDR * __xdrs, enum_t * __ep)); -extern bool_t xdr_array __P ((XDR * _xdrs, caddr_t * __addrp, u_int * __sizep, +extern bool_t xdr_int __P ((XDR *__xdrs, int *__ip)); +extern bool_t xdr_u_int __P ((XDR *__xdrs, u_int *__up)); +extern bool_t xdr_int32_t __P ((XDR *__xdrs, int32_t *__ip)); +extern bool_t xdr_uint32_t __P ((XDR *__xdrs, uint32_t *__up)); +extern bool_t xdr_long __P ((XDR *__xdrs, long *__lp)); +extern bool_t xdr_u_long __P ((XDR *__xdrs, u_long *__ulp)); +extern bool_t xdr_short __P ((XDR *__xdrs, short *__sp)); +extern bool_t xdr_u_short __P ((XDR *__xdrs, u_short *__usp)); +extern bool_t xdr_bool __P ((XDR *__xdrs, bool_t *__bp)); +extern bool_t xdr_enum __P ((XDR *__xdrs, enum_t *__ep)); +extern bool_t xdr_array __P ((XDR * _xdrs, caddr_t *__addrp, u_int *__sizep, u_int __maxsize, u_int __elsize, xdrproc_t __elproc)); -extern bool_t xdr_bytes __P ((XDR * __xdrs, char **__cpp, u_int * __sizep, +extern bool_t xdr_bytes __P ((XDR *__xdrs, char **__cpp, u_int *__sizep, u_int __maxsize)); -extern bool_t xdr_opaque __P ((XDR * __xdrs, caddr_t __cp, u_int __cnt)); -extern bool_t xdr_string __P ((XDR * __xdrs, char **__cpp, u_int __maxsize)); -extern bool_t xdr_union __P ((XDR * __xdrs, enum_t * __dscmp, char *__unp, - __const struct xdr_discrim * __choices, +extern bool_t xdr_opaque __P ((XDR *__xdrs, caddr_t __cp, u_int __cnt)); +extern bool_t xdr_string __P ((XDR *__xdrs, char **__cpp, u_int __maxsize)); +extern bool_t xdr_union __P ((XDR *__xdrs, enum_t *__dscmp, char *__unp, + __const struct xdr_discrim *__choices, xdrproc_t dfault)); -extern bool_t xdr_char __P ((XDR * __xdrs, char *__cp)); -extern bool_t xdr_u_char __P ((XDR * __xdrs, u_char * __cp)); -extern bool_t xdr_vector __P ((XDR * __xdrs, char *__basep, u_int __nelem, +extern bool_t xdr_char __P ((XDR *__xdrs, char *__cp)); +extern bool_t xdr_u_char __P ((XDR *__xdrs, u_char *__cp)); +extern bool_t xdr_vector __P ((XDR *__xdrs, char *__basep, u_int __nelem, u_int __elemsize, xdrproc_t __xdr_elem)); -extern bool_t xdr_float __P ((XDR * __xdrs, float *__fp)); -extern bool_t xdr_double __P ((XDR * __xdrs, double *__dp)); -extern bool_t xdr_reference __P ((XDR * __xdrs, caddr_t * __xpp, u_int __size, +extern bool_t xdr_float __P ((XDR *__xdrs, float *__fp)); +extern bool_t xdr_double __P ((XDR *__xdrs, double *__dp)); +extern bool_t xdr_reference __P ((XDR *__xdrs, caddr_t *__xpp, u_int __size, xdrproc_t __proc)); -extern bool_t xdr_pointer __P ((XDR * __xdrs, char **__objpp, +extern bool_t xdr_pointer __P ((XDR *__xdrs, char **__objpp, u_int __obj_size, xdrproc_t __xdr_obj)); -extern bool_t xdr_wrapstring __P ((XDR * __xdrs, char **__cpp)); +extern bool_t xdr_wrapstring __P ((XDR *__xdrs, char **__cpp)); extern u_long xdr_sizeof __P ((xdrproc_t, void *)); /* @@ -301,7 +313,7 @@ struct netobj char *n_bytes; }; typedef struct netobj netobj; -extern bool_t xdr_netobj __P ((XDR * __xdrs, struct netobj * __np)); +extern bool_t xdr_netobj __P ((XDR *__xdrs, struct netobj *__np)); /* * These are the public routines for the various implementations of @@ -309,27 +321,27 @@ extern bool_t xdr_netobj __P ((XDR * __xdrs, struct netobj * __np)); */ /* XDR using memory buffers */ -extern void xdrmem_create __P ((XDR * __xdrs, __const caddr_t __addr, +extern void xdrmem_create __P ((XDR *__xdrs, __const caddr_t __addr, u_int __size, enum xdr_op __xop)); /* XDR using stdio library */ -extern void xdrstdio_create __P ((XDR * __xdrs, FILE * __file, +extern void xdrstdio_create __P ((XDR *__xdrs, FILE *__file, enum xdr_op __xop)); /* XDR pseudo records for tcp */ -extern void xdrrec_create __P ((XDR * __xdrs, u_int __sendsize, +extern void xdrrec_create __P ((XDR *__xdrs, u_int __sendsize, u_int __recvsize, caddr_t __tcp_handle, int (*__readit) (char *, char *, int), int (*__writeit) (char *, char *, int))); /* make end of xdr record */ -extern bool_t xdrrec_endofrecord __P ((XDR * __xdrs, bool_t __sendnow)); +extern bool_t xdrrec_endofrecord __P ((XDR *__xdrs, bool_t __sendnow)); /* move to beginning of next record */ -extern bool_t xdrrec_skiprecord __P ((XDR * __xdrs)); +extern bool_t xdrrec_skiprecord __P ((XDR *__xdrs)); /* true if no more input */ -extern bool_t xdrrec_eof __P ((XDR * __xdrs)); +extern bool_t xdrrec_eof __P ((XDR *__xdrs)); /* free memory buffers for xdr */ extern void xdr_free __P ((xdrproc_t __proc, char *__objp)); diff --git a/sunrpc/xdr.c b/sunrpc/xdr.c index 668d9b683b..0e3e5fc63a 100644 --- a/sunrpc/xdr.c +++ b/sunrpc/xdr.c @@ -58,17 +58,14 @@ static char sccsid[] = "@(#)xdr.c 1.35 87/08/12"; /* * for unit alignment */ -static const char xdr_zero[BYTES_PER_XDR_UNIT] = -{0, 0, 0, 0}; +static const char xdr_zero[BYTES_PER_XDR_UNIT] = {0, 0, 0, 0}; /* * Free a data structure using XDR * Not a filter, but a convenient utility nonetheless */ void -xdr_free (proc, objp) - xdrproc_t proc; - char *objp; +xdr_free (xdrproc_t proc, char *objp) { XDR x; @@ -89,9 +86,7 @@ xdr_void (void) * XDR integers */ bool_t -xdr_int (xdrs, ip) - XDR *xdrs; - int *ip; +xdr_int (XDR *xdrs, int *ip) { #if INT_MAX < LONG_MAX @@ -126,9 +121,7 @@ xdr_int (xdrs, ip) * XDR unsigned integers */ bool_t -xdr_u_int (xdrs, up) - XDR *xdrs; - u_int *up; +xdr_u_int (XDR *xdrs, u_int *up) { #if UINT_MAX < ULONG_MAX u_long l; @@ -159,13 +152,50 @@ xdr_u_int (xdrs, up) } /* + * XDR 32bit integers + */ +bool_t +xdr_int32_t (XDR *xdrs, int32_t *lp) +{ + + if (xdrs->x_op == XDR_ENCODE) + return XDR_PUTINT32 (xdrs, lp); + + if (xdrs->x_op == XDR_DECODE) + return XDR_GETINT32 (xdrs, lp); + + if (xdrs->x_op == XDR_FREE) + return TRUE; + + return FALSE; +} + +/* + * XDR 32bit unsigned integers + */ +bool_t +xdr_uint32_t (XDR *xdrs, uint32_t *ulp) +{ + switch (xdrs->x_op) + { + case XDR_DECODE: + return XDR_GETINT32 (xdrs, (uint32_t *) ulp); + + case XDR_ENCODE: + return XDR_PUTINT32 (xdrs, (uint32_t *) ulp); + + case XDR_FREE: + return TRUE; + } + return FALSE; +} + +/* * XDR long integers * same as xdr_u_long - open coded to save a proc call! */ bool_t -xdr_long (xdrs, lp) - XDR *xdrs; - long *lp; +xdr_long (XDR *xdrs, long *lp) { if (xdrs->x_op == XDR_ENCODE) @@ -185,9 +215,7 @@ xdr_long (xdrs, lp) * same as xdr_long - open coded to save a proc call! */ bool_t -xdr_u_long (xdrs, ulp) - XDR *xdrs; - u_long *ulp; +xdr_u_long (XDR *xdrs, u_long *ulp) { switch (xdrs->x_op) { |