Blame lib/mount.x

Packit 8480eb
%/*
Packit 8480eb
% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
Packit 8480eb
% * unrestricted use provided that this legend is included on all tape
Packit 8480eb
% * media and as a part of the software program in whole or part.  Users
Packit 8480eb
% * may copy or modify Sun RPC without charge, but are not authorized
Packit 8480eb
% * to license or distribute it to anyone else except as part of a product or
Packit 8480eb
% * program developed by the user or with the express written consent of
Packit 8480eb
% * Sun Microsystems, Inc.
Packit 8480eb
% *
Packit 8480eb
% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
Packit 8480eb
% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
Packit 8480eb
% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
Packit 8480eb
% *
Packit 8480eb
% * Sun RPC is provided with no support and without any obligation on the
Packit 8480eb
% * part of Sun Microsystems, Inc. to assist in its use, correction,
Packit 8480eb
% * modification or enhancement.
Packit 8480eb
% *
Packit 8480eb
% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
Packit 8480eb
% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
Packit 8480eb
% * OR ANY PART THEREOF.
Packit 8480eb
% *
Packit 8480eb
% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
Packit 8480eb
% * or profits or other special, indirect and consequential damages, even if
Packit 8480eb
% * Sun has been advised of the possibility of such damages.
Packit 8480eb
% *
Packit 8480eb
% * Sun Microsystems, Inc.
Packit 8480eb
% * 2550 Garcia Avenue
Packit 8480eb
% * Mountain View, California  94043
Packit 8480eb
% */
Packit 8480eb
Packit 8480eb
%/*
Packit 8480eb
% * Copyright (c) 1985, 1990 by Sun Microsystems, Inc.
Packit 8480eb
% */
Packit 8480eb
%
Packit 8480eb
%/* from @(#)mount.x	1.3 91/03/11 TIRPC 1.0 */
Packit 8480eb
Packit 8480eb
/*
Packit 8480eb
 * Protocol description for the mount program
Packit 8480eb
 */
Packit 8480eb
Packit 8480eb
#ifdef RPC_HDR
Packit 8480eb
%#ifndef _rpcsvc_mount_h
Packit 8480eb
%#define _rpcsvc_mount_h
Packit 8480eb
%#include <memory.h>
Packit 8480eb
#endif
Packit 8480eb
Packit 8480eb
const MNTPATHLEN = 1024;	/* maximum bytes in a pathname argument */
Packit 8480eb
const MNTNAMLEN = 255;		/* maximum bytes in a name argument */
Packit 8480eb
const FHSIZE = 32;		/* size in bytes of a file handle */
Packit 8480eb
Packit 8480eb
/*
Packit 8480eb
 * The fhandle is the file handle that the server passes to the client.
Packit 8480eb
 * All file operations are done using the file handles to refer to a file
Packit 8480eb
 * or a directory. The file handle can contain whatever information the
Packit 8480eb
 * server needs to distinguish an individual file.
Packit 8480eb
 */
Packit 8480eb
typedef opaque fhandle[FHSIZE];	
Packit 8480eb
Packit 8480eb
/*
Packit 8480eb
 * If a status of zero is returned, the call completed successfully, and 
Packit 8480eb
 * a file handle for the directory follows. A non-zero status indicates
Packit 8480eb
 * some sort of error. The status corresponds with UNIX error numbers.
Packit 8480eb
 */
