📄 mountlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/mountLib.html - generated by refgen from mountLib.c --> <title> mountLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>mountLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>mountLib</strong> - Mount protocol library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./mountLib.html#mountdInit">mountdInit</a>( )</b> - initialize the mount daemon<br><b><a href="./mountLib.html#nfsExport">nfsExport</a>( )</b> - specify a file system to be NFS exported<br><b><a href="./mountLib.html#nfsUnexport">nfsUnexport</a>( )</b> - remove a file system from the list of exported file systems<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library implements a mount server to support mounting VxWorksfile systems remotely. The mount server is an implementation ofversion 1 of the mount protocol as defined in RFC 1094. It is closelyconnected with version 2 of the Network File System ProtocolSpecification, which in turn is implemented by the library <b><a href="./nfsdLib.html#top">nfsdLib</a></b>.<p></blockquote><h4>NOTE</h4><blockquote><p>The only routines in this library that are normally called byapplications are <b><a href="./mountLib.html#nfsExport">nfsExport</a>( )</b> and <b><a href="./mountLib.html#nfsUnexport">nfsUnexport</a>( )</b>. The mount daemon isnormally initialized indirectly by <b><a href="./nfsdLib.html#nfsdInit">nfsdInit</a>( )</b>.<p>The mount server is initialized by calling <b><a href="./mountLib.html#mountdInit">mountdInit</a>( )</b>. Normally,this is done by <b><a href="./nfsdLib.html#nfsdInit">nfsdInit</a>( )</b>, although it is possible to call<b><a href="./mountLib.html#mountdInit">mountdInit</a>( )</b> directly if the NFS server is not being initialized.Defining <b>INCLUDE_NFS_SERVER</b> enables the call to <b><a href="./nfsdLib.html#nfsdInit">nfsdInit</a>( )</b> duringthe boot process, which in turn calls <b><a href="./mountLib.html#mountdInit">mountdInit</a>( )</b>, so there isnormally no need to call either routine manually. <b><a href="./mountLib.html#mountdInit">mountdInit</a>( )</b> spawnsone task, <b>tMountd</b>, which registers as an RPC service with theportmapper.<p>Currently, only the <b><a href="./dosFsLib.html#top">dosFsLib</a></b> file system is supported.File systems are exported with the <b><a href="./mountLib.html#nfsExport">nfsExport</a>( )</b> call.<p>To export VxWorks file systems via NFS, you need facilities from boththis library and from <b><a href="./nfsdLib.html#top">nfsdLib</a></b>. To include both, add <b>INCLUDE_NFS_SERVER</b>and rebuild VxWorks.</blockQuote><h4>Example</h4><blockQuote>The following example illustrates how to export anexisting dosFs file system.<p>First, initialize the block device containing your file system.<p>Then assuming the dosFs system is called "/export" execute the following code on the target:<p><pre>nfsExport ("/export", 0, FALSE, 0); /* make available remotely */</pre>This makes it available to allclients to be mounted using the client's NFS mounting command. (OnUNIX systems, mounting file systems normally requires root privileges.)<p>VxWorks does not normally provide authentication services for NFSrequests, and the DOS file system does not provide file permissions.If you need to authenticate incoming requests, see the documentationfor <b><a href="./nfsdLib.html#nfsdInit">nfsdInit</a>( )</b> and <b><a href="./mountLib.html#mountdInit">mountdInit</a>( )</b> for information about authorizationhooks.<p>The following requests are accepted from clients. For details oftheir use, see Appendix A of RFC 1094, "NFS: Network File SystemProtocol Specification."<p><table><tr valign=top><th align=left> Procedure Name </th><th align=left> Procedure Number</tr><tr><td colspan="2"><hr></tr><tr valign=top><td align=left> <b>MOUNTPROC_NULL</b> </td><td align=left> 0</tr><tr valign=top><td align=left> <b>MOUNTPROC_MNT</b> </td><td align=left> 1</tr><tr valign=top><td align=left> <b>MOUNTPROC_DUMP</b> </td><td align=left> 2</tr><tr valign=top><td align=left> <b>MOUNTPROC_UMNT</b> </td><td align=left> 3</tr><tr valign=top><td align=left> <b>MOUNTPROC_UMNTALL</b> </td><td align=left> 4</tr><tr valign=top><td align=left> <b>MOUNTPROC_EXPORT</b> </td><td align=left> 5</tr><tr valign=top><td align=left></tr></tr></table></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dosFsLib.html#top">dosFsLib</a></b>, <b><a href="./nfsdLib.html#top">nfsdLib</a></b>, RFC 1094<p><hr><a name="mountdInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>mountdInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>mountdInit( )</strong> - initialize the mount daemon</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS mountdInit ( int priority, /* priority of the mount daemon */ int stackSize, /* stack size of the mount daemon */ FUNCPTR authHook, /* hook to run to authorize each request */ int nExports, /* maximum number of exported file systems */ int options /* currently unused - set to 0 */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine spawns a mount daemon if one does not alreadyexist. Defaults for the <i>priority</i> and <i>stackSize</i> arguments arein the global variables <b>mountdPriorityDefault</b> and<b>mountdStackSizeDefault</b>, and are initially set to<b>MOUNTD_PRIORITY_DEFAULT</b> and <b>MOUNTD_STACKSIZE_DEFAULT</b> respectively.<p>Normally, no authorization checking is performed by either mountd ornfsd. To add authorization checking, set <i>authHook</i> to point to aroutine declared as follows:<p><pre>nfsstat routine ( int progNum, /* RPC program number */ int versNum, /* RPC program version number */ int procNum, /* RPC procedure number */ struct sockaddr_in clientAddr, /* address of the client */ MOUNTD_ARGUMENT * mountdArg /* argument of the call */ )</pre>The <i>authHook</i> callback must return OK if the request is authorized,and any defined NFS error code (usually <b>NFSERR_ACCES</b>) if not.<p></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call <b><a href="./mountLib.html#mountdInit">mountdInit</a>( )</b> from within the kernel protection domain only, and the function referenced in the <i>authHook</i> parameter must reside in the kernel protection domain. This restriction does not apply under non-AE versions of VxWorks. <p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the mount daemon could not be correctlyinitialized.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mountLib.html#top">mountLib</a></b><hr><a name="nfsExport"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>nfsExport( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>nfsExport( )</strong> - specify a file system to be NFS exported</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS nfsExport ( char * directory, /* Directory to export - FS must support NFS */ int id, /* ID number for file system */ BOOL readOnly, /* TRUE if file system is exported read-only */ int options /* Reserved for future use - set to 0 */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine makes a file system available for mounting by a client.The client should be in the local host table (see <b><a href="./hostLib.html#hostAdd">hostAdd</a>( )</b>),although this is not required.<p>The <i>id</i> parameter can either be set to a specific value, or to 0.If it is set to 0, an ID number is assigned sequentially.Every time a file system is exported, it must have the same IDnumber, or clients currently mounting the file system will not beable to access files.<p>To display a list of exported file systems, use:<pre> -> nfsExportShow "localhost"</pre></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the file system could not be exported.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mountLib.html#top">mountLib</a></b>, <b><a href="./nfsLib.html#top">nfsLib</a></b>, <b><a href="./nfsLib.html#nfsExportShow">nfsExportShow</a>( )</b>, <b><a href="./mountLib.html#nfsUnexport">nfsUnexport</a>( )</b><hr><a name="nfsUnexport"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>nfsUnexport( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>nfsUnexport( )</strong> - remove a file system from the list of exported file systems</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS nfsUnexport ( char * dirName /* Name of the directory to unexport */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine removes a file system from the list of file systemsexported from the target. Any client attempting to mount a filesystem that is not exported will receive an error (<b>NFSERR_ACCESS</b>).<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the file system could not be removed fromthe exports list.<p></blockquote><h4>ERRNO</h4><blockquote><p>ENOENT<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mountLib.html#top">mountLib</a></b>, <b><a href="./nfsLib.html#top">nfsLib</a></b>, <b><a href="./nfsLib.html#nfsExportShow">nfsExportShow</a>( )</b>, <b><a href="./mountLib.html#nfsExport">nfsExport</a>( )</b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -