NAME
ldap - Lightweight Directory Access Protocol package
SYNOPSIS
cc[ flag... ] file... -lldap[ library... ]
#include <lber.h>
#include <ldap.h>
DESCRIPTION
The Lightweight Directory Access Protocol provides TCP/IP
access to the X.500 Directory or to a stand-alone LDAP
server. The SUNWlldap package includes various LDAP clients
and an LDAP client library used to provide programmatic
access to the LDAP protocol. This man page gives an overview
of the LDAP library functions.
Both synchronous and asynchronous APIs are provided. Also
included are various functions to parse the results returned
from these functions. These functions are found in the
libldap.so.3 shared object.
The basic interaction is as follows. A connection is made
to an LDAP server by calling ldap_open(3LDAP). An LDAP bind
operation is performed by calling one of ldap_bind(3LDAP)
and friends. Next, other operations are performed by cal-
ling one of the synchronous or asynchronous functions (for
example, ldap_search_s(3LDAP) or ldap_search(3LDAP) followed
by ldap_result(3LDAP)). Results returned from these func-
tions are interpreted by calling the LDAP parsing functions.
The LDAP association is terminated by calling
ldap_unbind(3LDAP). Errors can be interpreted by calling
ldap_perror(3LDAP). The ldap_set_rebind_proc(3LDAP) function
can be used to set a function to be called back when an LDAP
bind operation needs to occur when handling a client refer-
ral.
Search Filters
Search filters to be passed to the ldap search functions can
be constructed by hand, or by calling the
ldap_getfilter(3LDAP) functions.
Displaying Results
Results obtained from the ldap search functions can be out-
put by hand, by calling ldap_first_entry(3LDAP) and
ldap_next_entry(3LDAP) to step through the entries returned,
ldap_first_attribute(3LDAP) and ldap_next_attribute(3LDAP)
to step through an entry's attributes, and
ldap_get_values(3LDAP) to retrieve a given attribute's
value, and then calling printf(3C) or whatever to display
the values.
Alternatively, the entry can be output automatically by cal-
ling the ldap_entry2text(3LDAP),
ldap_entry2text_search(3LDAP), ldap_entry2html(3LDAP), or
ldap_entry2html_search(3LDAP) functions. These functions
look up the object class of the entry they are passed in the
ldaptemplates.conf(4) file to decide which attributes to
display and how to display them. Output is handled via a
function passed in as a parameter.
Uniform Resource Locators (URLS)
The ldap_url(3LDAP) functions can be used test a URL to see
if it is an LDAP URL, to parse LDAP URLs into their com-
ponent pieces, to initiate searches directly using an LDAP
URL, and to retrieve the URL associated with a DNS domain
name or a distinguished name.
User Friendly Naming
The ldap_ufn(3LDAP) functions implement a user friendly nam-
ing scheme via LDAP. This scheme allows you to look up
entries using fuzzy, untyped names like "mark smith, umich,
us".
Caching
The ldap_cache(3LDAP) functions implement a local client
caching scheme, providing a substantial performance increase
for repeated queries.
Utility Functions
Also provided are various utility functions. The
ldap_sort(3LDAP) functions are used to sort the entries and
values returned via the ldap search functions. The
ldap_friendly(3LDAP) functions are used to map from short
two letter country codes (or other strings) to longer
"friendlier" names. The ldap_charset(3LDAP) functions can
be used to translate to and from the T.61 character set used
for many character strings in the LDAP protocol.
Connectionless Access
The cldap_search_s(3LDAP) function allows you to access the
directory via Connectionless LDAP (CLDAP), which is similar
to LDAP but operates over UDP, obviating the need to set up
and tear down a connection by calling ldap_open(3LDAP),
ldap_bind(3LDAP), and ldap_unbind(3LDAP). cldap_open(3LDAP)
should be called before using cldap_search_s(3LDAP). All the
same getfilter, parsing, and display that can be used with
regular LDAP functions can be used with the CLDAP functions.
BER Library
Also included in the distribution is a set of lightweight
Basic Encoding Rules functions. These functions are used by
the LDAP library functions to encode and decode LDAP proto-
col elements using the (slightly simplified) Basic Encoding
Rules defined by LDAP. They are not normally used directly
by an LDAP application program. The functions provide a
printf and scanf-like interface, as well as lower-level
access.
Index
ldap_open(3LDAP)
open a connection to an LDAP server
ldap_init(3LDAP)
initialize the LDAP library without opening a connec-
tion to a server
ldap_result(3LDAP)
wait for the result from an asynchronous operation
ldap_abandon(3LDAP)
abandon (abort) an asynchronous operation
ldap_add(3LDAP)
asynchronously add an entry
ldap_add_s(3LDAP)
synchronously add an entry
ldap_add_ext(3LDAP)
asynchronously add an entry, return value and place
message
ldap_add_ext_s(3LDAP)
synchronously add an entry, return value and place
message
ldap_bind(3LDAP)
asynchronously bind to the directory
ldap_bind_s(3LDAP)
synchronously bind to the directory
ldap_simple_bind(3LDAP)
asynchronously bind to the directory using simple
authentication
ldap_simple_bind_s(3LDAP)
synchronously bind to the directory using simple
authentication
ldap_unbind(3LDAP)
synchronously unbind from the LDAP server and close
the connection
ldap_unbind_s(3LDAP)
equivalent to ldap_unbind(3LDAP)
ldap_enable_cache(3LDAP)
enable LDAP client caching
ldap_disable_cache(3LDAP)
disable LDAP client caching
ldap_destroy_cache(3LDAP)
disable LDAP client caching and destroy cache contents
ldap_flush_cache(3LDAP)
flush LDAP client cache
ldap_uncache_entry(3LDAP)
uncache requests pertaining to an entry
ldap_uncache_request(3LDAP)
uncache a request
ldap_set_cache_options(3LDAP)
set cache options
ldap_compare(3LDAP)
asynchronous compare to a directory entry
ldap_compare_s(3LDAP)
synchronous compare to a directory entry
ldap_compare_ext(3LDAP)
asynchronous compare to a directory entry, return
value and place message
ldap_compare_ext_s(3LDAP)
synchronous compare to a directory entry, return value
and place message
ldap_control_free(3LDAP)
LDAP control disposal
ldap_controls_free(3LDAP)
LDAP control disposal
ldap_delete(3LDAP)
asynchronously delete an entry
ldap_delete_s(3LDAP)
synchronously delete an entry
ldap_delete_ext(3LDAP)
asynchronously delete an entry, return value and place
message
ldap_delete_ext_s(3LDAP)
synchronously delete an entry, return value and place
ldap_init_templates(3LDAP)
initialize display template functions from a file
ldap_init_templates_buf(3LDAP)
initialize display template functions from a buffer
ldap_free_templates(3LDAP)
free display template function memory
ldap_first_reference(3LDAP)
steps through ldap_result(3LDAP) message chain
ldap_count_references(3LDAP)
counts the messages in an ldap_result(3LDAP) message
chain
ldap_first_message(3LDAP)
steps through ldap_result(3LDAP) message chain
ldap_count_messages(3LDAP)
counts the messages in an ldap_result(3LDAP) message
chain
ldap_next_message(3LDAP)
steps through ldap_result(3LDAP) message chain
ldap_msgtype(3LDAP)
returns the type of LDAP message
ldap_first_disptmpl(3LDAP)
get first display template
ldap_next_disptmpl(3LDAP)
get next display template
ldap_oc2template(3LDAP)
return template appropriate for objectclass
ldap_tmplattrs(3LDAP)
return attributes needed by template
ldap_first_tmplrow(3LDAP)
return first row of displayable items in a template
ldap_next_tmplrow(3LDAP)
return next row of displayable items in a template
ldap_first_tmplcol(3LDAP)
return first column of displayable items in a template
ldap_next_tmplcol(3LDAP)
return next column of displayable items in a template
ldap_entry2text(3LDAP)
display an entry as text using a display template
ldap_entry2text_search(3LDAP)
search for and display an entry as text using a
display template
ldap_vals2text(3LDAP)
display values as text
ldap_entry2html(3LDAP)
display an entry as HTML (HyperText Markup Language)
using a display template
ldap_entry2html_search(3LDAP)
search for and display an entry as HTML using a
display template
ldap_vals2html(3LDAP)
display values as HTML
ldap_perror(3LDAP)
print an LDAP error indication to standard error
ld_errno(3LDAP)
LDAP error indication
ldap_result2error(3LDAP)
extract LDAP error indication from LDAP result
ldap_errlist(3LDAP)
list of ldap errors and their meanings
ldap_err2string(3LDAP)
convert LDAP error indication to a string
ldap_first_attribute(3LDAP)
return first attribute name in an entry
ldap_next_attribute(3LDAP)
return next attribute name in an entry
ldap_first_entry(3LDAP)
return first entry in a chain of search results
ldap_next_entry(3LDAP)
return next entry in a chain of search results
ldap_count_entries(3LDAP)
return number of entries in a search result
ldap_friendly_name(3LDAP)
map from unfriendly to friendly names
ldap_free_friendlymap(3LDAP)
free resources used by ldap_friendly (3N)
ldap_get_dn(3LDAP)
extract the DN from an entry
ldap_explode_dn(3LDAP)
convert a DN into its component parts
ldap_explode_dns(3LDAP)
convert a DNS-style DN into its component parts
(experimental)
ldap_is_dns_dn(3LDAP)
check to see if a DN is a DNS-style DN (experimental)
ldap_dns_to_dn(3LDAP)
convert a DNS domain name into an X.500 distinguished
name
ldap_dn2ufn(3LDAP)
convert a DN into user friendly form
ldap_get_values(3LDAP)
return an attribute's values
ldap_get_values_len(3LDAP)
return an attribute values with lengths
ldap_value_free(3LDAP)
free memory allocated by lldap_get_values(3LDAP)
ldap_value_free_len(3LDAP)
free memory allocated by ldap_get_values_len(3LDAP)
ldap_count_values(3LDAP)
return number of values
ldap_count_values_len(3LDAP)
return number of values
ldap_init_getfilter(3LDAP)
initialize getfilter functions from a file
ldap_init_getfilter_buf(3LDAP)
initialize getfilter functions from a buffer
ldap_getfilter_free(3LDAP)
free resources allocated by ldap_init_getfilter (3N)
ldap_getfirstfilter(3LDAP)
return first search filter
ldap_getnextfilter(3LDAP)
return next search filter
ldap_build_filter(3LDAP)
construct an LDAP search filter from a pattern
ldap_setfilteraffixes(3LDAP)
set prefix and suffix for search filters
ldap_modify(3LDAP)
asynchronously modify an entry
ldap_modify_s(3LDAP)
synchronously modify an entry
ldap_modify_ext(3LDAP)
asynchronously modify an entry, return value, place
message
ldap_modify_ext_s(3LDAP)
synchronously modify an entry, return value, place
message
ldap_mods_free(3LDAP)
free array of pointers to mod structures used by
ldap_modify (3N)
ldap_modrdn2(3LDAP)
asynchronously modify the RDN of an entry
ldap_modrdn2_s(3LDAP)
synchronously modify the RDN of an entry
ldap_modrdn(3LDAP)
depreciated - use ldap_modrdn2 (3N)
ldap_modrdn_s(3LDAP)
depreciated - use ldap_modrdn2_s (3N)
ldap_rename(3LDAP)
asynchronously modify the name of an LDAP entry
ldap_rename_s(3LDAP)
synchronously modify the name of an LDAP entry
ldap_msgfree(3LDAP)
free results allocated by ldap_result (3N)
ldap_parse_result(3LDAP)
search for a message to parse
ldap_parse_extended_result(3LDAP)
search for a message to parse
ldap_parse_sasl_bind_result(3LDAP)
search for a message to parse
ldap_search(3LDAP)
asynchronously search the directory
ldap_search_s(3LDAP)
synchronously search the directory
ldap_search_ext(3LDAP)
asynchronously search the directory, return value and
place message
ldap_search_ext_s(3LDAP)
synchronously search the directory, return value and
place message
ldap_search_st(3LDAP)
synchronously search the directory with timeout
ldap_ufn_search_s(3LDAP)
user friendly search the directory
ldap_ufn_search_c(3LDAP)
user friendly search the directory with cancel
ldap_ufn_search_ct(3LDAP)
user friendly search the directory with cancel and
timeout
ldap_ufn_setfilter(3LDAP)
set filter file used by ldap_ufn (3N) functions
ldap_ufn_setprefix(3LDAP)
set prefix used by ldap_ufn (3N) functions
ldap_ufn_timeout(3LDAP)
set timeout used by ldap_ufn (3N) functions
ldap_is_ldap_url(3LDAP)
check a URL string to see if it is an LDAP URL
ldap_url_parse(3LDAP)
break up an LDAP URL string into its components
ldap_url_search(3LDAP)
asynchronously search using an LDAP URL
ldap_url_search_s(3LDAP)
synchronously search using an LDAP URL
ldap_url_search_st(3LDAP)
synchronously search using an LDAP URL and a timeout
ldap_dns_to_url(3LDAP)
locate the LDAP URL associated with a DNS domain name.
ldap_dn_to_url(3LDAP)
locate the LDAP URL associated with a distinguished
name.
ldap_init_searchprefs(3LDAP)
initialize searchprefs functions from a file
ldap_init_searchprefs_buf(3LDAP)
initialize searchprefs functions from a buffer
ldap_free_searchprefs(3LDAP)
free memory allocated by searchprefs functions
ldap_first_searchobj(3LDAP)
return first searchpref object
ldap_next_searchobj(3LDAP)
return next searchpref object
ldap_sort_entries(3LDAP)
sort a list of search results
ldap_sort_values(3LDAP)
sort a list of attribute values
ldap_sort_strcasecmp(3LDAP)
case insensitive string comparison
ldap_set_string_translators(3LDAP)
set character set translation functions used by LDAP
library
ldap_translate_from_t61(3LDAP)
translate from the T.61 character set to another char-
acter set
ldap_translate_to_t61(3LDAP)
translate to the T.61 character set from another char-
acter set
ldap_enable_translation(3LDAP)
enable or disable character translation for an LDAP
entry result
cldap_open(3LDAP)
open a connectionless LDAP (CLDAP) session
cldap_search_s(3LDAP)
perform a search using connectionless LDAP
cldap_setretryinfo(3LDAP)
set retry and timeout information using connectionless
LDAP
cldap_close(3LDAP)
terminate a connectionless LDAP session
ATTRIBUTES
See attributes(5) for a description of the following attri-
butes:
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | SUNWlldap (32-bit) |
|_____________________________|_____________________________|
| | SUNWldapx (64-bit) |
|_____________________________|_____________________________|
| Stability Level | Evolving |
|_____________________________|_____________________________|
|
Закладки на сайте Проследить за страницей |
Created 1996-2025 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |