OpenAFS
OpenAFS distributed network file system
|
00001 /* 00002 * cellconfig.h: 00003 * This file is automatically generated; please do not edit it. 00004 */ 00005 /* Including ./cellconfig.p.h at beginning of cellconfig.h file. */ 00006 00007 /* 00008 * Copyright 2000, International Business Machines Corporation and others. 00009 * All Rights Reserved. 00010 * 00011 * This software has been released under the terms of the IBM Public 00012 * License. For details, see the LICENSE file in the top-level source 00013 * directory or online at http://www.openafs.org/dl/license10.html 00014 */ 00015 00016 /* 00017 cellconfig.h: 00018 00019 Interface to the routines used by the FileServer to manipulate the cell/server database 00020 for the Cellular Andrew system, along with an operation to determine the name of the 00021 local cell. Included are a string variable used to hold the local cell name, definitions for 00022 the database file format and routines for: 00023 1) Acquiring the local cell name. 00024 2) Reading in the cell/server database from disk. 00025 3) Reporting the set of servers associated with a given cell name. 00026 4) Printing out the contents of the cell/server database. 00027 5) Reclaiming the space used by an in-memory database. 00028 00029 Creation date: 00030 17 August 1987 00031 00032 --------------------------------------------------------------------------------------------------------------*/ 00033 00034 #ifndef __CELLCONFIG_AFS_INCL_ 00035 #define __CELLCONFIG_AFS_INCL_ 1 00036 00037 #ifndef IPPROTO_MAX 00038 /* get sockaddr_in */ 00039 #ifdef AFS_NT40_ENV 00040 #include <winsock2.h> 00041 #else 00042 #include <sys/types.h> 00043 #include <netinet/in.h> 00044 #endif 00045 #endif 00046 #include <rx/rx_opaque.h> 00047 #include <opr/queue.h> 00048 00049 #define MAXCELLCHARS 64 00050 #define MAXHOSTCHARS 64 00051 #define MAXHOSTSPERCELL 8 00052 00053 /* 00054 * Return codes. 00055 */ 00056 #define AFSCONF_SUCCESS 0 /* worked */ 00057 00058 /* 00059 * Complete server info for one cell. 00060 */ 00061 struct afsconf_cell { 00062 char name[MAXCELLCHARS]; /*Cell name */ 00063 short numServers; /*Num active servers for the cell */ 00064 short flags; /* useful flags */ 00065 struct sockaddr_in hostAddr[MAXHOSTSPERCELL]; /*IP addresses for cell's servers */ 00066 char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS]; /*Names for cell's servers */ 00067 char *linkedCell; /* Linked cell name, if any */ 00068 int timeout; /* Data timeout, if non-zero */ 00069 }; 00070 00071 #define AFSCONF_CELL_FLAG_DNS_QUERIED 1 00072 00073 struct afsconf_cellalias { 00074 char aliasName[MAXCELLCHARS]; 00075 char realName[MAXCELLCHARS]; 00076 }; 00077 00078 struct afsconf_entry { 00079 struct afsconf_entry *next; /* next guy in afsconf_dir */ 00080 struct afsconf_cell cellInfo; /* info for this cell */ 00081 }; 00082 00083 struct afsconf_aliasentry { 00084 struct afsconf_aliasentry *next; 00085 struct afsconf_cellalias aliasInfo; 00086 }; 00087 00091 #define AFSCONF_SECOPTS_NOAUTH 0x1 00092 #define AFSCONF_SECOPTS_LOCALAUTH 0x2 00093 #define AFSCONF_SECOPTS_ALWAYSENCRYPT 0x4 00094 #define AFSCONF_SECOPTS_FALLBACK_NULL 0x8 00095 typedef afs_uint32 afsconf_secflags; 00096 00097 struct afsconf_dir { 00098 char *name; /* pointer to dir prefix */ 00099 char *cellName; /* cell name, if any, we're in */ 00100 struct afsconf_entry *entries; /* list of cell entries */ 00101 struct opr_queue keyList; /* list of keys */ 00102 afs_int32 timeRead; /* time stamp of file last read */ 00103 afs_int32 timeCheck; /* time of last check for update */ 00104 struct afsconf_aliasentry *alias_entries; /* cell aliases */ 00105 afsconf_secflags securityFlags; 00106 }; 00107 00108 extern afs_int32 afsconf_FindService(const char *aname); 00109 extern const char *afsconf_FindIANAName(const char *aname); 00110 extern struct afsconf_dir *afsconf_Open(const char *adir); 00111 extern int afsconf_CellApply(struct afsconf_dir *adir, 00112 int (*aproc) (struct afsconf_cell * cell, 00113 void *arock, 00114 struct afsconf_dir * dir), 00115 void *arock); 00116 extern int afsconf_CellAliasApply(struct afsconf_dir *adir, 00117 int (*aproc) (struct afsconf_cellalias * 00118 alias, void *arock, 00119 struct afsconf_dir * dir), 00120 void *arock); 00121 extern int afsconf_GetExtendedCellInfo(struct afsconf_dir *adir, 00122 char *acellName, char *aservice, 00123 struct afsconf_cell *acellInfo, 00124 char clones[]); 00125 extern int afsconf_GetAfsdbInfo(char *acellName, char *aservice, 00126 struct afsconf_cell *acellInfo); 00127 extern int afsconf_GetCellInfo(struct afsconf_dir *adir, char *acellName, 00128 char *aservice, 00129 struct afsconf_cell *acellInfo); 00130 extern int afsconf_GetLocalCell(struct afsconf_dir *adir, 00131 char *aname, afs_int32 alen); 00132 extern int afsconf_Close(struct afsconf_dir *adir); 00133 extern int afsconf_UpToDate(void *rock); 00134 00135 struct afsconf_keys; 00136 extern int afsconf_GetKeys(struct afsconf_dir *adir, 00137 struct afsconf_keys *astr); 00138 00139 struct ktc_encryptionKey; 00140 extern afs_int32 afsconf_GetLatestKey(struct afsconf_dir *adir, 00141 afs_int32 * avno, 00142 struct ktc_encryptionKey *akey); 00143 extern int afsconf_GetKey(void *rock, int avno, 00144 struct ktc_encryptionKey *akey); 00145 extern int afsconf_AddKey(struct afsconf_dir *adir, afs_int32 akvno, 00146 char akey[8], afs_int32 overwrite); 00147 extern int afsconf_DeleteKey(struct afsconf_dir *adir, afs_int32 akvno); 00148 00149 struct afsconf_typedKey; 00150 struct afsconf_typedKeyList { 00151 int nkeys; 00152 struct afsconf_typedKey **keys; 00153 }; 00154 00155 typedef enum { 00156 afsconf_rxkad = 0, 00157 afsconf_rxgk =1 00158 } afsconf_keyType; 00159 00160 extern struct afsconf_typedKey * 00161 afsconf_typedKey_get(struct afsconf_typedKey *); 00162 extern void afsconf_typedKey_put(struct afsconf_typedKey **); 00163 extern struct afsconf_typedKey * 00164 afsconf_typedKey_new(afsconf_keyType type, int kvno, 00165 int subType, struct rx_opaque *key); 00166 extern void afsconf_typedKey_free(struct afsconf_typedKey **); 00167 00168 extern void afsconf_typedKey_values(struct afsconf_typedKey *key, 00169 afsconf_keyType *type, 00170 int *kvno, 00171 int *minorType, 00172 struct rx_opaque **keyMaterial); 00173 00174 extern int afsconf_GetAllKeys(struct afsconf_dir *, 00175 struct afsconf_typedKeyList **); 00176 extern int afsconf_GetKeysByType(struct afsconf_dir *dir, 00177 afsconf_keyType type, int kvno, 00178 struct afsconf_typedKeyList **); 00179 extern int afsconf_GetKeyByTypes(struct afsconf_dir *dir, 00180 afsconf_keyType type, int kvno, int subType, 00181 struct afsconf_typedKey **); 00182 extern int afsconf_GetLatestKeysByType(struct afsconf_dir *dir, 00183 afsconf_keyType type, 00184 struct afsconf_typedKeyList **); 00185 extern int afsconf_GetLatestKeyByTypes(struct afsconf_dir *dir, 00186 afsconf_keyType type, int subType, 00187 struct afsconf_typedKey **); 00188 extern void afsconf_PutTypedKeyList(struct afsconf_typedKeyList **keys); 00189 extern int afsconf_AddTypedKey(struct afsconf_dir *dir, 00190 struct afsconf_typedKey *key, 00191 int overwrite); 00192 extern int afsconf_DeleteKeyByType(struct afsconf_dir *dir, 00193 afsconf_keyType type, int kvno); 00194 extern int afsconf_DeleteKeyBySubType(struct afsconf_dir *dir, 00195 afsconf_keyType type, int kvno, 00196 int subType); 00197 00198 /* authcon.c */ 00199 struct rx_securityClass; 00200 extern afs_int32 afsconf_ServerAuth(void *arock, 00201 struct rx_securityClass **, 00202 afs_int32 *); 00203 extern afs_int32 afsconf_ClientAuth(void *arock, 00204 struct rx_securityClass **astr, 00205 afs_int32 * aindex); 00206 extern afs_int32 afsconf_ClientAuthSecure(void *arock, 00207 struct rx_securityClass **astr, 00208 afs_int32 * aindex); 00209 00210 00211 extern afs_int32 afsconf_ClientAuthToken(struct afsconf_cell *info, 00212 afsconf_secflags flags, 00213 struct rx_securityClass **sc, 00214 afs_int32 *scIndex, 00215 time_t *expires); 00216 00217 00218 extern afs_int32 afsconf_PickClientSecObj(struct afsconf_dir *dir, 00219 afsconf_secflags flags, 00220 struct afsconf_cell *info, 00221 char *cellName, 00222 struct rx_securityClass **sc, 00223 afs_int32 *scIndex, 00224 time_t *expires); 00225 00226 extern void afsconf_SetSecurityFlags(struct afsconf_dir *dir, 00227 afsconf_secflags flags); 00228 00229 extern void afsconf_BuildServerSecurityObjects(void *, 00230 struct rx_securityClass ***, 00231 afs_int32 *); 00232 00233 /* writeconfig.c */ 00234 int afsconf_SetExtendedCellInfo(struct afsconf_dir *adir, const char *apath, 00235 struct afsconf_cell *acellInfo, char clones[]); 00236 int afsconf_SetCellInfo(struct afsconf_dir *adir, const char *apath, 00237 struct afsconf_cell *acellInfo); 00238 00239 00240 /* userok.c */ 00241 00242 struct rx_call; 00243 struct rx_identity; 00244 extern int afsconf_CheckAuth(void *arock, struct rx_call *acall); 00245 extern int afsconf_GetNoAuthFlag(struct afsconf_dir *adir); 00246 extern void afsconf_SetNoAuthFlag(struct afsconf_dir *adir, int aflag); 00247 extern int afsconf_DeleteUser(struct afsconf_dir *adir, char *auser); 00248 extern int afsconf_DeleteIdentity(struct afsconf_dir *, struct rx_identity *); 00249 extern int afsconf_GetNthUser(struct afsconf_dir *adir, afs_int32 an, 00250 char *abuffer, afs_int32 abufferLen); 00251 extern int afsconf_GetNthIdentity(struct afsconf_dir *, int, 00252 struct rx_identity **); 00253 extern int afsconf_AddUser(struct afsconf_dir *adir, char *aname); 00254 extern int afsconf_AddIdentity(struct afsconf_dir *adir, struct rx_identity *); 00255 extern int afsconf_SuperUser(struct afsconf_dir *adir, struct rx_call *acall, 00256 char *namep); 00257 extern int afsconf_SuperIdentity(struct afsconf_dir *, struct rx_call *, 00258 struct rx_identity **); 00259 extern int afsconf_IsSuperIdentity(struct afsconf_dir *, struct rx_identity *); 00260 00261 /* some well-known ports and their names; new additions to table in cellconfig.c, too */ 00262 #define AFSCONF_FILESERVICE "afs" 00263 #define AFSCONF_FILEPORT 7000 00264 #define AFSCONF_CALLBACKSERVICE "afscb" 00265 #define AFSCONF_CALLBACKPORT 7001 00266 #define AFSCONF_PROTSERVICE "afsprot" 00267 #define AFSCONF_PROTPORT 7002 00268 #define AFSCONF_VLDBSERVICE "afsvldb" 00269 #define AFSCONF_VLDBPORT 7003 00270 #define AFSCONF_KAUTHSERVICE "afskauth" 00271 #define AFSCONF_KAUTHPORT 7004 00272 #define AFSCONF_VOLUMESERVICE "afsvol" 00273 #define AFSCONF_VOLUMEPORT 7005 00274 #define AFSCONF_ERRORSERVICE "afserror" 00275 #define AFSCONF_ERRORPORT 7006 00276 #define AFSCONF_NANNYSERVICE "afsnanny" 00277 #define AFSCONF_NANNYPORT 7007 00278 #define AFSCONF_UPDATESERVICE "afsupdate" 00279 #define AFSCONF_UPDATEPORT 7008 00280 #define AFSCONF_RMTSYSSERVICE "afsrmtsys" 00281 #define AFSCONF_RMTSYSPORT 7009 00282 #define AFSCONF_RSDBSERVICE "afsres" 00283 #define AFSCONF_RESPORT 7010 00284 #define AFSCONF_REMIODBSERVICE "afsremio" 00285 #define AFSCONF_REMIOPORT 7011 00286 00287 #endif /* __CELLCONFIG_AFS_INCL_ */ 00288 00289 /* End of prolog file ./cellconfig.p.h. */ 00290 00291 #define AFSCONF_FAILURE (70354688L) 00292 #define AFSCONF_NOTFOUND (70354689L) 00293 #define AFSCONF_UNKNOWN (70354690L) 00294 #define AFSCONF_NOCELL (70354691L) 00295 #define AFSCONF_SYNTAX (70354692L) 00296 #define AFSCONF_NODB (70354693L) 00297 #define AFSCONF_FULL (70354694L) 00298 #define AFSCONF_NOCELLDB (70354695L) 00299 #define AFSCONF_NO_SECURITY_CLASS (70354696L) 00300 #define AFSCONF_BADKEY (70354697L) 00301 extern void initialize_ACFG_error_table(void); 00302 #define ERROR_TABLE_BASE_ACFG (70354688L) 00303 00304 /* for compatibility with older versions... */ 00305 #define init_ACFG_err_tbl initialize_ACFG_error_table 00306 #define ACFG_err_base ERROR_TABLE_BASE_ACFG 00307 00308 /* for compatibility with other users... */ 00309 #define ERROR_TABLE_BASE_acfg (70354688L) 00310 #define init_acfg_err_tbl initialize_ACFG_error_table 00311 #define initialize_acfg_error_table initialize_ACFG_error_table 00312 #define acfg_err_base ERROR_TABLE_BASE_acfg