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.
25 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
35 #include <sys/types.h>
36 #include <sys/param.h>
39 #include <sys/nvpair.h>
41 #include <libnvpair.h>
44 #define FS_REPARSE_TAG_STR "@{REPARSE"
45 #define FS_REPARSE_TAG_END_CHAR '}'
46 #define FS_REPARSE_TAG_END_STR "}"
47 #define FS_TOKEN_START_STR "@{"
48 #define FS_TOKEN_END_STR "}"
50 #define REPARSED "svc:/system/filesystem/reparse:default"
51 #define MAXREPARSELEN MAXPATHLEN
52 #define REPARSED_DOOR "/var/run/reparsed_door"
53 #define REPARSED_DOORCALL_MAX_RETRY 4
56 * This structure is shared between kernel code and user reparsed daemon.
57 * The 'res_len' must be defined as int, and not size_t, for 32-bit reparsed
58 * binary and 64-bit kernel code to work together.
60 typedef struct reparsed_door_res
{
64 } reparsed_door_res_t
;
66 extern nvlist_t
*reparse_init(void);
67 extern void reparse_free(nvlist_t
*nvl
);
68 extern int reparse_parse(const char *reparse_data
, nvlist_t
*nvl
);
69 extern int reparse_validate(const char *reparse_data
);
72 extern int reparse_kderef(const char *svc_type
, const char *svc_data
,
73 char *buf
, size_t *bufsz
);
74 extern int reparse_vnode_parse(vnode_t
*vp
, nvlist_t
*nvl
);
76 extern int reparse_add(nvlist_t
*nvl
, const char *svc_type
,
77 const char *svc_data
);
78 extern int reparse_remove(nvlist_t
*nvl
, const char *svc_type
);
79 extern int reparse_unparse(nvlist_t
*nvl
, char **stringp
);
80 extern int reparse_create(const char *path
, const char *data
);
81 extern int reparse_delete(const char *path
);
82 extern int reparse_deref(const char *svc_type
, const char *svc_data
,
83 char *buf
, size_t *bufsz
);
90 #endif /* _FS_REPARSE_H */