home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rxldp021.zip
/
rxldap-en.txt
< prev
next >
Wrap
Text File
|
2001-11-27
|
31KB
|
882 lines
name: RXLDAP
version: 0.21 2001-11-26
creator: YANO Takashi (IBM: tyano@yamato.ibm.com, Internet: tyano@tk.airnet.ne.jp)
function: LDAP API for OS/2 REXX
requirement:
OS/2 Warp4 or later with TCP/IP functions
history:
2001-11-XX 0.21: Add documents in English.
Rxldap_search_ext_s does not pass the right sizelimit.
Remove memory leak in Rxldap_search_ext/Rxldap_search_ext_s/utf8tostr.
2001-11-22 0.20: Add UTF-8 support.
Add RxldapToUTF8.
Add RxldapFromUTF8.
2001-11-16 0.11: Remove unnecessary files from OpenLDAP SDK subset.
2001-11-14 0.10: Use OpenLDAP SDK ported to OS/2 instead of IBM LDAP SDK.
Do not use LDAP.DLL.
Remove Rxldap_count_attributes.
Make it possible to omit Rxldap_parse_result's errcodevarname,
matcheddnvarname, errmsgvarname parameter.
Remove the limitation of Rxldap_result's all parameter.
Rxldap_search_st calls ldap_search_st.
Rxldap_url_search_st calls ldap_url_search_st.
Use OpneLDAP's error code symbols.
Use OpenLDAP's message type symbols.
Use OpenLDAP's option symbols.
Use OpenLDAP's scope symbols.
Update sample programs.
Add OpenLDAP SDK for OS/2 subset.
2001-11-02 0.02: Make it impossible to omit Rxldap_parse_result's matcheddnvarname,
errcodevarname, errmsgvarname to avoid trap.
Rxldap_parse_result's errcode is now symbols.
Make it possible to use use LDAP_RES_* symbols at Rxldap_result's msgid.
2001-10-31 0.01: Make it possible to omit Rxldap_result's timeout parameter.
2001-10-30 0.00: Initial release.
* API parameters
ld:
LDAP *, unsigned integer
msg:
LDAPMessage *, unsigned integer
msgid:
message ID, integer
port:
port number, integer
ldapctrl: LDAPControl **, stem variable
ldapctrl.0 = number of items
ldapctrl.n.!ldctl_oid = string
ldapctrl.n.!ldctl_value = string
ldapctrl.n.!ldctl_iscritical = integer
dn:
Entry's Distinguished Name
mods: LDAPMod **, stem vaiable
mods.0 = number of items
mods.n.!mod_op = operation, string or integer*
mods.n.!mod_type = attribute name
mods.n.!modv.0 = number of items
mods.n.!modv.m = a value of the attribute
*:
"LDAP_MOD_ADD"
"LDAP_MOD_ADD|LDAP_MOD_BVALUES"
"LDAP_MOD_DELETE"
"LDAP_MOD_DELETE|LDAP_MOD_BVALUES"
"LDAP_MOD_REPLACE"
"LDAP_MOD_REPLACE|LDAP_MOD_BVALUES"
0, 1, 2, 128, 129, 130
ber:
BerElement *, unsigned integer
pw:
Password
msgtype:
LDAP message type symbols
"LDAP_RES_ADD"
"LDAP_RES_ANY"
"LDAP_RES_BIND"
"LDAP_RES_COMPARE"
"LDAP_RES_DELETE"
"LDAP_RES_EXTENDED"
"LDAP_RES_EXTENDED_PARTIAL"
"LDAP_RES_MODIFY"
"LDAP_RES_RENAME"
"LDAP_RES_SEARCH_ENTRY"
"LDAP_RES_SEARCH_REFERENCE"
"LDAP_RES_SEARCH_RESULT"
"LDAP_RES_UNSOLICITED"
Ldaperr:
LDAP error code symbols.
"LDAP_ADMINLIMIT_EXCEEDED"
"LDAP_AFFECTS_MULTIPLE_DSAS"
"LDAP_ALIAS_DEREF_PROBLEM"
"LDAP_ALIAS_PROBLEM"
"LDAP_ALREADY_EXISTS"
"LDAP_AUTH_METHOD_NOT_SUPPORTED"
"LDAP_AUTH_UNKNOWN"
"LDAP_BUSY"
"LDAP_CLIENT_LOOP"
"LDAP_COMPARE_FALSE"
"LDAP_COMPARE_TRUE"
"LDAP_CONFIDENTIALITY_REQUIRED"
"LDAP_CONNECT_ERROR"
"LDAP_CONSTRAINT_VIOLATION"
"LDAP_CONTROL_NOT_FOUND"
"LDAP_DECODING_ERROR"
"LDAP_ENCODING_ERROR"
"LDAP_FILTER_ERROR"
"LDAP_INAPPROPRIATE_AUTH"
"LDAP_INAPPROPRIATE_MATCHING"
"LDAP_INSUFFICIENT_ACCESS"
"LDAP_INVALID_CREDENTIALS"
"LDAP_INVALID_DN_SYNTAX"
"LDAP_INVALID_SYNTAX"
"LDAP_IS_LEAF"
"LDAP_LOCAL_ERROR"
"LDAP_LOOP_DETECT"
"LDAP_MORE_RESULTS_TO_RETURN"
"LDAP_NAMING_VIOLATION"
"LDAP_NOT_ALLOWED_ON_NONLEAF"
"LDAP_NOT_ALLOWED_ON_RDN"
"LDAP_NOT_SUPPORTED"
"LDAP_NO_MEMORY"
"LDAP_NO_OBJECT_CLASS_MODS"
"LDAP_NO_RESULTS_RETURNED"
"LDAP_NO_SUCH_ATTRIBUTE"
"LDAP_NO_SUCH_OBJECT"
"LDAP_OBJECT_CLASS_VIOLATION"
"LDAP_OPERATIONS_ERROR"
"LDAP_OTHER"
"LDAP_PARAM_ERROR"
"LDAP_PARTIAL_RESULTS"
"LDAP_PROTOCOL_ERROR"
"LDAP_REFERRAL"
"LDAP_REFERRAL_LIMIT_EXCEEDED"
"LDAP_RESULTS_TOO_LARGE"
"LDAP_SASL_BIND_IN_PROGRESS"
"LDAP_SERVER_DOWN"
"LDAP_SIZELIMIT_EXCEEDED"
"LDAP_STRONG_AUTH_REQUIRED"
"LDAP_SUCCESS"
"LDAP_TIMELIMIT_EXCEEDED"
"LDAP_TIMEOUT"
"LDAP_TYPE_OR_VALUE_EXISTS"
"LDAP_UNAVAILABLE"
"LDAP_UNAVAILABLE_CRITICAL_EXTENSION"
"LDAP_UNDEFINED_TYPE"
"LDAP_UNWILLING_TO_PERFORM"
"LDAP_USER_CANCELLED"
option:
LDAP Option symbols
"LDAP_OPT_API_FEATURE_INFO"
"LDAP_OPT_API_INFO"
"LDAP_OPT_CLIENT_CONTROLS"
"LDAP_OPT_DEREF"
"LDAP_OPT_ERROR_NUMBER"
"LDAP_OPT_ERROR_STRING"
"LDAP_OPT_HOST_NAME"
"LDAP_OPT_MATCHED_DN"
"LDAP_OPT_PROTOCOL_VERSION"
"LDAP_OPT_REFERRALS"
"LDAP_OPT_RESTART"
"LDAP_OPT_SERVER_CONTROLS"
"LDAP_OPT_SIZELIMIT"
"LDAP_OPT_TIMELIMIT"
scope:
LDAP scope symbols
"LDAP_SCOPE_BASE"
"LDAP_SCOPE_DEFAULT"
"LDAP_SCOPE_ONELEVEL"
"LDAP_SCOPE_SUBTREE"
attrsonly: If attributes only, 1. If attributes with values, 0.
timeout: timeout in seconds (example: 10, 10.0)
filter: search filter
base: Search start node's DN
desc:
Stem vaiable that has URL's elements.
desc.!lud_host = host name
desc.!lud_port = port number
desc.!lud_scope = 'LDAP_SCOPE_BASE', 'LDAP_SCOPE_ONELEVEL', 'LDAP_SCOPE_SUBTREE'
desc.!lud_filter = search filter
desc.!lud_attrs.0 = number of attributes
desc.!lud_attrs.n = attribute
* Not supported IBM LDAP API (reason)
ldap_bind (Deprecated Functions)
ldap_bind_s (Deprecated Functions)
ldap_controls_free (REXX need not use this)
ldap_count_attributes (informal API)
ldap_count_values (REXX need not use this)
ldap_free_urldesc (REXX need not use this)
ldap_get_etnry_controls_np (informal API)
ldap_memfree (REXX need not use this)
ldap_modrdn (Deprecated Functions)
ldap_modrdn_s (Deprecated Functions)
ldap_mods_free (REXX need not use this)
ldap_open (Deprecated Functions)
ldap_parse_reference_np (informal API)
ldap_parse_sasl_bind_result (Future support)
ldap_perror (Deprecated Functions)
ldap_result2error (Deprecated Functions)
ldap_sasl_bind (Future support)
ldap_sasl_bind_s (Future support)
ldap_set_rebind_pro (informal API)
ldap_ssl_client_init (Future support)
ldap_ssl_init (Future support)
ldap_ssl_start (Deprecated Functions)
ldap_value_free (REXX need not use this)
ldap_value_free_len (REXX need not use this)
* UTF-8 support
- RXLDAP passes the DN to the C API after RXLDAP converts DN in the current
codepage into UTF-8. Your REXX program need not issue conversion.
- RXLDAP passes the search filter to the C API after RXLDAP converts the filter
in the current codepage into UTF-8. Your REXX program need not issue
conversion.
- RXLDAP issues UTF-8 conversions if you do not specify LDAP_MOD_BVALUES in
mods.n.!mod_op ("LDAP_MOD_ADD", "LDAP_MOD_DELETE", "LDAP_MOD_REPLACE"). Your
REXX program need not issue conversion.
- RXLDAP does not issue UTF-8 conversions if you specify LDAP_MOD_BVALUES in
mods.n.!mod_op ("LDAP_MOD_DELETE|LDAP_MOD_BVALUES",
"LDAP_MOD_REPLACE|LDAP_MOD_BVALUES"). RXLDAP passes the values in the REXX
variable to C API without any conversion.
- Rxldap_get_values returns values after converting from UTF-8 strings to
strings in the current codepage. Your REXX program need not issue conversion.
- Rxldap_get_dn returns DN after converting from UTF-8 strings to strings in
the current codepage. Your REXX program need not issue conversion.
- Rxldap_get_values_len returns the raw values from the C API.
- Rxldap_compare and Rxldap_compare_s pass the values to C API after converting
to the values into UTF-8. Your REXX program need not issue conversion.
- Rxldap_compare_ext and Rxldap_compare_ext_s pass the raw values in the REXX
variable to C API.
- If RXLDAP cannot convert the string from or to UTF-8,
RXLDAP passes the value to C API without conversions. RxldapToUTF8 and
RxldapFromUTF8 can check if the conversion works or not.
* API description
REXX API: RxldapLoadFuncs
function: Load RXLDAP API
syntax: RxldapLoadFuncs()
return value: RXLDAP's version information
example:
call RxldapLoadFuncs
REXX API: RxldapDropFuncs
function: Unload RXLDAP API
syntax: RxldapDropFuncs()
return value: ""
example:
call RxldapDropFuncs
REXX API: RxldapVersion
function: Return RXLDAP's version information
syntax: RxldapVersion()
return value: RXLDAP's version information
example:
call RxldapVersion
REXX API: RxldapToUTF8
function: Convert the string in the current codepage into UTF-8.
syntax: RxldapToUTF8(str)
return value: String in UTF-8. If impossible, returns "".
example:
call RxldapToUTF8 str
REXX API: RxldapFromUTF8
function: Convert the string in UTF-8 into the current codepage.
syntax: RxldapFromUTF8(utf8str)
return value: String in the current codepage. If impossible, returns "".
example:
call RxldapFromUTF8 utf8str
REXX API: Rxldap_abandon
C API: ldap_abandon
syntax: Rxldap_abandon(ld, msgid)
return value: 0 (success), -1 (error)
example:
call Rxldap_abandon ld, msgid
REXX API: Rxldap_abandon_ext
C API: ldap_abandon_ext
syntax: Rxldap_abandon(ld, msgid, serverctrlsstemname, clientctrlsstemname)
return value: ldaperr
arguments:
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
you can ommit: serverctrlsstemname, clientctrlsstemname
example:
call Rxldap_abandon ld, msgid, 'serverctrls.', 'clientctrls.'
REXX API: Rxldap_add
C API: ldap_add
syntax: Rxldap_add(ld, dn, modsstemname)
return value: msgid (success), -1 (error)
arguments:
modsstemname = stem name to store mods.
example:
call Rxldap_add ld, dn, 'mods.'
REXX API: Rxldap_add_s
C API: ldap_add_s
syntax: Rxldap_add_s(ld, dn, modsstemname)
return value: ldaperr
arguments:
modsstemname = stem name to store mods.
example:
call Rxldap_add_s ld, dn, 'mods.'
REXX API: Rxldap_add_ext
C API: ldap_add_ext
syntax: Rxldap_add_ext(ld, dn, modsstemname, serverctrlsstemname, clientctrlsstemname, msgidvarname)
return value: ldaperr
arguments:
modsstemname = stem name to store mods.
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
msgidvarname = REXX variable name to store msgid.
you can ommit: serverctrlsstemname, clientctrlsstemname
example:
call Rxldap_add_ext ld, dn, 'mods.', 'serverctrls.', 'clientctrls.', 'msgid'
REXX API: Rxldap_add_ext_s
C API: ldap_add_ext_s
syntax: Rxldap_add_ext_s(ld, dn, modsstemname, serverctrlsstemname, clientctrlsstemname)
return value: ldaperr
arguments:
modsstemname = stem name to store mods.
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
you can ommit: serverctrlsstemname, clientctrlsstemname
example:
call Rxldap_add_ext_s ld, dn, 'mods.', 'serverctrls.', 'clientctrls.'
REXX API: Rxldap_first_attribute
C API: ldap_first_attribute
syntax: Rxldap_first_attribute(ld, msg, bervarmame)
return value: attribute or "" (ldap_first_attribute returns NULL)
arguments:
bervarname = REXX variable name to store ber
example:
call Rxldap_first_attribute ld, msg, 'ber'
REXX API: Rxldap_next_attribute
C API: ldap_next_attribute
syntax: Rxldap_next_attribute(ld, msg, ber)
return value: attribute or "" (ldap_next_attribute returns NULL)
example:
call Rxldap_next_attribute ld, msg, ber
REXX API: Rxldap_simple_bind
C API: ldap_simple_bind
syntax: Rxldap_simple_bind(ld, dn, pw)
return value: msgid (success), -1 (fail)
you can ommit: dn, pw
example:
call Rxldap_simple_bind ld, dn, pw
REXX API: Rxldap_simple_bind_s
C API: ldap_simple_bind_s
syntax: Rxldap_simple_bind_s(ld, dn, pw)
return value: ldaperr
you can ommit: dn, pw
example:
call Rxldap_simple_bind_s ld, dn, pw
REXX API: Rxldap_unbind
C API: ldap_unbind
syntax: Rxldap_unbind(ld)
return value: msgid (success), -1 (fail)
example:
call Rxldap_unbind ld
REXX API: Rxldap_unbind_s
C API: ldap_unbind_s
syntax: Rxldap_unbind_s(ld)
return value: ldaperr
example:
call Rxldap_unbind_s ld
REXX API: Rxldap_compare
C API: ldap_compare
syntax: Rxldap_compare(ld, dn, attr, val)
return value: msgid (success), -1 (fail)
example:
call Rxldap_compare ld, dn, attr, val
REXX API: Rxldap_compare_s
C API: ldap_compare_s
syntax: Rxldap_compare_s(ld, dn, attr, val)
return value: ldaperr
example:
call Rxldap_compare_s ld, dn, attr, val
REXX API: Rxldap_compare_ext
C API: ldap_compare_ext
syntax: Rxldap_compare_ext(ld, dn, attr, val, serverctrlsstemname, clinetctrlsstemname, msgidvarname)
return value: ldaperr
arguments:
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
msgidvarname = REXX variable name to store msgid
you can ommit: serverctrlsstemname, clientctrlsstemname
example:
call Rxldap_compare_ext ld, dn, attr, val, 'serverctrls.', 'clinetctrls.', 'msgid'
REXX API: Rxldap_compare_ext_s
C API: ldap_compare_ext_s
syntax: Rxldap_compare_ext(ld, dn, attr, val, serverctrlsstemname, clinetctrlsstemname)
return value: ldaperr
arguments:
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
you can ommit: serverctrlsstemname, clientctrlsstemname
example:
call Rxldap_compare_ext_s ld, dn, attr, val, 'serverctrls.', 'clinetctrls.'
REXX API: Rxldap_delete
C API: ldap_delete
syntax: Rxldap_delete(ld, dn)
return value: msgid (success), -1 (fail)
example:
call Rxldap_delete ld, dn
REXX API: Rxldap_delete_s
C API: ldap_delete_s
syntax: Rxldap_delete_s(ld, dn)
return value: ldaperr
example:
call Rxldap_delete_s ld, dn
REXX API: Rxldap_delete_ext
C API: ldap_delete_ext
syntax: Rxldap_delete_ext(ld, dn, serverctrlsstemname, clientctrlsstemname, msgidvarname)
return value: ldaperr
arguments:
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
msgidvarname = REXX variable name to store msgid
you can ommit: serverctrlsstemname, clientctrlsstemname
example:
call Rxldap_delete_ext ld, dn, 'serverctrls.', 'clientctrls.', 'msgid'
REXX API: Rxldap_delete_ext_s
C API: ldap_delete_ext_s
syntax: Rxldap_delete_ext_s(ld, dn, serverctrlsstemname, clientctrlsstemname)
return value: ldaperr
arguments:
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
you can ommit: serverctrlsstemname, clientctrlsstemname
example:
call Rxldap_delete_ext_s ld, dn, 'serverctrls.', 'clientctrls.'
REXX API: Rxldap_first_etnry
C API: ldap_first_etnry
syntax: Rxldap_first_entry(ld, msg)
return value: msg (success), 0 (error)
example:
call Rxldap_first_entry ld, msg
REXX API: Rxldap_next_etnry
C API: ldap_next_etnry
syntax: Rxldap_next_entry(ld, msg)
return value: msg (success), 0 (error)
example:
call Rxldap_next_entry ld, msg
REXX API: Rxldap_count_etnries
C API: ldap_count_etnries
syntax: Rxldap_count_etnriesld, msg)
return value: number of entries
example:
call Rxldap_count_etnries ld, msg
REXX API: Rxldap_get_errno
C API: ldap_get_errno
syntax: Rxldap_get_errno(ld)
return value: ldaperr
example:
call Rxldap_get_errno ld
REXX API: Rxldap_err2string
C API: ldap_err2string
syntax: Rxldap_err2string(ldaperr)
return value: error message
example:
call Rxldap_err2string ldaperr
REXX API: Rxldap_get_dn
C API: ldap_get_dn
syntax: Rxldap_get_dn(ld, msg)
return value: dn (success), "" (error)
example:
call Rxldap_get_dn ld, msg
REXX API: Rxldap_explode_dn
C API: ldap_explode_dn
syntax: Rxldap_explode_dn(dn, notype, dnsstemname)
return value: dns.0é╠Æl
arguments:
dnsstemname = stem name to store parts of DN. (dns.0 = number of items, dns.n = item)
example:
call Rxldap_explode_dn dn, notype, 'dns.'
REXX API: Rxldap_get_values
C API: ldap_get_values
syntax: Rxldap_get_values(ld, msg, attr, valstemname)
return value: vals.0é╠Æl
arguments:
valsstemname = stem name to store attribute values. (vals.0 = number of items, vals.n = item value)
example:
call Rxldap_get_values ld, msg, attr, 'vals.'
REXX API: Rxldap_get_values_len
C API: ldap_get_values_len
syntax: Rxldap_get_values_len(ld, msg, attr, valstemname)
return value: vals.0é╠Æl
arguments:
valsstemname = stem name to store attribute values. (vals.0 = number of items, vals.n = item value)
example:
call Rxldap_get_values_len ld, msg, attr, 'vals.'
REXX API: Rxldap_init
C API: ldap_init
syntax: Rxldap_init(host, port)
return value: ld
you can ommit: port
example:
call Rxldap_init host, port
REXX API: Rxldap_msgfree
C API: ldap_msgfree
syntax: Rxldap_msgfree(msg)
return value: msgtype
example:
call Rxldap_msgfree msg
REXX API: Rxldap_ber_free
C API: ldap_ber_free
syntax: Rxldap_ber_free(ber)
return value: ""
example:
call Rxldap_ber_free ber
REXX API: Rxldap_first_message
C API: ldap_first_message
syntax: Rxldap_first_message(ld, msg)
return value: msg (success), 0 (error)
example:
call Rxldap_first_message ld, msg
REXX API: Rxldap_next_message
C API: ldap_next_message
syntax: Rxldap_next_message(ld, msg)
return value: msg (success), 0 (error)
example:
call Rxldap_next_message ld, msg
REXX API: Rxldap_count_messages
C API: ldap_count_messages
syntax: Rxldap_count_message(ld, msg)
return value: number of messages
example:
call Rxldap_count_message ld, msg
REXX API: Rxldap_modify
C API: ldap_modify
syntax: Rxldap_modify(ld, dn, modsstemname)
return value: msgid (success), -1 (error)
arguments:
modsstemname = stem name to store mods.
example:
call Rxldap_modify ld, dn, 'mods.'
REXX API: Rxldap_modify_ext
C API: ldap_modify_ext
syntax: Rxldap_modify_ext(ld, dn, modsstemname, serverctrlsstemname, clientctrlsstemname, msgidvarname)
return value: ldaperr
arguments:
modsstemname = stem name to store mods.
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
msgidvarname = REXX variable name to store msgid
you can ommit: serverctrlsstemname, clientctrlsstemname
example:
call Rxldap_modify_ext ld, dn, 'mods.', 'serverctrls.', 'clientctrls.', 'msgid'
REXX API: Rxldap_modify_s
C API: ldap_modify_s
syntax: Rxldap_modify_s(ld, dn, modsstemname)
return value: ldaperr
arguments:
modsstemname = stem name to store mods.
example:
call Rxldap_modify_s ld, dn, 'mods.'
REXX API: Rxldap_modify_ext_s
C API: ldap_modify_ext_s
syntax: Rxldap_modify_ext_s(ld, dn, modsstemname, serverctrlsstemname, clientctrlsstemname)
return value: ldaperr
arguments:
modsstemname = stem name to store mods.
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
you can ommit: serverctrlsstemname, clientctrlsstemname
example:
call Rxldap_modify_ext_s ld, dn, 'mods.', 'serverctrls.', 'clientctrls.'
REXX API: Rxldap_set_option
C API: ldap_set_option
syntax: Rxldap_set_option(ld, option, value)
return value: ldap_set_option's return value
arguments:
value = option values. (I tested only the values in the examples)
example:
call Rxldap_set_option ld, 'LDAP_OPT_TIMELIMIT', 10.0
call Rxldap_set_option ld, 'LDAP_OPT_SIZELIMIT', 10.0
REXX API: Rxldap_get_option
C API: ldap_set_option
syntax: Rxldap_set_option(ld, option, valvarname)
return value: ldap_get_option's return value.
arguments:
valvarname = REXX variable name to store the option value.(I tested only the values in the examples)
example:
call Rxldap_get_option ld, 'LDAP_OPT_TIMELIMIT', 'timeout'
call Rxldap_get_option ld, 'LDAP_OPT_HOST_NAME', 'host'
call Rxldap_get_option ld, 'LDAP_OPT_SIZELIMIT', 'size'
call Rxldap_get_option ld, 'LDAP_OPT_PROTOCOL_VERSION', 'ver'
call Rxldap_get_option ld, 'LDAP_OPT_API_INFO', 'ai'
say ai.!ldapai_api_version
say ai.!ldapai_protocol_version
say ai.!ldapai_vendor_name
say ai.!ldapai_vendor_version
do i = 1 to ai.!ldapai_extensions.0
say ai.!ldapai_extensions.i
end /* do */
call Rxldap_get_option ld, 'LDAP_OPT_API_FEATURE_INFO', 'aif'
say aif.!ldapaif_version
say aif.!ldapaif_name
REXX API: Rxldap_parse_result
C API: ldap_parse_result
syntax: Rxldap_parse_result(ld, msg, errcodevarname, matcheddnvarname, errmsgvarname, referralsstemname, serverctrlsstemname, freeit)
return value: ldaperr
arguments:
errcodevarname = REXX variable name to store errcode.
matcheddnvarname = REXX variable name to matcheddn.
errmsgvarname = REXX variable name to store errmsg.
referralsstemname = REXX variable name to store referrals.
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
freeit = free msg or not. (1: free, 0: not free)
you can ommit:errcodevarname, matcheddnvarname, errmsgvarname, referralsstemname, serverctrlsstemname
example:
call Rxldap_parse_result ld, msg, 'errcode', 'matcheddn', 'errmsg', 'referrals', 'serverctrls', freeit
REXX API: Rxldap_first_reference
C API: ldap_first_etnry
syntax: Rxldap_first_reference(ld, msg)
return value: msg (success), 0 (error)
example:
call Rxldap_first_reference ld, msg
REXX API: Rxldap_next_etnry
C API: ldap_next_etnry
syntax: Rxldap_next_reference(ld, msg)
return value: msg (success), 0 (error)
example:
call Rxldap_next_reference ld, msg
REXX API: Rxldap_count_references
C API: ldap_count_references
syntax: Rxldap_count_etnriesld, msg)
return value: number of entries.
example:
call Rxldap_count_references ld, msg
REXX API: Rxldap_rename
C API: ldap_rename
syntax: Rxldap_rename(ld, dn, newrdn, newparent, deleteoldrdn, serverctrlsstemname, clientctrlsstemname, msgidvarname)
return value: ldaperr
arguments:
newrdn = new RDN after operation
newparent = nre parent's RDN after operation
deleteoldrdn = delete old entry or not after operation (1: delete, 0 not delete)
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
msgidvarname = REXX variable name to store msgid
you can ommit:newparent, serverctrlsstemname, clientctrlsstemname
example:
call Rxldap_rename ld, dn, newrdn, newparent, deleteoldrdn, 'serverctrls.', 'clientctrls.', 'msgid'
REXX API: Rxldap_rename_s
C API: ldap_rename_s
syntax: Rxldap_rename_s(ld, dn, newrdn, newparent, deleteoldrdn, serverctrlsstemname, clientctrlsstemname)
return value: ldaperr
arguments:
newrdn = new RDN after operation
newparent = nre parent's RDN after operation
deleteoldrdn = delete old entry or not after operation (1: delete, 0 not delete)
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
you can ommit:newparent, serverctrlsstemname, clientctrlsstemname
example:
call Rxldap_rename_s ld, dn, newrdn, newparent, deleteoldrdn, 'serverctrls.', 'clientctrls.'
REXX API: Rxldap_result
C API: ldap_result
syntax: Rxldap_result(ld, msgid, all, timeout, msgvarname)
return value: msgtype
arguments:
msgid = msgid or message type symbols (example: 'LDAP_RES_ANY')
all = 'LDAP_MSG_ONE', 'LDAP_MSG_RECEIVED', 'LDAP_MSG_ALL'
msgvarname = REXX variable name to store msg (attrs.0 = number of items, attrs.n = attribute)
you can ommit:timeout
example:
call Rxldap_result ld, msgid, 'LDAP_MSG_ONE', 10.0, 'msg'
REXX API: Rxldap_msgtype
C API: ldap_msgtype
syntax: Rxldap_msgtype(msg)
return value: msgtype
example:
call Rxldap_msgtype msg
REXX API: Rxldap_msgid
C API: ldap_msgid
syntax: Rxldap_msgid(msg)
return value: msgid
example:
call Rxldap_msgid msg
REXX API: Rxldap_search
C API: ldap_search
syntax: Rxldap_search(ld, base, scope, filter, attrsstemname, attrsonly)
return value: msgid (success), -1 (error)
arguments:
attrsstemname = stem name to store attribute list (attrs.0 = number of items, attrs.n = attribute)
example:
call Rxldap_search ld, base, scope, filter, 'attrs.', 0
REXX API: Rxldap_search_ext
C API: ldap_search_ext
syntax: Rxldap_search_ext(ld, base, scope, filter, attrsstemname, attrsonly, serverctrlsstemname, clientctrlsstemname, timeout, sizelimit, msgidvarname)
return value: ldaperr
arguments:
attrsstemname = stem name to store attribute list (attrs.0 = number of items, attrs.n = attribute)
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
sizelimit = maximum message number. If 0, no limit.
msgidvarname = REXX variable name to store msgid
you can ommit: serverctrlsstemname, clientctrlsstemname
example:
call Rxldap_search_ext ld, base, scope, filter, 'attrs.', 0, 'serverctrls.', 'clientctrls.', 10.0, 0, 'msgid'
REXX API: Rxldap_search_s
C API: ldap_search_s
syntax: Rxldap_search_s(ld, base, scope, filter, attrsstemname, attrsonly, msgvarname)
return value: ldaperr
arguments:
attrsstemname = stem name to store attribute list (attrs.0 = number of items, attrs.n = attribute)
msgvarname = REXX variable name to store msg (attrs.0 = number of items, attrs.n = attribute)üB
example:
call Rxldap_search_s ld, base, scope, filter, 'attrs.', 0, 'msg'
REXX API: Rxldap_search_ext_s
C API: ldap_search_ext_s
syntax: Rxldap_search_ext_s(ld, base, scope, filter, attrsstemname, attrsonly, serverctrlsstemname, clientctrlsstemname, timeout, sizelimit, msgvarname)
return value: ldaperr
arguments:
attrsstemname = stem name to store attribute list (attrs.0 = number of items, attrs.n = attribute)
serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
sizelimit = maximum message number. If 0, no limit.
msgvarname = REXX variable name to store msg (attrs.0 = number of items, attrs.n = attribute)
you can ommit: serverctrlsstemname, clientctrlsstemname
example:
call Rxldap_search_ext_s ld, base, scope, filter, 'attrs.', 0, 'serverctrls.', 'clientctrls.', 10.0, 0, 'msg'
REXX API: Rxldap_search_st
C API: ldap_search_st
syntax: Rxldap_search_st(ld, base, scope, filter, attrsstemname, attrsonly, timeout, msgvarname)
return value: ldaperr
arguments:
attrsstemname = stem name to store attribute list (attrs.0 = number of items, attrs.n = attribute)
msgvarname = REXX variable name to store msg (attrs.0 = number of items, attrs.n = attribute)üB
example:
call Rxldap_search_st ld, base, scope, filter, 'attrs.', 0, 10.0, 'msg'
REXX API: Rxldap_is_ldap_url
C API: ldap_is_ldap_url
syntax: Rxldap_is_ldap_url(url)
return value: zero (not LDAP URL), not zero (LDAP URL)
example:
call Rxldap_is_ldap_url(url)
REXX API: Rxldap_url_desc
C API: ldap_url_desc
syntax: Rxldap_url_desc(url, descstemname)
return value: ldaperr
arguments:
descstemname = stem name to store desc.
example:
call Rxldap_url_desc url, 'desc.'
REXX API: Rxldap_url_search
C API: ldap_url_search
syntax: Rxldap_url_search(ld, url, attrsonly)
return value: msgid (success), -1 (fail)
example:
call Rxldap_url_search ld, url, 0
REXX API: Rxldap_url_search_s
C API: ldap_url_search_s
syntax: Rxldap_url_search_s(ld, url, attrsonly, msgvarname)
return value: ldaperr
example:
call Rxldap_url_search_s ld, url, 0, 'msg'
REXX API: Rxldap_url_search_st
C API: ldap_url_search_st
syntax: Rxldap_url_search_st(ld, url, attrsonly, timeout, msgvarname)
return value: ldaperr
example:
call Rxldap_url_search_st ld, url, 0, 10.0, 'msg'
REXX API: Rxldap_version
C API: ldap_version
syntax: Rxldap_version(stemname)
return value: ldaperr
example:
call Rxldap_version 'a.'
say a.!sdk_version
say a.!protocol_version
* Lmitation
- The binaries are built with debug information.
- "ldap_get_errno" is not a formal API. RXLDAP calls ldap_get_option with
LDAP_OPT_ERROR_NUMBER in the Rxldap_get_errno.
- "ldap_version" is not a formal API. RXLDAP calls ldap_get_option with
LDAP_OPT_API_INFO in the Rxldap_version.
- "ldap_ver_free" is not a formal API. RXLDAP calls ber_ree in the
Rxldap_ber_free.
- LDAPv2 API is dropped. RXLDAP never works with LDAPv2 servers.
* Packaging
rxldap.dll
rxldap.def
rxldap-jp.txt
rxldap-en.txt
rxldap.c
rxldap.sym
rxstring.h
testrxldap.cmd (This realy works. Please use it as a sample)
makefile
* How to build
nmake32 (DLL)
nmake32 DEBUG=1 (Build with debug option)
nmake32 pkg (ZIP)
nmake32 LDAPSDK=D:\LDAPSDK (Use OpenLDAP SDK for OS/2 at D:\LDAPSDK)
* Future enhancement
Support SSL.