xref: /titanic_51/usr/src/cmd/fs.d/nfs/mountd/mountd.h (revision a9685eaab1313767d1d4dac672c3a468519aa899)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
527242a7cSthurlow  * Common Development and Distribution License (the "License").
627242a7cSthurlow  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate 
227c478bd9Sstevel@tonic-gate /*
2354d34259SMarcel Telka  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
2489621fe1SMarcel Telka  */
2589621fe1SMarcel Telka 
2689621fe1SMarcel Telka /*
2727242a7cSthurlow  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
2811606941Sjwahlig  * Use is subject to license terms.
297c478bd9Sstevel@tonic-gate  */
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifndef	_MOUNTD_H
327c478bd9Sstevel@tonic-gate #define	_MOUNTD_H
337c478bd9Sstevel@tonic-gate 
341cc55349Srmesta #include <door.h>
357c478bd9Sstevel@tonic-gate #include <nfs/nfs.h>
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
387c478bd9Sstevel@tonic-gate extern "C" {
397c478bd9Sstevel@tonic-gate #endif
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate #define	MAXIPADDRLEN	512
427c478bd9Sstevel@tonic-gate 
4311606941Sjwahlig struct nd_hostservlist;
447c478bd9Sstevel@tonic-gate extern void rmtab_load(void);
457c478bd9Sstevel@tonic-gate extern void mntlist_send(SVCXPRT *transp);
467c478bd9Sstevel@tonic-gate extern void mntlist_new(char *host, char *path);
477c478bd9Sstevel@tonic-gate extern void mntlist_delete(char *host, char *path);
487c478bd9Sstevel@tonic-gate extern void mntlist_delete_all(char *host);
497c478bd9Sstevel@tonic-gate extern void netgroup_init(void);
507c478bd9Sstevel@tonic-gate extern int  netgroup_check(struct nd_hostservlist *, char *, int);
5154d34259SMarcel Telka extern void netgrp_cache_flush(void);
527c478bd9Sstevel@tonic-gate extern void export(struct svc_req *);
531cc55349Srmesta extern void nfsauth_func(void *, char *, size_t, door_desc_t *, uint_t);
547c478bd9Sstevel@tonic-gate extern char *inet_ntoa_r(struct in_addr, char *);
5527242a7cSthurlow extern int nfs_getfh(char *, int, int *, char *);
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate extern void nfsauth_prog(struct svc_req *, SVCXPRT *);
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate extern struct sh_list *share_list;
607c478bd9Sstevel@tonic-gate extern rwlock_t sharetab_lock;
617c478bd9Sstevel@tonic-gate extern void check_sharetab(void);
627c478bd9Sstevel@tonic-gate 
63*a9685eaaSMarcel Telka struct cln;
647c478bd9Sstevel@tonic-gate extern void log_cant_reply(SVCXPRT *);
65*a9685eaaSMarcel Telka extern void log_cant_reply_cln(struct cln *);
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate extern void *exmalloc(size_t);
687c478bd9Sstevel@tonic-gate 
697c478bd9Sstevel@tonic-gate extern struct share *findentry(char *);
70*a9685eaaSMarcel Telka extern int check_client(struct share *, struct cln *, int, uid_t, gid_t, uint_t,
71*a9685eaaSMarcel Telka     gid_t *, uid_t *, gid_t *, uint_t *, gid_t **);
727c478bd9Sstevel@tonic-gate 
73*a9685eaaSMarcel Telka extern int in_access_list(struct cln *, char *);
74*a9685eaaSMarcel Telka 
75*a9685eaaSMarcel Telka struct cln {
76*a9685eaaSMarcel Telka 	SVCXPRT *transp;
77*a9685eaaSMarcel Telka 	char *netid;
78*a9685eaaSMarcel Telka 	struct netconfig *nconf;
79*a9685eaaSMarcel Telka 	struct netbuf *nbuf;
80*a9685eaaSMarcel Telka 	struct nd_hostservlist *clnames;
81*a9685eaaSMarcel Telka 	char *host;
82*a9685eaaSMarcel Telka 	int flags;
83*a9685eaaSMarcel Telka };
84*a9685eaaSMarcel Telka 
85*a9685eaaSMarcel Telka extern void cln_init(struct cln *, SVCXPRT *);
86*a9685eaaSMarcel Telka extern void cln_init_lazy(struct cln *, char *, struct netbuf *);
87*a9685eaaSMarcel Telka extern void cln_fini(struct cln *);
88*a9685eaaSMarcel Telka extern struct netbuf *cln_getnbuf(struct cln *);
89*a9685eaaSMarcel Telka extern struct nd_hostservlist *cln_getclientsnames(struct cln *);
90*a9685eaaSMarcel Telka extern boolean_t cln_havehost(struct cln *);
91*a9685eaaSMarcel Telka extern char *cln_gethost(struct cln *);
9254d34259SMarcel Telka 
937c478bd9Sstevel@tonic-gate /*
947c478bd9Sstevel@tonic-gate  * These functions are defined here due to the fact
957c478bd9Sstevel@tonic-gate  * that we can not find the proper header file to
967c478bd9Sstevel@tonic-gate  * include. These functions are, at present, not
977c478bd9Sstevel@tonic-gate  * listed in any other header files.
987c478bd9Sstevel@tonic-gate  */
997c478bd9Sstevel@tonic-gate /*
1007c478bd9Sstevel@tonic-gate  * These three functions are hidden functions in the
1017c478bd9Sstevel@tonic-gate  * bsm libraries (libbsm).
1027c478bd9Sstevel@tonic-gate  */
1037c478bd9Sstevel@tonic-gate extern void audit_mountd_setup(void);
1047c478bd9Sstevel@tonic-gate extern void audit_mountd_mount(char *, char *, int);
1057c478bd9Sstevel@tonic-gate extern void audit_mountd_umount(char *, char *);
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate /*
1087c478bd9Sstevel@tonic-gate  * This appears to be a hidden function in libc.
1097c478bd9Sstevel@tonic-gate  * Private interface to nss_search().
1107c478bd9Sstevel@tonic-gate  * Accepts N strings rather than 1.
1117c478bd9Sstevel@tonic-gate  */
1127c478bd9Sstevel@tonic-gate extern  int __multi_innetgr();
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1157c478bd9Sstevel@tonic-gate }
1167c478bd9Sstevel@tonic-gate #endif
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate #endif	/* _MOUNTD_H */
119