ldap_url_parse
Parses the specified URL into its components.
LDAP Version:v3
Library:*ldapsdk.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX
Syntax
#include <ldap.h>
int ldap_url_parse (
const char *url,
LDAPURLDesc **ludpp);
Parameters
- url
-
(IN) Points to the URL that you want to parse.
- ludpp
-
(OUT) Points to an LDAPURLDesc structure that contains the components of the URL.
Return Values
This function does not return a standard LDAP error code. It returns one of the following:
Remarks
Since this function does not return a standard LDAP error code, you should not call ldap_err2string to parse the return code.
ldap_url_parse_ext performs a similar function, but handles default values differently. ldap_url_parse_ext is better suited for situations where you must convert an LDAPURLDesc structure back to a URL string, retaining the original form of the string.
The following lists describes how each field in the LDAPURLDesc structure is determined from the LDAP URL:
- lud_scheme: Contains the URL scheme (either ldap or ldaps).
- lud_host: Points to the name of the host as a dotted IP address or DNS format Set to an empty string if missing from URL.
- lud_port: Contains the port from the URL. Set to 389 or 636 if missing, depending on the scheme.
- lud_dn: Points to the distinguished name of the base entry from the URL. Set to an empty string if missing.
- lud_attrs: Points to a NULL-terminated list of attributes specified in the URL. NULL if no attributes specified.
- lud_scope: Contains the scope in the URL and uses one of the following flags. LDAP_SCOPE_BASE (0x00)-searches the entry specified by the base parameter. LDAP_SCOPE_ONELEVEL (0x01)-searches the entry specified by the base parameter and one level beneath that entry. LDAP_SCOPE_SUBTREE (0x02)-searches the entire subtree starting with the entry specified by the base parameter. Default is LDAP_SCOPE_BASE.
- lud_filter: Points to the search filter specified in the URL. If NULL is passed, a default filter ("objectclass=*") is used.
- lud_exts: Points to a NULL-terminated list of the extensions specified in the URL. NULL if no extensions are specified.
- lud_crit_exts: Specifies whether or not any critical extensions are included. Set to 1 if any critical extension are included, otherwise set to 0.