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 16, 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 credanonp 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 generally called before 75.Xr VFS_FHTOVP 9 76to validate that a client has access to the file system. 77.Pp 78The file system should call 79.Xr vfs_export_lookup 9 80with the address of an appropriate 81.Vt netexport 82structure and the address of the client, 83.Fa nam , 84to verify that the client can access this file system. 85.Sh RETURN VALUES 86The export flags, anonymous credentials and security flavors specific to the 87client (returned by 88.Xr vfs_export_lookup 9 ) 89will be returned in 90.Fa *exflagsp , 91.Fa *credanonp , 92.Fa *numsecflavors 93and 94.Fa *secflavors . 95.Sh SEE ALSO 96.Xr VFS 9 , 97.Xr VFS_FHTOVP 9 , 98.Xr vnode 9 , 99.Xr VOP_VPTOFH 9 100.Sh AUTHORS 101This manual page was written by 102.An Alfred Perlstein . 103