slapi_search_internal()

slapi_search_internal() performs an LDAP search operation to search the directory from your plug-in.

Syntax
#include "slapi-plugin.h"
Slapi_PBlock *slapi_search_internal( char *base, int scope,
			char *filter, LDAPControl **controls,
			char **attrs, int attrsonly );
Parameters
base
The DN of the entry that serves as the starting point for the search. For example, setting base o=Acme Industry, c=US restricts the search to entries at Acme Industry in the United States.
scope
Defines the scope of the search. It can be one of the following values:
  • LDAP_SCOPE_BASE searches the entry that is specified by the base.
  • LDAP_SCOPE_ONELEVEL searches all entries one level beneath the entry that is specified by base.
  • LDAP_SCOPE_SUBTREE searches the entry that is specified by base. It also searches all entries at all levels beneath the entry that is specified by base.
filter
The string representation of the filter to apply in the search.
controls
The NULL-terminated array of an LDAP controls that you want applied to the search operation.
attrs
The NULL-terminated array of attribute types to return from entries that match the filter. If you specify a NULL, all attributes are returned.
attrsonly
Specifies whether attribute values are returned along with the attribute types. It can have the following values:
  • 0 specifies that both attribute types and attribute values are returned.
  • 1 specifies that only attribute types are returned.
Returns
Call the slapi_free_search_results_internal() and slapi_pblock_destroy() to free the search results and the pblock that is returned by slapi_search_internal.