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 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
36 #include <sys/types.h>
37 #include <sys/param.h>
38 #include <sys/kiconv.h>
40 #define KICONV_MAX_CODENAME_LEN 63 /* copied from sys/kiconv.h */
42 #define NFSCMD_VERS_1 1
43 #define NFSCMD_VERSION NFSCMD_VERS_1
45 typedef enum { NFSCMD_CHARMAP_LOOKUP
, NFSCMD_ERROR
} nfscmd_t
;
46 typedef enum { NFSCMD_ERR_SUCCESS
, NFSCMD_ERR_BADCMD
, NFSCMD_ERR_NOTFOUND
,
47 NFSCMD_ERR_FAIL
, NFSCMD_ERR_DROP
, NFSCMD_ERR_NOMEM
} nfscmd_err_t
;
48 #define NFSCMD_ERR_RET 0x100000
50 typedef struct nfscmd_arg
{
55 char path
[MAXPATHLEN
];
61 typedef struct nfscmd_res
{
67 char codeset
[KICONV_MAX_CODENAME_LEN
+ 1];
75 #define NFSCMD_CONV_INBOUND 1
76 #define NFSCMD_CONV_OUTBOUND 0
78 extern int nfscmd_send(nfscmd_arg_t
*, nfscmd_res_t
*);
79 extern struct charset_cache
*nfscmd_findmap(struct exportinfo
*,
81 extern char *nfscmd_convname(struct sockaddr
*, struct exportinfo
*,
83 extern char *nfscmd_convdirent(struct sockaddr
*, struct exportinfo
*, char *,
84 size_t, enum nfsstat3
*);
85 extern size_t nfscmd_convdirplus(struct sockaddr
*, struct exportinfo
*, char *,
86 size_t, size_t, char **);
87 extern size_t nfscmd_countents(char *, size_t);
88 extern size_t nfscmd_dropped_entrysize(struct dirent
*, size_t, size_t);
96 #endif /* _NFS_CMD_H */