]> git.sur5r.net Git - openldap/blob - servers/slapd/back-shell/init.c
Add OpenLDAP RCSid to *.[ch] in clients, libraries, and servers.
[openldap] / servers / slapd / back-shell / init.c
1 /* init.c - initialize shell backend */
2 /* $OpenLDAP$ */
3
4 #include "portable.h"
5
6 #include <stdio.h>
7
8 #include <ac/socket.h>
9
10 #include "slap.h"
11 #include "shell.h"
12
13 #ifdef SLAPD_SHELL_DYNAMIC
14
15 int back_shell_LTX_init_module(int argc, char *argv[]) {
16     BackendInfo bi;
17
18     memset( &bi, 0, sizeof(bi) );
19     bi.bi_type = "shell";
20     bi.bi_init = shell_back_initialize;
21
22     backend_add(&bi);
23     return 0;
24 }
25
26 #endif /* SLAPD_SHELL_DYNAMIC */
27
28 int
29 shell_back_initialize(
30     BackendInfo *bi
31 )
32 {
33         bi->bi_open = 0;
34         bi->bi_config = 0;
35         bi->bi_close = 0;
36         bi->bi_destroy = 0;
37
38         bi->bi_db_init = shell_back_db_init;
39         bi->bi_db_config = shell_back_db_config;
40         bi->bi_db_open = 0;
41         bi->bi_db_close = 0;
42         bi->bi_db_destroy = shell_back_db_destroy;
43
44         bi->bi_op_bind = shell_back_bind;
45         bi->bi_op_unbind = shell_back_unbind;
46         bi->bi_op_search = shell_back_search;
47         bi->bi_op_compare = shell_back_compare;
48         bi->bi_op_modify = shell_back_modify;
49         bi->bi_op_modrdn = shell_back_modrdn;
50         bi->bi_op_add = shell_back_add;
51         bi->bi_op_delete = shell_back_delete;
52         bi->bi_op_abandon = shell_back_abandon;
53
54         bi->bi_acl_group = 0;
55
56         bi->bi_connection_init = 0;
57         bi->bi_connection_destroy = 0;
58
59         return 0;
60 }
61
62 int
63 shell_back_db_init(
64     Backend     *be
65 )
66 {
67         struct shellinfo        *si;
68
69         si = (struct shellinfo *) ch_calloc( 1, sizeof(struct shellinfo) );
70
71         be->be_private = si;
72
73         return si == NULL;
74 }
75
76 int
77 shell_back_db_destroy(
78     Backend     *be
79 )
80 {
81         free( be->be_private );
82         return 0;
83 }