00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
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;
00084 int read_only;
00085 int credentials;
00086 int res_size, arg_size;
00087 xdrproc_t xdr_result;
00088 xdrproc_t xdr_argument;
00089 funct_proc funct;
00090 char *name;
00091 print_proc log_print;
00092 print_res_proc log_print_res;
00093 };
00094
00095 extern struct dispatch_entry dtable[];
00096
00097
00098 extern uid_t fake_uid;
00099 extern gid_t fake_gid;
00100 extern int nfs_bufreqs;
00101
00102
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
00148
00149 #endif