]> git.sur5r.net Git - openldap/blob - servers/slapd/back-dnssrv/init.c
881532e385d4c67a1d464e503de3c1914991cd41
[openldap] / servers / slapd / back-dnssrv / init.c
1 /* init.c - initialize ldap backend */
2 /* $OpenLDAP$ */
3 /*
4  * Copyright 2000 The OpenLDAP Foundation, All Rights Reserved.
5  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
6  */
7
8 #include "portable.h"
9
10 #include <stdio.h>
11
12 #include <ac/socket.h>
13
14 #include "slap.h"
15 #include "back-dnssrv.h"
16
17 #ifdef SLAPD_DNSSRV_DYNAMIC
18
19 int back_dnssrv_LTX_init_module(int argc, char *argv[]) {
20     BackendInfo bi;
21
22     memset( &bi, 0, sizeof(bi) );
23     bi.bi_type = "dnssrv";
24     bi.bi_init = dnssrv_back_initialize;
25
26     backend_add(&bi);
27     return 0;
28 }
29
30 #endif /* SLAPD_DNSSRV_DYNAMIC */
31
32 int
33 dnssrv_back_initialize(
34     BackendInfo *bi
35 )
36 {
37         bi->bi_open = 0;
38         bi->bi_config = 0;
39         bi->bi_close = 0;
40         bi->bi_destroy = 0;
41
42         bi->bi_db_init = dnssrv_back_db_init;
43         bi->bi_db_config = dnssrv_back_db_config;
44         bi->bi_db_open = 0;
45         bi->bi_db_close = 0;
46         bi->bi_db_destroy = dnssrv_back_db_destroy;
47
48         bi->bi_op_bind = 0;
49         bi->bi_op_unbind = 0;
50         bi->bi_op_search = dnssrv_back_search;
51         bi->bi_op_compare = dnssrv_back_compare;
52         bi->bi_op_modify = dnssrv_back_modify;
53         bi->bi_op_modrdn = dnssrv_back_modrdn;
54         bi->bi_op_add = dnssrv_back_add;
55         bi->bi_op_delete = dnssrv_back_delete;
56         bi->bi_op_abandon = 0;
57
58         bi->bi_extended = 0;
59
60         bi->bi_acl_group = 0;
61
62 #ifdef HAVE_CYRUS_SASL
63         bi->bi_sasl_authorize = 0;
64         bi->bi_sasl_getsecret = 0;
65         bi->bi_sasl_putsecret = 0;
66 #endif /* HAVE_CYRUS_SASL */
67
68         bi->bi_connection_init = 0;
69         bi->bi_connection_destroy = 0;
70
71         return 0;
72 }
73
74 int
75 dnssrv_back_db_init(
76     Backend     *be
77 )
78 {
79 #if 0
80         struct ldapinfo *li;
81
82         li = (struct ldapinfo *) ch_calloc( 1, sizeof(struct ldapinfo) );
83         ldap_pvt_thread_mutex_init( &li->conn_mutex );
84
85         be->be_private = li;
86
87         return li == NULL;
88 #else
89         return 0;
90 #endif
91 }
92
93 int
94 dnssrv_back_db_destroy(
95     Backend     *be
96 )
97 {
98 #if 0
99         struct ldapinfo *li;
100
101         if (be->be_private) {
102                 li = (struct ldapinfo *)be->be_private;
103                 if (li->host) {
104                         free(li->host);
105                         li->host = NULL;
106                 }
107                 ldap_pvt_thread_mutex_destroy( &li->conn_mutex );
108         }
109
110         free( be->be_private );
111         return 0;
112 #else
113         return 0;
114 #endif
115 }