git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24973 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2009-03-28 17:08:10 +00:00
parent 037366a584
commit 7cbcadcb21

View File

@@ -85,49 +85,63 @@ typedef struct HDB{
* Then done the caller should call hdb_close(), and to release
* all resources hdb_destroy().
*/
krb5_error_code (*hdb_open)(krb5_context,
struct HDB*,
int,
mode_t);
krb5_error_code (*hdb_open)(krb5_context, struct HDB*, int, mode_t);
/**
* Close the database for transaction
*
* Closes the database for further transactions, wont release any
* permanant resources. the database can be ->hdb_open-ed again.
*/
krb5_error_code (*hdb_close)(krb5_context,
struct HDB*);
void (*hdb_free)(krb5_context,
struct HDB*,
hdb_entry_ex*);
krb5_error_code (*hdb_fetch)(krb5_context,
struct HDB*,
krb5_const_principal,
unsigned,
krb5_error_code (*hdb_close)(krb5_context, struct HDB*);
/**
* Free an entry after use.
*/
void (*hdb_free)(krb5_context, struct HDB*, hdb_entry_ex*);
/**
* Fetch an entry from the backend
*
* Fetch an entry from the backend, flags are what type of entry
* should be fetch: client, server, krbtgt.
*/
krb5_error_code (*hdb_fetch)(krb5_context, struct HDB*,
krb5_const_principal, unsigned,
hdb_entry_ex*);
krb5_error_code (*hdb_store)(krb5_context,
struct HDB*,
unsigned,
hdb_entry_ex*);
krb5_error_code (*hdb_remove)(krb5_context,
struct HDB*,
/**
* Store an entry to database
*/
krb5_error_code (*hdb_store)(krb5_context, struct HDB*,
unsigned, hdb_entry_ex*);
/**
* Remove an entry from the database.
*/
krb5_error_code (*hdb_remove)(krb5_context, struct HDB*,
krb5_const_principal);
krb5_error_code (*hdb_firstkey)(krb5_context,
struct HDB*,
unsigned,
hdb_entry_ex*);
krb5_error_code (*hdb_nextkey)(krb5_context,
struct HDB*,
unsigned,
hdb_entry_ex*);
krb5_error_code (*hdb_lock)(krb5_context,
struct HDB*,
int operation);
krb5_error_code (*hdb_unlock)(krb5_context,
struct HDB*);
krb5_error_code (*hdb_rename)(krb5_context,
struct HDB*,
const char*);
/**
* As part of iteration, fetch one entry
*/
krb5_error_code (*hdb_firstkey)(krb5_context, struct HDB*,
unsigned, hdb_entry_ex*);
/**
* As part of iteration, fetch next entry
*/
krb5_error_code (*hdb_nextkey)(krb5_context, struct HDB*,
unsigned, hdb_entry_ex*);
/**
* Lock database
*
* A lock can only be held by one consumers. Transaction can still
* happen on the database while the lock is held, so the entry is
* only useful for syncroning creation of the database and renaming of the database.
*/
krb5_error_code (*hdb_lock)(krb5_context, struct HDB*, int);
/**
* Unlock database
*/
krb5_error_code (*hdb_unlock)(krb5_context, struct HDB*);
/**
* Rename the data base.
*/
krb5_error_code (*hdb_rename)(krb5_context, struct HDB*, const char*);
/**
* Get a encoded principal from database.
*
@@ -135,18 +149,11 @@ typedef struct HDB{
* principal key and return all data related to principal. The
* encoded entry is of type hdb_entry or hdb_entry_alias.
*/
krb5_error_code (*hdb__get)(krb5_context,
struct HDB*,
krb5_data,
krb5_data*);
krb5_error_code (*hdb__put)(krb5_context,
struct HDB*,
int,
krb5_data,
krb5_data);
krb5_error_code (*hdb__del)(krb5_context,
struct HDB*,
krb5_data);
krb5_error_code (*hdb__get)(krb5_context, struct HDB*,
krb5_data, krb5_data*);
krb5_error_code (*hdb__put)(krb5_context, struct HDB*, int,
krb5_data, krb5_data);
krb5_error_code (*hdb__del)(krb5_context, struct HDB*, krb5_data);
/**
* Destroy the handle to the database.
*
@@ -155,8 +162,7 @@ typedef struct HDB{
* logical reverse of hdb_create() function that is the entry
* point for the module.
*/
krb5_error_code (*hdb_destroy)(krb5_context,
struct HDB*);
krb5_error_code (*hdb_destroy)(krb5_context, struct HDB*);
}HDB;
#define HDB_INTERFACE_VERSION 4