From b4eceddb52cf9253bc420c848e382c8ddd3674ec Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 27 Nov 2004 11:45:07 +0000 Subject: [PATCH] Add slap_find_control_id --- servers/slapd/controls.c | 13 +++++++++++++ servers/slapd/proto-slap.h | 1 + 2 files changed, 14 insertions(+) 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 -- 2.39.5