home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / comm / tcp / amitcp-sdk / src / rpclib / authunix_prot.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-29  |  1.3 KB  |  54 lines

  1. /*
  2.  *      $Id: authunix_prot.c,v 4.2 1994/09/29 23:48:50 jraja Exp $
  3.  *
  4.  *      XDR for UNIX style authentication parameters for RPC
  5.  *
  6.  *      Copyright © 1994 AmiTCP/IP Group,
  7.  *                       Network Solutions Development Inc.
  8.  *                       All rights reserved. 
  9.  */
  10.  
  11. /* @(#)authunix_prot.c    2.1 88/07/29 4.0 RPCSRC */
  12. #if !defined(lint) && defined(SCCSIDS)
  13. static char sccsid[] = "@(#)authunix_prot.c 1.15 87/08/11 Copyr 1984 Sun Micro";
  14. #endif
  15.  
  16. /*
  17.  * Copyright (C) 1984, Sun Microsystems, Inc.
  18.  */
  19.  
  20.  
  21. #include <sys/param.h>
  22. #include <rpc/types.h>
  23. #include <rpc/xdr.h>
  24. #include <rpc/auth.h>
  25. #include <rpc/auth_unix.h>
  26.  
  27. /*
  28.  * XDR for unix authentication parameters.
  29.  */
  30. bool_t XDRFUN
  31. xdr_authunix_parms(xdrs, p)
  32.     register XDR *xdrs;
  33.     register struct authunix_parms *p;
  34. {
  35.  
  36.     if (xdr_u_long(xdrs, &(p->aup_time))
  37.         && xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME)
  38. #ifdef AMITCP
  39.         && xdr_long(xdrs, &(p->aup_uid))
  40.         && xdr_long(xdrs, &(p->aup_gid))
  41.         && xdr_array(xdrs, (caddr_t *)&(p->aup_gids),
  42.             &(p->aup_len), NGRPS, sizeof(gid_t), xdr_long) ) {
  43. #else
  44.         && xdr_int(xdrs, &(p->aup_uid))
  45.         && xdr_int(xdrs, &(p->aup_gid))
  46.         && xdr_array(xdrs, (caddr_t *)&(p->aup_gids),
  47.             &(p->aup_len), NGRPS, sizeof(int), xdr_int) ) {
  48. #endif
  49.         return (TRUE);
  50.     }
  51.     return (FALSE);
  52. }
  53.  
  54.