Packit 8480eb
union fhstatus switch (unsigned fhs_status) {
Packit 8480eb
case 0:
Packit 8480eb
	fhandle fhs_fhandle;
Packit 8480eb
default:
Packit 8480eb
	void;
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
/*
Packit 8480eb
 * The type dirpath is the pathname of a directory
Packit 8480eb
 */
Packit 8480eb
typedef string dirpath<MNTPATHLEN>;
Packit 8480eb
Packit 8480eb
/*
Packit 8480eb
 * The type name is used for arbitrary names (hostnames, groupnames)
Packit 8480eb
 */
Packit 8480eb
typedef string name<MNTNAMLEN>;
Packit 8480eb
Packit 8480eb
/*
Packit 8480eb
 * A list of who has what mounted
Packit 8480eb
 */
Packit 8480eb
typedef struct mountbody *mountlist;
Packit 8480eb
struct mountbody {
Packit 8480eb
	name ml_hostname;
Packit 8480eb
	dirpath ml_directory;
Packit 8480eb
	mountlist ml_next;
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
/*
Packit 8480eb
 * A list of netgroups
Packit 8480eb
 */
Packit 8480eb
typedef struct groupnode *groups;
Packit 8480eb
struct groupnode {
Packit 8480eb
	name gr_name;
Packit 8480eb
	groups gr_next;
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
/*
Packit 8480eb
 * A list of what is exported and to whom
Packit 8480eb
 */
Packit 8480eb
typedef struct exportnode *exports;
Packit 8480eb
struct exportnode {
Packit 8480eb
	dirpath ex_dir;
Packit 8480eb
	groups ex_groups;
Packit 8480eb
	exports ex_next;
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
/*
Packit 8480eb
 * POSIX pathconf information
Packit 8480eb
 */
Packit 8480eb
struct ppathcnf {
Packit 8480eb
	int	pc_link_max;	/* max links allowed */
Packit 8480eb
	short	pc_max_canon;	/* max line len for a tty */
Packit 8480eb
	short	pc_max_input;	/* input a tty can eat all at once */
Packit 8480eb
	short	pc_name_max;	/* max file name length (dir entry) */
Packit 8480eb
	short	pc_path_max;	/* max path name length (/x/y/x/.. ) */
Packit 8480eb
	short	pc_pipe_buf;	/* size of a pipe (bytes) */
Packit 8480eb
	u_char	pc_vdisable;	/* safe char to turn off c_cc[i] */
Packit 8480eb
	char	pc_xxx;		/* alignment padding; cc_t == char */
Packit 8480eb
	short	pc_mask[2];	/* validity and boolean bits */
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
/*
Packit 8480eb
 * NFSv3 file handle
Packit 8480eb
 */
Packit 8480eb
const FHSIZE3 =	64;		/* max size of NFSv3 file handle in bytes */
Packit 8480eb
typedef opaque		fhandle3<FHSIZE3>;
Packit 8480eb
Packit 8480eb
/*
Packit 8480eb
 * NFSv3 mount status
Packit 8480eb
 */
Packit 8480eb
enum mountstat3 {
Packit 8480eb
	MNT_OK			= 0,	/* no error */
Packit 8480eb
	MNT3ERR_PERM		= 1,	/* not owner */
Packit 8480eb
	MNT3ERR_NOENT		= 2,	/* no such file or directory */
Packit 8480eb
	MNT3ERR_IO		= 5,	/* I/O error */
Packit 8480eb
	MNT3ERR_ACCES		= 13,	/* Permission denied */
Packit 8480eb
	MNT3ERR_NOTDIR		= 20,	/* Not a directory */
Packit 8480eb
	MNT3ERR_INVAL		= 22,	/* Invalid argument */
Packit 8480eb
	MNT3ERR_NAMETOOLONG	= 63,	/* File name too long */
Packit 8480eb
	MNT3ERR_NOTSUPP		= 10004,/* Operation not supported */
Packit 8480eb
	MNT3ERR_SERVERFAULT	= 10006	/* A failure on the server */
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
/*
Packit 8480eb
 * NFSv3 mount result
Packit 8480eb
 */
Packit 8480eb
struct mountres3_ok {
Packit 8480eb
	fhandle3	fhandle;
Packit 8480eb
	int		auth_flavors<>;
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
union mountres3 switch (mountstat3 fhs_status) {
Packit 8480eb
case MNT_OK:
Packit 8480eb
	mountres3_ok	mountinfo; /* File handle and supported flavors */
Packit 8480eb
default:
Packit 8480eb
	void;
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
program MOUNTPROG {
Packit 8480eb
	/*
Packit 8480eb
	 * Version one of the mount protocol communicates with version two
Packit 8480eb
	 * of the NFS protocol. The only connecting point is the fhandle 
Packit 8480eb
	 * structure, which is the same for both protocols.
Packit 8480eb
	 */
Packit 8480eb
	version MOUNTVERS {
Packit 8480eb
		/*
Packit 8480eb
		 * Does no work. It is made available in all RPC services
Packit 8480eb
		 * to allow server reponse testing and timing
Packit 8480eb
		 */
Packit 8480eb
		void
Packit 8480eb
		MOUNTPROC_NULL(void) = 0;
Packit 8480eb
Packit 8480eb
		/*	
Packit 8480eb
		 * If fhs_status is 0, then fhs_fhandle contains the
Packit 8480eb
	 	 * file handle for the directory. This file handle may
Packit 8480eb
		 * be used in the NFS protocol. This procedure also adds
Packit 8480eb
		 * a new entry to the mount list for this client mounting
Packit 8480eb
		 * the directory.
Packit 8480eb
		 * Unix authentication required.
Packit 8480eb
		 */
Packit 8480eb
		fhstatus 
Packit 8480eb
		MOUNTPROC_MNT(dirpath) = 1;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Returns the list of remotely mounted filesystems. The 
Packit 8480eb
		 * mountlist contains one entry for each hostname and 
Packit 8480eb
		 * directory pair.
Packit 8480eb
		 */
Packit 8480eb
		mountlist
Packit 8480eb
		MOUNTPROC_DUMP(void) = 2;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Removes the mount list entry for the directory
Packit 8480eb
		 * Unix authentication required.
Packit 8480eb
		 */
Packit 8480eb
		void
Packit 8480eb
		MOUNTPROC_UMNT(dirpath) = 3;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Removes all of the mount list entries for this client
Packit 8480eb
		 * Unix authentication required.
Packit 8480eb
		 */
Packit 8480eb
		void
Packit 8480eb
		MOUNTPROC_UMNTALL(void) = 4;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Returns a list of all the exported filesystems, and which
Packit 8480eb
		 * machines are allowed to import it.
Packit 8480eb
		 */
Packit 8480eb
		exports
Packit 8480eb
		MOUNTPROC_EXPORT(void)  = 5;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Identical to MOUNTPROC_EXPORT above
Packit 8480eb
		 */
Packit 8480eb
		exports
Packit 8480eb
		MOUNTPROC_EXPORTALL(void) = 6;
Packit 8480eb
	} = 1;
Packit 8480eb
Packit 8480eb
	/*
Packit 8480eb
	 * Version two of the mount protocol communicates with version two
Packit 8480eb
	 * of the NFS protocol.
Packit 8480eb
	 * The only difference from version one is the addition of a POSIX
Packit 8480eb
	 * pathconf call.
Packit 8480eb
	 */
Packit 8480eb
	version MOUNTVERS_POSIX {
Packit 8480eb
		/*
Packit 8480eb
		 * Does no work. It is made available in all RPC services
Packit 8480eb
		 * to allow server reponse testing and timing
Packit 8480eb
		 */
Packit 8480eb
		void
Packit 8480eb
		MOUNTPROC_NULL(void) = 0;
Packit 8480eb
Packit 8480eb
		/*	
Packit 8480eb
		 * If fhs_status is 0, then fhs_fhandle contains the
Packit 8480eb
	 	 * file handle for the directory. This file handle may
Packit 8480eb
		 * be used in the NFS protocol. This procedure also adds
Packit 8480eb
		 * a new entry to the mount list for this client mounting
Packit 8480eb
		 * the directory.
Packit 8480eb
		 * Unix authentication required.
Packit 8480eb
		 */
Packit 8480eb
		fhstatus 
Packit 8480eb
		MOUNTPROC_MNT(dirpath) = 1;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Returns the list of remotely mounted filesystems. The 
Packit 8480eb
		 * mountlist contains one entry for each hostname and 
Packit 8480eb
		 * directory pair.
Packit 8480eb
		 */
Packit 8480eb
		mountlist
Packit 8480eb
		MOUNTPROC_DUMP(void) = 2;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Removes the mount list entry for the directory
Packit 8480eb
		 * Unix authentication required.
Packit 8480eb
		 */
Packit 8480eb
		void
Packit 8480eb
		MOUNTPROC_UMNT(dirpath) = 3;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Removes all of the mount list entries for this client
Packit 8480eb
		 * Unix authentication required.
Packit 8480eb
		 */
Packit 8480eb
		void
Packit 8480eb
		MOUNTPROC_UMNTALL(void) = 4;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Returns a list of all the exported filesystems, and which
Packit 8480eb
		 * machines are allowed to import it.
Packit 8480eb
		 */
Packit 8480eb
		exports
Packit 8480eb
		MOUNTPROC_EXPORT(void)  = 5;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Identical to MOUNTPROC_EXPORT above
Packit 8480eb
		 */
Packit 8480eb
		exports
Packit 8480eb
		MOUNTPROC_EXPORTALL(void) = 6;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * POSIX pathconf info (Sun hack)
Packit 8480eb
		 */
Packit 8480eb
		ppathcnf
Packit 8480eb
		MOUNTPROC_PATHCONF(dirpath) = 7;
Packit 8480eb
	} = 2;
Packit 8480eb
Packit 8480eb
	/*
Packit 8480eb
	 * Version 3 of the protocol is for NFSv3
Packit 8480eb
	 */
Packit 8480eb
	version MOUNTVERS_NFSV3 {
Packit 8480eb
		/*
Packit 8480eb
		 * Does no work. It is made available in all RPC services
Packit 8480eb
		 * to allow server reponse testing and timing
Packit 8480eb
		 */
Packit 8480eb
		void
Packit 8480eb
		MOUNTPROC3_NULL(void) = 0;
Packit 8480eb
Packit 8480eb
		/*	
Packit 8480eb
		 * If fhs_status is 0, then fhs_fhandle contains the
Packit 8480eb
	 	 * file handle for the directory. This file handle may
Packit 8480eb
		 * be used in the NFS protocol. This procedure also adds
Packit 8480eb
		 * a new entry to the mount list for this client mounting
Packit 8480eb
		 * the directory.
Packit 8480eb
		 * Unix authentication required.
Packit 8480eb
		 */
Packit 8480eb
		mountres3 
Packit 8480eb
		MOUNTPROC3_MNT(dirpath) = 1;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Returns the list of remotely mounted filesystems. The 
Packit 8480eb
		 * mountlist contains one entry for each hostname and 
Packit 8480eb
		 * directory pair.
Packit 8480eb
		 */
Packit 8480eb
		mountlist
Packit 8480eb
		MOUNTPROC3_DUMP(void) = 2;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Removes the mount list entry for the directory
Packit 8480eb
		 * Unix authentication required.
Packit 8480eb
		 */
Packit 8480eb
		void
Packit 8480eb
		MOUNTPROC3_UMNT(dirpath) = 3;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Removes all of the mount list entries for this client
Packit 8480eb
		 * Unix authentication required.
Packit 8480eb
		 */
Packit 8480eb
		void
Packit 8480eb
		MOUNTPROC3_UMNTALL(void) = 4;
Packit 8480eb
Packit 8480eb
		/*
Packit 8480eb
		 * Returns a list of all the exported filesystems, and which
Packit 8480eb
		 * machines are allowed to import it.
Packit 8480eb
		 */
Packit 8480eb
		exports
Packit 8480eb
		MOUNTPROC3_EXPORT(void)  = 5;
Packit 8480eb
	} = 3;
Packit 8480eb
} = 100005;
Packit 8480eb
Packit 8480eb
#ifdef RPC_HDR
Packit 8480eb
%#endif /*!_rpcsvc_mount_h*/
Packit 8480eb
#endif