OpenAFS
OpenAFS distributed network file system
|
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 OPENAFS_WINNT_AFSD_CM_IOCTL_H 00011 #define OPENAFS_WINNT_AFSD_CM_IOCTL_H 1 00012 00013 #ifndef __CM_IOCTL_INTERFACES_ONLY__ 00014 #include "cm_user.h" 00015 #else 00016 typedef struct cm_fid { 00017 unsigned long cell; 00018 unsigned long volume; 00019 unsigned long vnode; 00020 unsigned long unique; 00021 } cm_fid_t; 00022 #endif /* __CM_IOCTL_INTERFACES_ONLY__ */ 00023 00024 /* the following four structures are used for fs get/set serverprefs command*/ 00025 #define CM_SPREF_VLONLY 0x01 00026 typedef struct cm_SPref { 00027 struct in_addr host; 00028 unsigned short rank; 00029 } cm_SPref_t; 00030 00031 typedef struct cm_SPrefRequest { 00032 unsigned short offset; 00033 unsigned short num_servers; 00034 unsigned short flags; 00035 } cm_SPrefRequest_t; 00036 00037 typedef struct cm_SPrefInfo { 00038 unsigned short next_offset; 00039 unsigned short num_servers; 00040 struct cm_SPref servers[1];/* we overrun this array intentionally...*/ 00041 } cm_SPrefInfo_t; 00042 00043 typedef struct cm_SSetPref { 00044 unsigned short flags; 00045 unsigned short num_servers; 00046 struct cm_SPref servers[1];/* we overrun this array intentionally...*/ 00047 } cm_SSetPref_t; 00048 00049 #define CM_IOCTLCACHEPARMS 16 00050 typedef struct cm_cacheParms { 00051 afs_uint64 parms[CM_IOCTLCACHEPARMS]; 00052 } cm_cacheParms_t; 00053 00054 typedef struct cm_ioctl { 00055 /* input side */ 00056 char *inDatap; /* ioctl func's current position 00057 * in input parameter block */ 00058 char *inAllocp; /* allocated input parameter block */ 00059 afs_uint32 inCopied; /* # of input bytes copied in so far 00060 * by write calls */ 00061 /* output side */ 00062 char *outDatap; /* output results assembled so far */ 00063 char *outAllocp; /* output results assembled so far */ 00064 afs_uint32 outCopied; /* # of output bytes copied back so far 00065 00066 /* flags */ 00067 afs_uint32 flags; 00068 } cm_ioctl_t; 00069 00070 /* flags for smb_ioctl_t */ 00071 #define CM_IOCTLFLAG_DATAIN 1 /* reading data from client to server */ 00072 #define CM_IOCTLFLAG_LOGON 2 /* got tokens from integrated logon */ 00073 #define CM_IOCTLFLAG_USEUTF8 4 /* this request is using UTF-8 strings */ 00074 #define CM_IOCTLFLAG_DATAOUT 8 /* sending data from server to client */ 00075 00076 00077 /* 00078 * The cm_IoctlQueryOptions structure is designed to be extendible. 00079 * None of the fields are required but when specified 00080 * by the client and understood by the server will be 00081 * used to more precisely specify the desired data. 00082 * 00083 * size must be set to the size of the structure 00084 * sent by the client including any variable length 00085 * data appended to the end of the static structure. 00086 * 00087 * field_flags are used to determine which fields have 00088 * been filled in and should be used. 00089 * 00090 * variable length data can be specified with fields 00091 * that include offsets to data appended to the 00092 * structure. 00093 * 00094 * when adding new fields you must: 00095 * - add the field 00096 * - define a CM_IOCTL_QOPTS_FIELD_xxx bit flag 00097 * - define a CM_IOCTL_QOPTS_HAVE_xxx macro 00098 * 00099 * It is critical that flags be consistent across all 00100 * implementations of the pioctl interface for a given 00101 * platform. This should be considered a public 00102 * interface used by third party application developers. 00103 */ 00104 00105 typedef struct cm_IoctlQueryOptions { 00106 afs_uint32 size; 00107 afs_uint32 field_flags; 00108 afs_uint32 literal; 00109 cm_fid_t fid; 00110 } cm_ioctlQueryOptions_t; 00111 00112 /* field flags - */ 00113 #define CM_IOCTL_QOPTS_FIELD_LITERAL 1 00114 #define CM_IOCTL_QOPTS_FIELD_FID 2 00115 00116 #define CM_IOCTL_QOPTS_HAVE_LITERAL(p) (p->size >= 12 && (p->field_flags & CM_IOCTL_QOPTS_FIELD_LITERAL)) 00117 #define CM_IOCTL_QOPTS_HAVE_FID(p) (p->size >= 28 && (p->field_flags & CM_IOCTL_QOPTS_FIELD_FID)) 00118 00119 #define MAXNUMSYSNAMES 16 /* max that current constants allow */ 00120 #define MAXSYSNAME 128 /* max sysname (i.e. @sys) size */ 00121 extern unsigned int cm_sysNameCount; 00122 extern clientchar_t *cm_sysNameList[MAXNUMSYSNAMES]; 00123 extern unsigned int cm_sysName64Count; 00124 extern clientchar_t *cm_sysName64List[MAXNUMSYSNAMES]; 00125 00126 /* Paths that are passed into pioctl calls can be specified using 00127 UTF-8. These strings are prefixed with UTF8_PREFIX defined below. 00128 The sequence ESC '%' 'G' is used by ISO-2022 to designate UTF-8 00129 strings. */ 00130 #define UTF8_PREFIX "\33%G" 00131 00132 extern const char utf8_prefix[]; 00133 extern const int utf8_prefix_size; 00134 00135 /* flags for rxstats pioctl */ 00136 00137 #define AFSCALL_RXSTATS_MASK 0x7 /* Valid flag bits */ 00138 #define AFSCALL_RXSTATS_ENABLE 0x1 /* Enable RX stats */ 00139 #define AFSCALL_RXSTATS_DISABLE 0x2 /* Disable RX stats */ 00140 #define AFSCALL_RXSTATS_CLEAR 0x4 /* Clear RX stats */ 00141 00142 /* pioctl flags */ 00143 00144 #define AFSCALL_FLAG_LOCAL_SYSTEM 0x1 00145 00146 #ifndef __CM_IOCTL_INTERFACES_ONLY__ 00147 00148 extern void cm_InitIoctl(void); 00149 00150 extern cm_ioctlQueryOptions_t * 00151 cm_IoctlGetQueryOptions(struct cm_ioctl *ioctlp, struct cm_user *userp); 00152 00153 extern void 00154 cm_IoctlSkipQueryOptions(struct cm_ioctl *ioctlp, struct cm_user *userp); 00155 00156 extern void 00157 cm_NormalizeAfsPath(clientchar_t *outpathp, long outlen, clientchar_t *inpathp); 00158 00159 extern void cm_SkipIoctlPath(cm_ioctl_t *ioctlp); 00160 00161 extern clientchar_t * cm_ParseIoctlStringAlloc(cm_ioctl_t *ioctlp, const char * ext_instrp); 00162 00163 extern int cm_UnparseIoctlString(cm_ioctl_t *ioctlp, char * ext_outp, const clientchar_t * cstr, int cchlen); 00164 00165 extern afs_int32 cm_IoctlGetACL(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00166 00167 extern afs_int32 cm_IoctlGetFileCellName(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00168 00169 extern afs_int32 cm_IoctlSetACL(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00170 00171 extern afs_int32 cm_IoctlFlushAllVolumes(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_req_t *reqp); 00172 00173 extern afs_int32 cm_IoctlFlushVolume(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00174 00175 extern afs_int32 cm_IoctlFlushFile(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00176 00177 extern afs_int32 cm_IoctlSetVolumeStatus(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00178 00179 extern afs_int32 cm_IoctlGetVolumeStatus(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00180 00181 extern afs_int32 cm_IoctlGetFid(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00182 00183 extern afs_int32 cm_IoctlGetOwner(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00184 00185 extern afs_int32 cm_IoctlSetOwner(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00186 00187 extern afs_int32 cm_IoctlSetGroup(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00188 00189 extern afs_int32 cm_IoctlWhereIs(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00190 00191 extern afs_int32 cm_IoctlStatMountPoint(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00192 00193 extern afs_int32 cm_IoctlDeleteMountPoint(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00194 00195 extern afs_int32 cm_IoctlCheckServers(cm_ioctl_t *ioctlp, cm_user_t *userp); 00196 00197 extern afs_int32 cm_IoctlGag(cm_ioctl_t *ioctlp, cm_user_t *userp); 00198 00199 extern afs_int32 cm_IoctlCheckVolumes(cm_ioctl_t *ioctlp, cm_user_t *userp); 00200 00201 extern afs_int32 cm_IoctlSetCacheSize(cm_ioctl_t *ioctlp, cm_user_t *userp); 00202 00203 extern afs_int32 cm_IoctlGetCacheParms(cm_ioctl_t *ioctlp, cm_user_t *userp); 00204 00205 extern afs_int32 cm_IoctlGetCell(cm_ioctl_t *ioctlp, cm_user_t *userp); 00206 00207 extern afs_int32 cm_IoctlNewCell(cm_ioctl_t *ioctlp, cm_user_t *userp); 00208 00209 extern afs_int32 cm_IoctlNewCell2(cm_ioctl_t *ioctlp, cm_user_t *userp); 00210 00211 extern afs_int32 cm_IoctlGetWsCell(cm_ioctl_t *ioctlp, cm_user_t *userp); 00212 00213 extern afs_int32 cm_IoctlSysName(cm_ioctl_t *ioctlp, cm_user_t *userp); 00214 00215 extern afs_int32 cm_IoctlGetCellStatus(cm_ioctl_t *ioctlp, cm_user_t *userp); 00216 00217 extern afs_int32 cm_IoctlSetCellStatus(cm_ioctl_t *ioctlp, cm_user_t *userp); 00218 00219 extern afs_int32 cm_IoctlSetSPrefs(cm_ioctl_t *ioctlp, cm_user_t *userp); 00220 00221 extern afs_int32 cm_IoctlGetSPrefs(cm_ioctl_t *ioctlp, cm_user_t *userp); 00222 00223 extern afs_int32 cm_IoctlStoreBehind(cm_ioctl_t *ioctlp, cm_user_t *userp); 00224 00225 extern afs_int32 cm_IoctlCreateMountPoint(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *dscp, cm_req_t *reqp, clientchar_t *leaf); 00226 00227 extern afs_int32 cm_CleanFile(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp); 00228 00229 extern afs_int32 cm_FlushFile(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp); 00230 00231 extern afs_int32 cm_FlushVolume(cm_user_t *, cm_req_t *reqp, afs_uint32 cell, afs_uint32 volume); 00232 00233 extern afs_int32 cm_FlushParent(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp); 00234 00235 extern afs_int32 cm_IoctlTraceControl(cm_ioctl_t *ioctlp, cm_user_t *userp); 00236 00237 extern afs_int32 cm_IoctlSetToken(cm_ioctl_t *ioctlp, cm_user_t *userp); 00238 00239 extern afs_int32 cm_IoctlGetTokenIter(cm_ioctl_t *ioctlp, cm_user_t *userp); 00240 00241 extern afs_int32 cm_IoctlGetToken(cm_ioctl_t *ioctlp, cm_user_t *userp); 00242 00243 extern afs_int32 cm_IoctlDelToken(cm_ioctl_t *ioctlp, cm_user_t *userp); 00244 00245 extern afs_int32 cm_IoctlDelAllToken(cm_ioctl_t *ioctlp, cm_user_t *userp); 00246 00247 extern afs_int32 cm_IoctlSymlink(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *dscp, cm_req_t *reqp, clientchar_t *leaf); 00248 00249 extern afs_int32 cm_IoctlIslink(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00250 00251 extern afs_int32 cm_IoctlListlink(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00252 00253 extern afs_int32 cm_IoctlDeletelink(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *dscp, cm_req_t *reqp); 00254 00255 extern afs_int32 cm_IoctlMakeSubmount(cm_ioctl_t *ioctlp, cm_user_t *userp); 00256 00257 extern afs_int32 cm_IoctlGetRxkcrypt(cm_ioctl_t *ioctlp, cm_user_t *userp); 00258 00259 extern afs_int32 cm_IoctlSetRxkcrypt(cm_ioctl_t *ioctlp, cm_user_t *userp); 00260 00261 extern afs_int32 cm_IoctlShutdown(cm_ioctl_t *ioctlp, cm_user_t *userp); 00262 00263 extern afs_int32 cm_IoctlFreemountAddCell(cm_ioctl_t *ioctlp, cm_user_t *userp); 00264 00265 extern afs_int32 cm_IoctlFreemountRemoveCell(cm_ioctl_t *ioctlp, cm_user_t *userp); 00266 00267 extern afs_int32 cm_IoctlMemoryDump(cm_ioctl_t *ioctlp, cm_user_t *userp); 00268 00269 extern afs_int32 cm_IoctlRxStatProcess(cm_ioctl_t *ioctlp, cm_user_t *userp); 00270 00271 extern afs_int32 cm_IoctlRxStatPeer(cm_ioctl_t *ioctlp, cm_user_t *userp); 00272 00273 extern afs_int32 cm_IoctlUUIDControl(struct cm_ioctl * ioctlp, struct cm_user *userp); 00274 00275 extern afs_int32 cm_IoctlPathAvailability(struct cm_ioctl * ioctlp, struct cm_user *userp, struct cm_scache *scp, struct cm_req *reqp); 00276 00277 extern afs_int32 cm_IoctlGetFileType(cm_ioctl_t *ioctlp, cm_user_t *userp, struct cm_scache *scp, struct cm_req *reqp); 00278 00279 extern afs_int32 cm_IoctlVolStatTest(struct cm_ioctl *ioctlp, struct cm_user *userp, cm_req_t *reqp); 00280 00281 extern afs_int32 cm_IoctlUnicodeControl(struct cm_ioctl *ioctlp, struct cm_user * userp); 00282 00283 extern void TranslateExtendedChars(char *str); 00284 00285 extern afs_int32 cm_IoctlGetUnixMode(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00286 00287 extern afs_int32 cm_IoctlSetUnixMode(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp); 00288 00289 extern afs_int32 cm_IoctlGetVerifyData(cm_ioctl_t *ioctlp); 00290 00291 extern afs_int32 cm_IoctlSetVerifyData(cm_ioctl_t *ioctlp); 00292 00293 #endif /* __CM_IOCTL_INTERFACES_ONLY__ */ 00294 00295 #endif /* OPENAFS_WINNT_AFSD_CM_IOCTL_H */