1 /*
2 * CDDL HEADER START
3 *
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.
7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 * Copyright 2016 Nexenta Systems, Inc.
26 */
27
28 #ifndef _MOUNTD_H
29 #define _MOUNTD_H
30
31 #include <door.h>
32 #include <nfs/nfs.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 struct nd_hostservlist;
39 extern void rmtab_load(void);
40 extern void mntlist_send(SVCXPRT *transp);
41 extern void mntlist_new(char *host, char *path);
42 extern void mntlist_delete(char *host, char *path);
43 extern void mntlist_delete_all(char *host);
44 extern void netgroup_init(void);
45 extern int netgroup_check(struct nd_hostservlist *, char *, int);
46 extern void netgrp_cache_flush(void);
47 extern void export(struct svc_req *);
48 extern void nfsauth_func(void *, char *, size_t, door_desc_t *, uint_t);
49 extern char *inet_ntoa_r(struct in_addr, char *);
50 extern int nfs_getfh(char *, int, int *, char *);
51
52 extern void nfsauth_prog(struct svc_req *, SVCXPRT *);
53
54 extern struct sh_list *share_list;
55 extern rwlock_t sharetab_lock;
56 extern void check_sharetab(void);
57
58 struct cln;
59 extern void log_cant_reply(SVCXPRT *);
60 extern void log_cant_reply_cln(struct cln *);
61
62 extern void *exmalloc(size_t);
63
64 extern struct share *findentry(char *);
65 extern int check_client(struct share *, struct cln *, int, uid_t, gid_t, uint_t,
66 gid_t *, uid_t *, gid_t *, uint_t *, gid_t **);
67
68 extern int in_access_list(struct cln *, char *);
69
70 struct cln {
71 SVCXPRT *transp;
72 char *netid;
73 struct netconfig *nconf;
74 struct netbuf *nbuf;
75 struct nd_hostservlist *clnames;
76 char host[INET6_ADDRSTRLEN];
77 int flags;
78 };
79
80 extern void cln_init(struct cln *, SVCXPRT *);
81 extern void cln_init_lazy(struct cln *, char *, struct netbuf *);
82 extern void cln_fini(struct cln *);
83 extern struct netbuf *cln_getnbuf(struct cln *);
84 extern struct nd_hostservlist *cln_getclientsnames(struct cln *);
85 extern char *cln_gethost(struct cln *);
86
87 /*
88 * These functions are defined here due to the fact
89 * that we can not find the proper header file to
90 * include. These functions are, at present, not
91 * listed in any other header files.
92 */
93 /*
94 * These three functions are hidden functions in the
95 * bsm libraries (libbsm).
96 */
97 extern void audit_mountd_setup(void);
98 extern void audit_mountd_mount(char *, char *, int);
99 extern void audit_mountd_umount(char *, char *);
100
101 /*
102 * This appears to be a hidden function in libc.
103 * Private interface to nss_search().
104 * Accepts N strings rather than 1.
105 */
106 extern int __multi_innetgr();
107
108 #ifdef __cplusplus
109 }
110 #endif
111
112 #endif /* _MOUNTD_H */