Previous section.

Protocols for Interworking: XNFS, Version 3W
Copyright © 1998 The Open Group

Mount Protocol

Introduction

The mount protocol is separate from, but related to, the NFS protocol. It provides operating system-specific services to get NFS off the ground - looking up server pathnames, validating user identity, and checking access permissions. Clients use the mount protocol to get the first file handle, which allows them entry into a remote file system.

Notice that the protocol definition implies stateful servers because the server maintains a list of client's mount requests. This corresponds to current implementations which hold the mount list on stable storage. However, the mount list information is not critical for the correct functioning of either the client or the server. It is intended for advisory use only; for example, to warn possible clients when a server is going down. The server must provide a mechanism to eliminate redundant information from the mount list.

Version 1 of the mount protocol is used with version 2 of the NFS protocol. The only connecting point is the fhandle structure, which is the same for both protocols.

RPC Information

Authentication

The mount service uses AUTH_UNIX style authentication only.

Transport Protocols

The mount service is currently supported on UDP/IP only.

Port Number

Consult the server's port mapper, described in Introduction to Port Mapper Program Protocol , to find the port number on which the mount service is registered.

Sizes of XDR Structures

These are the sizes, given in decimal bytes, of various XDR structures used in the protocol:

/* The maximum number of bytes in a pathname argument. */ const MNTPATHLEN = 1024; /* The maximum number of bytes in a name argument. */ const MNTNAMLEN = 255; /* The size in bytes of the opaque file handle. */ const FHSIZE = 32;

Basic Data Types

This section presents the data types used by the mount protocol. In many cases they are similar to the types used in NFS.

fhandle

The type fhandle is the file handle that the server passes to the client. All file operations are done using file handles to refer to a file or directory. The file handle can contain whatever information the server needs to distinguish an individual file.

This is the same as the fhandle XDR definition in version 2 of the NFS protocol; see Basic Data Types .

fhstatus
union fhstatus switch (unsigned status) { case 0: fhandle directory; default: void; };

The type fhstatus is a union. If a status of zero is returned, the call completed successfully, and a file handle for the directory follows. A non-zero status indicates that an error occurred. In case of an error, status will be set to one of the following values:

enum stat { MNT_OK = 0, MNT_EPERM = 1, MNT_ENOENT = 2, MNT_EACCESS = 13, MNT_EINVAL = 22 };

For a detailed description of the error conditions see Section 2.3, Error Numbers of the X/Open System Interfaces and Headers Specification (see reference XSH), [EPERM], [ENOENT], [EACCESS] and [EINVAL].

dirpath
typedef string dirpath<MNTPATHLEN>;

The type dirpath is a server pathname of a directory.

Implementations and applications must be able to handle pathnames as 8-bit transparent data (allowing use of arbitrary character set encodings). For maximum portability and interworking, it is recommended that applications and users define pathnames containing only the slash character (if required) plus the characters of the Portable Filename Character Set defined in ISO/IEC 9945-1:1990.

name
typedef string name<MNTNAMLEN>;

The type name is an arbitrary string used for various names.

Implementations and applications must be able to handle names as 8-bit transparent data (allowing use of arbitrary character set encodings). For maximum portability and interworking, it is recommended that applications and users define names containing only the characters of the Portable Filename Character Set defined in ISO/IEC 9945-1:1990.

Server Procedures

The following reference pages define the RPC procedures supplied by a mount server.

/* * Protocol description for the mount program */ program MOUNTPROG { /* * Version 1 of the mount protocol used with * version 2 of the NFS protocol. */ version MOUNTVERS { void MOUNTPROC_NULL(void) = 0; fhstatus MOUNTPROC_MNT(dirpath) = 1; mountlist MOUNTPROC_DUMP(void) = 2; void MOUNTPROC_UMNT(dirpath) = 3; void MOUNTPROC_UMNTALL(void) = 4; exportlist MOUNTPROC_EXPORT(void) = 5; } = 1; } = 100005;


Why not acquire a nicely bound hard copy?
Click here to return to the publication details or order a copy of this publication.

Contents Next section Index