2002-06-13 11:59:10 +08:00
|
|
|
.TH LDAP_URL 3 "RELEASEDATE" "OpenLDAP LDVERSION"
|
1999-09-12 12:41:47 +08:00
|
|
|
.\" $OpenLDAP$
|
2010-04-14 06:17:29 +08:00
|
|
|
.\" Copyright 1998-2010 The OpenLDAP Foundation All Rights Reserved.
|
1999-09-12 12:41:47 +08:00
|
|
|
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
|
1998-08-09 08:43:13 +08:00
|
|
|
.SH NAME
|
2007-07-25 03:11:39 +08:00
|
|
|
ldap_is_ldap_url, ldap_url_parse, ldap_free_urldesc \- LDAP Uniform Resource Locator routines
|
2002-06-21 15:32:54 +08:00
|
|
|
.SH LIBRARY
|
2009-06-03 08:43:44 +08:00
|
|
|
OpenLDAP LDAP (libldap, \-lldap)
|
1998-08-09 08:43:13 +08:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.ft B
|
|
|
|
#include <ldap.h>
|
|
|
|
.LP
|
|
|
|
.ft B
|
2001-07-24 14:26:32 +08:00
|
|
|
int ldap_is_ldap_url( const char *url )
|
1998-08-09 08:43:13 +08:00
|
|
|
.LP
|
|
|
|
.ft B
|
2001-07-24 14:26:32 +08:00
|
|
|
int ldap_url_parse( const char *url, LDAPURLDesc **ludpp )
|
1998-08-09 08:43:13 +08:00
|
|
|
.LP
|
|
|
|
typedef struct ldap_url_desc {
|
2001-07-24 14:26:32 +08:00
|
|
|
char * lud_scheme; /* URI scheme */
|
2004-08-29 22:55:56 +08:00
|
|
|
char * lud_host; /* LDAP host to contact */
|
2001-07-24 14:26:32 +08:00
|
|
|
int lud_port; /* port on host */
|
|
|
|
char * lud_dn; /* base for search */
|
|
|
|
char ** lud_attrs; /* list of attributes */
|
|
|
|
int lud_scope; /* a LDAP_SCOPE_... value */
|
|
|
|
char * lud_filter; /* LDAP search filter */
|
|
|
|
char ** lud_exts; /* LDAP extensions */
|
|
|
|
int lud_crit_exts; /* true if any extension is critical */
|
2000-10-18 03:07:56 +08:00
|
|
|
/* may contain additional fields for internal use */
|
1998-08-09 08:43:13 +08:00
|
|
|
} LDAPURLDesc;
|
|
|
|
.LP
|
|
|
|
.ft B
|
2007-11-14 18:00:36 +08:00
|
|
|
void ldap_free_urldesc( LDAPURLDesc *ludp );
|
1998-08-09 08:43:13 +08:00
|
|
|
.SH DESCRIPTION
|
2000-10-18 03:07:56 +08:00
|
|
|
These routines support the use of LDAP URLs (Uniform Resource Locators)
|
2006-06-10 01:20:38 +08:00
|
|
|
as detailed in RFC 4516. LDAP URLs look like this:
|
1998-08-09 08:43:13 +08:00
|
|
|
.nf
|
|
|
|
|
2000-10-18 03:07:56 +08:00
|
|
|
\fBldap://\fP\fIhostport\fP\fB/\fP\fIdn\fP[\fB?\fP\fIattrs\fP[\fB?\fP\fIscope\fP[\fB?\fP\fIfilter\fP[\fB?\fP\fIexts\fP]]]]
|
1998-08-09 08:43:13 +08:00
|
|
|
|
|
|
|
where:
|
|
|
|
\fIhostport\fP is a host name with an optional ":portnumber"
|
2000-10-18 03:07:56 +08:00
|
|
|
\fIdn\fP is the search base
|
|
|
|
\fIattrs\fP is a comma separated list of attributes to request
|
|
|
|
\fIscope\fP is one of these three strings:
|
|
|
|
base one sub (default=base)
|
|
|
|
\fIfilter\fP is filter
|
|
|
|
\fIexts\fP are recognized set of LDAP and/or API extensions.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
ldap://ldap.example.net/dc=example,dc=net?cn,sn?sub?(cn=*)
|
1998-08-09 08:43:13 +08:00
|
|
|
|
|
|
|
.fi
|
|
|
|
.LP
|
|
|
|
URLs that are wrapped in angle-brackets and/or preceded by "URL:" are also
|
2006-06-14 14:02:44 +08:00
|
|
|
tolerated. Alternative LDAP schemes such as ldaps:// and ldapi:// may be
|
2000-10-18 03:07:56 +08:00
|
|
|
parsed using the below routines as well.
|
1998-08-09 08:43:13 +08:00
|
|
|
.LP
|
|
|
|
.B ldap_is_ldap_url()
|
|
|
|
returns a non-zero value if \fIurl\fP looks like an LDAP URL (as
|
|
|
|
opposed to some other kind of URL). It can be used as a quick check
|
|
|
|
for an LDAP URL; the
|
|
|
|
.B ldap_url_parse()
|
|
|
|
routine should be used if a more thorough check is needed.
|
|
|
|
.LP
|
|
|
|
.B ldap_url_parse()
|
|
|
|
breaks down an LDAP URL passed in \fIurl\fP into its component pieces.
|
|
|
|
If successful, zero is returned, an LDAP URL description is
|
|
|
|
allocated, filled in, and \fIludpp\fP is set to point to it. If an
|
2000-10-18 03:07:56 +08:00
|
|
|
error occurs, a non-zero URL error code is returned.
|
1998-08-09 08:43:13 +08:00
|
|
|
.LP
|
|
|
|
.B ldap_free_urldesc()
|
|
|
|
should be called to free an LDAP URL description that was obtained from
|
|
|
|
a call to
|
|
|
|
.B ldap_url_parse().
|
|
|
|
.SH SEE ALSO
|
2006-06-14 14:02:44 +08:00
|
|
|
.nf
|
2002-03-30 05:06:31 +08:00
|
|
|
.BR ldap (3)
|
2006-06-14 14:02:44 +08:00
|
|
|
.BR "RFC 4516" " <http://www.rfc-editor.org/rfc/rfc4516.txt>"
|
1998-10-25 09:41:42 +08:00
|
|
|
.SH ACKNOWLEDGEMENTS
|
2006-06-14 14:02:44 +08:00
|
|
|
.fi
|
|
|
|
.so ../Project
|