source: trunk/athena/bin/quota/rcquotaxdr.c @ 7616

Revision 7616, 1.4 KB checked in by cfields, 30 years ago (diff)
Initial revision
Line 
1#include <stdio.h>
2#include <sys/types.h>
3#include <sys/param.h>
4#if defined(_AIX)
5#include <sys/select.h>
6#endif
7#if !defined(ultrix) && !defined(_AIX) && !defined(SOLARIS)
8#include <ufs/quota.h>
9#endif
10#include <rpc/rpc.h>
11#include <rpcsvc/rcquota.h>
12
13bool_t
14xdr_getcquota_args(xdrs, gq_argsp)
15        XDR *xdrs;
16        struct getcquota_args *gq_argsp;
17{
18        extern bool_t xdr_path();
19
20        return (xdr_path(xdrs, &gq_argsp->gqa_pathp) &&
21            xdr_int(xdrs, &gq_argsp->gqa_uid));
22}
23
24
25bool_t
26xdr_getcquota_rslt(xdrs, gq_rsltp)
27        XDR *xdrs;
28        struct getcquota_rslt *gq_rsltp;
29{
30  int i;
31  if (xdr_enum(xdrs, &gq_rsltp->gqr_status) &&
32      xdr_bool(xdrs, &gq_rsltp->rq_group) &&
33      xdr_int(xdrs, &gq_rsltp->rq_ngrps) &&
34      xdr_int(xdrs, &gq_rsltp->rq_bsize) &&
35      xdr_rcquota(xdrs, &gq_rsltp->gqr_zm))
36    {
37      for(i=0;i<NGROUPS+1;i++)
38        if (!xdr_rcquota(xdrs, &gq_rsltp->gqr_rcquota[i]))
39          break;
40      if (i!=NGROUPS+1) return(FALSE);
41      return(TRUE);
42    }
43  else return(FALSE);
44}
45
46bool_t
47xdr_rcquota(xdrs, rqp)
48        XDR *xdrs;
49        struct rcquota *rqp;
50{
51
52  return (xdr_int(xdrs, &rqp->rq_id) &&
53          xdr_u_long(xdrs, &rqp->rq_bhardlimit) &&
54          xdr_u_long(xdrs, &rqp->rq_bsoftlimit) &&
55          xdr_u_long(xdrs, &rqp->rq_curblocks) &&
56          xdr_u_long(xdrs, &rqp->rq_fhardlimit) &&
57          xdr_u_long(xdrs, &rqp->rq_fsoftlimit) &&
58          xdr_u_long(xdrs, &rqp->rq_curfiles) &&
59          xdr_u_long(xdrs, &rqp->rq_btimeleft) &&
60          xdr_u_long(xdrs, &rqp->rq_ftimeleft) );
61}
Note: See TracBrowser for help on using the repository browser.