Imported Debian patch 1.0.9-5
[nfs-utils.git] / utils / rquotad / rquota_xdr.c
1 /*
2  * Please do not edit this file.
3  * It was generated using rpcgen.
4  */
5
6 #include "rquota.h"
7
8 bool_t
9 xdr_getquota_args(xdrs, objp)
10         XDR *xdrs;
11         getquota_args *objp;
12 {
13
14          if (!xdr_string(xdrs, &objp->gqa_pathp, RQ_PATHLEN)) {
15                  return (FALSE);
16          }
17          if (!xdr_int(xdrs, &objp->gqa_uid)) {
18                  return (FALSE);
19          }
20         return (TRUE);
21 }
22
23 bool_t
24 xdr_ext_getquota_args(xdrs, objp)
25         XDR *xdrs;
26         ext_getquota_args *objp;
27 {
28
29          if (!xdr_string(xdrs, &objp->gqa_pathp, RQ_PATHLEN)) {
30                  return (FALSE);
31          }
32          if (!xdr_int(xdrs, &objp->gqa_type)) {
33                  return (FALSE);
34          }
35          if (!xdr_int(xdrs, &objp->gqa_id)) {
36                  return (FALSE);
37          }
38         return (TRUE);
39 }
40
41 bool_t
42 xdr_rquota(xdrs, objp)
43         XDR *xdrs;
44         rquota *objp;
45 {
46
47
48          if (xdrs->x_op == XDR_ENCODE) {
49                 int32_t *buf = XDR_INLINE(xdrs,10 * BYTES_PER_XDR_UNIT);
50                 if (buf == NULL) {
51                  if (!xdr_int(xdrs, &objp->rq_bsize)) {
52                          return (FALSE);
53                  }
54                  if (!xdr_bool(xdrs, &objp->rq_active)) {
55                          return (FALSE);
56                  }
57                  if (!xdr_u_int(xdrs, &objp->rq_bhardlimit)) {
58                          return (FALSE);
59                  }
60                  if (!xdr_u_int(xdrs, &objp->rq_bsoftlimit)) {
61                          return (FALSE);
62                  }
63                  if (!xdr_u_int(xdrs, &objp->rq_curblocks)) {
64                          return (FALSE);
65                  }
66                  if (!xdr_u_int(xdrs, &objp->rq_fhardlimit)) {
67                          return (FALSE);
68                  }
69                  if (!xdr_u_int(xdrs, &objp->rq_fsoftlimit)) {
70                          return (FALSE);
71                  }
72                  if (!xdr_u_int(xdrs, &objp->rq_curfiles)) {
73                          return (FALSE);
74                  }
75                  if (!xdr_u_int(xdrs, &objp->rq_btimeleft)) {
76                          return (FALSE);
77                  }
78                  if (!xdr_u_int(xdrs, &objp->rq_ftimeleft)) {
79                          return (FALSE);
80                  }
81
82           }
83           else {
84                  (void) IXDR_PUT_INT32(buf,objp->rq_bsize);
85                  (void) IXDR_PUT_BOOL(buf,objp->rq_active);
86                  (void) IXDR_PUT_U_INT32(buf,objp->rq_bhardlimit);
87                  (void) IXDR_PUT_U_INT32(buf,objp->rq_bsoftlimit);
88                  (void) IXDR_PUT_U_INT32(buf,objp->rq_curblocks);
89                  (void) IXDR_PUT_U_INT32(buf,objp->rq_fhardlimit);
90                  (void) IXDR_PUT_U_INT32(buf,objp->rq_fsoftlimit);
91                  (void) IXDR_PUT_U_INT32(buf,objp->rq_curfiles);
92                  (void) IXDR_PUT_U_INT32(buf,objp->rq_btimeleft);
93                  (void) IXDR_PUT_U_INT32(buf,objp->rq_ftimeleft);
94           }
95
96          return (TRUE);
97         } else if (xdrs->x_op == XDR_DECODE) {
98                 int32_t *buf = XDR_INLINE(xdrs,10 * BYTES_PER_XDR_UNIT);
99                 if (buf == NULL) {
100                  if (!xdr_int(xdrs, &objp->rq_bsize)) {
101                          return (FALSE);
102                  }
103                  if (!xdr_bool(xdrs, &objp->rq_active)) {
104                          return (FALSE);
105                  }
106                  if (!xdr_u_int(xdrs, &objp->rq_bhardlimit)) {
107                          return (FALSE);
108                  }
109                  if (!xdr_u_int(xdrs, &objp->rq_bsoftlimit)) {
110                          return (FALSE);
111                  }
112                  if (!xdr_u_int(xdrs, &objp->rq_curblocks)) {
113                          return (FALSE);
114                  }
115                  if (!xdr_u_int(xdrs, &objp->rq_fhardlimit)) {
116                          return (FALSE);
117                  }
118                  if (!xdr_u_int(xdrs, &objp->rq_fsoftlimit)) {
119                          return (FALSE);
120                  }
121                  if (!xdr_u_int(xdrs, &objp->rq_curfiles)) {
122                          return (FALSE);
123                  }
124                  if (!xdr_u_int(xdrs, &objp->rq_btimeleft)) {
125                          return (FALSE);
126                  }
127                  if (!xdr_u_int(xdrs, &objp->rq_ftimeleft)) {
128                          return (FALSE);
129                  }
130
131           }
132           else {
133                  objp->rq_bsize = IXDR_GET_INT32(buf);
134                  objp->rq_active = IXDR_GET_BOOL(buf);
135                  objp->rq_bhardlimit = IXDR_GET_U_INT32(buf);
136                  objp->rq_bsoftlimit = IXDR_GET_U_INT32(buf);
137                  objp->rq_curblocks = IXDR_GET_U_INT32(buf);
138                  objp->rq_fhardlimit = IXDR_GET_U_INT32(buf);
139                  objp->rq_fsoftlimit = IXDR_GET_U_INT32(buf);
140                  objp->rq_curfiles = IXDR_GET_U_INT32(buf);
141                  objp->rq_btimeleft = IXDR_GET_U_INT32(buf);
142                  objp->rq_ftimeleft = IXDR_GET_U_INT32(buf);
143           }
144          return(TRUE);
145         }
146
147          if (!xdr_int(xdrs, &objp->rq_bsize)) {
148                  return (FALSE);
149          }
150          if (!xdr_bool(xdrs, &objp->rq_active)) {
151                  return (FALSE);
152          }
153          if (!xdr_u_int(xdrs, &objp->rq_bhardlimit)) {
154                  return (FALSE);
155          }
156          if (!xdr_u_int(xdrs, &objp->rq_bsoftlimit)) {
157                  return (FALSE);
158          }
159          if (!xdr_u_int(xdrs, &objp->rq_curblocks)) {
160                  return (FALSE);
161          }
162          if (!xdr_u_int(xdrs, &objp->rq_fhardlimit)) {
163                  return (FALSE);
164          }
165          if (!xdr_u_int(xdrs, &objp->rq_fsoftlimit)) {
166                  return (FALSE);
167          }
168          if (!xdr_u_int(xdrs, &objp->rq_curfiles)) {
169                  return (FALSE);
170          }
171          if (!xdr_u_int(xdrs, &objp->rq_btimeleft)) {
172                  return (FALSE);
173          }
174          if (!xdr_u_int(xdrs, &objp->rq_ftimeleft)) {
175                  return (FALSE);
176          }
177         return (TRUE);
178 }
179
180 bool_t
181 xdr_gqr_status(xdrs, objp)
182         XDR *xdrs;
183         gqr_status *objp;
184 {
185
186          if (!xdr_enum(xdrs, (enum_t *)objp)) {
187                  return (FALSE);
188          }
189         return (TRUE);
190 }
191
192 bool_t
193 xdr_getquota_rslt(xdrs, objp)
194         XDR *xdrs;
195         getquota_rslt *objp;
196 {
197
198          if (!xdr_gqr_status(xdrs, &objp->status)) {
199                  return (FALSE);
200          }
201         switch (objp->status) {
202         case Q_OK:
203                  if (!xdr_rquota(xdrs, &objp->getquota_rslt_u.gqr_rquota)) {
204                          return (FALSE);
205                  }
206                 break;
207         case Q_NOQUOTA:
208                 break;
209         case Q_EPERM:
210                 break;
211         default:
212                 return (FALSE);
213         }
214         return (TRUE);
215 }