39.28. slapi_sdn_scope_test()

Description

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

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 against which dn is going to be tested.
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.
  • DNLDAP_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.