1 /*	$NetBSD: init.c,v 1.1.1.3 2010/12/12 15:23:01 adam Exp $	*/
2 
3 /* init.c - initialize ldap backend */
4 /* OpenLDAP: pkg/ldap/servers/slapd/back-dnssrv/init.c,v 1.29.2.7 2010/06/17 20:09:16 quanah Exp */
5 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
6  *
7  * Copyright 2000-2010 The OpenLDAP Foundation.
8  * Portions Copyright 2000-2003 Kurt D. Zeilenga.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted only as authorized by the OpenLDAP
13  * Public License.
14  *
15  * A copy of this license is available in the file LICENSE in the
16  * top-level directory of the distribution or, alternatively, at
17  * <http://www.OpenLDAP.org/license.html>.
18  */
19 /* ACKNOWLEDGEMENTS:
20  * This work was originally developed by Kurt D. Zeilenga for inclusion
21  * in OpenLDAP Software.
22  */
23 
24 #include "portable.h"
25 
26 #include <stdio.h>
27 
28 #include <ac/socket.h>
29 #include <ac/param.h>
30 #include <ac/string.h>
31 
32 #include "slap.h"
33 #include "config.h"
34 #include "proto-dnssrv.h"
35 
36 int
37 dnssrv_back_initialize(
38     BackendInfo	*bi )
39 {
40 	static char *controls[] = {
41 		LDAP_CONTROL_MANAGEDSAIT,
42 		NULL
43 	};
44 
45 	bi->bi_controls = controls;
46 
47 	bi->bi_open = dnssrv_back_open;
48 	bi->bi_config = 0;
49 	bi->bi_close = 0;
50 	bi->bi_destroy = 0;
51 
52 	bi->bi_db_init = 0;
53 	bi->bi_db_destroy = 0;
54 	bi->bi_db_config = 0 /* dnssrv_back_db_config */;
55 	bi->bi_db_open = 0;
56 	bi->bi_db_close = 0;
57 
58 	bi->bi_chk_referrals = dnssrv_back_referrals;
59 
60 	bi->bi_op_bind = dnssrv_back_bind;
61 	bi->bi_op_search = dnssrv_back_search;
62 	bi->bi_op_compare = 0 /* dnssrv_back_compare */;
63 	bi->bi_op_modify = 0;
64 	bi->bi_op_modrdn = 0;
65 	bi->bi_op_add = 0;
66 	bi->bi_op_delete = 0;
67 	bi->bi_op_abandon = 0;
68 	bi->bi_op_unbind = 0;
69 
70 	bi->bi_extended = 0;
71 
72 	bi->bi_connection_init = 0;
73 	bi->bi_connection_destroy = 0;
74 
75 	bi->bi_access_allowed = slap_access_always_allowed;
76 
77 	return 0;
78 }
79 
80 AttributeDescription	*ad_dc;
81 AttributeDescription	*ad_associatedDomain;
82 
83 int
84 dnssrv_back_open(
85     BackendInfo *bi )
86 {
87 	const char *text;
88 
89 	(void)slap_str2ad( "dc", &ad_dc, &text );
90 	(void)slap_str2ad( "associatedDomain", &ad_associatedDomain, &text );
91 
92 	return 0;
93 }
94 
95 int
96 dnssrv_back_db_init(
97 	Backend	*be,
98 	ConfigReply *cr)
99 {
100 	return 0;
101 }
102 
103 int
104 dnssrv_back_db_destroy(
105 	Backend	*be,
106 	ConfigReply *cr )
107 {
108 	return 0;
109 }
110 
111 #if SLAPD_DNSSRV == SLAPD_MOD_DYNAMIC
112 
113 /* conditionally define the init_module() function */
114 SLAP_BACKEND_INIT_MODULE( dnssrv )
115 
116 #endif /* SLAPD_DNSSRV == SLAPD_MOD_DYNAMIC */
117 
118