aboutsummaryrefslogtreecommitdiff
path: root/nis/nis_xdr.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-10-31 12:13:49 +0000
committerUlrich Drepper <drepper@redhat.com>1998-10-31 12:13:49 +0000
commita1129917d77757941eded59e574f5fc9199284cb (patch)
treef934658661b419f0fe5a2508a15b982a78e4003c /nis/nis_xdr.c
parent655b26bb758d9acb15e4870c1c541bb25c36cdd1 (diff)
downloadglibc-a1129917d77757941eded59e574f5fc9199284cb.tar
glibc-a1129917d77757941eded59e574f5fc9199284cb.tar.gz
glibc-a1129917d77757941eded59e574f5fc9199284cb.tar.bz2
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 'nis/nis_xdr.c')
-rw-r--r--nis/nis_xdr.c117
1 files changed, 24 insertions, 93 deletions
diff --git a/nis/nis_xdr.c b/nis/nis_xdr.c
index efeb7d09dd..898518213a 100644
--- a/nis/nis_xdr.c
+++ b/nis/nis_xdr.c
@@ -63,7 +63,7 @@ xdr_nstype (XDR *xdrs, nstype *objp)
static bool_t
xdr_oar_mask (XDR *xdrs, oar_mask *objp)
{
- if (!xdr_u_long (xdrs, &objp->oa_rights))
+ if (!xdr_u_int (xdrs, &objp->oa_rights))
return FALSE;
if (!xdr_zotypes (xdrs, &objp->oa_otype))
return FALSE;
@@ -90,7 +90,7 @@ _xdr_nis_server (XDR *xdrs, nis_server *objp)
if (!xdr_array (xdrs, (char **) &objp->ep.ep_val, (u_int *) &objp->ep.ep_len,
~0, sizeof (endpoint), (xdrproc_t) xdr_endpoint))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->key_type))
+ if (!xdr_u_int (xdrs, &objp->key_type))
return FALSE;
if (!xdr_netobj (xdrs, &objp->pkey))
return FALSE;
@@ -109,7 +109,7 @@ _xdr_directory_obj (XDR *xdrs, directory_obj *objp)
sizeof (nis_server), (xdrproc_t) _xdr_nis_server))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->do_ttl))
+ if (!xdr_uint32_t (xdrs, &objp->do_ttl))
return FALSE;
if (!xdr_array (xdrs, (char **) &objp->do_armask.do_armask_val,
(u_int *) & objp->do_armask.do_armask_len, ~0,
@@ -121,7 +121,7 @@ _xdr_directory_obj (XDR *xdrs, directory_obj *objp)
static bool_t
xdr_entry_col (XDR *xdrs, entry_col *objp)
{
- if (!xdr_u_long (xdrs, &objp->ec_flags))
+ if (!xdr_u_int (xdrs, &objp->ec_flags))
return FALSE;
if (!xdr_bytes (xdrs, (char **) &objp->ec_value.ec_value_val,
(u_int *) &objp->ec_value.ec_value_len, ~0))
@@ -144,7 +144,7 @@ xdr_entry_obj (XDR *xdrs, entry_obj *objp)
static bool_t
xdr_group_obj (XDR *xdrs, group_obj *objp)
{
- if (!xdr_u_long (xdrs, &objp->gr_flags))
+ if (!xdr_u_int (xdrs, &objp->gr_flags))
return FALSE;
if (!xdr_array (xdrs, (char **) &objp->gr_members.gr_members_val,
(u_int *) &objp->gr_members.gr_members_len, ~0,
@@ -172,9 +172,9 @@ xdr_table_col (XDR *xdrs, table_col *objp)
{
if (!xdr_string (xdrs, &objp->tc_name, 64))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->tc_flags))
+ if (!xdr_u_int (xdrs, &objp->tc_flags))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->tc_rights))
+ if (!xdr_u_int (xdrs, &objp->tc_rights))
return FALSE;
return TRUE;
}
@@ -242,9 +242,9 @@ xdr_objdata (XDR *xdrs, objdata *objp)
static bool_t
xdr_nis_oid (XDR *xdrs, nis_oid *objp)
{
- if (!xdr_u_long (xdrs, &objp->ctime))
+ if (!xdr_uint32_t (xdrs, &objp->ctime))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->mtime))
+ if (!xdr_uint32_t (xdrs, &objp->mtime))
return FALSE;
return TRUE;
}
@@ -262,9 +262,9 @@ _xdr_nis_object (XDR *xdrs, nis_object *objp)
return FALSE;
if (!_xdr_nis_name (xdrs, &objp->zo_domain))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->zo_access))
+ if (!xdr_u_int (xdrs, &objp->zo_access))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->zo_ttl))
+ if (!xdr_uint32_t (xdrs, &objp->zo_ttl))
return FALSE;
if (!xdr_objdata (xdrs, &objp->zo_data))
return FALSE;
@@ -282,71 +282,6 @@ _xdr_nis_error (XDR *xdrs, nis_error *objp)
bool_t
_xdr_nis_result (XDR *xdrs, nis_result *objp)
{
- register long *buf;
-
- if (xdrs->x_op == XDR_ENCODE)
- {
- if (!_xdr_nis_error (xdrs, &objp->status))
- return FALSE;
- if (!xdr_array (xdrs, (char **) &objp->objects.objects_val,
- (u_int *) &objp->objects.objects_len, ~0,
- sizeof (nis_object), (xdrproc_t) _xdr_nis_object))
- return FALSE;
- if (!xdr_netobj (xdrs, &objp->cookie))
- return FALSE;
- buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
- if (buf == NULL)
- {
- if (!xdr_u_long (xdrs, &objp->zticks))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dticks))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->aticks))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->cticks))
- return FALSE;
- }
- else
- {
- IXDR_PUT_U_LONG (buf, objp->zticks);
- IXDR_PUT_U_LONG (buf, objp->dticks);
- IXDR_PUT_U_LONG (buf, objp->aticks);
- IXDR_PUT_U_LONG (buf, objp->cticks);
- }
- return TRUE;
- }
- else if (xdrs->x_op == XDR_DECODE)
- {
- if (!_xdr_nis_error (xdrs, &objp->status))
- return FALSE;
- if (!xdr_array (xdrs, (char **) &objp->objects.objects_val,
- (u_int *) &objp->objects.objects_len, ~0,
- sizeof (nis_object), (xdrproc_t) _xdr_nis_object))
- return FALSE;
- if (!xdr_netobj (xdrs, &objp->cookie))
- return FALSE;
- buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
- if (buf == NULL)
- {
- if (!xdr_u_long (xdrs, &objp->zticks))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dticks))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->aticks))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->cticks))
- return FALSE;
- }
- else
- {
- objp->zticks = IXDR_GET_U_LONG (buf);
- objp->dticks = IXDR_GET_U_LONG (buf);
- objp->aticks = IXDR_GET_U_LONG (buf);
- objp->cticks = IXDR_GET_U_LONG (buf);
- }
- return TRUE;
- }
-
if (!_xdr_nis_error (xdrs, &objp->status))
return FALSE;
if (!xdr_array (xdrs, (char **) &objp->objects.objects_val,
@@ -355,13 +290,13 @@ _xdr_nis_result (XDR *xdrs, nis_result *objp)
return FALSE;
if (!xdr_netobj (xdrs, &objp->cookie))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->zticks))
+ if (!xdr_uint32_t (xdrs, &objp->zticks))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->dticks))
+ if (!xdr_uint32_t (xdrs, &objp->dticks))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->aticks))
+ if (!xdr_uint32_t (xdrs, &objp->aticks))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->cticks))
+ if (!xdr_uint32_t (xdrs, &objp->cticks))
return FALSE;
return TRUE;
}
@@ -387,7 +322,7 @@ _xdr_ib_request (XDR *xdrs, ib_request *objp)
(u_int *) &objp->ibr_srch.ibr_srch_len, ~0,
sizeof (nis_attr), (xdrproc_t) xdr_nis_attr))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->ibr_flags))
+ if (!xdr_u_int (xdrs, &objp->ibr_flags))
return FALSE;
if (!xdr_array (xdrs, (char **) &objp->ibr_obj.ibr_obj_val,
(u_int *) &objp->ibr_obj.ibr_obj_len, 1,
@@ -397,7 +332,7 @@ _xdr_ib_request (XDR *xdrs, ib_request *objp)
(u_int *) &objp->ibr_cbhost.ibr_cbhost_len, 1,
sizeof (nis_server), (xdrproc_t) _xdr_nis_server))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->ibr_bufsize))
+ if (!xdr_u_int (xdrs, &objp->ibr_bufsize))
return FALSE;
if (!xdr_netobj (xdrs, &objp->ibr_cookie))
return FALSE;
@@ -409,7 +344,7 @@ _xdr_ping_args (XDR *xdrs, ping_args *objp)
{
if (!_xdr_nis_name (xdrs, &objp->dir))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->stamp))
+ if (!xdr_uint32_t (xdrs, &objp->stamp))
return FALSE;
return TRUE;
}
@@ -419,9 +354,9 @@ _xdr_cp_result (XDR *xdrs, cp_result *objp)
{
if (!_xdr_nis_error (xdrs, &objp->cp_status))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->cp_zticks))
+ if (!xdr_uint32_t (xdrs, &objp->cp_zticks))
return FALSE;
- if (!xdr_u_long (xdrs, &objp->cp_dticks))
+ if (!xdr_uint32_t (xdrs, &objp->cp_dticks))
return FALSE;
return TRUE;
}
@@ -429,14 +364,10 @@ _xdr_cp_result (XDR *xdrs, cp_result *objp)
bool_t
_xdr_nis_tag (XDR *xdrs, nis_tag *objp)
{
- if (!xdr_u_long (xdrs, &objp->tag_type))
- {
- return FALSE;
- }
- if (!xdr_string (xdrs, &objp->tag_val, 1024))
- {
- return FALSE;
- }
+ if (!xdr_u_int (xdrs, &objp->tag_type))
+ return FALSE;
+ if (!xdr_string (xdrs, &objp->tag_val, ~0))
+ return FALSE;
return TRUE;
}