#include <ldap.h> typedef struct ldap_url_desc { char *lud_host; /* LDAP host to contact */ int lud_port; /* port on host */ char *lud_dn; /* base for search */ char **lud_attrs; /* NULL-terminate list of attributes */ int lud_scope; /* a valid LDAP_SCOPE_... value */ char *lud_filter; /* LDAP search filter */ char *lud_string; /* for internal use only */ } LDAPURLDesc; int ldap_url_parse( char *url, LDAPURLDesc **ludpp)
The ldap_url_parse() function breaks down the LDAP URL passed in url into its component pieces. The URLs passed in to ldap_url_parse() must be in the local codepage. Use ldap_url_parse_utf8() for UTF-8 URLs.
The LDAPURLDesc structure returned by this API should be freed with ldap_free_urldesc().
This routine supports the use of LDAP URLs (Uniform Resource Locators). Supported LDAP URLs look like this, where sections in brackets are optional:
ldap[s]://[hostport][/[dn[?[attributes][?[scope][?[filter]]]]]]
where:
For example:
ldap://example.ibm.com/c=US?o,description?one?o=ibm
URLs that are wrapped in angle-brackets and/or preceded by "URL:" are also tolerated, including the form url:ldapurl.
For example:
URL:ldaps://example.ibm.com/c=US?o,description?one?o=ibm
This form also is allowed: <url:ldapurl>
For example:
<URL:ldap://example.ibm.com/c=US?o,description?one?o=ibm>
No i5/OS authority is required.
LDAP_URL_ERR_NOTLDAP | URL doesn't begin with "ldap://" |
LDAP_URL_ERR_BADSCOPE | URL scope string is invalid |
LDAP_URL_ERR_MEM | can't allocate memory space |
The following message may be sent from this function.
Message ID | Error Message Text |
---|---|
CPF3CF2 E | Error(s) occurred during running of ldap_url_parse API. |
Top | LDAP APIs | APIs by category |