__P removal.
[dragonfly.git] / crypto / heimdal / lib / kafs / kafs.h
1 /*
2  * Copyright (c) 1995 - 2001 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.
12  * 
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.
16  * 
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.
20  * 
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.
32  *
33  * $Id: kafs.h,v 1.35 2001/09/10 16:05:31 assar Exp $
34  * $DragonFly: src/crypto/heimdal/lib/kafs/Attic/kafs.h,v 1.2 2003/11/14 03:54:29 dillon Exp $
35  */
36
37
38 #ifndef __KAFS_H
39 #define __KAFS_H
40
41 /* XXX must include krb5.h or krb.h */
42
43 /* sys/ioctl.h must be included manually before kafs.h */
44
45 /*
46  */
47 #define AFSCALL_PIOCTL 20
48 #define AFSCALL_SETPAG 21
49
50 #ifndef _VICEIOCTL
51 #define _VICEIOCTL(id)  ((unsigned int ) _IOW('V', id, struct ViceIoctl))
52 #endif /* _VICEIOCTL */
53
54 #define VIOCSETAL               _VICEIOCTL(1)
55 #define VIOCGETAL               _VICEIOCTL(2)
56 #define VIOCSETTOK              _VICEIOCTL(3)
57 #define VIOCGETVOLSTAT          _VICEIOCTL(4)
58 #define VIOCSETVOLSTAT          _VICEIOCTL(5)
59 #define VIOCFLUSH               _VICEIOCTL(6)
60 #define VIOCGETTOK              _VICEIOCTL(8)
61 #define VIOCUNLOG               _VICEIOCTL(9)
62 #define VIOCCKSERV              _VICEIOCTL(10)
63 #define VIOCCKBACK              _VICEIOCTL(11)
64 #define VIOCCKCONN              _VICEIOCTL(12)
65 #define VIOCWHEREIS             _VICEIOCTL(14)
66 #define VIOCACCESS              _VICEIOCTL(20)
67 #define VIOCUNPAG               _VICEIOCTL(21)
68 #define VIOCGETFID              _VICEIOCTL(22)
69 #define VIOCSETCACHESIZE        _VICEIOCTL(24)
70 #define VIOCFLUSHCB             _VICEIOCTL(25)
71 #define VIOCNEWCELL             _VICEIOCTL(26)
72 #define VIOCGETCELL             _VICEIOCTL(27)
73 #define VIOC_AFS_DELETE_MT_PT   _VICEIOCTL(28)
74 #define VIOC_AFS_STAT_MT_PT     _VICEIOCTL(29)
75 #define VIOC_FILE_CELL_NAME     _VICEIOCTL(30)
76 #define VIOC_GET_WS_CELL        _VICEIOCTL(31)
77 #define VIOC_AFS_MARINER_HOST   _VICEIOCTL(32)
78 #define VIOC_GET_PRIMARY_CELL   _VICEIOCTL(33)
79 #define VIOC_VENUSLOG           _VICEIOCTL(34)
80 #define VIOC_GETCELLSTATUS      _VICEIOCTL(35)
81 #define VIOC_SETCELLSTATUS      _VICEIOCTL(36)
82 #define VIOC_FLUSHVOLUME        _VICEIOCTL(37)
83 #define VIOC_AFS_SYSNAME        _VICEIOCTL(38)
84 #define VIOC_EXPORTAFS          _VICEIOCTL(39)
85 #define VIOCGETCACHEPARAMS      _VICEIOCTL(40)
86 #define VIOC_GCPAGS             _VICEIOCTL(48) 
87
88 struct ViceIoctl {
89   caddr_t in, out;
90   short in_size;
91   short out_size;
92 };
93
94 struct ClearToken {
95   int32_t AuthHandle;
96   char HandShakeKey[8];
97   int32_t ViceId;
98   int32_t BeginTimestamp;
99   int32_t EndTimestamp;
100 };
101
102 /* Use k_hasafs() to probe if the machine supports AFS syscalls.
103    The other functions will generate a SIGSYS if AFS is not supported */
104
105 int k_hasafs (void);
106
107 int krb_afslog (const char *cell, const char *realm);
108 int krb_afslog_uid (const char *cell, const char *realm, uid_t uid);
109 int krb_afslog_home (const char *cell, const char *realm,
110                          const char *homedir);
111 int krb_afslog_uid_home (const char *cell, const char *realm, uid_t uid,
112                              const char *homedir);
113
114 int krb_realm_of_cell (const char *cell, char **realm);
115
116 /* compat */
117 #define k_afsklog krb_afslog
118 #define k_afsklog_uid krb_afslog_uid
119
120 int k_pioctl (char *a_path,
121                   int o_opcode,
122                   struct ViceIoctl *a_paramsP,
123                   int a_followSymlinks);
124 int k_unlog (void);
125 int k_setpag (void);
126 int k_afs_cell_of_file (const char *path, char *cell, int len);
127
128
129
130 /* XXX */
131 #ifdef KFAILURE
132 #define KRB_H_INCLUDED
133 #endif
134
135 #ifdef KRB5_RECVAUTH_IGNORE_VERSION
136 #define KRB5_H_INCLUDED
137 #endif
138
139 #ifdef KRB_H_INCLUDED
140 int kafs_settoken (const char*, uid_t, CREDENTIALS*);
141 #endif
142
143 #ifdef KRB5_H_INCLUDED
144 krb5_error_code krb5_afslog_uid (krb5_context context,
145                                      krb5_ccache id,
146                                      const char *cell,
147                                      krb5_const_realm realm,
148                                      uid_t uid);
149 krb5_error_code krb5_afslog (krb5_context context,
150                                  krb5_ccache id, 
151                                  const char *cell,
152                                  krb5_const_realm realm);
153 krb5_error_code krb5_afslog_uid_home (krb5_context context,
154                                           krb5_ccache id,
155                                           const char *cell,
156                                           krb5_const_realm realm,
157                                           uid_t uid,
158                                           const char *homedir);
159
160 krb5_error_code krb5_afslog_home (krb5_context context,
161                                       krb5_ccache id,
162                                       const char *cell,
163                                       krb5_const_realm realm,
164                                       const char *homedir);
165
166 krb5_error_code krb5_realm_of_cell (const char *cell, char **realm);
167
168 #endif
169
170
171 #define _PATH_VICE              "/usr/vice/etc/"
172 #define _PATH_THISCELL          _PATH_VICE "ThisCell"
173 #define _PATH_CELLSERVDB        _PATH_VICE "CellServDB"
174 #define _PATH_THESECELLS        _PATH_VICE "TheseCells"
175
176 #define _PATH_ARLA_VICE         "/usr/arla/etc/"
177 #define _PATH_ARLA_THISCELL     _PATH_ARLA_VICE "ThisCell"
178 #define _PATH_ARLA_CELLSERVDB   _PATH_ARLA_VICE "CellServDB"
179 #define _PATH_ARLA_THESECELLS   _PATH_ARLA_VICE "TheseCells"
180
181 #define _PATH_OPENAFS_DEBIAN_VICE               "/etc/openafs/"
182 #define _PATH_OPENAFS_DEBIAN_THISCELL           _PATH_OPENAFS_DEBIAN_VICE "ThisCell"
183 #define _PATH_OPENAFS_DEBIAN_CELLSERVDB         _PATH_OPENAFS_DEBIAN_VICE "CellServDB"
184 #define _PATH_OPENAFS_DEBIAN_THESECELLS         _PATH_OPENAFS_DEBIAN_VICE "TheseCells"
185
186 #define _PATH_ARLA_DEBIAN_VICE                  "/etc/arla/"
187 #define _PATH_ARLA_DEBIAN_THISCELL              _PATH_ARLA_DEBIAN_VICE "ThisCell"
188 #define _PATH_ARLA_DEBIAN_CELLSERVDB            _PATH_ARLA_DEBIAN_VICE "CellServDB"
189 #define _PATH_ARLA_DEBIAN_THESECELLS            _PATH_ARLA_DEBIAN_VICE "TheseCells"
190
191 extern int _kafs_debug;
192
193 #endif /* __KAFS_H */