ubik: Remove unused sampleName
[openafs.git] / src / config / afs_args.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
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
8  */
9
10 #ifndef _AFS_ARGS_H_
11 #define _AFS_ARGS_H_
12
13 /*
14  * AFS system call opcodes
15  *
16  * When adding new opcodes, please also update afsd_init_syscall_opcodes()
17  * for syscall tracing.
18  */
19
20 #define AFSOP_START_RXCALLBACK    0     /* no aux parms */
21 #define AFSOP_START_AFS           1     /* no aux parms */
22 #define AFSOP_START_BKG           2     /* no aux parms */
23 #define AFSOP_START_TRUNCDAEMON   3     /* no aux parms */
24 #define AFSOP_START_CS            4     /* no aux parms */
25 #define AFSOP_ADDCELL             5     /* parm 2 = cell str */
26 #define AFSOP_CACHEINIT           6     /* parms 2-4 -> cache sizes */
27 #define AFSOP_CACHEINFO           7     /* the cacheinfo file */
28 #define AFSOP_VOLUMEINFO          8     /* the volumeinfo file */
29 #define AFSOP_CACHEFILE           9     /* a random cache file (V*) */
30 #define AFSOP_CACHEINODE         10     /* random cache file by inode */
31 #define AFSOP_AFSLOG             11     /* output log file */
32 #define AFSOP_ROOTVOLUME         12     /* non-standard root volume name */
33
34 #define AFSOP_STARTLOG           14     /* temporary: Start afs logging */
35 #define AFSOP_ENDLOG             15     /* temporary: End afs logging */
36 #define AFSOP_AFS_VFSMOUNT       16     /* vfsmount cover for hpux */
37 #define AFSOP_ADVISEADDR         17     /* to init rx cid generator */
38 #define AFSOP_CLOSEWAIT          18     /* make all closes synchronous */
39 #define AFSOP_RXEVENT_DAEMON     19     /* rxevent daemon */
40 #define AFSOP_GETMTU             20     /* stand-in for SIOCGIFMTU, for now */
41 #define AFSOP_GETIFADDRS         21     /* get machine's ethernet interfaces */
42
43 #define AFSOP_ADDCELL2           29     /* 2nd add cell protocol interface */
44 #define AFSOP_AFSDB_HANDLER      30     /* userspace AFSDB lookup handler */
45 #define AFSOP_SET_DYNROOT        31     /* enable/disable dynroot support */
46 #define AFSOP_ADDCELLALIAS       32     /* create alias for existing cell */
47 #define AFSOP_SET_FAKESTAT       33     /* enable/disable fakestat support */
48 #define AFSOP_CELLINFO           34     /* set the cellinfo file name */
49 #define AFSOP_SET_THISCELL       35     /* set the primary cell */
50 #define AFSOP_BASIC_INIT         36     /* used to be part of START_AFS */
51 #define AFSOP_SET_BACKUPTREE     37     /* enable backup tree support */
52 #define AFSOP_SET_RXPCK          38     /* set rx_extraPackets*/
53 #define AFSOP_BUCKETPCT          39     /* bucket percentage */
54 #define AFSOP_SET_RXMAXMTU       40     /* set rx_MyMaxSendSize,rx_maxReceiveSizeUser,rx_maxReceiveSize */
55 #define AFSOP_BKG_HANDLER        41     /* userspace-capable Bkg daemon */
56 #define AFSOP_GETMASK            42     /* stand-in for SIOCGIFNETMASK */
57 #define AFSOP_SET_RXMAXFRAGS     43     /* set rxi_nSendFrags, rxi_nRecvFrags */
58 #define AFSOP_SET_RMTSYS_FLAG    44     /* set flag if rmtsys is enabled */
59 #define AFSOP_SEED_ENTROPY       45     /* Give the kernel hcrypto entropy */
60 #define AFSOP_SET_INUMCALC       46     /* set inode number calculation method */
61 #define AFSOP_SET_VOLUME_TTL     47     /* set the vldb cache timeout */
62
63 #define AFSOP_RXLISTENER_DAEMON  48     /* starts kernel RX listener */
64
65 #define AFSOP_CACHEBASEDIR       50     /* cache base dir */
66 #define AFSOP_CACHEDIRS          51     /* number of files per dir */
67 #define AFSOP_CACHEFILES         52     /* number of files */
68
69 #define AFSOP_SETINT             60     /* set key/value pairs for ints */
70
71 #define AFSOP_GO                100     /* whether settime is being done */
72
73 #define AFSOP_CHECKLOCKS        200     /* dump lock state */
74 #define AFSOP_SHUTDOWN          201     /* Totally shutdown afs (deallocate all) */
75
76 #define AFSOP_STOP_RXCALLBACK   210     /* Stop CALLBACK process */
77 #define AFSOP_STOP_AFS          211     /* Stop AFS process */
78 #define AFSOP_STOP_BKG          212     /* Stop BKG process */
79 #define AFSOP_STOP_TRUNCDAEMON  213     /* Stop cache truncate daemon */
80 /* AFSOP_STOP_RXEVENT           214        defined in osi.h */
81 /* AFSOP_STOP_COMPLETE          215        defined in osi.h */
82 #define AFSOP_STOP_CS           216     /* Stop CheckServer daemon */
83 /* AFSOP_STOP_RXK_LISTENER      217        defined in osi.h */
84 #define AFSOP_STOP_AFSDB        218     /* Stop AFSDB handler */
85 #define AFSOP_STOP_NETIF        219     /* Stop Netif poller */
86
87 #define AFSOP_MAX_OPCODE        AFSOP_STOP_NETIF /* Largest defined opcode. */
88
89 /*
90  * AFS system call types and flags.
91  */
92
93 /* The range 20-30 is reserved for AFS system offsets in the afs_syscall */
94 #define AFSCALL_PIOCTL          20
95 #define AFSCALL_SETPAG          21
96 #define AFSCALL_IOPEN           22
97 #define AFSCALL_ICREATE         23
98 #define AFSCALL_IREAD           24
99 #define AFSCALL_IWRITE          25
100 #define AFSCALL_IINC            26
101 #define AFSCALL_IDEC            27
102 #define AFSCALL_CALL            28
103
104 #define AFSCALL_ICL             30
105
106 /* 64 bit versions of inode system calls. */
107 #define AFSCALL_IOPEN64         41
108 #define AFSCALL_ICREATE64       42
109 #define AFSCALL_IINC64          43
110 #define AFSCALL_IDEC64          44
111 #define AFSCALL_ILISTINODE64    45      /* Used by ListViceInodes */
112 #define AFSCALL_ICREATENAME64   46      /* pass in platform specific pointer
113                                          * used to create a name in in a
114                                          * directory.
115                                          */
116 #ifdef AFS_SGI_VNODE_GLUE
117 #define AFSCALL_INIT_KERNEL_CONFIG 47   /* set vnode glue ops. */
118 #endif
119
120 /* these are for initialization flags */
121
122 #define AFSCALL_INIT_MEMCACHE 0x1
123
124 /* flags for rxstats pioctl */
125
126 #define AFSCALL_RXSTATS_MASK    0x7     /* Valid flag bits */
127 #define AFSCALL_RXSTATS_ENABLE  0x1     /* Enable RX stats */
128 #define AFSCALL_RXSTATS_DISABLE 0x2     /* Disable RX stats */
129 #define AFSCALL_RXSTATS_CLEAR   0x4     /* Clear RX stats */
130
131 /* arguments passed by afsd */
132 #define IDTYPE_UID 0
133
134 /* We don't necessarily have VenusFid here */
135 struct afs_umv_param {
136     afs_int32 id;
137     afs_int32 idtype;
138     afs_int32 sCell;
139     afs_int32 sVolume;
140     afs_int32 sVnode;
141     afs_int32 sUnique;
142     afs_int32 dCell;
143     afs_int32 dVolume;
144     afs_int32 dVnode;
145     afs_int32 dUnique;
146 };
147
148 #ifdef AFS_DARWIN_ENV
149 # define AFS_USPC_UMV 1
150 #endif
151 #define AFS_USPC_SHUTDOWN 2
152
153 struct afs_uspc_param {
154     afs_int32 retval;
155     afs_int32 ts; /* brequest ts - always unique */
156     afs_int32 bufSz;
157     afs_int32 reqtype;
158     union {
159         struct afs_umv_param umv;
160     } req;
161 };
162
163 struct afs_cacheParams {
164     afs_int32 cacheScaches;
165     afs_int32 cacheFiles;
166     afs_int32 cacheBlocks;
167     afs_int32 cacheDcaches;
168     afs_int32 cacheVolumes;
169     afs_int32 chunkSize;
170     afs_int32 setTimeFlag;
171     afs_int32 memCacheFlag;
172     afs_int32 inodes;
173     afs_int32 users;
174     afs_int32 dynamic_vcaches;
175 };
176
177 /* Supported values for AFSOP_SET_INUMCALC. */
178 enum {
179     AFS_INUMCALC_COMPAT = 0,
180     AFS_INUMCALC_MD5 = 1
181 };
182
183 /* Supported volume ttl range. */
184 #define AFS_MIN_VOLUME_TTL 600
185 #define AFS_MAX_VOLUME_TTL MAX_AFS_INT32
186
187 /*
188  * Note that the AFS_*ALLOCSIZ values should be multiples of sizeof(void*) to
189  * accomodate pointer alignment.
190  */
191 /* Used in rx.c as well as afs directory. */
192 #if     defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV)
193 /* XXX Because of rxkad_cprivate... XXX */
194 #define AFS_SMALLOCSIZ  (38*sizeof(void *))     /* "Small" allocated size */
195 #else
196 #define AFS_SMALLOCSIZ  (64*sizeof(void *))     /*  "Small" allocated size */
197 #endif
198 #define AFS_LRALLOCSIZ  4096    /* "Large" allocated size */
199
200 /* Cache configuration available through the client callback interface */
201 typedef struct cm_initparams_v1 {
202     afs_uint32 nChunkFiles;
203     afs_uint32 nStatCaches;
204     afs_uint32 nDataCaches;
205     afs_uint32 nVolumeCaches;
206     afs_uint32 firstChunkSize;
207     afs_uint32 otherChunkSize;
208     afs_uint32 cacheSize;
209     afs_uint32 setTime;
210     afs_uint32 memCache;
211 } cm_initparams_v1;
212
213 /*
214  * If you need to change afs_cacheParams, you should probably create a brand
215  * new structure.  Keeping the old structure will allow backwards compatibility
216  * with old clients (even if it is only used to calculate allocation size).
217  * If you do change the size or the format, you'll need to bump
218  * AFS_CLIENT_CONFIG_RETRIEVAL_VERSION.  This allows some primitive form
219  * of versioning a la rxdebug.
220  */
221
222 #define AFS_CLIENT_RETRIEVAL_VERSION            1       /* latest version */
223 #define AFS_CLIENT_RETRIEVAL_FIRST_EDITION      1       /* first version */
224
225 /* Defines and structures for the AFS proc replacement layer for the original syscall (AFS_SYSCALL) strategy */
226
227 #ifdef AFS_LINUX20_ENV
228
229 #define PROC_FSDIRNAME "openafs"
230 #define PROC_SYSCALL_NAME "afs_ioctl"
231 #define PROC_SYSCALL_FNAME "/proc/fs/openafs/afs_ioctl"
232 #define PROC_SYSCALL_ARLA_FNAME "/proc/fs/nnpfs/afs_ioctl"
233 #define PROC_CELLSERVDB_NAME "CellServDB"
234 #define PROC_PEER_NAME "rx_peer"
235 #define PROC_CONN_NAME "rx_conn"
236 #define PROC_CALL_NAME "rx_call"
237 #define PROC_RX_NAME "rx"
238 #define PROC_SERVICES_NAME "rx_services"
239 #define PROC_RXSTATS_NAME "rx_stats"
240 #define VIOC_SYSCALL_TYPE 'C'
241 #define VIOC_SYSCALL _IOW(VIOC_SYSCALL_TYPE,1,void *)
242 #define VIOC_SYSCALL32 _IOW(VIOC_SYSCALL_TYPE,1,int)
243
244 struct afsprocdata {
245   long param4;
246   long param3;
247   long param2;
248   long param1;
249   long syscall;
250 };
251
252 struct afsprocdata32 {
253   unsigned int param4;
254   unsigned int param3;
255   unsigned int param2;
256   unsigned int param1;
257   unsigned int syscall;
258 };
259
260 #endif
261
262 #ifdef AFS_DARWIN80_ENV
263 struct afssysargs {
264     unsigned int syscall;
265     unsigned int param1;
266     unsigned int param2;
267     unsigned int param3;
268     unsigned int param4;
269     unsigned int param5;
270     unsigned int param6;
271     unsigned int retval;
272 };
273
274 /* args reordered to avoid alignment issues */
275 struct afssysargs64 {
276     user_addr_t param1;
277     user_addr_t param2;
278     user_addr_t param3;
279     user_addr_t param4;
280     user_addr_t param5;
281     user_addr_t param6;
282     unsigned int syscall;
283     unsigned int retval;
284 };
285 #define VIOC_SYSCALL_TYPE 'C'
286 #define VIOC_SYSCALL _IOWR(VIOC_SYSCALL_TYPE,1,struct afssysargs)
287 #define VIOC_SYSCALL64 _IOWR(VIOC_SYSCALL_TYPE,2,struct afssysargs64)
288 #define SYSCALL_DEV_FNAME "/dev/openafs_ioctl"
289 #endif
290
291 #ifdef AFS_SUN511_ENV
292 # define VIOC_SYSCALL_TYPE 'C'
293 # define VIOC_SYSCALL _IOW(VIOC_SYSCALL_TYPE, 1, struct afssysargs)
294 # define VIOC_SYSCALL32 _IOW(VIOC_SYSCALL_TYPE, 2, struct afssysargs32)
295 # define SYSCALL_DEV_FNAME "/dev/afs"
296
297 struct afssysargs {
298     afs_uint64 param6;
299     afs_uint64 param5;
300     afs_uint64 param4;
301     afs_uint64 param3;
302     afs_uint64 param2;
303     afs_uint64 param1;
304     afs_uint32 syscall;
305 };
306
307 struct afssysargs32 {
308     afs_uint32 param6;
309     afs_uint32 param5;
310     afs_uint32 param4;
311     afs_uint32 param3;
312     afs_uint32 param2;
313     afs_uint32 param1;
314     afs_uint32 syscall;
315 };
316 #endif /* AFS_SUN511_ENV */
317
318 #ifdef AFS_CACHE_VNODE_PATH
319 #define AFS_CACHE_CELLS_INODE -2
320 #define AFS_CACHE_ITEMS_INODE -3
321 #define AFS_CACHE_VOLUME_INODE -4
322 #endif
323
324 #endif /* _AFS_ARGS_H_ */