xref: /netbsd-src/crypto/external/bsd/heimdal/dist/lib/krb5/db_plugin.h (revision d3273b5b76f5afaafe308cead5511dbb8df8c5e9)
1*d3273b5bSchristos /*	$NetBSD: db_plugin.h,v 1.2 2017/01/28 21:31:49 christos Exp $	*/
2b9d004c6Schristos 
3b9d004c6Schristos /*
4b9d004c6Schristos  * Copyright (c) 2011, Secure Endpoints Inc.
5b9d004c6Schristos  * All rights reserved.
6b9d004c6Schristos  *
7b9d004c6Schristos  * Redistribution and use in source and binary forms, with or without
8b9d004c6Schristos  * modification, are permitted provided that the following conditions
9b9d004c6Schristos  * are met:
10b9d004c6Schristos  *
11b9d004c6Schristos  * - Redistributions of source code must retain the above copyright
12b9d004c6Schristos  *   notice, this list of conditions and the following disclaimer.
13b9d004c6Schristos  *
14b9d004c6Schristos  * - Redistributions in binary form must reproduce the above copyright
15b9d004c6Schristos  *   notice, this list of conditions and the following disclaimer in
16b9d004c6Schristos  *   the documentation and/or other materials provided with the
17b9d004c6Schristos  *   distribution.
18b9d004c6Schristos  *
19b9d004c6Schristos  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20b9d004c6Schristos  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21b9d004c6Schristos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22b9d004c6Schristos  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23b9d004c6Schristos  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24b9d004c6Schristos  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25b9d004c6Schristos  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26b9d004c6Schristos  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27b9d004c6Schristos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28b9d004c6Schristos  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29b9d004c6Schristos  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
30b9d004c6Schristos  * OF THE POSSIBILITY OF SUCH DAMAGE.
31b9d004c6Schristos  */
32b9d004c6Schristos 
33b9d004c6Schristos /* Id */
34b9d004c6Schristos 
35b9d004c6Schristos #ifndef HEIMDAL_KRB5_DB_PLUGIN_H
36b9d004c6Schristos #define HEIMDAL_KRB5_DB_PLUGIN_H 1
37b9d004c6Schristos 
38b9d004c6Schristos #define KRB5_PLUGIN_DB "krb5_db_plug"
39b9d004c6Schristos #define KRB5_PLUGIN_DB_VERSION_0 0
40b9d004c6Schristos 
41b9d004c6Schristos /** @struct krb5plugin_db_ftable_desc
42b9d004c6Schristos  *
43b9d004c6Schristos  * @brief Description of the krb5 DB plugin facility.
44b9d004c6Schristos  *
45b9d004c6Schristos  * The krb5_aname_to_lname(3) function's DB rule is pluggable.  The
46b9d004c6Schristos  * plugin is named KRB5_PLUGIN_DB ("krb5_db_plug"), with a single minor
47b9d004c6Schristos  * version, KRB5_PLUGIN_DB_VERSION_0 (0).
48b9d004c6Schristos  *
49b9d004c6Schristos  * The plugin consists of a data symbol referencing a structure of type
50b9d004c6Schristos  * krb5plugin_db_ftable_desc, with three fields:
51b9d004c6Schristos  *
52b9d004c6Schristos  * @param init          Plugin initialization function (see krb5-plugin(7))
53b9d004c6Schristos  *
54b9d004c6Schristos  * @param minor_version The plugin minor version number (0)
55b9d004c6Schristos  *
56b9d004c6Schristos  * @param fini          Plugin finalization function
57b9d004c6Schristos  *
58b9d004c6Schristos  * The init entry point is expected to call heim_db_register().  The
59b9d004c6Schristos  * fini entry point is expected to do nothing.
60b9d004c6Schristos  *
61b9d004c6Schristos  * @ingroup krb5_support
62b9d004c6Schristos  */
63b9d004c6Schristos typedef struct krb5plugin_db_ftable_desc {
64b9d004c6Schristos     int			minor_version;
65b9d004c6Schristos     krb5_error_code	(KRB5_LIB_CALL *init)(krb5_context, void **);
66b9d004c6Schristos     void		(KRB5_LIB_CALL *fini)(void *);
67b9d004c6Schristos } krb5plugin_db_ftable;
68b9d004c6Schristos 
69b9d004c6Schristos #endif /* HEIMDAL_KRB5_DB_PLUGIN_H */
70b9d004c6Schristos 
71