2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #ifndef OPENAFS_WINNT_AFSD_CM_IOCTL_H
11 #define OPENAFS_WINNT_AFSD_CM_IOCTL_H 1
13 #ifndef __CM_IOCTL_INTERFACES_ONLY__
16 typedef struct cm_fid {
22 #endif /* __CM_IOCTL_INTERFACES_ONLY__ */
24 /* the following four structures are used for fs get/set serverprefs command*/
25 #define CM_SPREF_VLONLY 0x01
26 typedef struct cm_SPref {
31 typedef struct cm_SPrefRequest {
32 unsigned short offset;
33 unsigned short num_servers;
37 typedef struct cm_SPrefInfo {
38 unsigned short next_offset;
39 unsigned short num_servers;
40 struct cm_SPref servers[1];/* we overrun this array intentionally...*/
43 typedef struct cm_SSetPref {
45 unsigned short num_servers;
46 struct cm_SPref servers[1];/* we overrun this array intentionally...*/
49 #define CM_IOCTLCACHEPARMS 16
50 typedef struct cm_cacheParms {
51 afs_uint64 parms[CM_IOCTLCACHEPARMS];
54 typedef struct cm_ioctl {
56 char *inDatap; /* ioctl func's current position
57 * in input parameter block */
58 char *inAllocp; /* allocated input parameter block */
59 afs_uint32 inCopied; /* # of input bytes copied in so far
62 char *outDatap; /* output results assembled so far */
63 char *outAllocp; /* output results assembled so far */
64 afs_uint32 outCopied; /* # of output bytes copied back so far
70 /* flags for smb_ioctl_t */
71 #define CM_IOCTLFLAG_DATAIN 1 /* reading data from client to server */
72 #define CM_IOCTLFLAG_LOGON 2 /* got tokens from integrated logon */
73 #define CM_IOCTLFLAG_USEUTF8 4 /* this request is using UTF-8 strings */
74 #define CM_IOCTLFLAG_DATAOUT 8 /* sending data from server to client */
78 * The cm_IoctlQueryOptions structure is designed to be extendible.
79 * None of the fields are required but when specified
80 * by the client and understood by the server will be
81 * used to more precisely specify the desired data.
83 * size must be set to the size of the structure
84 * sent by the client including any variable length
85 * data appended to the end of the static structure.
87 * field_flags are used to determine which fields have
88 * been filled in and should be used.
90 * variable length data can be specified with fields
91 * that include offsets to data appended to the
94 * when adding new fields you must:
96 * - define a CM_IOCTL_QOPTS_FIELD_xxx bit flag
97 * - define a CM_IOCTL_QOPTS_HAVE_xxx macro
99 * It is critical that flags be consistent across all
100 * implementations of the pioctl interface for a given
101 * platform. This should be considered a public
102 * interface used by third party application developers.
105 typedef struct cm_IoctlQueryOptions {
107 afs_uint32 field_flags;
110 } cm_ioctlQueryOptions_t;
113 #define CM_IOCTL_QOPTS_FIELD_LITERAL 1
114 #define CM_IOCTL_QOPTS_FIELD_FID 2
116 #define CM_IOCTL_QOPTS_HAVE_LITERAL(p) (p->size >= 12 && (p->field_flags & CM_IOCTL_QOPTS_FIELD_LITERAL))
117 #define CM_IOCTL_QOPTS_HAVE_FID(p) (p->size >= 28 && (p->field_flags & CM_IOCTL_QOPTS_FIELD_FID))
119 #define MAXNUMSYSNAMES 16 /* max that current constants allow */
120 #define MAXSYSNAME 128 /* max sysname (i.e. @sys) size */
121 extern unsigned int cm_sysNameCount;
122 extern clientchar_t *cm_sysNameList[MAXNUMSYSNAMES];
123 extern unsigned int cm_sysName64Count;
124 extern clientchar_t *cm_sysName64List[MAXNUMSYSNAMES];
126 /* Paths that are passed into pioctl calls can be specified using
127 UTF-8. These strings are prefixed with UTF8_PREFIX defined below.
128 The sequence ESC '%' 'G' is used by ISO-2022 to designate UTF-8
130 #define UTF8_PREFIX "\33%G"
132 extern const char utf8_prefix[];
133 extern const int utf8_prefix_size;
135 /* flags for rxstats pioctl */
137 #define AFSCALL_RXSTATS_MASK 0x7 /* Valid flag bits */
138 #define AFSCALL_RXSTATS_ENABLE 0x1 /* Enable RX stats */
139 #define AFSCALL_RXSTATS_DISABLE 0x2 /* Disable RX stats */
140 #define AFSCALL_RXSTATS_CLEAR 0x4 /* Clear RX stats */
144 #define AFSCALL_FLAG_LOCAL_SYSTEM 0x1
146 #ifndef __CM_IOCTL_INTERFACES_ONLY__
148 extern void cm_InitIoctl(void);
150 extern cm_ioctlQueryOptions_t *
151 cm_IoctlGetQueryOptions(struct cm_ioctl *ioctlp, struct cm_user *userp);
154 cm_IoctlSkipQueryOptions(struct cm_ioctl *ioctlp, struct cm_user *userp);
157 cm_NormalizeAfsPath(clientchar_t *outpathp, long outlen, clientchar_t *inpathp);
159 extern void cm_SkipIoctlPath(cm_ioctl_t *ioctlp);
161 extern clientchar_t * cm_ParseIoctlStringAlloc(cm_ioctl_t *ioctlp, const char * ext_instrp);
163 extern int cm_UnparseIoctlString(cm_ioctl_t *ioctlp, char * ext_outp, const clientchar_t * cstr, int cchlen);
165 extern afs_int32 cm_IoctlGetACL(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
167 extern afs_int32 cm_IoctlGetFileCellName(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
169 extern afs_int32 cm_IoctlSetACL(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
171 extern afs_int32 cm_IoctlFlushAllVolumes(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_req_t *reqp);
173 extern afs_int32 cm_IoctlFlushVolume(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
175 extern afs_int32 cm_IoctlFlushFile(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
177 extern afs_int32 cm_IoctlSetVolumeStatus(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
179 extern afs_int32 cm_IoctlGetVolumeStatus(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
181 extern afs_int32 cm_IoctlGetFid(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
183 extern afs_int32 cm_IoctlGetOwner(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
185 extern afs_int32 cm_IoctlSetOwner(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
187 extern afs_int32 cm_IoctlSetGroup(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
189 extern afs_int32 cm_IoctlWhereIs(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
191 extern afs_int32 cm_IoctlStatMountPoint(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
193 extern afs_int32 cm_IoctlDeleteMountPoint(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
195 extern afs_int32 cm_IoctlCheckServers(cm_ioctl_t *ioctlp, cm_user_t *userp);
197 extern afs_int32 cm_IoctlGag(cm_ioctl_t *ioctlp, cm_user_t *userp);
199 extern afs_int32 cm_IoctlCheckVolumes(cm_ioctl_t *ioctlp, cm_user_t *userp);
201 extern afs_int32 cm_IoctlSetCacheSize(cm_ioctl_t *ioctlp, cm_user_t *userp);
203 extern afs_int32 cm_IoctlGetCacheParms(cm_ioctl_t *ioctlp, cm_user_t *userp);
205 extern afs_int32 cm_IoctlGetCell(cm_ioctl_t *ioctlp, cm_user_t *userp);
207 extern afs_int32 cm_IoctlNewCell(cm_ioctl_t *ioctlp, cm_user_t *userp);
209 extern afs_int32 cm_IoctlNewCell2(cm_ioctl_t *ioctlp, cm_user_t *userp);
211 extern afs_int32 cm_IoctlGetWsCell(cm_ioctl_t *ioctlp, cm_user_t *userp);
213 extern afs_int32 cm_IoctlSysName(cm_ioctl_t *ioctlp, cm_user_t *userp);
215 extern afs_int32 cm_IoctlGetCellStatus(cm_ioctl_t *ioctlp, cm_user_t *userp);
217 extern afs_int32 cm_IoctlSetCellStatus(cm_ioctl_t *ioctlp, cm_user_t *userp);
219 extern afs_int32 cm_IoctlSetSPrefs(cm_ioctl_t *ioctlp, cm_user_t *userp);
221 extern afs_int32 cm_IoctlGetSPrefs(cm_ioctl_t *ioctlp, cm_user_t *userp);
223 extern afs_int32 cm_IoctlStoreBehind(cm_ioctl_t *ioctlp, cm_user_t *userp);
225 extern afs_int32 cm_IoctlCreateMountPoint(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *dscp, cm_req_t *reqp, clientchar_t *leaf);
227 extern afs_int32 cm_CleanFile(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp);
229 extern afs_int32 cm_FlushFile(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp);
231 extern afs_int32 cm_FlushVolume(cm_user_t *, cm_req_t *reqp, afs_uint32 cell, afs_uint32 volume);
233 extern afs_int32 cm_FlushParent(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp);
235 extern afs_int32 cm_IoctlTraceControl(cm_ioctl_t *ioctlp, cm_user_t *userp);
237 extern afs_int32 cm_IoctlSetToken(cm_ioctl_t *ioctlp, cm_user_t *userp);
239 extern afs_int32 cm_IoctlGetTokenIter(cm_ioctl_t *ioctlp, cm_user_t *userp);
241 extern afs_int32 cm_IoctlGetToken(cm_ioctl_t *ioctlp, cm_user_t *userp);
243 extern afs_int32 cm_IoctlDelToken(cm_ioctl_t *ioctlp, cm_user_t *userp);
245 extern afs_int32 cm_IoctlDelAllToken(cm_ioctl_t *ioctlp, cm_user_t *userp);
247 extern afs_int32 cm_IoctlSymlink(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *dscp, cm_req_t *reqp, clientchar_t *leaf);
249 extern afs_int32 cm_IoctlIslink(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
251 extern afs_int32 cm_IoctlListlink(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
253 extern afs_int32 cm_IoctlDeletelink(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *dscp, cm_req_t *reqp);
255 extern afs_int32 cm_IoctlMakeSubmount(cm_ioctl_t *ioctlp, cm_user_t *userp);
257 extern afs_int32 cm_IoctlGetRxkcrypt(cm_ioctl_t *ioctlp, cm_user_t *userp);
259 extern afs_int32 cm_IoctlSetRxkcrypt(cm_ioctl_t *ioctlp, cm_user_t *userp);
261 extern afs_int32 cm_IoctlShutdown(cm_ioctl_t *ioctlp, cm_user_t *userp);
263 extern afs_int32 cm_IoctlFreemountAddCell(cm_ioctl_t *ioctlp, cm_user_t *userp);
265 extern afs_int32 cm_IoctlFreemountRemoveCell(cm_ioctl_t *ioctlp, cm_user_t *userp);
267 extern afs_int32 cm_IoctlMemoryDump(cm_ioctl_t *ioctlp, cm_user_t *userp);
269 extern afs_int32 cm_IoctlRxStatProcess(cm_ioctl_t *ioctlp, cm_user_t *userp);
271 extern afs_int32 cm_IoctlRxStatPeer(cm_ioctl_t *ioctlp, cm_user_t *userp);
273 extern afs_int32 cm_IoctlUUIDControl(struct cm_ioctl * ioctlp, struct cm_user *userp);
275 extern afs_int32 cm_IoctlPathAvailability(struct cm_ioctl * ioctlp, struct cm_user *userp, struct cm_scache *scp, struct cm_req *reqp);
277 extern afs_int32 cm_IoctlGetFileType(cm_ioctl_t *ioctlp, cm_user_t *userp, struct cm_scache *scp, struct cm_req *reqp);
279 extern afs_int32 cm_IoctlVolStatTest(struct cm_ioctl *ioctlp, struct cm_user *userp, cm_req_t *reqp);
281 extern afs_int32 cm_IoctlUnicodeControl(struct cm_ioctl *ioctlp, struct cm_user * userp);
283 extern void TranslateExtendedChars(char *str);
285 extern afs_int32 cm_IoctlGetUnixMode(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
287 extern afs_int32 cm_IoctlSetUnixMode(cm_ioctl_t *ioctlp, cm_user_t *userp, cm_scache_t *scp, cm_req_t *reqp);
289 extern afs_int32 cm_IoctlGetVerifyData(cm_ioctl_t *ioctlp);
291 extern afs_int32 cm_IoctlSetVerifyData(cm_ioctl_t *ioctlp);
293 extern afs_int32 cm_IoctlGetCallerAccess(cm_ioctl_t *ioctlp, struct cm_user *userp, cm_scache_t *scp, cm_req_t *reqp);
295 #endif /* __CM_IOCTL_INTERFACES_ONLY__ */
297 #endif /* OPENAFS_WINNT_AFSD_CM_IOCTL_H */