1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
3 * Data Types for policy and principal information that
4 * exists in the respective databases.
8 * This file was originally created with rpcgen.
9 * It has been hacked up since then.
14 #include <sys/types.h>
18 /* Okay, this is a bit obscure. The libdb2 configure script doesn't
19 detect it, but on Tru64 5.1, netinet/in.h causes sys/bittypes.h to
20 be included, and that has a typedef for u_int32_t. Because the
21 configure script doesn't detect it, it causes db-config.h to have a
22 #define for u_int32_t, so including db.h and then netinet/in.h
23 causes compilation to fail.
25 Since gssrpc/types.h includes netinet/in.h, including that first
26 will cause the typedef to be seen before the macro definition,
27 which still isn't quite right, but is close enough for now.
29 A better fix might be for db.h to include netinet/in.h if that's
30 where we find u_int32_t. */
31 #include <gssrpc/types.h>
32 #include <gssrpc/xdr.h>
37 /* DB2 uses EFTYPE to indicate a database file of the wrong format, and falls
38 * back to EINVAL if the platform does not define EFTYPE. */
40 #define IS_EFTYPE(e) ((e) == EFTYPE || (e) == EINVAL)
42 #define IS_EFTYPE(e) ((e) == EINVAL)
45 typedef long osa_adb_ret_t;
47 #define OSA_ADB_POLICY_DB_MAGIC 0x12345A00
49 #define OSA_ADB_POLICY_VERSION_MASK 0x12345D00
50 #define OSA_ADB_POLICY_VERSION_1 0x12345D01
51 #define OSA_ADB_POLICY_VERSION_2 0x12345D02
52 #define OSA_ADB_POLICY_VERSION_3 0x12345D03
56 typedef struct _osa_adb_db_lock_ent_t {
59 int refcnt, lockmode, lockcnt;
61 } osa_adb_lock_ent, *osa_adb_lock_t;
63 typedef struct _osa_adb_db_ent_t {
71 } osa_adb_db_ent, *osa_adb_db_t, *osa_adb_princ_t, *osa_adb_policy_t;
74 * Return Code (the rest are in adb_err.h)
83 krb5_error_code osa_adb_create_db(char *filename, char *lockfile, int magic);
84 krb5_error_code osa_adb_destroy_db(char *filename, char *lockfile, int magic);
85 krb5_error_code osa_adb_init_db(osa_adb_db_t *dbp, char *filename,
86 char *lockfile, int magic);
87 krb5_error_code osa_adb_fini_db(osa_adb_db_t db, int magic);
88 krb5_error_code osa_adb_get_lock(osa_adb_db_t db, int mode);
89 krb5_error_code osa_adb_release_lock(osa_adb_db_t db);
90 krb5_error_code osa_adb_open_and_lock(osa_adb_princ_t db, int locktype);
91 krb5_error_code osa_adb_close_and_unlock(osa_adb_princ_t db);
92 krb5_error_code osa_adb_create_policy(osa_adb_policy_t db,
93 osa_policy_ent_t entry);
94 krb5_error_code osa_adb_destroy_policy(osa_adb_policy_t db,
96 krb5_error_code osa_adb_get_policy(osa_adb_policy_t db, char *name,
97 osa_policy_ent_t *entry);
98 krb5_error_code osa_adb_put_policy(osa_adb_policy_t db,
99 osa_policy_ent_t entry);
100 krb5_error_code osa_adb_iter_policy(osa_adb_policy_t db,
101 osa_adb_iter_policy_func func,
103 void osa_free_policy_ent(osa_policy_ent_t val);
105 bool_t xdr_osa_policy_ent_rec(XDR *xdrs, osa_policy_ent_t objp);
107 #endif /* __ADB_H__ */