]> git.sur5r.net Git - openldap/blob - doc/man/man3/ldap_url.3
Don't suggest free by deprecated function.
[openldap] / doc / man / man3 / ldap_url.3
1 .TH LDAP_URL 3 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2006 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ldap_is_ldap_url,
7 ldap_url_parse,
8 ldap_free_urldesc \- LDAP Uniform Resource Locator routines
9 .SH LIBRARY
10 OpenLDAP LDAP (libldap, -lldap)
11 .SH SYNOPSIS
12 .nf
13 .ft B
14 #include <ldap.h>
15 .LP
16 .ft B
17 int ldap_is_ldap_url( const char *url )
18 .LP
19 .ft B
20 int ldap_url_parse( const char *url, LDAPURLDesc **ludpp )
21 .LP
22 typedef struct ldap_url_desc {
23     char *      lud_scheme;     /* URI scheme */
24     char *      lud_host;       /* LDAP host to contact */
25     int         lud_port;       /* port on host */
26     char *      lud_dn;         /* base for search */
27     char **     lud_attrs;      /* list of attributes */
28     int         lud_scope;      /* a LDAP_SCOPE_... value */
29     char *      lud_filter;     /* LDAP search filter */
30     char **     lud_exts;       /* LDAP extensions */
31     int         lud_crit_exts;  /* true if any extension is critical */
32     /* may contain additional fields for internal use */
33 } LDAPURLDesc;
34 .LP
35 .ft B
36 ldap_free_urldesc( LDAPURLDesc *ludp )
37 .SH DESCRIPTION
38 These routines support the use of LDAP URLs (Uniform Resource Locators)
39 as detailed in RFC 4516.  LDAP URLs look like this:
40 .nf
41
42   \fBldap://\fP\fIhostport\fP\fB/\fP\fIdn\fP[\fB?\fP\fIattrs\fP[\fB?\fP\fIscope\fP[\fB?\fP\fIfilter\fP[\fB?\fP\fIexts\fP]]]]
43
44 where:
45   \fIhostport\fP is a host name with an optional ":portnumber"
46   \fIdn\fP is the search base
47   \fIattrs\fP is a comma separated list of attributes to request
48   \fIscope\fP is one of these three strings:
49     base one sub (default=base)
50   \fIfilter\fP is filter
51   \fIexts\fP are recognized set of LDAP and/or API extensions.
52
53 Example:
54   ldap://ldap.example.net/dc=example,dc=net?cn,sn?sub?(cn=*)
55
56 .fi
57 .LP
58 URLs that are wrapped in angle-brackets and/or preceded by "URL:" are also
59 tolerated.  Alternative LDAP schemes such as ldaps:// and ldapi:// may be
60 parsed using the below routines as well.
61 .LP
62 .B ldap_is_ldap_url()
63 returns a non-zero value if \fIurl\fP looks like an LDAP URL (as
64 opposed to some other kind of URL).  It can be used as a quick check
65 for an LDAP URL; the
66 .B ldap_url_parse()
67 routine should be used if a more thorough check is needed.
68 .LP
69 .B ldap_url_parse()
70 breaks down an LDAP URL passed in \fIurl\fP into its component pieces.
71 If successful, zero is returned, an LDAP URL description is
72 allocated, filled in, and \fIludpp\fP is set to point to it.  If an
73 error occurs, a non-zero URL error code is returned.
74 .LP
75 .B ldap_free_urldesc()
76 should be called to free an LDAP URL description that was obtained from
77 a call to
78 .B ldap_url_parse().
79 .SH SEE ALSO
80 .nf
81 .BR ldap (3)
82 .BR "RFC 4516" " <http://www.rfc-editor.org/rfc/rfc4516.txt>"
83 .SH ACKNOWLEDGEMENTS
84 .fi
85 .so ../Project