cd86d43ca15e7707964d539262f95fb5042b6630
[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
50 /* The range 20-30 is reserved for AFS system offsets in the afs_syscall */
51 #define AFSCALL_PIOCTL          20
52 #define AFSCALL_SETPAG          21
53 #define AFSCALL_IOPEN           22
54 #define AFSCALL_ICREATE         23
55 #define AFSCALL_IREAD           24
56 #define AFSCALL_IWRITE          25
57 #define AFSCALL_IINC            26
58 #define AFSCALL_IDEC            27
59 #define AFSCALL_CALL            28
60
61 #define AFSCALL_ICL             30
62
63 /* 64 bit versions of inode system calls. */
64 #define AFSCALL_IOPEN64         41
65 #define AFSCALL_ICREATE64       42
66 #define AFSCALL_IINC64          43
67 #define AFSCALL_IDEC64          44
68 #define AFSCALL_ILISTINODE64    45      /* Used by ListViceInodes */
69 #define AFSCALL_ICREATENAME64   46      /* pass in platform specific pointer
70                                          * used to create a name in in a
71                                          * directory.
72                                          */
73 #ifdef AFS_SGI_VNODE_GLUE
74 #define AFSCALL_INIT_KERNEL_CONFIG 47   /* set vnode glue ops. */
75 #endif
76
77 #ifdef  AFS_SGI53_ENV
78 #define AFSOP_NFSSTATICADDR      32     /* to contents addr of nfs kernel addr */
79 #define AFSOP_NFSSTATICADDRPTR   33     /* pass addr of variable containing 
80                                          * address into kernel. */
81 #define AFSOP_NFSSTATICADDR2     34     /* pass address in as hyper. */
82 #define AFSOP_SBLOCKSTATICADDR2  35     /* for sblock and sbunlock */
83 #endif
84 #define AFSOP_GETMASK            42     /* stand-in for SIOCGIFNETMASK */
85 /* For SGI, this can't interfere with any of the 64 bit inode calls. */
86 #define AFSOP_RXLISTENER_DAEMON  48     /* starts kernel RX listener */
87
88 /* these are for initialization flags */
89
90 #define AFSCALL_INIT_MEMCACHE 0x1
91 #define AFSCALL_INIT_MEMCACHE_SLEEP 0x2 /* Use osi_Alloc to allocate memcache
92                                          * instead of osi_Alloc_NoSleep */
93
94 /* flags for rxstats pioctl */
95
96 #define AFSCALL_RXSTATS_MASK    0x7     /* Valid flag bits */
97 #define AFSCALL_RXSTATS_ENABLE  0x1     /* Enable RX stats */
98 #define AFSCALL_RXSTATS_DISABLE 0x2     /* Disable RX stats */
99 #define AFSCALL_RXSTATS_CLEAR   0x4     /* Clear RX stats */
100
101 #define AFSOP_GO                100     /* whether settime is being done */
102 /* not for initialization: debugging assist */
103 #define AFSOP_CHECKLOCKS        200     /* dump lock state */
104 #define AFSOP_SHUTDOWN          201     /* Totally shutdown afs (deallocate all) */
105
106 /* The following aren't used by afs_initState but by afs_termState! */
107 #define AFSOP_STOP_RXCALLBACK   210     /* Stop CALLBACK process */
108 #define AFSOP_STOP_AFS          211     /* Stop AFS process */
109 #define AFSOP_STOP_CS           216     /* Stop CheckServer daemon. */
110 #define AFSOP_STOP_BKG          212     /* Stop BKG process */
111 #define AFSOP_STOP_TRUNCDAEMON  213     /* Stop cache truncate daemon */
112 /* #define AFSOP_STOP_RXEVENT   214     defined in osi.h              */
113 /* #define AFSOP_STOP_COMPLETE     215  defined in osi.h              */
114 /* #define AFSOP_STOP_RXK_LISTENER   217     defined in osi.h         */
115 #define AFSOP_STOP_AFSDB        218     /* Stop AFSDB handler */
116
117 /* Main afs syscall entry; this number may vary per system (i.e. defined in afs/param.h) */
118 #ifndef AFS_SYSCALL
119 #define AFS_SYSCALL             31
120 #endif
121
122 /* arguments passed by afsd */
123 struct afs_cacheParams {
124     afs_int32 cacheScaches;
125     afs_int32 cacheFiles;
126     afs_int32 cacheBlocks;
127     afs_int32 cacheDcaches;
128     afs_int32 cacheVolumes;
129     afs_int32 chunkSize;
130     afs_int32 setTimeFlag;
131     afs_int32 memCacheFlag;
132     afs_int32 inodes;
133     afs_int32 users;
134 };
135
136 /*
137  * Note that the AFS_*ALLOCSIZ values should be multiples of sizeof(void*) to
138  * accomodate pointer alignment.
139  */
140 /* Used in rx.c as well as afs directory. */
141 #if     defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV)
142 /* XXX Because of rxkad_cprivate... XXX */
143 #define AFS_MDALLOCSIZ  (127*sizeof(void *))    /* "Medium" allocated size */
144 #define AFS_MALLOC_LOW_WATER    50      /* Min free blocks before allocating more */
145 #define AFS_SMALLOCSIZ  (38*sizeof(void *))     /* "Small" allocated size */
146 #else
147 #define AFS_SMALLOCSIZ  (64*sizeof(void *))     /*  "Small" allocated size */
148 #endif
149
150 /* Cache configuration available through the client callback interface */
151 typedef struct cm_initparams_v1 {
152     afs_uint32 nChunkFiles;
153     afs_uint32 nStatCaches;
154     afs_uint32 nDataCaches;
155     afs_uint32 nVolumeCaches;
156     afs_uint32 firstChunkSize;
157     afs_uint32 otherChunkSize;
158     afs_uint32 cacheSize;
159     afs_uint32 setTime;
160     afs_uint32 memCache;
161 } cm_initparams_v1;
162
163 /*
164  * If you need to change afs_cacheParams, you should probably create a brand
165  * new structure.  Keeping the old structure will allow backwards compatibility
166  * with old clients (even if it is only used to calculate allocation size).
167  * If you do change the size or the format, you'll need to bump
168  * AFS_CLIENT_CONFIG_RETRIEVAL_VERSION.  This allows some primitive form
169  * of versioning a la rxdebug.
170  */
171
172 #define AFS_CLIENT_RETRIEVAL_VERSION            1       /* latest version */
173 #define AFS_CLIENT_RETRIEVAL_FIRST_EDITION      1       /* first version */
174
175 /* Defines and structures for the AFS proc replacement layer for the original syscall (AFS_SYSCALL) strategy */
176
177 #ifdef AFS_LINUX20_ENV
178  
179 #define PROC_FSDIRNAME "openafs"
180 #define PROC_SYSCALL_NAME "afs_ioctl"
181 #define PROC_SYSCALL_FNAME "/proc/fs/openafs/afs_ioctl"
182 #define PROC_SYSCALL_ARLA_FNAME "/proc/fs/nnpfs/afs_ioctl"
183 #define PROC_CELLSERVDB_NAME "CellServDB"
184 #define PROC_PEER_NAME "rx_peer"
185 #define PROC_CONN_NAME "rx_conn"
186 #define PROC_CALL_NAME "rx_call"
187 #define PROC_RX_NAME "rx"
188 #define PROC_SERVICES_NAME "rx_services"
189 #define PROC_RXSTATS_NAME "rx_stats"
190 #define VIOC_SYSCALL_TYPE 'C' 
191 #define VIOC_SYSCALL _IOW(VIOC_SYSCALL_TYPE,1,void *)
192  
193 struct afsprocdata {
194   long param4;
195   long param3;
196   long param2;
197   long param1;
198   long syscall;
199 };
200  
201 #endif
202
203
204 #endif /* _AFS_ARGS_H_ */