Skip to content
Snippets Groups Projects
Commit 9c6a5df8 authored by Howard Chu's avatar Howard Chu Committed by Quanah Gibson-Mount
Browse files

More for overlay use, add connid extension

parent 4b6f888b
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ struct sockinfo {
#define SOCK_EXT_BINDDN 1
#define SOCK_EXT_PEERNAME 2
#define SOCK_EXT_SSF 4
#define SOCK_EXT_CONNID 8
extern FILE *opensock LDAP_P((
const char *sockpath));
......
......@@ -77,6 +77,7 @@ static slap_verbmasks bs_exts[] = {
{ BER_BVC("binddn"), SOCK_EXT_BINDDN },
{ BER_BVC("peername"), SOCK_EXT_PEERNAME },
{ BER_BVC("ssf"), SOCK_EXT_SSF },
{ BER_BVC("connid"), SOCK_EXT_CONNID },
{ BER_BVNULL, 0 }
};
......@@ -158,6 +159,7 @@ static int sock_over_op(
{
slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
void *private = op->o_bd->be_private;
slap_callback cb = { NULL, slap_null_cb, NULL, NULL };
slap_operation_t which;
int rc;
......@@ -174,11 +176,22 @@ static int sock_over_op(
return SLAP_CB_CONTINUE;
}
op->o_bd->be_private = on->on_bi.bi_private;
cb.sc_next = op->o_callback;
op->o_callback = &cb;
rc = sockfuncs[which]( op, rs );
op->o_bd->be_private = private;
op->o_callback = cb.sc_next;
return rc;
}
static int
sock_over_response( Operatiion *op, SlapReply *rs )
{
slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
struct sockinfo *si = (struct sockinfo *)on->on_bi.bi_private;
}
static int
sock_over_setup()
{
......@@ -196,6 +209,7 @@ sock_over_setup()
sockover.on_bi.bi_op_modrdn = sock_over_op;
sockover.on_bi.bi_op_add = sock_over_op;
sockover.on_bi.bi_op_delete = sock_over_op;
sockover.on_response = sock_over_response;
sockover.on_bi.bi_cf_ocs = osocs;
......
......@@ -151,4 +151,7 @@ sock_print_conn(
if( si->si_extensions & SOCK_EXT_SSF ) {
fprintf( fp, "ssf: %d\n", conn->c_ssf );
}
if( si->si_extensions & SOCK_EXT_CONNID ) {
fprintf( fp, "connid: %lu\n", conn->c_connid );
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment