From: Howard Chu Date: Sat, 27 Nov 2004 11:45:07 +0000 (+0000) Subject: Add slap_find_control_id X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~202 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b4eceddb52cf9253bc420c848e382c8ddd3674ec;p=openldap Add slap_find_control_id --- diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 5ccca5b4ad..da339a55e8 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -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 ) diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index d3e8f64c15..fb453692a9 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -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