]> git.sur5r.net Git - openldap/blob - servers/slapd/overlays/overlays.c
Add static build for accesslog
[openldap] / servers / slapd / overlays / overlays.c
1 /* overlays.c - Static overlay framework */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 2003-2005 The OpenLDAP Foundation.
6  * Copyright 2003 by Howard Chu.
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 initially developed by Howard Chu for inclusion in
19  * OpenLDAP Software.
20  */
21
22 #include "portable.h"
23
24 #include "slap.h"
25
26 #if SLAPD_OVER_ACCESSLOG == SLAPD_MOD_STATIC
27 extern int acceslog_init();
28 #endif
29 #if SLAPD_OVER_DENYOP == SLAPD_MOD_STATIC
30 extern int denyop_init();
31 #endif
32 #if SLAPD_OVER_DYNGROUP == SLAPD_MOD_STATIC
33 extern int dyngroup_init();
34 #endif
35 #if SLAPD_OVER_DYNLIST == SLAPD_MOD_STATIC
36 extern int dynlist_init();
37 #endif
38 #if SLAPD_OVER_GLUE == SLAPD_MOD_STATIC
39 extern int glue_init();
40 #endif
41 #if SLAPD_OVER_LASTMOD == SLAPD_MOD_STATIC
42 extern int lastmod_init();
43 #endif
44 #if SLAPD_OVER_PPOLICY == SLAPD_MOD_STATIC
45 extern int ppolicy_init();
46 #endif
47 #if SLAPD_OVER_PROXYCACHE == SLAPD_MOD_STATIC
48 extern int pcache_init();
49 #endif
50 #if SLAPD_OVER_REFINT == SLAPD_MOD_STATIC
51 extern int refint_init();
52 #endif
53 #if SLAPD_OVER_RETCODE == SLAPD_MOD_STATIC
54 extern int retcode_init();
55 #endif
56 #if SLAPD_OVER_RWM == SLAPD_MOD_STATIC
57 extern int rwm_init();
58 #endif
59 #if SLAPD_OVER_SYNCPROV == SLAPD_MOD_STATIC
60 extern int syncprov_init();
61 #endif
62 #if SLAPD_OVER_TRANSLUCENT == SLAPD_MOD_STATIC
63 extern int translucent_init();
64 #endif
65 #if SLAPD_OVER_UNIQUE == SLAPD_MOD_STATIC
66 extern int unique_init();
67 #endif
68
69 static struct {
70         char *name;
71         int (*func)();
72 } funcs[] = {
73 #if SLAPD_OVER_ACCESSLOG == SLAPD_MOD_STATIC
74         { "Access Log", accesslog_init },
75 #endif
76 #if SLAPD_OVER_DENYOP == SLAPD_MOD_STATIC
77         { "Deny Operation", denyop_init },
78 #endif
79 #if SLAPD_OVER_DYNGROUP == SLAPD_MOD_STATIC
80         { "Dynamic Group", dyngroup_init },
81 #endif
82 #if SLAPD_OVER_DYNLIST == SLAPD_MOD_STATIC
83         { "Dynamic List", dynlist_init },
84 #endif
85 #if SLAPD_OVER_GLUE == SLAPD_MOD_STATIC
86         { "Backend Glue", glue_init },
87 #endif
88 #if SLAPD_OVER_LASTMOD == SLAPD_MOD_STATIC
89         { "Last Modification", lastmod_init },
90 #endif
91 #if SLAPD_OVER_PPOLICY == SLAPD_MOD_STATIC
92         { "Password Policy", ppolicy_init },
93 #endif
94 #if SLAPD_OVER_PROXYCACHE == SLAPD_MOD_STATIC
95         { "Proxy Cache", pcache_init },
96 #endif
97 #if SLAPD_OVER_REFINT == SLAPD_MOD_STATIC
98         { "Referential Integrity", refint_init },
99 #endif
100 #if SLAPD_OVER_RETCODE == SLAPD_MOD_STATIC
101         { "Return Code", retcode_init },
102 #endif
103 #if SLAPD_OVER_RWM == SLAPD_MOD_STATIC
104         { "Rewrite/Remap", rwm_init },
105 #endif
106 #if SLAPD_OVER_SYNCPROV == SLAPD_MOD_STATIC
107         { "Syncrepl Provider", syncprov_init },
108 #endif
109 #if SLAPD_OVER_TRANSLUCENT == SLAPD_MOD_STATIC
110         { "Translucent Proxy", translucent_init },
111 #endif
112 #if SLAPD_OVER_UNIQUE == SLAPD_MOD_STATIC
113         { "Attribute Uniqueness", unique_init },
114 #endif
115         { NULL, NULL }
116 };
117
118 int
119 overlay_init(void)
120 {
121         int i, rc = 0;
122
123         for ( i=0; funcs[i].name; i++ ) {
124                 rc = funcs[i].func();
125                 if ( rc ) {
126                         Debug( LDAP_DEBUG_ANY,
127                 "%s overlay setup failed, err %d\n", funcs[i].name, rc, 0 );
128                         break;
129                 }
130         }
131         return rc;
132 }