Table of Contents | Previous | Next | Index

Netscape Directory SDK 3.0 for C Programmer’s Guide
     Chapter 17 Data Types and Structures

LDAPURLDesc

LDAPURLDesc is a type of structure that represents the components of an LDAP URL. LDAP URLs have the following syntax:

ldap://hostport/dn[?attributes[?scope[?filter]]]
For example:

ldap://ldap.itd.umich.edu/c=US?o,description?one?o=umich
Calling the ldap_url_parse() routine creates an LDAPURLDesc structure containing the components of the URL. To free the LDAPURLDesc structure, call the ldap_free_urldesc() routine.

LDAPURLDesc is defined as follows:

typedef struct ldap_url_desc {
   char *lud_host;
   int lud_port;
   char *lud_dn;
   char **lud_attrs;
   int lud_scope;
   char *lud_filter;
   unsigned long lud_options;
} LDAPURLDesc;
The fields in this structure are described below:

lud_host

Name of the host in the URL

lud_port

Number of the port in the URL

lud_dn

Distinguished name in the URL. This "base entry" DN identifies the starting point of the search.

lud_attrs

Pointer to a NULL-terminated list of the attributes specified in the URL

lud_scope

Integer representing the scope of the search specified in the URL:

lud_filter

Search filter included in the URL

lud_options

Options (if LDAP_URL_OPT_SECURE, indicates that the protocol is ldaps:// instead of ldap://)

For example, if you pass the following URL to the ldap_url_parse() function:

ldap://ldap.netscape.com:5000/o=Airius.com?cn,mail,telephoneNumber?sub?(sn=Jensen)
the resulting LDAPURLDesc structure (ludpp, in this example) contains the following values:

ludpp->lud_host
ldap.netscape.com
ludpp->lud_port
5000
ludpp->lud_dn
o=Airius.com
ludpp->lud_attrs[0]
cn
ludpp->lud_attrs[1]
mail
ludpp->lud_attrs[2]
telephoneNumber
ludpp->lud_attrs[3]
NULL
ludpp->lud_scope
LDAP_SCOPE_SUBTREE
ludpp->lud_filter
(sn=Jensen)


Table of Contents | Previous | Next | Index

Last Updated: 10/01/98 17:05:28