1139823Simp/*-
21541Srgrimes * Copyright (c) 1989, 1993
31541Srgrimes *	The Regents of the University of California.  All rights reserved.
41541Srgrimes *
51541Srgrimes * This code is derived from software contributed to Berkeley by
61541Srgrimes * Rick Macklem at The University of Guelph.
71541Srgrimes *
81541Srgrimes * Redistribution and use in source and binary forms, with or without
91541Srgrimes * modification, are permitted provided that the following conditions
101541Srgrimes * are met:
111541Srgrimes * 1. Redistributions of source code must retain the above copyright
121541Srgrimes *    notice, this list of conditions and the following disclaimer.
131541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
141541Srgrimes *    notice, this list of conditions and the following disclaimer in the
151541Srgrimes *    documentation and/or other materials provided with the distribution.
161541Srgrimes * 4. Neither the name of the University nor the names of its contributors
171541Srgrimes *    may be used to endorse or promote products derived from this software
181541Srgrimes *    without specific prior written permission.
191541Srgrimes *
201541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
211541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
221541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
231541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
241541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
251541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
261541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
271541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
281541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
291541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
301541Srgrimes * SUCH DAMAGE.
311541Srgrimes *
3222521Sdyson *	@(#)nfsmount.h	8.3 (Berkeley) 3/30/95
3350477Speter * $FreeBSD$
341541Srgrimes */
351541Srgrimes
3683651Speter#ifndef _NFSCLIENT_NFSMOUNT_H_
3783651Speter#define _NFSCLIENT_NFSMOUNT_H_
3822521Sdyson
39214048Srmacklem#include <sys/socket.h>
40214048Srmacklem
41214048Srmacklem#include <nfs/nfs_mountcommon.h>
42214048Srmacklem
43184588Sdfr#include <rpc/types.h>
44184588Sdfr#include <rpc/auth.h>
45184588Sdfr#include <rpc/clnt.h>
46184588Sdfr#include <rpc/rpcsec_gss.h>
47184588Sdfr
481541Srgrimes/*
491541Srgrimes * Mount structure.
501541Srgrimes * One allocated on every NFS mount.
511541Srgrimes * Holds NFS specific information for mount.
521541Srgrimes */
531541Srgrimesstruct	nfsmount {
54214048Srmacklem	struct	nfsmount_common nm_com;	/* Common fields for nlm */
551541Srgrimes	int	nm_numgrps;		/* Max. size of groupslist */
56122698Salfred	u_char	nm_fh[NFSX_V4FH];	/* File handle of root dir */
579336Sdfr	int	nm_fhsize;		/* Size of root file handle */
581541Srgrimes	int	nm_sotype;		/* Type of socket */
591541Srgrimes	int	nm_soproto;		/* and protocol */
601541Srgrimes	int	nm_soflags;		/* pr_flags for socket protocol */
6128270Swollman	struct	sockaddr *nm_nam;	/* Addr of server */
621541Srgrimes	int	nm_deadthresh;		/* Threshold of timeouts-->dead server*/
631541Srgrimes	int	nm_rsize;		/* Max size of read rpc */
641541Srgrimes	int	nm_wsize;		/* Max size of write rpc */
659336Sdfr	int	nm_readdirsize;		/* Size of a readdir rpc */
661541Srgrimes	int	nm_readahead;		/* Num. of blocks to readahead */
67147280Sgreen	int	nm_wcommitsize;		/* Max size of commit for write */
6836176Speter	int	nm_acdirmin;		/* Directory attr cache min lifetime */
6936176Speter	int	nm_acdirmax;		/* Directory attr cache max lifetime */
7036176Speter	int	nm_acregmin;		/* Reg file attr cache min lifetime */
7136176Speter	int	nm_acregmax;		/* Reg file attr cache max lifetime */
729336Sdfr	u_char	nm_verf[NFSX_V3WRITEVERF]; /* V3 write verifier */
7360938Sjake	TAILQ_HEAD(, buf) nm_bufq;	/* async io buffer queue */
7419449Sdfr	short	nm_bufqlen;		/* number of buffers in queue */
7519449Sdfr	short	nm_bufqwant;		/* process wants to add to the queue */
7619449Sdfr	int	nm_bufqiods;		/* number of iods processing queue */
7736473Speter	u_int64_t nm_maxfilesize;	/* maximum file size */
78122953Salfred	struct nfs_rpcops *nm_rpcops;
79131691Salfred	int	nm_tprintf_initial_delay;	/* initial delay */
80131691Salfred	int	nm_tprintf_delay;		/* interval for messages */
81184588Sdfr	int	nm_secflavor;		 /* auth flavor to use for rpc */
82184588Sdfr	struct __rpc_client *nm_client;
83184588Sdfr	struct rpc_timers nm_timers[NFS_MAX_TIMER]; /* RTT Timers for rpcs */
84184588Sdfr	char	nm_principal[MNAMELEN];	/* GSS-API principal of server */
85184588Sdfr	gss_OID	nm_mech_oid;		/* OID of selected GSS-API mechanism */
86230547Sjhb	int	nm_nametimeo;		/* timeout for +ve entries (sec) */
87202767Srmacklem	int	nm_negnametimeo;	/* timeout for -ve entries (sec) */
88122698Salfred
89122698Salfred	/* NFSv4 */
90122698Salfred	uint64_t nm_clientid;
91122698Salfred	fsid_t	nm_fsid;
92122698Salfred	u_int	nm_lease_time;
93122698Salfred	time_t	nm_last_renewal;
941541Srgrimes};
951541Srgrimes
96214048Srmacklem#define	nm_mtx		nm_com.nmcom_mtx
97214048Srmacklem#define	nm_flag		nm_com.nmcom_flag
98214048Srmacklem#define	nm_state	nm_com.nmcom_state
99214048Srmacklem#define	nm_mountp	nm_com.nmcom_mountp
100214048Srmacklem#define	nm_timeo	nm_com.nmcom_timeo
101214048Srmacklem#define	nm_retry	nm_com.nmcom_retry
102214048Srmacklem#define	nm_hostname	nm_com.nmcom_hostname
103214048Srmacklem#define	nm_getinfo	nm_com.nmcom_getinfo
104216931Srmacklem#define	nm_vinvalbuf	nm_com.nmcom_vinvalbuf
105214048Srmacklem
10655206Speter#if defined(_KERNEL)
1071541Srgrimes/*
1081541Srgrimes * Convert mount ptr to nfsmount ptr.
1091541Srgrimes */
1101541Srgrimes#define VFSTONFS(mp)	((struct nfsmount *)((mp)->mnt_data))
11119449Sdfr
112131691Salfred#ifndef NFS_TPRINTF_INITIAL_DELAY
113131691Salfred#define NFS_TPRINTF_INITIAL_DELAY       12
11455206Speter#endif
1151541Srgrimes
116131691Salfred#ifndef NFS_TPRINTF_DELAY
117131691Salfred#define NFS_TPRINTF_DELAY               30
1182175Spaul#endif
119131691Salfred
120230547Sjhb#ifndef NFS_DEFAULT_NAMETIMEO
121230547Sjhb#define NFS_DEFAULT_NAMETIMEO		60
122230547Sjhb#endif
123230547Sjhb
124202767Srmacklem#ifndef NFS_DEFAULT_NEGNAMETIMEO
125202767Srmacklem#define NFS_DEFAULT_NEGNAMETIMEO	60
126202767Srmacklem#endif
127202767Srmacklem
128131691Salfred#endif
129131691Salfred
130131691Salfred#endif
131