Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

nfsd.H

Go to the documentation of this file.
00001 // Copyright (C) 2001, Compaq Computer Corporation
00002 // 
00003 // This file is part of Vesta.
00004 // 
00005 // Vesta is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 // 
00010 // Vesta is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with Vesta; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 // Last modified on Wed Dec  8 01:35:23 EST 2004 by ken@xorian.net
00020 
00021 /*
00022  * nfsd.H       This program implements a user-space NFS server.
00023  *
00024  * Authors:     Mark A. Shand, May 1988
00025  *              Rick Sladkey, <jrs@world.std.com>
00026  *              Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
00027  *
00028  *              Copyright 1988 Mark A. Shand
00029  *              This software maybe be used for any purpose provided
00030  *              the above copyright notice is retained.  It is supplied
00031  *              as is, with no warranty expressed or implied.
00032  */
00033 
00034 #ifndef _NFSD_H
00035 #define _NFSD_H
00036 
00037 #include "system.h"
00038 extern "C" {
00039 #include "nfs_prot.h"
00040 }
00041 #include "AccessControl.H"
00042 
00043 #if defined(__STDC__) || defined(__cplusplus)
00044 #   define _PRO(f, a)   f a
00045 #else
00046 #   define _PRO(f, a)   f ()
00047 #endif
00048 
00049 union argument_types {
00050         nfs_fh                  nfsproc_getattr_2_arg;
00051         sattrargs               nfsproc_setattr_2_arg;
00052         diropargs               nfsproc_lookup_2_arg;
00053         nfs_fh                  nfsproc_readlink_2_arg;
00054         readargs                nfsproc_read_2_arg;
00055         writeargs               nfsproc_write_2_arg;
00056         createargs              nfsproc_create_2_arg;
00057         diropargs               nfsproc_remove_2_arg;
00058         renameargs              nfsproc_rename_2_arg;
00059         linkargs                nfsproc_link_2_arg;
00060         symlinkargs             nfsproc_symlink_2_arg;
00061         createargs              nfsproc_mkdir_2_arg;
00062         diropargs               nfsproc_rmdir_2_arg;
00063         readdirargs             nfsproc_readdir_2_arg;
00064         nfs_fh                  nfsproc_statfs_2_arg;
00065 };
00066 
00067 union result_types {
00068         attrstat                r_attrstat;
00069         diropres                r_diropres;
00070         readlinkres             r_readlinkres;
00071         readres                 r_readres;
00072         nfsstat                 r_nfsstat;
00073         readdirres              r_readdirres;
00074         statfsres               r_statfsres;
00075 };
00076 
00077 typedef int (*funct_proc)(union argument_types*, union result_types*,
00078                           AccessControl::Identity);
00079 typedef void (*print_proc)(char* buf, union argument_types *argp);
00080 typedef void (*print_res_proc)(char* buf, union result_types *argp);
00081 
00082 struct dispatch_entry {
00083         int authenticate;       /* 1 if op requires access checking */
00084         int read_only;          /* 1 if op forbidden on RO FS */
00085         int credentials;        /* 1 if credentials needed */
00086         int res_size, arg_size; /* sizeof the res/arg structs */
00087         xdrproc_t xdr_result;
00088         xdrproc_t xdr_argument;
00089         funct_proc funct;
00090         char *name;             /* name of function */
00091         print_proc log_print;
00092         print_res_proc log_print_res;
00093 };
00094 
00095 extern struct dispatch_entry dtable[];
00096 
00097 /* Imported global variables. */
00098 extern uid_t fake_uid;
00099 extern gid_t fake_gid;
00100 extern int nfs_bufreqs; /* # of NFS requests to fit in socket buffer */
00101 
00102 /* Global Function prototypes. */
00103 extern _PRO( void mallocfailed, (void) );
00104 extern _PRO( nfsstat getattr, (nfs_fh *fh, fattr *attr,
00105                                struct stat *stat_optimize) );
00106 extern _PRO( void nfsd_init, (int) );
00107 
00108 #define DEVICE_FAKE_FD -2
00109 
00110 extern int nfsd_nfsproc_null_2(void* argp, union result_types* resp, 
00111     AccessControl::Identity cred);
00112 extern int nfsd_nfsproc_getattr_2(nfs_fh* argp, union result_types* resp, 
00113     AccessControl::Identity cred);
00114 extern int nfsd_nfsproc_setattr_2(sattrargs* argp, union result_types* resp, 
00115     AccessControl::Identity cred);
00116 extern int nfsd_nfsproc_root_2(void* argp, union result_types* resp, 
00117     AccessControl::Identity cred);
00118 extern int nfsd_nfsproc_lookup_2(diropargs* argp, union result_types* resp, 
00119     AccessControl::Identity cred);
00120 extern int nfsd_nfsproc_readlink_2(nfs_fh* argp, union result_types* resp, 
00121     AccessControl::Identity cred);
00122 extern int nfsd_nfsproc_read_2(readargs* argp, union result_types* resp, 
00123     AccessControl::Identity cred);
00124 extern int nfsd_nfsproc_writecache_2(void* argp, union result_types* resp, 
00125     AccessControl::Identity cred);
00126 extern int nfsd_nfsproc_write_2(writeargs* argp, union result_types* resp, 
00127     AccessControl::Identity cred);
00128 extern int nfsd_nfsproc_create_2(createargs* argp, union result_types* resp, 
00129     AccessControl::Identity cred);
00130 extern int nfsd_nfsproc_remove_2(diropargs* argp, union result_types* resp, 
00131     AccessControl::Identity cred);
00132 extern int nfsd_nfsproc_rename_2(renameargs* argp, union result_types* resp, 
00133     AccessControl::Identity cred);
00134 extern int nfsd_nfsproc_link_2(linkargs* argp, union result_types* resp, 
00135     AccessControl::Identity cred);
00136 extern int nfsd_nfsproc_symlink_2(symlinkargs* argp, union result_types* resp, 
00137     AccessControl::Identity cred);
00138 extern int nfsd_nfsproc_mkdir_2(createargs* argp, union result_types* resp, 
00139     AccessControl::Identity cred);
00140 extern int nfsd_nfsproc_rmdir_2(diropargs* argp, union result_types* resp, 
00141     AccessControl::Identity cred);
00142 extern int nfsd_nfsproc_readdir_2(readdirargs* argp, union result_types* resp, 
00143     AccessControl::Identity cred);
00144 extern int nfsd_nfsproc_statfs_2(nfs_fh* argp, union result_types* resp, 
00145     AccessControl::Identity cred);
00146 
00147 /* End of nfsd.h. */
00148 
00149 #endif

Generated on Mon May 8 00:48:45 2006 for Vesta by  doxygen 1.4.2