From: Kurt Zeilenga Date: Sun, 1 Jun 2003 00:09:32 +0000 (+0000) Subject: read get_extop func X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~948 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2fcbaf29d959270cf117df6020680701979b4516;p=openldap read get_extop func --- diff --git a/servers/slapd/extended.c b/servers/slapd/extended.c index a9a601476e..b853d7a27d 100644 --- a/servers/slapd/extended.c +++ b/servers/slapd/extended.c @@ -88,6 +88,24 @@ static struct { static struct extop_list *find_extop( struct extop_list *list, struct berval *oid ); +struct berval * +get_supported_extop (int index) +{ + struct extop_list *ext; + + /* linear scan is slow, but this way doesn't force a + * big change on root_dse.c, where this routine is used. + */ + for (ext = supp_ext_list; ext != NULL && --index >= 0; ext = ext->next) { + ; /* empty */ + } + + if (ext == NULL) return NULL; + + return &ext->oid; +} + + int exop_root_dse_info( Entry *e ) { AttributeDescription *ad_supportedExtension diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 050782828e..5d378d991a 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -466,6 +466,8 @@ LDAP_SLAPD_F (int) extops_init LDAP_P(( void )); LDAP_SLAPD_F (int) extops_kill LDAP_P(( void )); +LDAP_SLAPD_F (struct berval *) get_supported_extop LDAP_P((int index)); + /* * * cancel.c * */