]> git.sur5r.net Git - openldap/blob - servers/slapd/back-shell/init.c
Add copyright notices
[openldap] / servers / slapd / back-shell / init.c
1 /* init.c - initialize shell backend */
2 /* $OpenLDAP$ */
3 /*
4  * Copyright 1998-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 "shell.h"
16
17 #ifdef SLAPD_SHELL_DYNAMIC
18
19 int back_shell_LTX_init_module(int argc, char *argv[]) {
20     BackendInfo bi;
21
22     memset( &bi, 0, sizeof(bi) );
23     bi.bi_type = "shell";
24     bi.bi_init = shell_back_initialize;
25
26     backend_add(&bi);
27     return 0;
28 }
29
30 #endif /* SLAPD_SHELL_DYNAMIC */
31
32 int
33 shell_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 = shell_back_db_init;
43         bi->bi_db_config = shell_back_db_config;
44         bi->bi_db_open = 0;
45         bi->bi_db_close = 0;
46         bi->bi_db_destroy = shell_back_db_destroy;
47
48         bi->bi_op_bind = shell_back_bind;
49         bi->bi_op_unbind = shell_back_unbind;
50         bi->bi_op_search = shell_back_search;
51         bi->bi_op_compare = shell_back_compare;
52         bi->bi_op_modify = shell_back_modify;
53         bi->bi_op_modrdn = shell_back_modrdn;
54         bi->bi_op_add = shell_back_add;
55         bi->bi_op_delete = shell_back_delete;
56         bi->bi_op_abandon = shell_back_abandon;
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 shell_back_db_init(
76     Backend     *be
77 )
78 {
79         struct shellinfo        *si;
80
81         si = (struct shellinfo *) ch_calloc( 1, sizeof(struct shellinfo) );
82
83         be->be_private = si;
84
85         return si == NULL;
86 }
87
88 int
89 shell_back_db_destroy(
90     Backend     *be
91 )
92 {
93         free( be->be_private );
94         return 0;
95 }