vm: replace vnode v_pages with a v_pagecache_list list_t
[unleashed.git] / kernel / fs / nfs / nfs_auth_xdr.c
blob1ccba37a210d231eaba81eac985da2234887b5d7
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
27 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
28 * Use is subject to license terms.
31 #include <nfs/auth.h>
32 #include <rpc/auth_sys.h>
34 bool_t
35 xdr_varg(XDR *xdrs, varg_t *vap)
37 if (!xdr_u_int(xdrs, &vap->vers))
38 return (FALSE);
40 switch (vap->vers) {
41 case V_PROTO:
42 if (!xdr_nfsauth_arg(xdrs, &vap->arg_u.arg))
43 return (FALSE);
44 break;
46 /* Additional versions of the args go here */
48 default:
49 vap->vers = V_ERROR;
50 return (FALSE);
51 /* NOTREACHED */
53 return (TRUE);
56 bool_t
57 xdr_nfsauth_arg(XDR *xdrs, nfsauth_arg_t *argp)
59 if (!xdr_u_int(xdrs, &argp->cmd))
60 return (FALSE);
61 if (!xdr_netobj(xdrs, &argp->areq.req_client))
62 return (FALSE);
63 if (!xdr_string(xdrs, &argp->areq.req_netid, ~0))
64 return (FALSE);
65 if (!xdr_string(xdrs, &argp->areq.req_path, A_MAXPATH))
66 return (FALSE);
67 if (!xdr_int(xdrs, &argp->areq.req_flavor))
68 return (FALSE);
69 if (!xdr_uid_t(xdrs, &argp->areq.req_clnt_uid))
70 return (FALSE);
71 if (!xdr_gid_t(xdrs, &argp->areq.req_clnt_gid))
72 return (FALSE);
73 if (!xdr_array(xdrs, (caddr_t *)&argp->areq.req_clnt_gids.val,
74 &argp->areq.req_clnt_gids.len, NGROUPS_UMAX, (uint_t)sizeof (gid_t),
75 xdr_gid_t))
76 return (FALSE);
77 return (TRUE);
80 bool_t
81 xdr_nfsauth_res(XDR *xdrs, nfsauth_res_t *argp)
83 if (!xdr_u_int(xdrs, &argp->stat))
84 return (FALSE);
85 if (!xdr_int(xdrs, &argp->ares.auth_perm))
86 return (FALSE);
87 if (!xdr_uid_t(xdrs, &argp->ares.auth_srv_uid))
88 return (FALSE);
89 if (!xdr_gid_t(xdrs, &argp->ares.auth_srv_gid))
90 return (FALSE);
91 if (!xdr_array(xdrs, (caddr_t *)&argp->ares.auth_srv_gids.val,
92 &argp->ares.auth_srv_gids.len, NGROUPS_UMAX, (uint_t)sizeof (gid_t),
93 xdr_gid_t))
94 return (FALSE);
95 return (TRUE);