2 * Copyright 2000, International Business Machines Corporation and others.
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
10 #ifndef TRANSARC_AFS_ADMIN_INTERNAL_H
11 #define TRANSARC_AFS_ADMIN_INTERNAL_H
13 #include <afs/param.h>
15 #include <afs/cellconfig.h>
20 #define BEGIN_MAGIC 0xb0b0b0b0
21 #define END_MAGIC 0xc0c0c0c0
23 typedef struct afs_token_handle {
30 char cell[MAXCELLCHARS];
31 struct ktc_token afs_token;
32 struct ktc_token kas_token;
33 struct rx_securityClass *afs_sc[3];
34 struct rx_securityClass *afs_encrypt_sc[3];
35 struct rx_securityClass *kas_sc[3];
36 struct ktc_principal client;
38 } afs_token_handle_t, *afs_token_handle_p;
40 typedef struct afs_cell_handle {
44 afs_token_handle_p tokens;
45 char working_cell[MAXCELLCHARS];
46 struct ubik_client *kas;
47 struct ubik_client *pts;
48 struct ubik_client *vos;
54 } afs_cell_handle_t, *afs_cell_handle_p;
56 #define CACHED_ITEMS 5
58 typedef int (*validate_specific_data_func)(
63 typedef int (*destroy_specific_data_func)(
68 typedef int (*get_cached_data_func)(
75 typedef int (*make_rpc_func)(
79 int *last_item_contains_data,
85 * the afs_admin_iterator_t structure contains one mutex (named
86 * mutex) that should be held while manipulating any of the other
87 * elements in the structure. The only exception to this rule is
88 * that it is legale to make rpc's without the mutex being held.
91 typedef struct afs_admin_iterator {
94 pthread_mutex_t mutex; /* hold to manipulate this structure */
95 pthread_cond_t add_item; /* wait for data to be added to the cache */
96 pthread_cond_t remove_item; /* wait for data to be removed from the cache */
97 pthread_t bg_worker; /* thread id of background worker */
98 int cache_slots_used; /* number of items in the cache */
99 int done_iterating; /* finished iterating over the database */
100 int request_terminated; /* Done has been called on this iterator */
101 afs_status_t st; /* the status of the last rpc */
102 int cache_queue_head; /* index into principal that's the head of the q */
103 int cache_queue_tail; /* index into principal that's the tail of the q */
105 make_rpc_func make_rpc;
106 get_cached_data_func get_cached_data;
107 validate_specific_data_func validate_specific;
108 destroy_specific_data_func destroy_specific;
110 } afs_admin_iterator_t, *afs_admin_iterator_p;
113 afs_admin_iterator_p iter,
119 afs_admin_iterator_p iter,
124 afs_admin_iterator_p iter,
126 make_rpc_func make_rpc,
127 get_cached_data_func get_cached_data,
128 validate_specific_data_func validate_specific_data,
129 destroy_specific_data_func destroy_specific_data,
132 #endif /* TRANSARC_AFS_ADMIN_INTERNAL_H */