forget about device fd, we don't need it
[arla.git] / include / arla-pioctl.h
blob770e70585e9ba27f2246c12fcfe3eb800ab92c15
1 /*
2 * Copyright (c) 1995 - 2005 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
34 /* $Id$ */
36 #ifndef __ARLA_PIOCT_H
37 #define __ARLA_PIOCT_H
39 /* sys/ioctl.h must be included manually before kafs.h */
43 #define arla_AFSCALL_PIOCTL 20
44 #define arla_AFSCALL_SETPAG 21
46 struct arlaViceIoctl {
47 caddr_t in, out;
48 short in_size;
49 short out_size;
53 #define arla_VICEIOCTL(id) \
54 ((unsigned int ) _IOW('V', id, struct arlaViceIoctl))
55 #define arla_ARLAIOCTL(id) \
56 ((unsigned int ) _IOW('A', id, struct arlaViceIoctl))
57 #define arla_AFSCOMMONIOCTL(id) \
58 ((unsigned int ) _IOW('C', id, struct arlaViceIoctl))
61 * ioctls
64 #define ARLA_VIOCCLOSEWAIT arla_VICEIOCTL(1)
65 #define ARLA_VIOCABORT arla_VICEIOCTL(2)
66 #define ARLA_VIOIGETCELL arla_VICEIOCTL(3)
69 * pioctls
72 #define ARLA_VIOCSETAL arla_VICEIOCTL(1)
73 #define ARLA_VIOCGETAL arla_VICEIOCTL(2)
74 #define ARLA_VIOCSETTOK arla_VICEIOCTL(3)
75 #define ARLA_VIOCGETVOLSTAT arla_VICEIOCTL(4)
76 #define ARLA_VIOCSETVOLSTAT arla_VICEIOCTL(5)
77 #define ARLA_VIOCFLUSH arla_VICEIOCTL(6)
78 #define ARLA_VIOCSTAT arla_VICEIOCTL(7)
79 #define ARLA_VIOCGETTOK arla_VICEIOCTL(8)
80 #define ARLA_VIOCUNLOG arla_VICEIOCTL(9)
81 #define ARLA_VIOCCKSERV arla_VICEIOCTL(10)
82 #define ARLA_VIOCCKBACK arla_VICEIOCTL(11)
83 #define ARLA_VIOCCKCONN arla_VICEIOCTL(12)
84 #define ARLA_VIOCGETTIME arla_VICEIOCTL(13)
85 #define ARLA_VIOCWHEREIS arla_VICEIOCTL(14)
86 #define ARLA_VIOCPREFETCH arla_VICEIOCTL(15)
87 #define ARLA_VIOCNOP arla_VICEIOCTL(16)
88 #define ARLA_VIOCENGROUP arla_VICEIOCTL(17)
89 #define ARLA_VIOCDISGROUP arla_VICEIOCTL(18)
90 #define ARLA_VIOCLISTGROUPS arla_VICEIOCTL(19)
91 #define ARLA_VIOCACCESS arla_VICEIOCTL(20)
92 #define ARLA_VIOCUNPAG arla_VICEIOCTL(21)
93 #define ARLA_VIOCGETFID arla_VICEIOCTL(22)
94 #define ARLA_VIOCWAITFOREVER arla_VICEIOCTL(23)
95 #define ARLA_VIOCSETCACHESIZE arla_VICEIOCTL(24)
96 #define ARLA_VIOCFLUSHCB arla_VICEIOCTL(25)
97 #define ARLA_VIOCNEWCELL arla_VICEIOCTL(26)
98 #define ARLA_VIOCGETCELL arla_VICEIOCTL(27)
99 #define ARLA_VIOC_AFS_DELETE_MT_PT arla_VICEIOCTL(28)
100 #define ARLA_VIOC_AFS_STAT_MT_PT arla_VICEIOCTL(29)
101 #define ARLA_VIOC_FILE_CELL_NAME arla_VICEIOCTL(30)
102 #define ARLA_VIOC_GET_WS_CELL arla_VICEIOCTL(31)
103 #define ARLA_VIOC_AFS_MARINER_HOST arla_VICEIOCTL(32)
104 #define ARLA_VIOC_GET_PRIMARY_CELL arla_VICEIOCTL(33)
105 #define ARLA_VIOC_VENUSLOG arla_VICEIOCTL(34)
106 #define ARLA_VIOC_GETCELLSTATUS arla_VICEIOCTL(35)
107 #define ARLA_VIOC_SETCELLSTATUS arla_VICEIOCTL(36)
108 #define ARLA_VIOC_FLUSHVOLUME arla_VICEIOCTL(37)
109 #define ARLA_VIOC_AFS_SYSNAME arla_VICEIOCTL(38)
110 #define ARLA_VIOC_EXPORTAFS arla_VICEIOCTL(39)
111 #define ARLA_VIOCGETCACHEPARAMS arla_VICEIOCTL(40)
112 #define ARLA_VIOCGETVCXSTATUS arla_VICEIOCTL(41)
113 #define ARLA_VIOC_SETSPREFS33 arla_VICEIOCTL(42)
114 #define ARLA_VIOC_GETSPREFS arla_VICEIOCTL(43)
115 #define ARLA_VIOC_GAG arla_VICEIOCTL(44)
116 #define ARLA_VIOC_TWIDDLE arla_VICEIOCTL(45)
117 #define ARLA_VIOC_SETSPREFS arla_VICEIOCTL(46)
118 #define ARLA_VIOC_STORBEHIND arla_VICEIOCTL(47)
119 #define ARLA_VIOC_GCPAGS arla_VICEIOCTL(48)
120 #define ARLA_VIOC_GETINITPARAMS arla_VICEIOCTL(49)
121 #define ARLA_VIOC_GETCPREFS arla_VICEIOCTL(50)
122 #define ARLA_VIOC_SETCPREFS arla_VICEIOCTL(51)
123 #define ARLA_VIOC_FLUSHMOUNT arla_VICEIOCTL(52)
124 #define ARLA_VIOC_RXSTATPROC arla_VICEIOCTL(53)
125 #define ARLA_VIOC_RXSTATPEER arla_VICEIOCTL(54)
127 #define ARLA_VIOC_GETRXKCRYPT arla_VICEIOCTL(55) /* 48 in some implementations */
128 #define ARLA_VIOC_SETRXKCRYPT arla_VICEIOCTL(56) /* with cryptosupport in afs */
130 /* arla specific */
132 #define ARLA_VIOC_FPRIOSTATUS arla_VICEIOCTL(57) /* arla: set file prio */
133 #define ARLA_VIOC_FHGET arla_VICEIOCTL(58) /* arla: fallback getfh */
134 #define ARLA_VIOC_FHOPEN arla_VICEIOCTL(59) /* arla: fallback fhopen */
135 #define ARLA_VIOC_NNPFSDEBUG arla_VICEIOCTL(60) /* arla: controls nnpfsdebug */
136 #define ARLA_VIOC_ARLADEBUG arla_VICEIOCTL(61) /* arla: controls arla debug */
137 #define ARLA_VIOC_AVIATOR arla_VICEIOCTL(62) /* arla: debug interface */
138 #define ARLA_VIOC_NNPFSDEBUG_PRINT arla_VICEIOCTL(63) /* arla: print nnpfs status */
139 #define ARLA_VIOC_CALCULATE_CACHE arla_VICEIOCTL(64) /* arla: force cache check */
140 #define ARLA_VIOC_BREAKCALLBACK arla_VICEIOCTL(65) /* arla: break callback */
142 #define ARLA_VIOC_PREFETCHTAPE arla_VICEIOCTL(66) /* MR-AFS prefetch from tape */
143 #define ARLA_VIOC_RESIDENCY_CMD arla_VICEIOCTL(67) /* generic MR-AFS cmds */
144 #define ARLA_VIOC_GETVCXSTATUS2 arla_VICEIOCTL(69) /* vcache statistics */
147 #define ARLA_AIOC_STATISTICS arla_ARLAIOCTL(1) /* arla: fetch statistics */
148 #define ARLA_AIOC_PTSNAMETOID arla_ARLAIOCTL(2) /* arla: pts name to id */
149 #define ARLA_AIOC_GETCACHEPARAMS arla_ARLAIOCTL(3) /* arla: get cache params */
150 #define ARLA_AIOC_GETPREFETCH arla_ARLAIOCTL(4) /* arla: get prefetch value */
151 #define ARLA_AIOC_SETPREFETCH arla_ARLAIOCTL(5) /* arla: set prefetch value */
152 #define ARLA_AFSCOMMONIOC_GKK5SETTOK arla_ARLAIOCTL(6) /* gk k5 set token */
153 #define ARLA_AFSCOMMONIOC_GKLISTTOK arla_ARLAIOCTL(7) /* gk list token */
154 #define ARLA_AIOC_SETCACHEPARAMS arla_ARLAIOCTL(8) /* arla: set cache params */
155 #define ARLA_AIOC_CONNECTMODE arla_ARLAIOCTL(9)
157 #define ARLA_AFSCOMMONIOC_NEWALIAS arla_AFSCOMMONIOCTL(1) /* common: ... */
158 #define ARLA_AFSCOMMONIOC_LISTALIAS arla_AFSCOMMONIOCTL(2) /* common: ... */
160 #define ARLA_VIOCGETTOK2 arla_AFSCOMMONIOCTL(7)
161 #define ARLA_VIOCSETTOK2 arla_AFSCOMMONIOCTL(8)
163 #define ARLA_TOKEN_TYPE_NULL 0
164 /* secindex 1 was used for vab */
165 #define ARLA_TOKEN_TYPE_KAD 2
166 /* secindex 3 was used for broken rxkad cryptall */
167 #define ARLA_TOKEN_TYPE_K5 4
168 #define ARLA_TOKEN_TYPE_GK 5
171 * GETCELLSTATUS flags
174 #define arla_CELLSTATUS_PRIMARY 0x01 /* this is the `primary' cell */
175 #define arla_CELLSTATUS_SETUID 0x02 /* setuid honored for this cell */
176 #define arla_CELLSTATUS_OBSOLETE_VL 0x04 /* uses obsolete VL servers */
179 * ARLA_AIOC_CONNECTMODE arguments
182 #define arla_CONNMODE_PROBE 0
183 #define arla_CONNMODE_CONN 1
184 #define arla_CONNMODE_FETCH 2
185 #define arla_CONNMODE_DISCONN 3
186 #define arla_CONNMODE_PARCONNECTED 4
187 #define arla_CONNMODE_CONN_WITHCALLBACKS 5
190 * The struct for VIOC_FPRIOSTATUS
193 #define arla_FPRIO_MAX 100
194 #define arla_FPRIO_MIN 0
195 #define arla_FPRIO_DEFAULT arla_FPRIO_MAX
197 #define arla_FPRIO_GET 0
198 #define arla_FPRIO_SET 1
199 #define arla_FPRIO_GETMAX 2
200 #define arla_FPRIO_SETMAX 3
202 struct arla_vioc_fprio {
203 int16_t cmd;
204 int16_t prio;
205 int32_t Cell;
206 int32_t Volume;
207 int32_t Vnode;
208 int32_t Unique;
213 * Flags for VIOCCKSERV
216 #define arla_CKSERV_DONTPING 1
217 #define arla_CKSERV_FSONLY 2
219 #define arla_CKSERV_MAXSERVERS 16 /* limitation of VIOCCKSERV number of
220 returned servers */
223 * for AIOC_STATISTICS
226 #define arla_STATISTICS_OPCODE_LIST 0
227 #define arla_STATISTICS_OPCODE_GETENTRY 1
229 #define arla_STATISTICS_REQTYPE_FETCHSTATUS 1
230 #define arla_STATISTICS_REQTYPE_FETCHDATA 2
231 #define arla_STATISTICS_REQTYPE_BULKSTATUS 3
232 #define arla_STATISTICS_REQTYPE_STOREDATA 4
233 #define arla_STATISTICS_REQTYPE_STORESTATUS 5
236 * for AIOC_GETCACHEPARAMS
239 #define arla_GETCACHEPARAMS_OPCODE_HIGHBYTES 1
240 #define arla_GETCACHEPARAMS_OPCODE_USEDBYTES 2
241 #define arla_GETCACHEPARAMS_OPCODE_LOWBYTES 3
242 #define arla_GETCACHEPARAMS_OPCODE_HIGHVNODES 4
243 #define arla_GETCACHEPARAMS_OPCODE_USEDVNODES 5
244 #define arla_GETCACHEPARAMS_OPCODE_LOWVNODES 6
247 * for AIOC_SETCACHEPARAMS
250 #define arla_SETCACHEPARAMS_OPCODE_BYTES 1
251 #define arla_SETCACHEPARAMS_OPCODE_VNODES 2
254 struct arla_ClearToken {
255 int32_t AuthHandle;
256 char HandShakeKey[8];
257 int32_t ViceId;
258 int32_t BeginTimestamp;
259 int32_t EndTimestamp;
263 * for ARLA_VIOC_GETVCXSTATUS2
266 struct afs_vcxstat2 {
267 int32_t callerAccess;
268 int32_t cbExpires;
269 int32_t anyAccess;
270 char mvstat;
274 #endif /* __ARLA_PIOCT_H */