xref: /netbsd-src/external/bsd/openldap/dist/servers/slapd/back-dnssrv/init.c (revision 60ab2ca5c0570c0013b39de285ddaa91fe27d029)
1 /* init.c - initialize ldap backend */
2 /* $OpenLDAP: pkg/ldap/servers/slapd/back-dnssrv/init.c,v 1.29.2.4 2008/02/11 23:26:46 kurt Exp $ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 2000-2008 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 #include <ac/param.h>
28 #include <ac/string.h>
29 
30 #include "slap.h"
31 #include "config.h"
32 #include "proto-dnssrv.h"
33 
34 int
35 dnssrv_back_initialize(
36     BackendInfo	*bi )
37 {
38 	static char *controls[] = {
39 		LDAP_CONTROL_MANAGEDSAIT,
40 		NULL
41 	};
42 
43 	bi->bi_controls = controls;
44 
45 	bi->bi_open = dnssrv_back_open;
46 	bi->bi_config = 0;
47 	bi->bi_close = 0;
48 	bi->bi_destroy = 0;
49 
50 	bi->bi_db_init = 0;
51 	bi->bi_db_destroy = 0;
52 	bi->bi_db_config = dnssrv_back_db_config;
53 	bi->bi_db_open = 0;
54 	bi->bi_db_close = 0;
55 
56 	bi->bi_chk_referrals = dnssrv_back_referrals;
57 
58 	bi->bi_op_bind = dnssrv_back_bind;
59 	bi->bi_op_search = dnssrv_back_search;
60 	bi->bi_op_compare = 0 /* dnssrv_back_compare */;
61 	bi->bi_op_modify = 0;
62 	bi->bi_op_modrdn = 0;
63 	bi->bi_op_add = 0;
64 	bi->bi_op_delete = 0;
65 	bi->bi_op_abandon = 0;
66 	bi->bi_op_unbind = 0;
67 
68 	bi->bi_extended = 0;
69 
70 	bi->bi_connection_init = 0;
71 	bi->bi_connection_destroy = 0;
72 
73 	bi->bi_access_allowed = slap_access_always_allowed;
74 
75 	return 0;
76 }
77 
78 AttributeDescription	*ad_dc;
79 AttributeDescription	*ad_associatedDomain;
80 
81 int
82 dnssrv_back_open(
83     BackendInfo *bi )
84 {
85 	const char *text;
86 
87 	(void)slap_str2ad( "dc", &ad_dc, &text );
88 	(void)slap_str2ad( "associatedDomain", &ad_associatedDomain, &text );
89 
90 	return 0;
91 }
92 
93 int
94 dnssrv_back_db_init(
95 	Backend	*be,
96 	ConfigReply *cr)
97 {
98 	return 0;
99 }
100 
101 int
102 dnssrv_back_db_destroy(
103 	Backend	*be,
104 	ConfigReply *cr )
105 {
106 	return 0;
107 }
108 
109 #if SLAPD_DNSSRV == SLAPD_MOD_DYNAMIC
110 
111 /* conditionally define the init_module() function */
112 SLAP_BACKEND_INIT_MODULE( dnssrv )
113 
114 #endif /* SLAPD_DNSSRV == SLAPD_MOD_DYNAMIC */
115 
116