MAN page from Mandrake Other ldap-devel-3.3-3.i386.rpm
LDAP_URL
Section: C Library Functions (3)
Updated: 28 March 1996
Index NAME
ldap_is_ldap_url,ldap_url_parse,ldap_free_urldesc,ldap_url_search,ldap_url_search_s,ldap_url_search_st - LDAP Uniform Resource Locator routines
SYNOPSIS
#include <lber.h>#include <ldap.h>int ldap_is_ldap_url( url )char *url;int ldap_url_parse( url, ludpp )char *url;LDAPURLDesc **ludpp;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;ldap_free_urldesc( ludp )LDAPURLDesc *ludp;int ldap_url_search( ld, url, attrsonly )LDAP *ld;char *url;int attrsonly;int ldap_url_search_s( ld, url, attrsonly, res )LDAP *ld;char *url;int attrsonly;LDAPMessage **res;int ldap_url_search_st( ld, url, attrsonly, timeout, res )LDAP *ld;char *url;int attrsonly;struct timeval *timeout;LDAPMessage **res; DESCRIPTION
These routines support the use of LDAP URLs (Uniform Resource Locators).LDAP URLs look like this:
ldap://hostport/dn[?attributes[?scope[?filter]]]where: hostport is a host name with an optional ":portnumber" dnis the base DN to be used for an LDAP search operation attributes is a comma separated list of attributes to be retrieved scope is one of these three strings: base one sub (default=base) filteris LDAP search filter as used in a call to ldap_search(3)e.g., ldap://ldap.itd.umich.edu/c=US?o,description?one?o=umich
URLs that are wrapped in angle-brackets and/or preceded by "URL:" are alsotolerated.
ldap_is_ldap_url()returns a non-zero value if url looks like an LDAP URL (asopposed to some other kind of URL). It can be used as a quick checkfor an LDAP URL; theldap_url_parse()routine should be used if a more thorough check is needed.
ldap_url_parse()breaks down an LDAP URL passed in url into its component pieces.If successful, zero is returned, an LDAP URL description isallocated, filled in, and ludpp is set to point to it. If anerror occurs, one of these values is returned:
LDAP_URL_ERR_NOTLDAP - URL doesn't begin with "ldap://" LDAP_URL_ERR_NODN - URL has no DN (required) LDAP_URL_ERR_BADSCOPE - URL scope string is invalid LDAP_URL_ERR_MEM - can't allocate memory space
ldap_free_urldesc()should be called to free an LDAP URL description that was obtained froma call toldap_url_parse().
ldap_url_search()initiates an asynchronous LDAP search based on the contents of theurl string. This routine acts just likeldap_search(3)except that many search parameters are pulled out of the URL.
ldap_url_search_s()performs a synchronous LDAP search based on the contents of theurl string. This routine acts just likeldap_search_s(3)except that many search parameters are pulled out of the URL.
ldap_url_search_st()performs a synchronous LDAP URL search with a specified timeout.This routine acts just likeldap_search_st(3)except that many search parameters are pulled out of the URL.
SEE ALSO
ldap(3),
ldap_search(3)
An LDAP URL Format,Tim Howes and Mark Smith, December 1995. Internet Draft (work in progress).Currently available at this URL:
ftp://ds.internic.net/internet-drafts/draft-ietf-asid-ldap-format-03.txt
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- SEE ALSO
This document was created byman2html,using the manual pages.