ubik: Introduce new beacon lock
[openafs.git] / src / ubik / ubik.p.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 #ifndef UBIK_H
11 #define UBIK_H
12
13 #include <stdarg.h>
14
15 #include <ubik_int.h>
16
17 /*! \name ubik_trans types */
18 #define UBIK_READTRANS      0
19 #define UBIK_WRITETRANS     1
20 /*\}*/
21
22 /*! \name ubik_lock types */
23 #define LOCKREAD            1
24 #define LOCKWRITE           2
25 #define LOCKWAIT            3
26 /*\}*/
27
28 /*! \name ubik client flags */
29 #define UPUBIKONLY          1   /*!< only check servers presumed functional */
30 #define UBIK_CALL_NEW       2   /*!< use the semantics of ubik_Call_New */
31 /*\}*/
32
33 /*! \name RX services types */
34 #define VOTE_SERVICE_ID     50
35 #define DISK_SERVICE_ID     51
36 #define USER_SERVICE_ID     52  /*!< Since most applications use same port! */
37 /*\}*/
38
39 #define UBIK_MAGIC      0x354545
40
41 /*! \name global ubik parameters */
42 #define MAXSERVERS          20  /*!< max number of servers */
43 /*\}*/
44
45 /*! version comparison macro */
46 #define vcmp(a,b) ((a).epoch == (b).epoch? ((a).counter - (b).counter) : ((a).epoch - (b).epoch))
47
48 /*! \name ubik_client state bits */
49 #define CFLastFailed        1   /*!< last call failed to this guy (to detect down hosts) */
50 /*\}*/
51
52 #include <afs/afs_assert.h>
53 #ifdef AFS_PTHREAD_ENV
54 #include <pthread.h>
55 #else
56 #include <lwp.h>
57 #endif
58
59 /*!
60  * \brief per-client structure for ubik
61  */
62 struct ubik_client {
63     short initializationState;  /*!< ubik client init state */
64     short states[MAXSERVERS];   /*!< state bits */
65     struct rx_connection *conns[MAXSERVERS];
66     afs_int32 syncSite;
67 #ifdef AFS_PTHREAD_ENV
68     pthread_mutex_t cm;
69 #endif
70 };
71
72 #ifdef AFS_PTHREAD_ENV
73 #define LOCK_UBIK_CLIENT(client) MUTEX_ENTER(&client->cm)
74 #define UNLOCK_UBIK_CLIENT(client) MUTEX_EXIT(&client->cm)
75 #else
76 #define LOCK_UBIK_CLIENT(client)
77 #define UNLOCK_UBIK_CLIENT(client)
78 #endif
79
80 #define ubik_GetRPCConn(astr,aindex)    ((aindex) >= MAXSERVERS? 0 : (astr)->conns[aindex])
81 #define ubik_GetRPCHost(astr,aindex)    ((aindex) >= MAXSERVERS? 0 : (astr)->hosts[aindex])
82
83 /*!
84  * \brief ubik header file structure
85  */
86 struct ubik_hdr {
87     afs_int32 magic;            /*!< magic number */
88     short pad1;                 /*!< some 0-initd padding */
89     short size;                 /*!< header allocation size */
90     struct ubik_version version;        /*!< the version for this file */
91 };
92
93 /*!
94  * \brief representation of a ubik transaction
95  */
96 struct ubik_trans {
97     struct ubik_dbase *dbase;   /*!< corresponding database */
98     struct ubik_trans *next;    /*!< in the list */
99     afs_int32 locktype;         /*!< transaction lock */
100     struct ubik_trunc *activeTruncs;    /*!< queued truncates */
101     struct ubik_tid tid;        /*!< transaction id of this trans (if write trans.) */
102     afs_int32 minCommitTime;    /*!< time before which this trans can't commit */
103     afs_int32 seekFile;         /*!< seek ptr: file number */
104     afs_int32 seekPos;          /*!< seek ptr: offset therein */
105     short flags;                /*!< trans flag bits */
106     char type;                  /*!< type of trans */
107     iovec_wrt iovec_info;
108     iovec_buf iovec_data;
109 };
110
111 /*!
112  * \brief representation of a truncation operation
113  */
114 struct ubik_trunc {
115     struct ubik_trunc *next;
116     afs_int32 file;             /*!< file to truncate */
117     afs_int32 length;           /*!< new size */
118 };
119
120 struct ubik_stat {
121     afs_int32 size;
122     afs_int32 mtime;
123 };
124
125 #if defined(UKERNEL)
126 #include "afs/lock.h"
127 #else /* defined(UKERNEL) */
128 #include <lock.h>               /* just to make sure we've got this */
129 #endif /* defined(UKERNEL) */
130
131 /*!
132  * \brief representation of a ubik database.
133  *
134  * Contains info on low-level disk access routines
135  * for use by disk transaction module.
136  */
137 struct ubik_dbase {
138     char *pathName;             /*!< root name for dbase */
139     struct ubik_trans *activeTrans;     /*!< active transaction list */
140     struct ubik_version version;        /*!< version number */
141 #ifdef AFS_PTHREAD_ENV
142     pthread_mutex_t versionLock;        /*!< lock on version number */
143 #elif defined(UKERNEL)
144     struct afs_lock versionLock;        /*!< lock on version number */
145 #else                           /* defined(UKERNEL) */
146     struct Lock versionLock;    /*!< lock on version number */
147 #endif                          /* defined(UKERNEL) */
148     afs_int32 tidCounter;       /*!< last RW or RO trans tid counter */
149     afs_int32 writeTidCounter;  /*!< last write trans tid counter */
150     afs_int32 flags;            /*!< flags */
151     /* physio procedures */
152     int (*read) (struct ubik_dbase * adbase, afs_int32 afile, void *abuffer,
153                  afs_int32 apos, afs_int32 alength);
154     int (*write) (struct ubik_dbase * adbase, afs_int32 afile, void *abuffer,
155                   afs_int32 apos, afs_int32 alength);
156     int (*truncate) (struct ubik_dbase * adbase, afs_int32 afile,
157                      afs_int32 asize);
158     int (*sync) (struct ubik_dbase * adbase, afs_int32 afile);
159     int (*stat) (struct ubik_dbase * adbase, afs_int32 afid,
160                  struct ubik_stat * astat);
161     void (*open) (struct ubik_dbase * adbase, afs_int32 afid);
162     int (*setlabel) (struct ubik_dbase * adbase, afs_int32 afile, struct ubik_version * aversion);      /*!< set the version label */
163     int (*getlabel) (struct ubik_dbase * adbase, afs_int32 afile, struct ubik_version * aversion);      /*!< retrieve the version label */
164     int (*getnfiles) (struct ubik_dbase * adbase);      /*!< find out number of files */
165     short readers;              /*!< number of current read transactions */
166     struct ubik_version cachedVersion;  /*!< version of caller's cached data */
167 #ifdef UKERNEL
168     struct afs_lock cache_lock;
169 #else
170     struct Lock cache_lock; /*!< protects cached application data */
171 #endif
172 #ifdef AFS_PTHREAD_ENV
173     pthread_cond_t version_cond;    /*!< condition variable to manage changes to version */
174     pthread_cond_t flags_cond;      /*!< condition variable to manage changes to flags */
175 #endif
176 };
177
178 /**
179  * ubik_CheckCache callback function.
180  *
181  * @param[in] atrans  ubik transaction
182  * @param[in] rock    rock passed to ubik_CheckCache
183  *
184  * @return operation status
185  *   @retval 0        cache was read properly
186  */
187 typedef int (*ubik_updatecache_func) (struct ubik_trans *atrans, void *rock);
188
189 /*! \name procedures for automatically authenticating ubik connections */
190 extern int (*ubik_CRXSecurityProc) (void *, struct rx_securityClass **,
191                                     afs_int32 *);
192 extern void *ubik_CRXSecurityRock;
193 extern int (*ubik_SRXSecurityProc) (void *, struct rx_securityClass **,
194                                     afs_int32 *);
195 extern void *ubik_SRXSecurityRock;
196 extern int (*ubik_CheckRXSecurityProc) (void *, struct rx_call *);
197 extern void *ubik_CheckRXSecurityRock;
198
199 extern void ubik_SetClientSecurityProcs(int (*scproc)(void *,
200                                                       struct rx_securityClass **,
201                                                       afs_int32 *),
202                                         int (*checkproc) (void *),
203                                         void *rock);
204 extern void ubik_SetServerSecurityProcs
205                 (void (*buildproc) (void *,
206                                     struct rx_securityClass ***,
207                                     afs_int32 *),
208                  int (*checkproc) (void *, struct rx_call *),
209                  void *rock);
210
211 /*\}*/
212
213 /*
214  * For applications that make use of ubik_BeginTransReadAnyWrite, writing
215  * processes must not update the application-level cache as they write,
216  * or else readers can read the new cache before the data is committed to
217  * the db. So, when a commit occurs, the cache must be updated right then.
218  * If set, this function will be called during commits of write transactions,
219  * to update the application-level cache after a write. This will be called
220  * immediately after the local disk commit succeeds, and it will be called
221  * with a lock held that prevents other threads from reading from the cache
222  * or the db in general.
223  *
224  * Note that this function MUST be set in order to make use of
225  * ubik_BeginTransReadAnyWrite.
226  */
227 extern int (*ubik_SyncWriterCacheProc) (void);
228
229 /****************INTERNALS BELOW ****************/
230
231 #ifdef UBIK_INTERNALS
232 /*! \name some ubik parameters */
233 #define UBIK_PAGESIZE       1024        /*!< fits in current r packet */
234 #define UBIK_LOGPAGESIZE    10  /*!< base 2 log thereof */
235 #define NBUFFERS            20  /*!< number of 1K buffers */
236 #define HDRSIZE             64  /*!< bytes of header per dbfile */
237 /*\}*/
238
239 /*! \name ubik_dbase flags */
240 #define DBWRITING           1   /*!< are any write trans. in progress */
241 /*\}*/
242
243 /*!\name ubik trans flags */
244 #define TRDONE              1   /*!< commit or abort done */
245 #define TRABORT             2   /*!< if #TRDONE, tells if aborted */
246 #define TRREADANY           4   /*!< read any data available in trans */
247 #define TRCACHELOCKED       32  /*!< this trans has locked dbase->cache_lock
248                                  *   (meaning, this trans has called
249                                  *   ubik_CheckCache at some point */
250 #define TRREADWRITE         64  /*!< read even if there's a conflicting ubik-
251                                  *   level write lock */
252 /*\}*/
253
254 /*! \name ubik_lock flags */
255 #define LWANT               1
256 /*\}*/
257
258 /*! \name ubik system database numbers */
259 #define LOGFILE             (-1)
260 /*\}*/
261
262 /*! \name define log opcodes */
263 #define LOGNEW              100 /*!< start transaction */
264 #define LOGEND              101 /*!< commit (good) end transaction */
265 #define LOGABORT            102 /*!< abort (fail) transaction */
266 #define LOGDATA             103 /*!< data */
267 #define LOGTRUNCATE         104 /*!< truncate operation */
268 /*\}*/
269
270 /*!
271  * \name timer constants
272  * time constant for replication algorithms: the R time period is 20 seconds.  Both
273  * #SMALLTIME and #BIGTIME must be larger than #RPCTIMEOUT+max(#RPCTIMEOUT, #POLLTIME),
274  * so that timeouts do not prevent us from getting through to our servers in time.
275  *
276  * We use multi-R to time out multiple down hosts concurrently.
277  * The only other restrictions:  #BIGTIME > #SMALLTIME and
278  * #BIGTIME-#SMALLTIME > #MAXSKEW (the clock skew).
279  */
280 #define MAXSKEW 10
281 #define POLLTIME 15
282 #define RPCTIMEOUT 20
283 #define BIGTIME 75
284 #define SMALLTIME 60
285 /*\}*/
286
287 /*!
288  * \brief the per-server state, used by the sync site to keep track of its charges
289  */
290 struct ubik_server {
291     struct ubik_server *next;   /*!< next ptr */
292     afs_uint32 addr[UBIK_MAX_INTERFACE_ADDR];   /*!< network order, addr[0] is primary */
293     afs_int32 lastVoteTime;     /*!< last time yes vote received */
294     afs_int32 lastBeaconSent;   /*!< last time beacon attempted */
295     struct ubik_version version;        /*!< version, only used during recovery */
296     struct rx_connection *vote_rxcid;   /*!< cid to use to contact dude for votes */
297     struct rx_connection *disk_rxcid;   /*!< cid to use to contact dude for disk reqs */
298     char lastVote;              /*!< true if last vote was yes */
299     char up;                    /*!< is it up? */
300     char beaconSinceDown;       /*!< did beacon get through since last crash? */
301     char currentDB;             /*!< is dbase up-to-date */
302     char magic;                 /*!< the one whose vote counts twice */
303     char isClone;               /*!< is only a clone, doesn't vote */
304 };
305
306 /*! \name hold and release functions on a database */
307 #ifdef AFS_PTHREAD_ENV
308 # define        DBHOLD(a)       MUTEX_ENTER(&((a)->versionLock))
309 # define        DBRELE(a)       MUTEX_EXIT(&((a)->versionLock))
310 #else /* !AFS_PTHREAD_ENV */
311 # define        DBHOLD(a)       ObtainWriteLock(&((a)->versionLock))
312 # define        DBRELE(a)       ReleaseWriteLock(&((a)->versionLock))
313 #endif /* !AFS_PTHREAD_ENV */
314 /*\}*/
315
316 /* globals */
317
318 /*!name list of all servers in the system */
319 extern struct ubik_server *ubik_servers;
320 extern char amIClone;
321 /*\}*/
322
323 /*! \name network port info */
324 extern short ubik_callPortal;
325 /*\}*/
326
327 /*! \name urecovery state bits for sync site */
328 #define UBIK_RECSYNCSITE        1       /* am sync site */
329 #define UBIK_RECFOUNDDB         2       /* found acceptable dbase from quorum */
330 #define UBIK_RECHAVEDB          4       /* fetched best dbase */
331 #define UBIK_RECLABELDB         8       /* relabelled dbase */
332 #define UBIK_RECSENTDB          0x10    /* sent best db to *everyone* */
333 #define UBIK_RECSBETTER         UBIK_RECLABELDB /* last state */
334 /*\}*/
335
336 extern afs_int32 ubik_quorum;   /* min hosts in quorum */
337 extern struct ubik_dbase *ubik_dbase;   /* the database handled by this server */
338 extern afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR];   /* this host addr, in net order */
339 extern int ubik_amSyncSite;     /* sleep on this waiting to be sync site */
340 extern struct ubik_stats {      /* random stats */
341     afs_int32 escapes;
342 } ubik_stats;
343 extern afs_int32 ubik_epochTime;        /* time when this site started */
344 extern afs_int32 urecovery_state;       /* sync site recovery process state */
345 extern struct ubik_trans *ubik_currentTrans;    /* current trans */
346 extern struct ubik_version ubik_dbVersion;      /* sync site's dbase version */
347 extern afs_int32 ubik_debugFlag;        /* ubik debug flag */
348 extern int ubikPrimaryAddrOnly; /* use only primary address */
349
350 /* this extern gives the sync site's db version, with epoch of 0 if none yet */
351
352 /*!
353  * \brief Global beacon data.  All values are protected by beacon_lock
354  * This lock also protects some values in the ubik_server structures:
355  *      lastVoteTime
356  *      lastBeaconSent
357  *      lastVote
358  *      up
359  *      beaconSinceDown
360  */
361 struct beacon_data {
362 #ifdef AFS_PTHREAD_ENV
363     pthread_mutex_t beacon_lock;
364 #endif
365     int ubik_amSyncSite;                /*!< flag telling if I'm sync site */
366     afs_int32 syncSiteUntil;            /*!< valid only if amSyncSite */
367 };
368
369 #define UBIK_BEACON_LOCK MUTEX_ENTER(&beacon_globals.beacon_lock)
370 #define UBIK_BEACON_UNLOCK MUTEX_EXIT(&beacon_globals.beacon_lock)
371
372 /* phys.c */
373 extern int uphys_stat(struct ubik_dbase *adbase, afs_int32 afid,
374                       struct ubik_stat *astat);
375 extern int uphys_read(struct ubik_dbase *adbase, afs_int32 afile,
376                       void *abuffer, afs_int32 apos,
377                       afs_int32 alength);
378 extern int uphys_write(struct ubik_dbase *adbase, afs_int32 afile,
379                        void *abuffer, afs_int32 apos,
380                        afs_int32 alength);
381 extern int uphys_truncate(struct ubik_dbase *adbase, afs_int32 afile,
382                           afs_int32 asize);
383 extern int uphys_getnfiles(struct ubik_dbase *adbase);
384 extern int uphys_getlabel(struct ubik_dbase *adbase, afs_int32 afile,
385                           struct ubik_version *aversion);
386 extern int uphys_setlabel(struct ubik_dbase *adbase, afs_int32 afile,
387                           struct ubik_version *aversion);
388 extern int uphys_sync(struct ubik_dbase *adbase, afs_int32 afile);
389 extern void uphys_invalidate(struct ubik_dbase *adbase,
390                              afs_int32 afid);
391
392 /*! \name recovery.c */
393 extern int urecovery_ResetState(void);
394 extern int urecovery_LostServer(struct ubik_server *server);
395 extern int urecovery_AllBetter(struct ubik_dbase *adbase,
396                                int areadAny);
397 extern int urecovery_AbortAll(struct ubik_dbase *adbase);
398 extern int urecovery_CheckTid(struct ubik_tid *atid, int abortalways);
399 extern int urecovery_Initialize(struct ubik_dbase *adbase);
400 extern void *urecovery_Interact(void *);
401 extern int DoProbe(struct ubik_server *server);
402 /*\}*/
403
404 /*! \name ubik.c */
405 extern afs_int32 ContactQuorum_NoArguments(afs_int32 (*proc)
406                                                        (struct rx_connection *,
407                                                         ubik_tid *),
408                                            struct ubik_trans *atrans,
409                                            int aflags);
410
411 extern afs_int32 ContactQuorum_DISK_Lock(struct ubik_trans *atrans,
412                                          int aflags,
413                                          afs_int32 file, afs_int32 position,
414                                          afs_int32 length, afs_int32 type);
415
416 extern afs_int32 ContactQuorum_DISK_Write(struct ubik_trans *atrans,
417                                           int aflags,
418                                           afs_int32 file, afs_int32 position,
419                                           bulkdata *data);
420
421 extern afs_int32 ContactQuorum_DISK_Truncate(struct ubik_trans *atrans,
422                                              int aflags,
423                                              afs_int32 file, afs_int32 length);
424
425 extern afs_int32 ContactQuorum_DISK_WriteV(struct ubik_trans *atrans,
426                                            int aflags,
427                                            iovec_wrt * io_vector,
428                                            iovec_buf *io_buffer);
429
430 extern afs_int32 ContactQuorum_DISK_SetVersion(struct ubik_trans *atrans,
431                                                int aflags,
432                                                ubik_version *OldVersion,
433                                                ubik_version *NewVersion);
434
435 extern void panic(char *format, ...)
436     AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
437
438 extern afs_uint32 ubikGetPrimaryInterfaceAddr(afs_uint32 addr);
439
440 extern int ubik_CheckAuth(struct rx_call *);
441
442 /*\}*/
443
444 /*! \name beacon.c */
445 struct afsconf_cell;
446 extern void ubeacon_InitSecurityClass(void);
447 extern void ubeacon_ReinitServer(struct ubik_server *ts);
448 extern void ubeacon_Debug(struct ubik_debug *aparm);
449 extern int ubeacon_AmSyncSite(void);
450 extern int ubeacon_InitServerListByInfo(afs_uint32 ame,
451                                         struct afsconf_cell *info,
452                                         char clones[]);
453 extern int ubeacon_InitServerList(afs_uint32 ame, afs_uint32 aservers[]);
454 extern void *ubeacon_Interact(void *);
455 extern struct beacon_data beacon_globals;
456
457 /*\}*/
458
459 /*! \name disk.c */
460 extern int udisk_Init(int nBUffers);
461 extern void udisk_Debug(struct ubik_debug *aparm);
462 extern int udisk_Invalidate(struct ubik_dbase *adbase, afs_int32 afid);
463 extern int udisk_read(struct ubik_trans *atrans, afs_int32 afile,
464                       void *abuffer, afs_int32 apos, afs_int32 alen);
465 extern int udisk_truncate(struct ubik_trans *atrans, afs_int32 afile,
466                           afs_int32 alength);
467 extern int udisk_write(struct ubik_trans *atrans, afs_int32 afile,
468                        void *abuffer, afs_int32 apos, afs_int32 alen);
469 extern int udisk_begin(struct ubik_dbase *adbase, int atype,
470                        struct ubik_trans **atrans);
471 extern int udisk_commit(struct ubik_trans *atrans);
472 extern int udisk_abort(struct ubik_trans *atrans);
473 extern int udisk_end(struct ubik_trans *atrans);
474 /*\}*/
475
476 /*! \name lock.c */
477 extern void ulock_Init(void);
478 extern int  ulock_getLock(struct ubik_trans *atrans, int atype, int await);
479 extern void ulock_relLock(struct ubik_trans *atrans);
480 extern void ulock_Debug(struct ubik_debug *aparm);
481 /*\}*/
482
483 /*! \name vote.c */
484 extern int uvote_ShouldIRun(void);
485 extern afs_int32 uvote_GetSyncSite(void);
486 extern int uvote_Init(void);
487 extern void ubik_vprint(const char *format, va_list ap)
488     AFS_ATTRIBUTE_FORMAT(__printf__, 1, 0);
489
490 extern void ubik_print(const char *format, ...)
491     AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
492
493 extern void ubik_dprint(const char *format, ...)
494     AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
495
496 extern void ubik_dprint_25(const char *format, ...)
497     AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
498 /*\}*/
499
500 #endif /* UBIK_INTERNALS */
501
502 extern afs_int32 ubik_nBuffers;
503
504 /*!
505  * \name Public function prototypes
506  */
507
508 /*! \name ubik.c */
509 struct afsconf_cell;
510 extern int ubik_ServerInitByInfo(afs_uint32 myHost, short myPort,
511                                  struct afsconf_cell *info, char clones[],
512                                  const char *pathName,
513                                  struct ubik_dbase **dbase);
514 extern int ubik_ServerInit(afs_uint32 myHost, short myPort,
515                            afs_uint32 serverList[],
516                            const char *pathName, struct ubik_dbase **dbase);
517 extern int ubik_BeginTrans(struct ubik_dbase *dbase,
518                            afs_int32 transMode, struct ubik_trans **transPtr);
519 extern int ubik_BeginTransReadAny(struct ubik_dbase *dbase,
520                                   afs_int32 transMode,
521                                   struct ubik_trans **transPtr);
522 extern int ubik_BeginTransReadAnyWrite(struct ubik_dbase *dbase,
523                                        afs_int32 transMode,
524                                        struct ubik_trans **transPtr);
525 extern int ubik_AbortTrans(struct ubik_trans *transPtr);
526
527 extern int ubik_EndTrans(struct ubik_trans *transPtr);
528 extern int ubik_Read(struct ubik_trans *transPtr, void *buffer,
529                      afs_int32 length);
530 extern int ubik_Flush(struct ubik_trans *transPtr);
531 extern int ubik_Write(struct ubik_trans *transPtr, void *buffer,
532                       afs_int32 length);
533 extern int ubik_Seek(struct ubik_trans *transPtr, afs_int32 fileid,
534                      afs_int32 position);
535 extern int ubik_Tell(struct ubik_trans *transPtr, afs_int32 * fileid,
536                      afs_int32 * position);
537 extern int ubik_Truncate(struct ubik_trans *transPtr,
538                          afs_int32 length);
539 extern int ubik_SetLock(struct ubik_trans *atrans, afs_int32 apos,
540                         afs_int32 alen, int atype);
541 extern int ubik_WaitVersion(struct ubik_dbase *adatabase,
542                             struct ubik_version *aversion);
543 extern int ubik_GetVersion(struct ubik_trans *atrans,
544                            struct ubik_version *avers);
545 extern int ubik_CheckCache(struct ubik_trans *atrans,
546                            ubik_updatecache_func check,
547                            void *rock);
548 /*\}*/
549
550 /*! \name ubikclient.c */
551
552 extern int ubik_ParseClientList(int argc, char **argv, afs_uint32 * aothers);
553 extern unsigned int afs_random(void);
554 extern int ubik_ClientInit(struct rx_connection **serverconns,
555                            struct ubik_client **aclient);
556 extern afs_int32 ubik_ClientDestroy(struct ubik_client *aclient);
557 extern struct rx_connection *ubik_RefreshConn(struct rx_connection *tc);
558 #ifdef UBIK_LEGACY_CALLITER
559 extern afs_int32 ubik_CallIter(int (*aproc) (), struct ubik_client *aclient,
560                                afs_int32 aflags, int *apos, long p1, long p2,
561                                long p3, long p4, long p5, long p6, long p7,
562                                long p8, long p9, long p10, long p11, long p12,
563                                long p13, long p14, long p15, long p16);
564 extern afs_int32 ubik_Call_New(int (*aproc) (), struct ubik_client
565                                *aclient, afs_int32 aflags, long p1, long p2,
566                                long p3, long p4, long p5, long p6, long p7,
567                                long p8, long p9, long p10, long p11, long p12,
568                                long p13, long p14, long p15, long p16);
569 #endif
570 /*\}*/
571
572 /* \name ubikcmd.c */
573 extern int ubik_ParseServerList(int argc, char **argv, afs_uint32 *ahost,
574                                 afs_uint32 *aothers);
575 /*\}*/
576
577 /* \name uinit.c */
578
579 struct rx_securityClass;
580 extern afs_int32 ugen_ClientInit(int noAuthFlag, const char *confDir,
581                                  char *cellName, afs_int32 sauth,
582                                  struct ubik_client **uclientp,
583                                  int (*secproc) (struct rx_securityClass *sc,
584                                                  afs_int32 scIndex),
585                                  char *funcName,
586                                  afs_int32 gen_rxkad_level,
587                                  afs_int32 maxservers, char *serviceid,
588                                  afs_int32 deadtime, afs_uint32 server,
589                                  afs_uint32 port, afs_int32 usrvid);
590
591 #endif /* UBIK_H */