/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 1989, 19934* The Regents of the University of California. All rights reserved.5*6* This code is derived from software contributed to Berkeley by7* Rick Macklem at The University of Guelph.8*9* Redistribution and use in source and binary forms, with or without10* modification, are permitted provided that the following conditions11* are met:12* 1. Redistributions of source code must retain the above copyright13* notice, this list of conditions and the following disclaimer.14* 2. Redistributions in binary form must reproduce the above copyright15* notice, this list of conditions and the following disclaimer in the16* documentation and/or other materials provided with the distribution.17* 3. Neither the name of the University nor the names of its contributors18* may be used to endorse or promote products derived from this software19* without specific prior written permission.20*21* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND22* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE23* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE24* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE25* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL26* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS27* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)28* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT29* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY30* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF31* SUCH DAMAGE.32*/3334#ifndef _NFSCLIENT_NFSMOUNT_H_35#define _NFSCLIENT_NFSMOUNT_H_3637#include <sys/socket.h>3839#include <nfs/nfs_mountcommon.h>4041#include <rpc/types.h>42#include <rpc/auth.h>43#include <rpc/clnt.h>44#include <rpc/rpcsec_gss.h>4546/*47* Mount structure.48* One allocated on every NFS mount.49* Holds NFS specific information for mount.50*/51struct nfsmount {52struct nfsmount_common nm_com; /* Common fields for nlm */53int nm_numgrps; /* Max. size of groupslist */54u_char nm_fh[NFSX_V4FH]; /* File handle of root dir */55int nm_fhsize; /* Size of root file handle */56int nm_sotype; /* Type of socket */57int nm_soproto; /* and protocol */58int nm_soflags; /* pr_flags for socket protocol */59struct sockaddr *nm_nam; /* Addr of server */60int nm_deadthresh; /* Threshold of timeouts-->dead server*/61int nm_rsize; /* Max size of read rpc */62int nm_wsize; /* Max size of write rpc */63int nm_readdirsize; /* Size of a readdir rpc */64int nm_readahead; /* Num. of blocks to readahead */65int nm_wcommitsize; /* Max size of commit for write */66int nm_acdirmin; /* Directory attr cache min lifetime */67int nm_acdirmax; /* Directory attr cache max lifetime */68int nm_acregmin; /* Reg file attr cache min lifetime */69int nm_acregmax; /* Reg file attr cache max lifetime */70u_char nm_verf[NFSX_V3WRITEVERF]; /* V3 write verifier */71TAILQ_HEAD(, buf) nm_bufq; /* async io buffer queue */72short nm_bufqlen; /* number of buffers in queue */73short nm_bufqwant; /* process wants to add to the queue */74int nm_bufqiods; /* number of iods processing queue */75u_int64_t nm_maxfilesize; /* maximum file size */76struct nfs_rpcops *nm_rpcops;77int nm_tprintf_initial_delay; /* initial delay */78int nm_tprintf_delay; /* interval for messages */79int nm_secflavor; /* auth flavor to use for rpc */80struct __rpc_client *nm_client;81struct rpc_timers nm_timers[NFS_MAX_TIMER]; /* RTT Timers for rpcs */82char nm_principal[MNAMELEN]; /* GSS-API principal of server */83gss_OID nm_mech_oid; /* OID of selected GSS-API mechanism */84int nm_nametimeo; /* timeout for +ve entries (sec) */85int nm_negnametimeo; /* timeout for -ve entries (sec) */8687/* NFSv4 */88uint64_t nm_clientid;89fsid_t nm_fsid;90u_int nm_lease_time;91time_t nm_last_renewal;92};9394#define nm_mtx nm_com.nmcom_mtx95#define nm_flag nm_com.nmcom_flag96#define nm_state nm_com.nmcom_state97#define nm_mountp nm_com.nmcom_mountp98#define nm_timeo nm_com.nmcom_timeo99#define nm_retry nm_com.nmcom_retry100#define nm_hostname nm_com.nmcom_hostname101#define nm_getinfo nm_com.nmcom_getinfo102#define nm_vinvalbuf nm_com.nmcom_vinvalbuf103104#if defined(_KERNEL)105/*106* Convert mount ptr to nfsmount ptr.107*/108#define VFSTONFS(mp) ((struct nfsmount *)((mp)->mnt_data))109110#ifndef NFS_TPRINTF_INITIAL_DELAY111#define NFS_TPRINTF_INITIAL_DELAY 12112#endif113114#ifndef NFS_TPRINTF_DELAY115#define NFS_TPRINTF_DELAY 30116#endif117118#ifndef NFS_DEFAULT_NAMETIMEO119#define NFS_DEFAULT_NAMETIMEO 60120#endif121122#ifndef NFS_DEFAULT_NEGNAMETIMEO123#define NFS_DEFAULT_NEGNAMETIMEO 60124#endif125126#endif127128#endif129130131