]> git.sur5r.net Git - openldap/blob - servers/slapd/back-dnssrv/init.c
rework static backend initialization
[openldap] / servers / slapd / back-dnssrv / init.c
1 /* init.c - initialize ldap backend */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 2000-2004 The OpenLDAP Foundation.
6  * Portions Copyright 2000-2003 Kurt D. Zeilenga.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted only as authorized by the OpenLDAP
11  * Public License.
12  *
13  * A copy of this license is available in the file LICENSE in the
14  * top-level directory of the distribution or, alternatively, at
15  * <http://www.OpenLDAP.org/license.html>.
16  */
17 /* ACKNOWLEDGEMENTS:
18  * This work was originally developed by Kurt D. Zeilenga for inclusion
19  * in OpenLDAP Software.
20  */
21
22 #include "portable.h"
23
24 #include <stdio.h>
25
26 #include <ac/socket.h>
27
28 #include "slap.h"
29 #include "proto-dnssrv.h"
30 #include "external.h"
31
32 #if SLAPD_DNSSRV == SLAPD_MOD_DYNAMIC
33
34 int init_module(int argc, char *argv[])
35 {
36     BackendInfo bi;
37
38     memset( &bi, '\0', sizeof(bi) );
39     bi.bi_type = "dnssrv";
40     bi.bi_init = dnssrv_back_initialize;
41
42     backend_add( &bi );
43     return 0;
44 }
45
46 #endif /* SLAPD_DNSSRV */
47
48 int
49 dnssrv_back_initialize(
50     BackendInfo *bi )
51 {
52         static char *controls[] = {
53                 LDAP_CONTROL_MANAGEDSAIT,
54                 LDAP_CONTROL_VALUESRETURNFILTER,
55                 NULL
56         };
57
58         bi->bi_controls = controls;
59
60         bi->bi_open = 0;
61         bi->bi_config = 0;
62         bi->bi_close = 0;
63         bi->bi_destroy = 0;
64
65         bi->bi_db_init = 0;
66         bi->bi_db_destroy = 0;
67         bi->bi_db_config = dnssrv_back_db_config;
68         bi->bi_db_open = 0;
69         bi->bi_db_close = 0;
70
71         bi->bi_chk_referrals = dnssrv_back_referrals;
72
73         bi->bi_op_bind = dnssrv_back_bind;
74         bi->bi_op_search = dnssrv_back_search;
75         bi->bi_op_compare = 0 /* dnssrv_back_compare */;
76         bi->bi_op_modify = 0;
77         bi->bi_op_modrdn = 0;
78         bi->bi_op_add = 0;
79         bi->bi_op_delete = 0;
80         bi->bi_op_abandon = 0;
81         bi->bi_op_unbind = 0;
82
83         bi->bi_extended = 0;
84
85         bi->bi_connection_init = 0;
86         bi->bi_connection_destroy = 0;
87
88         return 0;
89 }
90
91 int
92 dnssrv_back_db_init(
93     Backend     *be )
94 {
95         return 0;
96 }
97
98 int
99 dnssrv_back_db_destroy(
100     Backend     *be )
101 {
102         return 0;
103 }