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