Add slap_find_control_id

This commit is contained in:
Howard Chu 2004-11-27 11:45:07 +00:00
parent ed9925f6d9
commit b4eceddb52
2 changed files with 14 additions and 0 deletions

View file

@ -348,6 +348,19 @@ find_ctrl( const char *oid )
return NULL;
}
int
slap_find_control_id(
const char *oid,
int *cid )
{
slap_control *ctrl = find_ctrl( oid );
if ( ctrl && cid ) {
*cid = ctrl->sc_cid;
return LDAP_SUCCESS;
}
return LDAP_CONTROL_NOT_FOUND;
}
void slap_free_ctrls(
Operation *op,
LDAPControl **ctrls )

View file

@ -397,6 +397,7 @@ LDAP_SLAPD_F (int) slap_controls_init LDAP_P ((void));
LDAP_SLAPD_F (void) controls_destroy LDAP_P ((void));
LDAP_SLAPD_F (int) controls_root_dse_info LDAP_P ((Entry *e));
LDAP_SLAPD_F (int) get_supported_controls LDAP_P (( char ***ctrloidsp, slap_mask_t **ctrlmasks ));
LDAP_SLAPD_F (int) slap_find_control_id LDAP_P (( const char *oid, int *cid ));
/*
* config.c