]> git.sur5r.net Git - openldap/blob - servers/slapd/back-shell/init.c
Added connection initialisation and destruction notification. Now backends can regist...
[openldap] / servers / slapd / back-shell / init.c
1 /* init.c - initialize shell backend */
2
3 #include "portable.h"
4
5 #include <stdio.h>
6
7 #include <ac/socket.h>
8
9 #include "slap.h"
10 #include "shell.h"
11
12 int
13 shell_back_initialize(
14     BackendInfo *bi
15 )
16 {
17         bi->bi_open = 0;
18         bi->bi_config = 0;
19         bi->bi_close = 0;
20         bi->bi_destroy = 0;
21
22         bi->bi_db_init = shell_back_db_init;
23         bi->bi_db_config = shell_back_db_config;
24         bi->bi_db_open = 0;
25         bi->bi_db_close = 0;
26         bi->bi_db_destroy = shell_back_db_destroy;
27
28         bi->bi_op_bind = shell_back_bind;
29         bi->bi_op_unbind = shell_back_unbind;
30         bi->bi_op_search = shell_back_search;
31         bi->bi_op_compare = shell_back_compare;
32         bi->bi_op_modify = shell_back_modify;
33         bi->bi_op_modrdn = shell_back_modrdn;
34         bi->bi_op_add = shell_back_add;
35         bi->bi_op_delete = shell_back_delete;
36         bi->bi_op_abandon = shell_back_abandon;
37
38 #ifdef SLAPD_ACLGROUPS
39         bi->bi_acl_group = 0;
40 #endif
41
42         bi->bi_connection_init = 0;
43         bi->bi_connection_destroy = 0;
44
45         return 0;
46 }
47
48 int
49 shell_back_db_init(
50     Backend     *be
51 )
52 {
53         struct shellinfo        *si;
54
55         si = (struct shellinfo *) ch_calloc( 1, sizeof(struct shellinfo) );
56
57         be->be_private = si;
58
59         return si == NULL;
60 }
61
62 int
63 shell_back_db_destroy(
64     Backend     *be
65 )
66 {
67         free( be->be_private );
68         return 0;
69 }