OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/afs/exporter.h
00001 /*
00002  * Copyright 2000, International Business Machines Corporation and others.
00003  * All Rights Reserved.
00004  *
00005  * This software has been released under the terms of the IBM Public
00006  * License.  For details, see the LICENSE file in the top-level source
00007  * directory or online at http://www.openafs.org/dl/license10.html
00008  */
00009 
00010 #ifndef __EXPORTER__
00011 #define __EXPORTER__
00012 
00013 #ifdef UID_NOBODY
00014 #define NFS_NOBODY      UID_NOBODY
00015 #endif
00016 #ifndef NFS_NOBODY
00017 #define NFS_NOBODY      -2      /* maps Nfs's "nobody" but since not declared by some systems (i.e. Ultrix) we use a constant  */
00018 #endif
00019 #define RMTUSER_REQ             0xabc
00020 #define RMTUSER_REQ_PRIV        0xabe
00021 
00037 #if defined(AFS_SUN5_64BIT_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZPTR==64)) || defined(AFS_LINUX_64BIT_KERNEL)
00038 #define AFS_XLATOR_MAGIC        0x8765  /* XXX */
00039 #else
00040 #define AFS_XLATOR_MAGIC        0x87654321
00041 #endif
00042 
00043 #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
00044 #define AFS_NFSXLATORREQ(cred) 0
00045 #else
00046 #define AFS_NFSXLATORREQ(cred)    (afs_cr_rgid(cred) == NFSXLATOR_CRED)
00047 #endif
00048 
00049 struct afs_exporter;
00050 
00051 struct exporterops {
00052     int (*export_reqhandler) (struct afs_exporter *exp,
00053                               afs_ucred_t **cred,
00054                               afs_uint32 host,
00055                               afs_int32 *pag,
00056                               struct afs_exporter **expp);
00057     void (*export_hold) (struct afs_exporter *exp);
00058     void (*export_rele) (struct afs_exporter *exp);
00059     int (*export_sysname) (struct afs_exporter *exp,
00060                            char *inname,
00061                            char ***outname,
00062                            int *num,
00063                            int allpags);
00064     void (*export_garbagecollect) (struct afs_exporter *exp,
00065                                    afs_int32 param);
00066     int (*export_statistics) (struct afs_exporter *exp);
00067     int (*export_checkhost) (struct afs_exporter *exp, afs_uint32 host);
00068     afs_uint32 (*export_gethost) (struct afs_exporter *exp);
00069 };
00070 
00071 struct exporterstats {
00072     afs_int32 calls;            /* # of calls to the exporter */
00073     afs_int32 rejectedcalls;    /* # of afs rejected  calls */
00074     afs_int32 nopag;            /* # of unpagged remote calls */
00075     afs_int32 invalidpag;       /* # of invalid pag calls */
00076 };
00077 
00078 struct afs_exporter {
00079     struct afs_exporter *exp_next;
00080     struct exporterops *exp_op;
00081     afs_int32 exp_states;
00082     afs_int32 exp_type;
00083     struct exporterstats exp_stats;
00084     char *exp_data;
00085 };
00086 
00087 /* exp_type values */
00088 #define EXP_NULL    0           /* Undefined */
00089 #define EXP_NFS     1           /* Nfs/Afs translator */
00090 
00091 /* exp_states values */
00092 #define EXP_EXPORTED    1
00093 #define EXP_UNIXMODE    2
00094 #define EXP_PWSYNC      4
00095 #define EXP_SUBMOUNTS   8
00096 #define EXP_CLIPAGS    16
00097 #define EXP_CALLBACK   32
00098 
00099 
00100 #define AFS_NFSFULLFID  1
00101 
00102 #define EXP_REQHANDLER(EXP, CRED, HOST, PAG, EXPP) \
00103         (*(EXP)->exp_op->export_reqhandler)(EXP, CRED, HOST, PAG, EXPP)
00104 #define EXP_HOLD(EXP)   \
00105         (*(EXP)->exp_op->export_hold)(EXP)
00106 #define EXP_RELE(EXP)   \
00107         (*(EXP)->exp_op->export_rele)(EXP)
00108 #define EXP_SYSNAME(EXP, INNAME, OUTNAME, NUM, ALLPAGS)   \
00109         (*(EXP)->exp_op->export_sysname)(EXP, INNAME, OUTNAME, NUM, ALLPAGS)
00110 #define EXP_GC(EXP, param)      \
00111         (*(EXP)->exp_op->export_garbagecollect)(EXP, param)
00112 #define EXP_STATISTICS(EXP)     \
00113         (*(EXP)->exp_op->export_statistics)(EXP)
00114 #define EXP_CHECKHOST(EXP, HOST)        \
00115         (*(EXP)->exp_op->export_checkhost)(EXP, HOST)
00116 #define EXP_GETHOST(EXP)        \
00117         (*(EXP)->exp_op->export_gethost)(EXP)
00118 
00119 struct afs3_fid {
00120     u_short len;
00121     u_short padding;
00122     afs_uint32 Cell;
00123     afs_uint32 Volume;
00124     afs_uint32 Vnode;
00125     afs_uint32 Unique;
00126 };
00127 
00128 struct Sfid {
00129     afs_uint32 padding;
00130     afs_uint32 Cell;
00131     afs_uint32 Volume;
00132     afs_uint32 Vnode;
00133     afs_uint32 Unique;
00134 #ifdef  AFS_SUN5_ENV
00135     struct cred *credp;
00136 #endif
00137 };
00138 
00139 
00140 #endif /* __EXPORTER__ */
 All Data Structures Files Functions Variables