1 .TH LDAP_GET_DN 3 "22 September 1998" "OpenLDAP LDVERSION"
3 ldap_get_dn, ldap_explode_dn, ldap_explode_rdn, ldap_dn2ufn, ldap_is_dns_dn, ldap_explode_dns \- LDAP DN handling routines
11 char *ldap_get_dn(ld, entry)
17 char **ldap_explode_dn(dn, notypes)
23 char **ldap_explode_rdn(rdn, notypes)
34 int ldap_is_dns_dn(dn)
39 char **ldap_explode_dns(dn)
43 These routines allow LDAP entry names (Distinguished Names, or DNs)
44 to be obtained, parsed, converted to a user-friendly form, and tested.
45 A DN has the form described in RFC 1779 "A String Representation of
46 Distinguished Names", unless it is an experimental DNS-style DN
47 which takes the form of an RFC 822 mail address.
51 routine takes an \fIentry\fP as returned by
52 .BR ldap_first_entry (3)
54 .BR ldap_next_entry (3)
56 the entry's DN. Space for the DN will have been obtained via
58 and should be freed by the caller by a call to
63 routine takes a DN as returned by
65 and breaks it up into its component parts. Each part is known as a
66 Relative Distinguished Name, or RDN.
69 NULL-terminated array, each component of which contains an RDN from the
70 DN. The \fInotypes\fP parameter is used to request that only the RDN
71 values be returned, not their types. For example, the DN "cn=Bob,
72 c=US" would return as either { "cn=Bob", "c=US", NULL } or { "Bob",
73 "US", NULL }, depending on whether notypes was 0 or 1, respectively.
74 The result can be freed by calling
75 .BR ldap_value_free (3).
79 routine takes an RDN as returned by
80 .B ldap_explode_dn(dn,0)
81 and breaks it up into its "type=value" component parts (or just "value",
82 if the \fInotypes\fP parameter is set). The result can be freed by
84 .BR ldap_value_free (3).
87 is used to turn a DN as returned by
89 into a more user-friendly form, stripping off type names. See
90 RFC 1781 "Using the Directory to Achieve User Friendly Naming"
91 for more details on the UFN format. The space for the UFN returned
92 is obtained by a call to
94 and the user is responsible for freeing it via a call to
98 returns non-zero if the dn string is an experimental
99 DNS-style DN (generally in the form of an RFC 822 e-mail address). It
100 returns zero if the dn appears to be an RFC 1779 format DN.
102 .B ldap_explode_dns()
103 takes a DNS-style DN and breaks it up into its
105 .B ldap_explode_dns()
106 returns a NULL-terminated array.
107 For example, the DN "mcs.umich.edu" will return { "mcs", "umich", "edu",
108 NULL }. The result can be freed by calling
109 .BR ldap_value_free (3).
111 If an error occurs in
113 NULL is returned and the
115 field in the \fIld\fP parameter is set to indicate the error. See
117 for a description of possible error codes.
118 .BR ldap_explode_dn() ,
119 .BR ldap_explode_rdn() ,
120 .B ldap_explode_dns()
123 will return NULL with
125 set appropriately in case of trouble.
127 These routines malloc memory that the caller must free.
130 .BR ldap_first_entry(3),
132 .BR ldap_value_free(3)
135 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
137 is derived from University of Michigan LDAP 3.3 Release.