[Date Prev][Date Next] [Chronological] [Thread] [Top]

Can I reuse the back-ldap in my own overlay?



I want to write a overlay "DirectForwarding" that does not do the LDAP
request in local back-bdb, but intercepts the request and forwards it to
a remote DSA.
I know that back-ldap in chain overlay does the same work by initiating
the same request to the remote DSA appeared in the referral entry. 
So is it possible to reuse back-ldap in my overlay "DirectForwarding"? 
If yes, what fields of struct SlapReply should be set to simulate what
back-bdb does?

Below is example code:
------------------------------------------------------------------------
-----------------------------
static slap_overinst DirectForwarding;

static int DirectForwarding_search(
	Operation *op,
	SlapReply *rs
)
{
	/* ... */
	ldap_back_search(op,rs);

      /* ... */
	send_ldap_result( op, rs );
      
      return 0;   
}

int DirectForwarding_initialize() {

	/* statically declared just after the #includes at top */
	DirectForwarding.on_bi.bi_type = "DirectForwarding";
      /*... Other opeartion functions are ignored here */
	DirectForwarding.on_bi.bi_op_search = DirectForwarding_search;


	return(overlay_register(&DirectForwarding));
}

------------------------------------------------------------------------
-----------------------------

 
-Shijun Chen-