1.\" 2.\" Copyright (c) 1999 Alfred Perlstein 3.\" 4.\" All rights reserved. 5.\" 6.\" This program is free software. 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following condition 10.\" is met: 11.\" Redistributions of source code must retain the above copyright 12.\" notice, this condition and the following disclaimer. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 15.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 18.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24.\" 25.\" $FreeBSD$ 26.\" 27.Dd June 17, 2020 28.Dt VFS_CHECKEXP 9 29.Os 30.Sh NAME 31.Nm VFS_CHECKEXP 32.Nd check if a file system is exported to a client 33.Sh SYNOPSIS 34.In sys/param.h 35.In sys/mount.h 36.Ft int 37.Fo VFS_CHECKEXP 38.Fa "struct mount *mp" 39.Fa "struct sockaddr *nam" 40.Fa "uint64_t *exflagsp" 41.Fa "struct ucred **credanonp" 42.Fa "int *numsecflavor" 43.Fa "int *secflavors" 44.Fc 45.Sh DESCRIPTION 46The 47.Fn VFS_CHECKEXP 48macro is used by the NFS server to check if a mount point is exported 49to a client. 50.Pp 51The arguments it expects are: 52.Bl -tag -width numsecflavors 53.It Fa mp 54The mount point to be checked. 55.It Fa nam 56An mbuf containing the network address of the client. 57.It Fa exflagsp 58Return parameter for the export flags for this client. 59.It Fa credanonp 60Return parameter for the anonymous credentials for this client. 61.It Fa numsecflavors 62Return value for the number of security flavors for this client. 63.It Fa secflavors 64Must be an array of size MAXSECFLAVORS, in which the security flavors 65for this client are returned. 66.El 67.Pp 68The 69.Fn VFS_CHECKEXP 70macro should be called on a file system's mount structure to determine if it 71is exported to a client whose address is contained in 72.Fa nam . 73.Pp 74It is called in the NFS server once a vnode for a file handle has been 75acquired, in order to determine what access the client is allowed on 76the file system the vnode resides in. 77For NFSv4, it is also called whenever the lookup operation crosses a 78server file system mount point, to update the access information. 79.Pp 80The operation is file system specific, but is normally handled by 81the default ``vfs_stdcheckexp''. 82.Sh RETURN VALUES 83The export flags, anonymous credentials and security flavors specific to the 84client 85will be returned in 86.Fa *exflagsp , 87.Fa *credanonp , 88.Fa *numsecflavors 89and 90.Fa *secflavors . 91.Sh SEE ALSO 92.Xr VFS 9 , 93.Xr VFS_FHTOVP 9 , 94.Xr vnode 9 , 95.Xr VOP_VPTOFH 9 96.Sh AUTHORS 97This manual page was written by 98.An Alfred Perlstein . 99