⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mountlib.html

📁 vxworks相关论文
💻 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.html"><i>VxWorks Reference Manual :  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><i><a href="./mountLib.html#mountdInit">mountdInit</a></i>(&nbsp;)</b>  -  initialize the mount daemon<br><b><i><a href="./mountLib.html#nfsExport">nfsExport</a></i>(&nbsp;)</b>  -  specify a file system to be NFS exported<br><b><i><a href="./mountLib.html#nfsUnexport">nfsUnexport</a></i>(&nbsp;)</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 nfsdLib.<p></blockquote><h4>NOTE</h4><blockquote><p>The only routines in this library that are normally called byapplications are <b><i><a href="./mountLib.html#nfsExport">nfsExport</a></i>(&nbsp;)</b> and <b><i><a href="./mountLib.html#nfsUnexport">nfsUnexport</a></i>(&nbsp;)</b>.  The mount daemon isnormally initialized indirectly by <b><i><a href="./nfsdLib.html#nfsdInit">nfsdInit</a></i>(&nbsp;)</b>.<p>The mount server is initialized by calling <b><i><a href="./mountLib.html#mountdInit">mountdInit</a></i>(&nbsp;)</b>.  Normally,this is done by <b><i><a href="./nfsdLib.html#nfsdInit">nfsdInit</a></i>(&nbsp;)</b>, although it is possible to call<b><i><a href="./mountLib.html#mountdInit">mountdInit</a></i>(&nbsp;)</b> directly if the NFS server is not being initialized.Defining <b>INCLUDE_NFS_SERVER</b> enables the call to <b><i><a href="./nfsdLib.html#nfsdInit">nfsdInit</a></i>(&nbsp;)</b> duringthe boot process, which in turn calls <b><i><a href="./mountLib.html#mountdInit">mountdInit</a></i>(&nbsp;)</b>, so there isnormally no need to call either routine manually.  <b><i><a href="./mountLib.html#mountdInit">mountdInit</a></i>(&nbsp;)</b> spawnsone task, <b>tMountd</b>, which registers as an RPC service with theportmapper.<p>Currently, only <b><a href="./dosFsLib.html#top">dosFsLib</a></b> file systems are supported; RT11 file systemscannot be exported.  File systems are exported with the <b><i><a href="./mountLib.html#nfsExport">nfsExport</a></i>(&nbsp;)</b>call.<p>To export VxWorks file systems via NFS, you need facilities from boththis library and from nfsdLib.  To include both, define the configurationmacro <b>INCLUDE_NFS_SERVER</b> and rebuild VxWorks.<p>To initialize a file system that is to be exported, set the<b>DOS_OPT_EXPORT</b> option in the <b>DOS_VOL_CONFIG</b> structure used forinitialization.  You can do this directly in the <b><i><a href="./dosFsLib.html#dosFsDevInit">dosFsDevInit</a></i>(&nbsp;)</b> call,or indirectly with <b><i><a href="./dosFsLib.html#dosFsDevInitOptionsSet">dosFsDevInitOptionsSet</a></i>(&nbsp;)</b> or <b><i><a href="./dosFsLib.html#dosFsMkfsOptionsSet">dosFsMkfsOptionsSet</a></i>(&nbsp;)</b>.<p></blockQuote><h4>Example</h4><blockQuote>The following example illustrates how to initialize and export anexisting dosFs file system.<p>First, initialize the block device containing your file system(identified by <i>pBlockDevice</i> below).<p>Then execute the following code on the target:<p><pre>dosFsDevInitOptionsSet (DOS_OPT_EXPORT);      /* make exportable */dosFsDevInit ("/export", pBlockDevice, NULL); /* initialize on VxWorks */nfsExport ("/export", 0, FALSE, 0);           /* make available remotely */</pre>This initializes the DOS file system, and 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>Note that DOS file names are normally limited to 8 characters with athree character extension.  You can use an additional initializationoption, <b>DOS_OPT_LONGNAMES</b>, to enable the VxWorks extension that allowsfile names up to forty characters long.  Replace the<b><i><a href="./dosFsLib.html#dosFsDevInitOptionsSet">dosFsDevInitOptionsSet</a></i>(&nbsp;)</b> call in the example above with the following:<p><pre>dosFsMkfsOptionsSet (DOS_OPT_EXPORT | DOS_OPT_LONGNAMES);</pre>The variables <b>dosFsUserId</b>, <b>dosFsGroupId</b>, and <b>dosFsFileMode</b> can beset before initialization to specify ownership and permissions asreported over NFS, but they are not required. The defaults appear inthe <b><a href="./dosFsLib.html#top">dosFsLib</a></b> manual entry.  DOS file systems do not provide forpermissions, user IDs, and group IDs on a per-file basis; thesevariables specify this information for all files on an entire DOS filesystem.<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><i><a href="./nfsdLib.html#nfsdInit">nfsdInit</a></i>(&nbsp;)</b> and <b><i><a href="./mountLib.html#mountdInit">mountdInit</a></i>(&nbsp;)</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="./mountLib.html#top">mountLib</a></b>, <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.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>mountdInit</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>mountdInit</i>(&nbsp;)</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>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.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>nfsExport</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>nfsExport</i>(&nbsp;)</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><i><a href="./hostLib.html#hostAdd">hostAdd</a></i>(&nbsp;)</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>    -&gt; 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><i><a href="./nfsLib.html#nfsExportShow">nfsExportShow</a></i>(&nbsp;)</b>, <b><i><a href="./mountLib.html#nfsUnexport">nfsUnexport</a></i>(&nbsp;)</b><hr><a name="nfsUnexport"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>nfsUnexport</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>nfsUnexport</i>(&nbsp;)</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><i><a href="./nfsLib.html#nfsExportShow">nfsExportShow</a></i>(&nbsp;)</b>, <b><i><a href="./mountLib.html#nfsExport">nfsExport</a></i>(&nbsp;)</b></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -