VxWorks Reference Manual : Libraries

nfsLib

NAME

nfsLib - Network File System (NFS) library

ROUTINES

nfsHelp( ) - display the NFS help menu
nfsExportShow( ) - display the exported file systems of a remote host
nfsAuthUnixPrompt( ) - modify the NFS UNIX authentication parameters
nfsAuthUnixShow( ) - display the NFS UNIX authentication parameters
nfsAuthUnixSet( ) - set the NFS UNIX authentication parameters
nfsAuthUnixGet( ) - get the NFS UNIX authentication parameters
nfsIdSet( ) - set the ID number of the NFS UNIX authentication parameters

DESCRIPTION

This library provides the client side of services for NFS (Network File System) devices. Most routines in this library should not be called by users, but rather by device drivers. The driver is responsible for keeping track of file pointers, mounted disks, and cached buffers. This library uses Remote Procedure Calls (RPC) to make the NFS calls.

VxWorks is delivered with NFS disabled. The configuration macro for NFS is INCLUDE_NFS.

In the same file, NFS_USER_ID and NFS_GROUP_ID should be defined to set the default user ID and group ID at system start-up. For information about creating NFS devices, see the VxWorks Programmer's Guide: Network.

Normal use of NFS requires no more than 2000 bytes of stack.

NFS USER IDENTIFICATION

NFS is built on top of RPC and uses a type of RPC authentication known as AUTH_UNIX, which is passed onto the NFS server with every NFS request. AUTH_UNIX is a structure that contains necessary information for NFS, including the user ID number and a list of group IDs to which the user belongs. On UNIX systems, a user ID is specified in the file /etc/passwd. The list of groups to which a user belongs is specified in the file /etc/group.

To change the default authentication parameters, use nfsAuthUnixPrompt( ). To change just the AUTH_UNIX ID, use nfsIdSet( ). Usually, only the user ID needs to be changed to indicate a new NFS user.

INCLUDE FILES

nfsLib.h

SEE ALSO

rpcLib, ioLib, nfsDrv, VxWorks Programmer's Guide: Network


Libraries : Routines

nfsHelp( )

NAME

nfsHelp( ) - display the NFS help menu

SYNOPSIS


void nfsHelp (void)

DESCRIPTION

This routine displays a summary of NFS facilities typically called from the shell:

    nfsHelp                       Print this list
    netHelp                       Print general network help list
    nfsMount "host","filesystem"[,"devname"]  Create device with
                                    file system/directory from host
    nfsUnmount "devname"          Remove an NFS device
    nfsAuthUnixShow               Print current UNIX authentication
    nfsAuthUnixPrompt             Prompt for UNIX authentication
    nfsIdSet id                   Set user ID for UNIX authentication
    nfsDevShow                    Print list of NFS devices
    nfsExportShow "host"          Print a list of NFS file systems which
                                    are exported on the specified host
    mkdir "dirname"               Create directory
    rm "file"                     Remove file

    EXAMPLE:  -> hostAdd "wrs", "90.0.0.2"
              -> nfsMount "wrs","/disk0/path/mydir","/mydir/"
              -> cd "/mydir/"
              -> nfsAuthUnixPrompt     /* fill in user ID, etc.     */
              -> ls                    /* list /disk0/path/mydir    */
              -> copy < foo            /* copy foo to standard out  */
              -> ld < foo.o            /* load object module foo.o  */
              -> nfsUnmount "/mydir/"  /* remove NFS device /mydir/ */

RETURNS

N/A

SEE ALSO

nfsLib


Libraries : Routines

nfsExportShow( )

NAME

nfsExportShow( ) - display the exported file systems of a remote host

SYNOPSIS

STATUS nfsExportShow
    (
    char * hostName /* host machine to show exports for */
    )

DESCRIPTION

This routine displays the file systems of a specified host and the groups that are allowed to mount them.

