]> git.sur5r.net Git - openldap/blob - doc/man/man3/ldap_url.3
Add -s warning
[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 .ft
16 .LP
17 .ft B
18 int ldap_is_ldap_url( const char *url )
19 .LP
20 .ft B
21 int ldap_url_parse( const char *url, LDAPURLDesc **ludpp )
22 .LP
23 typedef struct ldap_url_desc {
24     char *      lud_scheme;     /* URI scheme */
25     char *      lud_host;       /* LDAP host to contact */
26     int         lud_port;       /* port on host */
27     char *      lud_dn;         /* base for search */
28     char **     lud_attrs;      /* list of attributes */
29     int         lud_scope;      /* a LDAP_SCOPE_... value */
30     char *      lud_filter;     /* LDAP search filter */
31     char **     lud_exts;       /* LDAP extensions */
32     int         lud_crit_exts;  /* true if any extension is critical */
33     /* may contain additional fields for internal use */
34 } LDAPURLDesc;
35 .LP
36 .ft B
37 ldap_free_urldesc( LDAPURLDesc *ludp )
38 .SH DESCRIPTION
39 These routines support the use of LDAP URLs (Uniform Resource Locators)
40 as detailed in RFC 2255.  LDAP URLs look like this:
41 .nf
42
43   \fBldap://\fP\fIhostport\fP\fB/\fP\fIdn\fP[\fB?\fP\fIattrs\fP[\fB?\fP\fIscope\fP[\fB?\fP\fIfilter\fP[\fB?\fP\fIexts\fP]]]]
44
45 where:
46   \fIhostport\fP is a host name with an optional ":portnumber"
47   \fIdn\fP is the search base
48   \fIattrs\fP is a comma separated list of attributes to request
49   \fIscope\fP is one of these three strings:
50     base one sub (default=base)
51   \fIfilter\fP is filter
52   \fIexts\fP are recognized set of LDAP and/or API extensions.
53
54 Example:
55   ldap://ldap.example.net/dc=example,dc=net?cn,sn?sub?(cn=*)
56
57 .fi
58 .LP
59 URLs that are wrapped in angle-brackets and/or preceded by "URL:" are also
60 tolerated.  Alternative schemes such as ldaps:// and ldapi:// may be
61 parsed using the below routines as well.
62 .LP
63 .B ldap_is_ldap_url()
64 returns a non-zero value if \fIurl\fP looks like an LDAP URL (as
65 opposed to some other kind of URL).  It can be used as a quick check
66 for an LDAP URL; the
67 .B ldap_url_parse()
68 routine should be used if a more thorough check is needed.
69 .LP
70 .B ldap_url_parse()
71 breaks down an LDAP URL passed in \fIurl\fP into its component pieces.
72 If successful, zero is returned, an LDAP URL description is
73 allocated, filled in, and \fIludpp\fP is set to point to it.  If an
74 error occurs, a non-zero URL error code is returned.
75 .LP
76 .B ldap_free_urldesc()
77 should be called to free an LDAP URL description that was obtained from
78 a call to
79 .B ldap_url_parse().
80 .SH SEE ALSO
81 .BR ldap (3)
82 .LP
83 .B The LDAP URL Format, RFC 2255,
84 Tim Howes and Mark Smith, December 1997.
85 .SH ACKNOWLEDGEMENTS
86 .B OpenLDAP
87 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
88 .B OpenLDAP
89 is derived from University of Michigan LDAP 3.3 Release.