1 /* translucent.c - translucent proxy module */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2004-2006 The OpenLDAP Foundation.
6 * Portions Copyright 2005 Symas Corporation.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted only as authorized by the OpenLDAP
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>.
18 * This work was initially developed by Symas Corp. for inclusion in
19 * OpenLDAP Software. This work was sponsored by Hewlett-Packard.
24 #ifdef SLAPD_OVER_TRANSLUCENT
28 #include <ac/string.h>
29 #include <ac/socket.h>
37 typedef struct translucent_info {
38 BackendDB db; /* captive backend */
43 static ConfigLDAPadd translucent_ldadd;
44 static ConfigCfAdd translucent_cfadd;
46 static ConfigTable translucentcfg[] = {
47 { "translucent_strict", "on|off", 1, 2, 0,
48 ARG_ON_OFF|ARG_OFFSET,
49 (void *)offsetof(translucent_info, strict),
50 "( OLcfgOvAt:14.1 NAME 'olcTranslucentStrict' "
51 "DESC 'Reveal attribute deletion constraint violations' "
52 "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
53 { "translucent_no_glue", "on|off", 1, 2, 0,
54 ARG_ON_OFF|ARG_OFFSET,
55 (void *)offsetof(translucent_info, no_glue),
56 "( OLcfgOvAt:14.2 NAME 'olcTranslucentNoGlue' "
57 "DESC 'Disable automatic glue records for ADD and MODRDN' "
58 "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
59 { NULL, NULL, 0, 0, 0, ARG_IGNORED }
62 static ConfigOCs translucentocs[] = {
64 "NAME 'olcTranslucentConfig' "
65 "DESC 'Translucent configuration' "
66 "SUP olcOverlayConfig "
67 "MAY ( olcTranslucentStrict $ olcTranslucentNoGlue ) )",
68 Cft_Overlay, translucentcfg, NULL, translucent_cfadd },
70 "NAME 'olcTranslucentDatabase' "
71 "DESC 'Translucent target database configuration' "
72 "AUXILIARY )", Cft_Misc, translucentcfg, translucent_ldadd },
75 /* for translucent_init() */
78 translucent_ldadd( CfEntryInfo *cei, Entry *e, ConfigArgs *ca )
83 Debug(LDAP_DEBUG_TRACE, "==> translucent_ldadd\n", 0, 0, 0);
85 if ( cei->ce_type != Cft_Overlay || !cei->ce_bi ||
86 cei->ce_bi->bi_cf_ocs != translucentocs )
87 return LDAP_CONSTRAINT_VIOLATION;
89 on = (slap_overinst *)cei->ce_bi;
90 ov = on->on_bi.bi_private;
96 translucent_cfadd( Operation *op, SlapReply *rs, Entry *e, ConfigArgs *ca )
98 CfEntryInfo *cei = e->e_private;
99 slap_overinst *on = (slap_overinst *)cei->ce_bi;
100 translucent_info *ov = on->on_bi.bi_private;
103 Debug(LDAP_DEBUG_TRACE, "==> translucent_cfadd\n", 0, 0, 0);
105 /* FIXME: should not hardcode "olcDatabase" here */
106 bv.bv_len = sprintf( ca->msg, "olcDatabase=%s",
107 ov->db.bd_info->bi_type );
111 /* We can only create this entry if the database is table-driven
113 if ( ov->db.bd_info->bi_cf_ocs )
114 config_build_entry( op, rs, cei, ca, &bv,
115 ov->db.bd_info->bi_cf_ocs,
116 &translucentocs[1] );
121 static slap_overinst translucent;
125 ** call syncrepl_add_glue() with the parent suffix;
129 static struct berval glue[] = { BER_BVC("top"), BER_BVC("glue"), BER_BVNULL };
131 void glue_parent(Operation *op) {
133 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
134 struct berval ndn = BER_BVNULL;
139 dnParent( &op->o_req_ndn, &pdn );
140 ber_dupbv_x( &ndn, &pdn, op->o_tmpmemctx );
142 Debug(LDAP_DEBUG_TRACE, "=> glue_parent: fabricating glue for <%s>\n", ndn.bv_val, 0, 0);
146 ber_dupbv(&e->e_name, &ndn);
147 ber_dupbv(&e->e_nname, &ndn);
149 a = attr_alloc( slap_schema.si_ad_objectClass );
150 a->a_vals = ch_malloc(sizeof(struct berval) * 3);
151 ber_dupbv(&a->a_vals[0], &glue[0]);
152 ber_dupbv(&a->a_vals[1], &glue[1]);
153 ber_dupbv(&a->a_vals[2], &glue[2]);
154 a->a_nvals = a->a_vals;
155 a->a_next = e->e_attrs;
158 a = attr_alloc( slap_schema.si_ad_structuralObjectClass );
159 a->a_vals = ch_malloc(sizeof(struct berval) * 2);
160 ber_dupbv(&a->a_vals[0], &glue[1]);
161 ber_dupbv(&a->a_vals[1], &glue[2]);
162 a->a_nvals = a->a_vals;
163 a->a_next = e->e_attrs;
170 nop.o_bd->bd_info = (BackendInfo *) on->on_info->oi_orig;
171 syncrepl_add_glue(&nop, e);
172 nop.o_bd->bd_info = (BackendInfo *) on;
174 op->o_tmpfree( ndn.bv_val, op->o_tmpmemctx );
184 BerVarray dup_bervarray(BerVarray b) {
187 for(len = 0; b[len].bv_val; len++);
188 nb = ch_malloc((len+1) * sizeof(BerValue));
189 for(i = 0; i < len; i++) ber_dupbv(&nb[i], &b[i]);
190 nb[len].bv_val = NULL;
197 ** free only the Attribute*, not the contents;
200 void free_attr_chain(Attribute *b) {
202 for(a=b; a; a=a->a_next) {
212 ** if not bound as root, send ACCESS error;
213 ** if glue, glue_parent();
218 static int translucent_add(Operation *op, SlapReply *rs) {
219 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
220 translucent_info *ov = on->on_bi.bi_private;
221 Debug(LDAP_DEBUG_TRACE, "==> translucent_add: %s\n",
222 op->o_req_dn.bv_val, 0, 0);
224 op->o_bd->bd_info = (BackendInfo *) on->on_info;
225 send_ldap_error(op, rs, LDAP_INSUFFICIENT_ACCESS,
226 "user modification of overlay database not permitted");
227 op->o_bd->bd_info = (BackendInfo *) on;
230 if(!ov->no_glue) glue_parent(op);
231 return(SLAP_CB_CONTINUE);
235 ** translucent_modrdn()
236 ** if not bound as root, send ACCESS error;
237 ** if !glue, glue_parent();
238 ** else return CONTINUE;
242 static int translucent_modrdn(Operation *op, SlapReply *rs) {
243 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
244 translucent_info *ov = on->on_bi.bi_private;
245 Debug(LDAP_DEBUG_TRACE, "==> translucent_modrdn: %s -> %s\n",
246 op->o_req_dn.bv_val, op->orr_newrdn.bv_val, 0);
248 op->o_bd->bd_info = (BackendInfo *) on->on_info;
249 send_ldap_error(op, rs, LDAP_INSUFFICIENT_ACCESS,
250 "user modification of overlay database not permitted");
251 op->o_bd->bd_info = (BackendInfo *) on;
254 if(!ov->no_glue) glue_parent(op);
255 return(SLAP_CB_CONTINUE);
259 ** translucent_delete()
260 ** if not bound as root, send ACCESS error;
261 ** else return CONTINUE;
265 static int translucent_delete(Operation *op, SlapReply *rs) {
266 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
267 Debug(LDAP_DEBUG_TRACE, "==> translucent_delete: %s\n",
268 op->o_req_dn.bv_val, 0, 0);
270 op->o_bd->bd_info = (BackendInfo *) on->on_info;
271 send_ldap_error(op, rs, LDAP_INSUFFICIENT_ACCESS,
272 "user modification of overlay database not permitted");
273 op->o_bd->bd_info = (BackendInfo *) on;
276 return(SLAP_CB_CONTINUE);
280 translucent_tag_cb( Operation *op, SlapReply *rs )
282 op->o_tag = LDAP_REQ_MODIFY;
283 op->orm_modlist = op->o_callback->sc_private;
284 rs->sr_tag = slap_req2res( op->o_tag );
286 return SLAP_CB_CONTINUE;
290 ** translucent_modify()
291 ** modify in local backend if exists in both;
292 ** otherwise, add to local backend;
293 ** fail if not defined in captive backend;
297 static int translucent_modify(Operation *op, SlapReply *rs) {
298 SlapReply nrs = { REP_RESULT };
301 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
302 translucent_info *ov = on->on_bi.bi_private;
303 Entry ne, *e = NULL, *re = NULL;
305 Modifications *m, *mm;
306 int del, rc, erc = 0;
307 slap_callback cb = { 0 };
309 Debug(LDAP_DEBUG_TRACE, "==> translucent_modify: %s\n",
310 op->o_req_dn.bv_val, 0, 0);
313 ** fetch entry from the captive backend;
314 ** if it did not exist, fail;
315 ** release it, if captive backend supports this;
320 rc = ov->db.bd_info->bi_entry_get_rw(&nop, &nop.o_req_ndn, NULL, NULL, 0, &re);
321 if(rc != LDAP_SUCCESS || re == NULL ) {
322 send_ldap_error((&nop), rs, LDAP_NO_SUCH_OBJECT,
323 "attempt to modify nonexistent local record");
328 ** fetch entry from local backend;
330 ** foreach Modification:
331 ** if attr not present in local:
332 ** if Mod == LDAP_MOD_DELETE:
333 ** if remote attr not present, return NO_SUCH;
334 ** if remote attr present, drop this Mod;
335 ** else force this Mod to LDAP_MOD_ADD;
340 op->o_bd->bd_info = (BackendInfo *) on->on_info;
341 rc = be_entry_get_rw(op, &op->o_req_ndn, NULL, NULL, 0, &e);
342 op->o_bd->bd_info = (BackendInfo *) on;
344 if(e && rc == LDAP_SUCCESS) {
345 Debug(LDAP_DEBUG_TRACE, "=> translucent_modify: found local entry\n", 0, 0, 0);
346 for(m = op->orm_modlist; m; m = m->sml_next) {
347 for(a = e->e_attrs; a; a = a->a_next)
348 if(a->a_desc == m->sml_desc) break;
349 if(a) continue; /* found local attr */
350 if(m->sml_op == LDAP_MOD_DELETE) {
351 for(a = re->e_attrs; a; a = a->a_next)
352 if(a->a_desc == m->sml_desc) break;
353 /* not found remote attr */
355 erc = LDAP_NO_SUCH_ATTRIBUTE;
359 erc = LDAP_CONSTRAINT_VIOLATION;
362 Debug(LDAP_DEBUG_TRACE,
363 "=> translucent_modify: silently dropping delete: %s\n",
364 m->sml_desc->ad_cname.bv_val, 0, 0);
365 for(mm = op->orm_modlist; mm->sml_next != m; mm = mm->sml_next);
366 mm->sml_next = m->sml_next;
368 slap_mods_free(m, 1);
372 m->sml_op = LDAP_MOD_ADD;
374 erc = SLAP_CB_CONTINUE;
377 if(ov->db.bd_info->bi_entry_release_rw)
378 ov->db.bd_info->bi_entry_release_rw(&nop, re, 0);
382 op->o_bd->bd_info = (BackendInfo *) on->on_info;
383 be_entry_release_r(op, e);
384 op->o_bd->bd_info = (BackendInfo *) on;
385 if(erc == SLAP_CB_CONTINUE) {
388 send_ldap_error(op, rs, erc,
389 "attempt to delete nonexistent attribute");
394 /* don't leak remote entry copy */
396 if(ov->db.bd_info->bi_entry_release_rw)
397 ov->db.bd_info->bi_entry_release_rw(&nop, re, 0);
402 ** foreach Modification:
403 ** if MOD_ADD or MOD_REPLACE, add Attribute;
404 ** if no Modifications were suitable:
405 ** if strict, throw CONSTRAINT_VIOLATION;
406 ** else, return early SUCCESS;
407 ** fabricate Entry with new Attribute chain;
408 ** glue_parent() for this Entry;
409 ** call bi_op_add() in local backend;
413 Debug(LDAP_DEBUG_TRACE, "=> translucent_modify: fabricating local add\n", 0, 0, 0);
415 for(del = 0, ax = NULL, m = op->orm_modlist; m; m = m->sml_next) {
416 if(((m->sml_op & LDAP_MOD_OP) != LDAP_MOD_ADD) &&
417 ((m->sml_op & LDAP_MOD_OP) != LDAP_MOD_REPLACE)) {
418 Debug(LDAP_DEBUG_ANY,
419 "=> translucent_modify: silently dropped modification(%d): %s\n",
420 m->sml_op, m->sml_desc->ad_cname.bv_val, 0);
421 if((m->sml_op & LDAP_MOD_OP) == LDAP_MOD_DELETE) del++;
424 a = attr_alloc( m->sml_desc );
425 a->a_vals = m->sml_values;
426 a->a_nvals = m->sml_nvalues ? m->sml_nvalues : a->a_vals;
431 if(del && ov->strict) {
433 send_ldap_error(op, rs, LDAP_CONSTRAINT_VIOLATION,
434 "attempt to delete attributes from local database");
440 send_ldap_error(op, rs, LDAP_CONSTRAINT_VIOLATION,
441 "modification contained other than ADD or REPLACE");
444 /* rs->sr_text = "no valid modification found"; */
445 rs->sr_err = LDAP_SUCCESS;
446 send_ldap_result(op, rs);
451 ne.e_name = op->o_req_dn;
452 ne.e_nname = op->o_req_ndn;
456 ne.e_bv.bv_val = NULL;
459 nop.o_tag = LDAP_REQ_ADD;
460 nop.oq_add.rs_e = ≠
464 cb.sc_response = translucent_tag_cb;
465 cb.sc_private = op->orm_modlist;
466 cb.sc_next = nop.o_callback;
467 nop.o_callback = &cb;
468 rc = on->on_info->oi_orig->bi_op_add(&nop, &nrs);
474 static int translucent_compare(Operation *op, SlapReply *rs) {
476 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
477 translucent_info *ov = on->on_bi.bi_private;
478 AttributeAssertion *ava = op->orc_ava;
482 Debug(LDAP_DEBUG_TRACE, "==> translucent_compare: <%s> %s:%s\n",
483 op->o_req_dn.bv_val, ava->aa_desc->ad_cname.bv_val, ava->aa_value.bv_val);
486 ** if the local backend has an entry for this attribute:
487 ** CONTINUE and let it do the compare;
490 op->o_bd->bd_info = (BackendInfo *) on->on_info;
491 rc = be_entry_get_rw(op, &op->o_req_ndn, NULL, ava->aa_desc, 0, &e);
492 if(e && rc == LDAP_SUCCESS) {
493 be_entry_release_r(op, e);
494 op->o_bd->bd_info = (BackendInfo *) on;
495 return(SLAP_CB_CONTINUE);
497 op->o_bd->bd_info = (BackendInfo *) on;
500 ** call compare() in the captive backend;
501 ** return the result;
505 nop.o_callback = NULL;
506 rc = ov->db.bd_info->bi_op_compare(&nop, rs);
512 ** translucent_search_cb()
513 ** merge local data with the search result
517 static int translucent_search_cb(Operation *op, SlapReply *rs) {
519 Entry *e, *re = NULL;
520 Attribute *a, *ax, *an, *as = NULL;
521 Operation * original_op, local_op;
524 if(!op || !rs || rs->sr_type != REP_SEARCH || !rs->sr_entry)
525 return(SLAP_CB_CONTINUE);
527 Debug(LDAP_DEBUG_TRACE, "==> translucent_search_cb: %s\n",
528 rs->sr_entry->e_name.bv_val, 0, 0);
530 original_op = op->o_callback->sc_private;
531 on = (slap_overinst *) original_op->o_bd->bd_info;
532 local_op = *original_op;
534 local_op.o_bd->bd_info = (BackendInfo *) on->on_info->oi_orig;
535 rc = be_entry_get_rw(&local_op, &rs->sr_entry->e_nname, NULL, NULL, 0, &e);
536 local_op.o_bd->bd_info = (BackendInfo *) on;
539 ** if we got an entry from local backend:
540 ** make a copy of this search result;
541 ** foreach local attr:
542 ** foreach search result attr:
543 ** if match, result attr with local attr;
544 ** if new local, add to list;
545 ** append new local attrs to search result;
549 if(e && rc == LDAP_SUCCESS) {
550 re = entry_dup(rs->sr_entry);
551 for(ax = e->e_attrs; ax; ax = ax->a_next) {
553 if(is_at_operational(ax->a_desc->ad_type)) continue;
555 for(a = re->e_attrs; a; a = a->a_next) {
556 if(a->a_desc == ax->a_desc) {
557 if(a->a_vals != a->a_nvals)
558 ber_bvarray_free(a->a_nvals);
559 ber_bvarray_free(a->a_vals);
560 a->a_vals = dup_bervarray(ax->a_vals);
561 a->a_nvals = (ax->a_vals == ax->a_nvals) ?
562 a->a_vals : dup_bervarray(ax->a_nvals);
571 local_op.o_bd->bd_info = (BackendInfo *) on->on_info->oi_orig;
572 be_entry_release_r(&local_op, e);
573 local_op.o_bd->bd_info = (BackendInfo *) on;
575 /* literally append, so locals are always last */
578 for(ax = re->e_attrs; ax->a_next; ax = ax->a_next);
585 rs->sr_flags |= REP_ENTRY_MUSTBEFREED;
588 return(SLAP_CB_CONTINUE);
592 ** translucent_search()
593 ** search via captive backend;
594 ** override results with any local data;
598 static int translucent_search(Operation *op, SlapReply *rs) {
599 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
601 translucent_info *ov = on->on_bi.bi_private;
602 slap_callback cb = { NULL, NULL, NULL, NULL };
604 Debug(LDAP_DEBUG_TRACE, "==> translucent_search: <%s> %s\n",
605 op->o_req_dn.bv_val, op->ors_filterstr.bv_val, 0);
607 cb.sc_response = (slap_response *) translucent_search_cb;
609 cb.sc_next = nop.o_callback;
611 nop.o_callback = &cb;
613 return (ov->db.bd_info->bi_op_search(&nop, rs));
618 ** translucent_bind()
619 ** pass bind request to captive backend;
623 static int translucent_bind(Operation *op, SlapReply *rs) {
624 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
626 translucent_info *ov = on->on_bi.bi_private;
628 Debug(LDAP_DEBUG_TRACE, "translucent_bind: <%s> method %d\n",
629 op->o_req_dn.bv_val, op->orb_method, 0);
632 return (ov->db.bd_info->bi_op_bind(&nop, rs));
636 ** translucent_connection_destroy()
637 ** pass disconnect notification to captive backend;
641 static int translucent_connection_destroy(BackendDB *be, Connection *conn) {
642 slap_overinst *on = (slap_overinst *) be->bd_info;
643 translucent_info *ov = on->on_bi.bi_private;
646 Debug(LDAP_DEBUG_TRACE, "translucent_connection_destroy\n", 0, 0, 0);
648 rc = ov->db.bd_info->bi_connection_destroy(&ov->db, conn);
654 ** translucent_db_config()
655 ** pass config directives to captive backend;
656 ** parse unrecognized directives ourselves;
660 static int translucent_db_config(
668 slap_overinst *on = (slap_overinst *) be->bd_info;
669 translucent_info *ov = on->on_bi.bi_private;
671 Debug(LDAP_DEBUG_TRACE, "==> translucent_db_config: %s\n",
672 argc ? argv[0] : "", 0, 0);
674 /* Something for the captive database? */
675 if ( ov->db.bd_info && ov->db.bd_info->bi_db_config )
676 return ov->db.bd_info->bi_db_config( &ov->db, fname, lineno,
678 return SLAP_CONF_UNKNOWN;
682 ** translucent_db_init()
683 ** initialize the captive backend;
687 static int translucent_db_init(BackendDB *be) {
688 slap_overinst *on = (slap_overinst *) be->bd_info;
689 translucent_info *ov;
692 Debug(LDAP_DEBUG_TRACE, "==> translucent_db_init\n", 0, 0, 0);
694 ov = ch_calloc(1, sizeof(translucent_info));
695 on->on_bi.bi_private = ov;
697 ov->db.be_private = NULL;
698 ov->db.be_pcl_mutexp = &ov->db.be_pcl_mutex;
700 if ( !backend_db_init( "ldap", &ov->db )) {
701 Debug( LDAP_DEBUG_CONFIG, "translucent: unable to open captive back-ldap\n", 0, 0, 0);
704 SLAP_DBFLAGS(be) |= SLAP_DBFLAG_NO_SCHEMA_CHECK;
705 SLAP_DBFLAGS(be) |= SLAP_DBFLAG_NOLASTMOD;
711 ** translucent_db_open()
712 ** if the captive backend has an open() method, call it;
716 static int translucent_db_open(BackendDB *be) {
717 slap_overinst *on = (slap_overinst *) be->bd_info;
718 translucent_info *ov = on->on_bi.bi_private;
721 Debug(LDAP_DEBUG_TRACE, "==> translucent_db_open\n", 0, 0, 0);
723 /* need to inherit something from the original database... */
724 ov->db.be_def_limit = be->be_def_limit;
725 ov->db.be_limits = be->be_limits;
726 ov->db.be_acl = be->be_acl;
727 ov->db.be_dfltaccess = be->be_dfltaccess;
729 rc = backend_startup_one( &ov->db );
731 if(rc) Debug(LDAP_DEBUG_TRACE,
732 "translucent: bi_db_open() returned error %d\n", rc, 0, 0);
738 ** translucent_db_close()
739 ** if the captive backend has a close() method, call it;
740 ** free any config data;
745 translucent_db_close( BackendDB *be )
747 slap_overinst *on = (slap_overinst *) be->bd_info;
748 translucent_info *ov = on->on_bi.bi_private;
751 Debug(LDAP_DEBUG_TRACE, "==> translucent_db_close\n", 0, 0, 0);
753 if ( ov && ov->db.bd_info && ov->db.bd_info->bi_db_close ) {
754 rc = ov->db.bd_info->bi_db_close(&ov->db);
761 ** translucent_db_destroy()
762 ** if the captive backend has a db_destroy() method, call it
767 translucent_db_destroy( BackendDB *be )
769 slap_overinst *on = (slap_overinst *) be->bd_info;
770 translucent_info *ov = on->on_bi.bi_private;
773 Debug(LDAP_DEBUG_TRACE, "==> translucent_db_close\n", 0, 0, 0);
776 /* cleanup stuff inherited from the original database... */
777 ov->db.be_suffix = NULL;
778 ov->db.be_nsuffix = NULL;
779 BER_BVZERO( &ov->db.be_rootdn );
780 BER_BVZERO( &ov->db.be_rootndn );
781 BER_BVZERO( &ov->db.be_rootpw );
782 /* FIXME: there might be more... */
784 if ( ov->db.be_private != NULL ) {
785 backend_destroy_one( &ov->db, 0 );
789 on->on_bi.bi_private = NULL;
796 ** translucent_initialize()
797 ** initialize the slap_overinst with our entry points;
801 int translucent_initialize() {
805 Debug(LDAP_DEBUG_TRACE, "==> translucent_initialize\n", 0, 0, 0);
807 translucent.on_bi.bi_type = "translucent";
808 translucent.on_bi.bi_db_init = translucent_db_init;
809 translucent.on_bi.bi_db_config = translucent_db_config;
810 translucent.on_bi.bi_db_open = translucent_db_open;
811 translucent.on_bi.bi_db_close = translucent_db_close;
812 translucent.on_bi.bi_db_destroy = translucent_db_destroy;
813 translucent.on_bi.bi_op_bind = translucent_bind;
814 translucent.on_bi.bi_op_add = translucent_add;
815 translucent.on_bi.bi_op_modify = translucent_modify;
816 translucent.on_bi.bi_op_modrdn = translucent_modrdn;
817 translucent.on_bi.bi_op_delete = translucent_delete;
818 translucent.on_bi.bi_op_search = translucent_search;
819 translucent.on_bi.bi_op_compare = translucent_compare;
820 translucent.on_bi.bi_connection_destroy = translucent_connection_destroy;
822 translucent.on_bi.bi_cf_ocs = translucentocs;
823 rc = config_register_schema ( translucentcfg, translucentocs );
826 return(overlay_register(&translucent));
829 #if SLAPD_OVER_TRANSLUCENT == SLAPD_MOD_DYNAMIC && defined(PIC)
830 int init_module(int argc, char *argv[]) {
831 return translucent_initialize();
835 #endif /* SLAPD_OVER_TRANSLUCENT */