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