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]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
32 #include <sys/sysmacros.h>
33 #include <sys/types.h>
36 * NFSv4 id mapping daemon
38 * This daemon is used by the kernel to map strings in the form
39 * "user@dns_domain" from an integer form or vice-versa. The daemon
40 * uses the system configured name services for the mapping.
42 * The status results determines if a mapping was successful.
44 * The mapping is cached in the kernel, so that expensive upcalls are
45 * reduced to a minimum.
55 #define NFSMAPID_STR_UID 1
56 #define NFSMAPID_UID_STR 2
57 #define NFSMAPID_STR_GID 3
58 #define NFSMAPID_GID_STR 4
59 #define NFSMAPID_SRV_NETINFO 5
62 * We are passing in arguments in a variable length struct
63 * similar to a dirent_t. We break apart a utf8string into
64 * its components and allocate a struct long enough to hold
65 * the string and a NUL terminator. The caller must ensure the
77 typedef struct mapid_arg mapid_arg_t
;
80 * The actual required size of the args, rounded up to a 64 bit boundary
82 #define MAPID_ARG_LEN(str_length) \
83 ((offsetof(mapid_arg_t, str[0]) + 1 + (str_length) + 7) & ~ 7)
91 * numeric string is mapped to its literal number
93 #define NFSMAPID_NUMSTR 1
96 * Value cannot be mapped, badly formed string
98 #define NFSMAPID_UNMAPPABLE 2
101 * Caller provided invalid arguments
103 #define NFSMAPID_INVALID 3
106 * Internal error in daemon e.g. out of memory, can't return result
108 #define NFSMAPID_INTERNAL 4
111 * Incorrect domain used
113 #define NFSMAPID_BADDOMAIN 5
116 * Out of range uid/gid
118 #define NFSMAPID_BADID 6
121 * User or group cannot be found in nameservice
123 #define NFSMAPID_NOTFOUND 7
126 * Similar to the arguments, the result is variable length.
127 * The returner must ensure the string terminator is set.
138 typedef struct mapid_res mapid_res_t
;
141 * The actual required size of the result, rounded up to a 64 bit boundary
143 #define MAPID_RES_LEN(str_length) \
144 ((offsetof(mapid_res_t, str[0]) + 1 + (str_length) + 7) & ~ 7)
147 * Support for referral name resolution by the NFS client
149 typedef struct refd_door_args
{
150 int cmd
; /* NFS4_FS_LOCATIONS/NFS4_SRV_NETINFO */
151 int xdr_len
; /* Length of xdr Buffer */
152 char xdr_arg
[1]; /* Buffer holding xdr encoded data */
155 typedef struct refd_door_res
{
162 typedef struct refd_door_args32
{
166 } refd_door_args32_t
;
168 typedef struct refd_door_res32
{
179 #endif /* _NFSID_MAP_H */