Sun Directory Server Enterprise Edition 7.0 Developer's Guide

slapi_sdn_scope_test()

Checks whether an entry, given its DN, is in the scope of a certain base DN.

Syntax

#include "slapi-plugin.h"
 int slapi_sdn_scope_test( const Slapi_DN *dn, const Slapi_DN *base,
    int scope );

Parameters

This function takes the following parameters:

dn

The DN of the entry subject of scope test.

base

The base DN to which dn is going to be tested against.

scope

The scope tested. This parameter can take one of the following levels

  • LDAP_SCOPE_BASE - where the entry DN should be the same as the base DN

  • LDAP_SCOPE_ONELEVEL - where the base DN should be the parent of the entry DN

  • LDAP_SCOPE_SUBTREE - where the base DN should at least be the suffix of the entry DN

Returns

This function returns non-zero if dn matches the scoping criteria given by base and scope.

Description

This function carries out a simple test to check whether the DN passed in the dn parameter is actually in scope of the base DN according to the values passed into the scope and base parameters.

See Also

slapi_sdn_compare()

slapi_sdn_isparent()

slapi_sdn_issuffix()