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