EXAMPLE

   -> nfsExportShow "wrs"
   /d0               staff
   /d1               staff eng
   /d2               eng
   /d3
   value = 0 = 0x0

RETURNS

OK or ERROR.

SEE ALSO

nfsLib


Libraries : Routines

nfsAuthUnixPrompt( )

NAME

nfsAuthUnixPrompt( ) - modify the NFS UNIX authentication parameters

SYNOPSIS


void nfsAuthUnixPrompt (void)

DESCRIPTION

This routine allows UNIX authentication parameters to be changed from the shell. The user is prompted for each parameter, which can be changed by entering the new value next to the current one.

EXAMPLE

   -> nfsAuthUnixPrompt
   machine name:   yuba
   user ID:        2001 128
   group ID:       100
   num of groups:  1 3
   group #1:        100 100
   group #2:        0 120
   group #3:        0 200
   value = 3 = 0x3

SEE ALSO

nfsLib, nfsAuthUnixShow( ), nfsAuthUnixSet( ), nfsAuthUnixGet( ), nfsIdSet( )


Libraries : Routines

nfsAuthUnixShow( )

NAME

nfsAuthUnixShow( ) - display the NFS UNIX authentication parameters

SYNOPSIS


void nfsAuthUnixShow (void)

DESCRIPTION

This routine displays the parameters set by nfsAuthUnixSet( ) or nfsAuthUnixPrompt( ).

EXAMPLE

   -> nfsAuthUnixShow
   machine name = yuba
   user ID      = 2001
   group ID     = 100
   group [0]    = 100
   value = 1 = 0x1

RETURNS

N/A

SEE ALSO

nfsLib, nfsAuthUnixPrompt( ), nfsAuthUnixSet( ), nfsAuthUnixGet( ), nfsIdSet( )


Libraries : Routines

nfsAuthUnixSet( )

NAME

nfsAuthUnixSet( ) - set the NFS UNIX authentication parameters

SYNOPSIS

void nfsAuthUnixSet
    (
    char * machname, /* host machine */
    int    uid,      /* user ID */
    int    gid,      /* group ID */
    int    ngids,    /* number of group IDs */
    int *  aup_gids  /* array of group IDs */
    )

DESCRIPTION

This routine sets UNIX authentication parameters. It is initially called by usrNetInit( ) in usrConfig.c. machname should be set with the name of the mounted system (i.e. the target name itself) to distinguish hosts from hosts on a NFS network.

RETURNS

N/A

SEE ALSO

nfsLib, nfsAuthUnixPrompt( ), nfsAuthUnixShow( ), nfsAuthUnixGet( ), nfsIdSet( ), usrConfig


Libraries : Routines

nfsAuthUnixGet( )

NAME

nfsAuthUnixGet( ) - get the NFS UNIX authentication parameters

SYNOPSIS

void nfsAuthUnixGet
    (
    char * machname, /* where to store host machine */
    int *  pUid,     /* where to store user ID */
    int *  pGid,     /* where to store group ID */
    int *  pNgids,   /* where to store number of group IDs */
    int *  gids      /* where to store array of group IDs */
    )

DESCRIPTION

This routine gets the previously set UNIX authentication values.

RETURNS

N/A

SEE ALSO

nfsLib, nfsAuthUnixPrompt( ), nfsAuthUnixShow( ), nfsAuthUnixSet( ), nfsIdSet( )


Libraries : Routines

nfsIdSet( )

NAME

nfsIdSet( ) - set the ID number of the NFS UNIX authentication parameters

SYNOPSIS

void nfsIdSet
    (
    int uid /* user ID on host machine */
    )

DESCRIPTION

This routine sets only the UNIX authentication user ID number. For most NFS permission needs, only the user ID needs to be changed. Set uid to the user ID on the NFS server.

RETURNS

N/A

SEE ALSO

nfsLib, nfsAuthUnixPrompt( ), nfsAuthUnixShow( ), nfsAuthUnixSet( ), nfsAuthUnixGet( )