HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
5.6.3 Getting the parent DN of a DN
To get a copy of the parent DN for a DN, call either the slapi_sdn_get_parent() or the
slapi_sdn_get_backend_parent() function.
These functions return the parent DN of dn. If dn is a suffix served by the back end,
slapi_sdn_get_backend_parent() returns NULL.
When you are finished working with the parent DN, you should free it from memory by calling
slapi_ch_free_string().
5.6.4 Normalizing a DN
You can use the following front end functions to normalize and convert the case of a DN:
Use slapi_sdn_get_ndn() to normalize a DN.
Use “slapi_dn_normalize_case()” to both normalize the DN and convert all characters in
the DN to lowercase.
NOTE:
These functions operate on the actual DN specified in the argument, not a copy of the DN. If you
want to modify a copy of the DN, call slapi_ch_strdup() to make a copy of the DN.
To compare DNs (for example, to search the database for a particular DN), use the
slapi_sdn_compare() function instead of normalizing and comparing the DNs using string
functions.
5.7 Working with search filters
When a client requests an LDAP search operation, the front end passes the search filter to the
back end as part of the parameter block. The filter is passed through the SLAPI_SEARCH_FILTER
parameter. A string representation of the filter is also available in the SLAPI_SEARCH_STRFILTER
parameter.
To manipulate search filters, call the following front end routines:
Table 5-3 Front end functions for manipulating filters
DescriptionFunction
Determine if an entry matches a filter's criteria.“slapi_filter_test()”
Get the filter type.“slapi_filter_get_choice()”
Get the attribute type and value used for comparison in an attribute-value assertion
filter. (Only applicable to the following searches: LDAP_FILTER_EQUALITY,
LDAP_FILTER_GE, LDAP_FILTER_LE, and LDAP_FILTER_APPROX.)
“slapi_filter_get_ava()”
Get the type of attribute that the filter is searching for. (Only applicable to
LDAP_FILTER_PRESENT searches.)
“slapi_filter_get_type()”
Get the substring pattern used for the filter. (Only applicable to
LDAP_FILTER_SUBSTRING searches.)
“slapi_filter_get_subfilt()”
Convert a string representation of a filter to a filter of the data type Slapi_Filter.
“slapi_str2filter()”
Construct a new LDAP_FILTER_AND, LDAP_FILTER_OR, or LDAP_FILTER_NOT filter
from other filters.
“slapi_filter_join()”
Get the components of a filter. (Only applicable to LDAP_FILTER_AND,
LDAP_FILTER_OR, and LDAP_FILTER_NOT searches.)
“slapi_filter_list_first()”
“slapi_filter_list_next()”
Free a filter from memory.“slapi_filter_free()”
54 Front end API functions