home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxldp021.zip / rxldap-en.txt < prev    next >
Text File  |  2001-11-27  |  31KB  |  882 lines

  1. name: RXLDAP
  2. version: 0.21 2001-11-26
  3. creator: YANO Takashi (IBM: tyano@yamato.ibm.com, Internet: tyano@tk.airnet.ne.jp)
  4. function: LDAP API for OS/2 REXX
  5. requirement: 
  6. OS/2 Warp4 or later with TCP/IP functions
  7. history:
  8. 2001-11-XX 0.21: Add documents in English.
  9.                  Rxldap_search_ext_s does not pass the right sizelimit.
  10.                  Remove memory leak in Rxldap_search_ext/Rxldap_search_ext_s/utf8tostr.
  11. 2001-11-22 0.20: Add UTF-8 support.
  12.                  Add RxldapToUTF8.
  13.                  Add RxldapFromUTF8.
  14. 2001-11-16 0.11: Remove unnecessary files from OpenLDAP SDK subset.
  15. 2001-11-14 0.10: Use OpenLDAP SDK ported to OS/2 instead of IBM LDAP SDK.
  16.                  Do not use LDAP.DLL.
  17.                  Remove Rxldap_count_attributes.
  18.                  Make it possible to omit Rxldap_parse_result's errcodevarname,
  19.                  matcheddnvarname, errmsgvarname parameter.
  20.                  Remove the limitation of Rxldap_result's all parameter.
  21.                  Rxldap_search_st calls ldap_search_st.
  22.                  Rxldap_url_search_st calls ldap_url_search_st.
  23.                  Use OpneLDAP's error code symbols.
  24.                  Use OpenLDAP's message type symbols.
  25.                  Use OpenLDAP's option symbols.
  26.                  Use OpenLDAP's scope symbols.
  27.                  Update sample programs.
  28.                  Add OpenLDAP SDK for OS/2 subset.
  29. 2001-11-02 0.02: Make it impossible to omit Rxldap_parse_result's matcheddnvarname,
  30.                  errcodevarname, errmsgvarname to avoid trap.
  31.                  Rxldap_parse_result's errcode is now symbols.
  32.                  Make it possible to use use LDAP_RES_* symbols at Rxldap_result's msgid.
  33. 2001-10-31 0.01: Make it possible to omit Rxldap_result's timeout parameter.
  34. 2001-10-30 0.00: Initial release.
  35.  
  36. * API parameters
  37. ld:
  38. LDAP *, unsigned integer
  39.  
  40. msg:
  41. LDAPMessage *, unsigned integer
  42.  
  43. msgid:
  44. message ID, integer
  45.  
  46. port:
  47. port number, integer
  48.  
  49. ldapctrl: LDAPControl **, stem variable
  50. ldapctrl.0 = number of items
  51. ldapctrl.n.!ldctl_oid = string
  52. ldapctrl.n.!ldctl_value = string
  53. ldapctrl.n.!ldctl_iscritical = integer
  54.  
  55. dn:
  56. Entry's Distinguished Name
  57.  
  58. mods: LDAPMod **, stem vaiable
  59. mods.0 = number of items
  60. mods.n.!mod_op = operation, string or integer*
  61. mods.n.!mod_type = attribute name
  62. mods.n.!modv.0 = number of items
  63. mods.n.!modv.m = a value of the attribute
  64. *:
  65. "LDAP_MOD_ADD"
  66. "LDAP_MOD_ADD|LDAP_MOD_BVALUES"
  67. "LDAP_MOD_DELETE"
  68. "LDAP_MOD_DELETE|LDAP_MOD_BVALUES"
  69. "LDAP_MOD_REPLACE"
  70. "LDAP_MOD_REPLACE|LDAP_MOD_BVALUES"
  71. 0, 1, 2, 128, 129, 130
  72.  
  73. ber: 
  74. BerElement *, unsigned integer
  75.  
  76. pw:
  77. Password
  78.  
  79. msgtype:
  80. LDAP message type symbols
  81. "LDAP_RES_ADD"
  82. "LDAP_RES_ANY"
  83. "LDAP_RES_BIND"
  84. "LDAP_RES_COMPARE"
  85. "LDAP_RES_DELETE"
  86. "LDAP_RES_EXTENDED"
  87. "LDAP_RES_EXTENDED_PARTIAL"
  88. "LDAP_RES_MODIFY"
  89. "LDAP_RES_RENAME"
  90. "LDAP_RES_SEARCH_ENTRY"
  91. "LDAP_RES_SEARCH_REFERENCE"
  92. "LDAP_RES_SEARCH_RESULT"
  93. "LDAP_RES_UNSOLICITED"
  94.  
  95. Ldaperr:
  96. LDAP error code symbols.
  97. "LDAP_ADMINLIMIT_EXCEEDED"
  98. "LDAP_AFFECTS_MULTIPLE_DSAS"
  99. "LDAP_ALIAS_DEREF_PROBLEM"
  100. "LDAP_ALIAS_PROBLEM"
  101. "LDAP_ALREADY_EXISTS"
  102. "LDAP_AUTH_METHOD_NOT_SUPPORTED"
  103. "LDAP_AUTH_UNKNOWN"
  104. "LDAP_BUSY"
  105. "LDAP_CLIENT_LOOP"
  106. "LDAP_COMPARE_FALSE"
  107. "LDAP_COMPARE_TRUE"
  108. "LDAP_CONFIDENTIALITY_REQUIRED"
  109. "LDAP_CONNECT_ERROR"
  110. "LDAP_CONSTRAINT_VIOLATION"
  111. "LDAP_CONTROL_NOT_FOUND"
  112. "LDAP_DECODING_ERROR"
  113. "LDAP_ENCODING_ERROR"
  114. "LDAP_FILTER_ERROR"
  115. "LDAP_INAPPROPRIATE_AUTH"
  116. "LDAP_INAPPROPRIATE_MATCHING"
  117. "LDAP_INSUFFICIENT_ACCESS"
  118. "LDAP_INVALID_CREDENTIALS"
  119. "LDAP_INVALID_DN_SYNTAX"
  120. "LDAP_INVALID_SYNTAX"
  121. "LDAP_IS_LEAF"
  122. "LDAP_LOCAL_ERROR"
  123. "LDAP_LOOP_DETECT"
  124. "LDAP_MORE_RESULTS_TO_RETURN"
  125. "LDAP_NAMING_VIOLATION"
  126. "LDAP_NOT_ALLOWED_ON_NONLEAF"
  127. "LDAP_NOT_ALLOWED_ON_RDN"
  128. "LDAP_NOT_SUPPORTED"
  129. "LDAP_NO_MEMORY"
  130. "LDAP_NO_OBJECT_CLASS_MODS"
  131. "LDAP_NO_RESULTS_RETURNED"
  132. "LDAP_NO_SUCH_ATTRIBUTE"
  133. "LDAP_NO_SUCH_OBJECT"
  134. "LDAP_OBJECT_CLASS_VIOLATION"
  135. "LDAP_OPERATIONS_ERROR"
  136. "LDAP_OTHER"
  137. "LDAP_PARAM_ERROR"
  138. "LDAP_PARTIAL_RESULTS"
  139. "LDAP_PROTOCOL_ERROR"
  140. "LDAP_REFERRAL"
  141. "LDAP_REFERRAL_LIMIT_EXCEEDED"
  142. "LDAP_RESULTS_TOO_LARGE"
  143. "LDAP_SASL_BIND_IN_PROGRESS"
  144. "LDAP_SERVER_DOWN"
  145. "LDAP_SIZELIMIT_EXCEEDED"
  146. "LDAP_STRONG_AUTH_REQUIRED"
  147. "LDAP_SUCCESS"
  148. "LDAP_TIMELIMIT_EXCEEDED"
  149. "LDAP_TIMEOUT"
  150. "LDAP_TYPE_OR_VALUE_EXISTS"
  151. "LDAP_UNAVAILABLE"
  152. "LDAP_UNAVAILABLE_CRITICAL_EXTENSION"
  153. "LDAP_UNDEFINED_TYPE"
  154. "LDAP_UNWILLING_TO_PERFORM"
  155. "LDAP_USER_CANCELLED"
  156.  
  157. option:
  158. LDAP Option symbols
  159. "LDAP_OPT_API_FEATURE_INFO"
  160. "LDAP_OPT_API_INFO"
  161. "LDAP_OPT_CLIENT_CONTROLS"
  162. "LDAP_OPT_DEREF"
  163. "LDAP_OPT_ERROR_NUMBER"
  164. "LDAP_OPT_ERROR_STRING"
  165. "LDAP_OPT_HOST_NAME"
  166. "LDAP_OPT_MATCHED_DN"
  167. "LDAP_OPT_PROTOCOL_VERSION"
  168. "LDAP_OPT_REFERRALS"
  169. "LDAP_OPT_RESTART"
  170. "LDAP_OPT_SERVER_CONTROLS"
  171. "LDAP_OPT_SIZELIMIT"
  172. "LDAP_OPT_TIMELIMIT"
  173.  
  174. scope:
  175. LDAP scope symbols
  176. "LDAP_SCOPE_BASE"
  177. "LDAP_SCOPE_DEFAULT"
  178. "LDAP_SCOPE_ONELEVEL"
  179. "LDAP_SCOPE_SUBTREE"
  180.  
  181. attrsonly: If attributes only, 1. If attributes with values, 0.
  182.  
  183. timeout: timeout in seconds (example: 10, 10.0)
  184.  
  185. filter: search filter
  186.  
  187. base: Search start node's DN
  188.  
  189. desc: 
  190. Stem vaiable that has URL's elements.
  191. desc.!lud_host = host name
  192. desc.!lud_port = port number
  193. desc.!lud_scope = 'LDAP_SCOPE_BASE', 'LDAP_SCOPE_ONELEVEL', 'LDAP_SCOPE_SUBTREE'
  194. desc.!lud_filter = search filter
  195. desc.!lud_attrs.0 = number of attributes
  196. desc.!lud_attrs.n = attribute
  197.  
  198. * Not supported IBM LDAP API (reason)
  199. ldap_bind (Deprecated Functions)
  200. ldap_bind_s (Deprecated Functions)
  201. ldap_controls_free (REXX need not use this)      
  202. ldap_count_attributes (informal API)     
  203. ldap_count_values (REXX need not use this)
  204. ldap_free_urldesc (REXX need not use this)
  205. ldap_get_etnry_controls_np (informal API)
  206. ldap_memfree (REXX need not use this)
  207. ldap_modrdn (Deprecated Functions)
  208. ldap_modrdn_s (Deprecated Functions)  
  209. ldap_mods_free (REXX need not use this)
  210. ldap_open (Deprecated Functions)
  211. ldap_parse_reference_np (informal API)
  212. ldap_parse_sasl_bind_result (Future support)
  213. ldap_perror (Deprecated Functions)
  214. ldap_result2error (Deprecated Functions)
  215. ldap_sasl_bind (Future support)
  216. ldap_sasl_bind_s (Future support)       
  217. ldap_set_rebind_pro (informal API)
  218. ldap_ssl_client_init (Future support)
  219. ldap_ssl_init (Future support)
  220. ldap_ssl_start (Deprecated Functions) 
  221. ldap_value_free (REXX need not use this)
  222. ldap_value_free_len (REXX need not use this)
  223.  
  224. * UTF-8 support
  225. - RXLDAP passes the DN to the C API after RXLDAP converts DN in the current
  226.   codepage into UTF-8. Your REXX program need not issue conversion.
  227. - RXLDAP passes the search filter to the C API after RXLDAP converts the filter
  228.   in the current codepage into UTF-8. Your REXX program need not issue
  229.   conversion.
  230. - RXLDAP issues UTF-8 conversions if you do not specify LDAP_MOD_BVALUES in
  231.   mods.n.!mod_op ("LDAP_MOD_ADD", "LDAP_MOD_DELETE", "LDAP_MOD_REPLACE"). Your
  232.   REXX program need not issue conversion.
  233. - RXLDAP does not issue UTF-8 conversions if you specify LDAP_MOD_BVALUES in
  234.   mods.n.!mod_op ("LDAP_MOD_DELETE|LDAP_MOD_BVALUES",
  235.   "LDAP_MOD_REPLACE|LDAP_MOD_BVALUES"). RXLDAP passes the values in the REXX
  236.   variable to C API without any conversion.
  237. - Rxldap_get_values returns values after converting from UTF-8 strings to
  238.   strings in the current codepage. Your REXX program need not issue conversion.
  239. - Rxldap_get_dn returns DN after converting from UTF-8 strings to strings in
  240.   the current codepage. Your REXX program need not issue conversion.
  241. - Rxldap_get_values_len returns the raw values from the C API.  
  242. - Rxldap_compare and Rxldap_compare_s pass the values to C API after converting
  243.   to the values into UTF-8. Your REXX program need not issue conversion.
  244. - Rxldap_compare_ext and Rxldap_compare_ext_s pass the raw values in the REXX
  245.   variable to C API.
  246. - If RXLDAP cannot convert the string from or to UTF-8,  
  247. RXLDAP passes the value to C API without conversions. RxldapToUTF8 and
  248.   RxldapFromUTF8 can check if the conversion works or not.
  249.  
  250. * API description
  251.  
  252. REXX API:       RxldapLoadFuncs
  253. function:       Load RXLDAP API
  254. syntax:         RxldapLoadFuncs()
  255. return value:   RXLDAP's version information
  256. example:
  257. call RxldapLoadFuncs
  258.  
  259. REXX API:       RxldapDropFuncs
  260. function:       Unload RXLDAP API
  261. syntax:         RxldapDropFuncs()
  262. return value:   ""
  263. example:
  264. call RxldapDropFuncs
  265.  
  266. REXX API:       RxldapVersion
  267. function:       Return RXLDAP's version information
  268. syntax:         RxldapVersion()
  269. return value:   RXLDAP's version information
  270. example:
  271. call RxldapVersion
  272.  
  273. REXX API:       RxldapToUTF8
  274. function:       Convert the string in the current codepage into UTF-8.
  275. syntax:         RxldapToUTF8(str)
  276. return value:   String in UTF-8. If impossible, returns "".
  277. example:
  278. call RxldapToUTF8 str
  279.  
  280. REXX API:       RxldapFromUTF8
  281. function:       Convert the string in UTF-8 into the current codepage.
  282. syntax:         RxldapFromUTF8(utf8str)
  283. return value:   String in the current codepage. If impossible, returns "".
  284. example:
  285. call RxldapFromUTF8 utf8str
  286.  
  287. REXX API:       Rxldap_abandon
  288. C API:          ldap_abandon
  289. syntax:         Rxldap_abandon(ld, msgid)
  290. return value:   0 (success), -1 (error)
  291. example:
  292. call Rxldap_abandon ld, msgid
  293.  
  294. REXX API:       Rxldap_abandon_ext
  295. C API:          ldap_abandon_ext
  296. syntax:         Rxldap_abandon(ld, msgid, serverctrlsstemname, clientctrlsstemname)
  297. return value:   ldaperr
  298. arguments:                   
  299. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  300. clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
  301. you can ommit:  serverctrlsstemname, clientctrlsstemname
  302. example:
  303. call Rxldap_abandon ld, msgid, 'serverctrls.', 'clientctrls.'
  304.  
  305. REXX API:       Rxldap_add
  306. C API:          ldap_add
  307. syntax:         Rxldap_add(ld, dn, modsstemname)
  308. return value:   msgid (success), -1 (error)
  309. arguments:                   
  310. modsstemname = stem name to store mods.
  311. example:
  312. call Rxldap_add ld, dn, 'mods.'
  313.  
  314. REXX API:       Rxldap_add_s
  315. C API:          ldap_add_s
  316. syntax:         Rxldap_add_s(ld, dn, modsstemname)
  317. return value:   ldaperr
  318. arguments:                   
  319. modsstemname = stem name to store mods.
  320. example:
  321. call Rxldap_add_s ld, dn, 'mods.'
  322.  
  323. REXX API:       Rxldap_add_ext
  324. C API:          ldap_add_ext
  325. syntax:         Rxldap_add_ext(ld, dn, modsstemname, serverctrlsstemname, clientctrlsstemname, msgidvarname)
  326. return value:   ldaperr
  327. arguments:                   
  328. modsstemname = stem name to store mods.
  329. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  330. clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
  331. msgidvarname = REXX variable name to store msgid.
  332. you can ommit:  serverctrlsstemname, clientctrlsstemname
  333. example:
  334. call Rxldap_add_ext ld, dn, 'mods.', 'serverctrls.', 'clientctrls.', 'msgid'
  335.  
  336. REXX API:       Rxldap_add_ext_s
  337. C API:          ldap_add_ext_s    
  338. syntax:         Rxldap_add_ext_s(ld, dn, modsstemname, serverctrlsstemname, clientctrlsstemname)
  339. return value:   ldaperr
  340. arguments:                   
  341. modsstemname = stem name to store mods.
  342. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  343. clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
  344. you can ommit:  serverctrlsstemname, clientctrlsstemname
  345. example:
  346. call Rxldap_add_ext_s ld, dn, 'mods.', 'serverctrls.', 'clientctrls.'
  347.  
  348. REXX API:       Rxldap_first_attribute
  349. C API:          ldap_first_attribute
  350. syntax:         Rxldap_first_attribute(ld, msg, bervarmame)
  351. return value:   attribute or "" (ldap_first_attribute returns NULL)
  352. arguments:                   
  353. bervarname = REXX variable name to store ber
  354. example:
  355. call Rxldap_first_attribute ld, msg, 'ber'
  356.  
  357. REXX API:       Rxldap_next_attribute
  358. C API:          ldap_next_attribute
  359. syntax:         Rxldap_next_attribute(ld, msg, ber)
  360. return value:   attribute or "" (ldap_next_attribute returns NULL)
  361. example:
  362. call Rxldap_next_attribute ld, msg, ber
  363.  
  364. REXX API:       Rxldap_simple_bind
  365. C API:          ldap_simple_bind
  366. syntax:         Rxldap_simple_bind(ld, dn, pw)
  367. return value:   msgid (success), -1 (fail)
  368. you can ommit:  dn, pw
  369. example:
  370. call Rxldap_simple_bind ld, dn, pw
  371.  
  372. REXX API:       Rxldap_simple_bind_s
  373. C API:          ldap_simple_bind_s
  374. syntax:         Rxldap_simple_bind_s(ld, dn, pw)
  375. return value:   ldaperr
  376. you can ommit:  dn, pw
  377. example:
  378. call Rxldap_simple_bind_s ld, dn, pw
  379.  
  380. REXX API:       Rxldap_unbind
  381. C API:          ldap_unbind
  382. syntax:         Rxldap_unbind(ld)
  383. return value:   msgid (success), -1 (fail)
  384. example:
  385. call Rxldap_unbind ld
  386.  
  387. REXX API:       Rxldap_unbind_s
  388. C API:          ldap_unbind_s
  389. syntax:         Rxldap_unbind_s(ld)
  390. return value:   ldaperr
  391. example:
  392. call Rxldap_unbind_s ld
  393.  
  394. REXX API:       Rxldap_compare
  395. C API:          ldap_compare
  396. syntax:         Rxldap_compare(ld, dn, attr, val)
  397. return value:   msgid (success), -1 (fail)
  398. example:
  399. call Rxldap_compare ld, dn, attr, val
  400.  
  401. REXX API:       Rxldap_compare_s
  402. C API:          ldap_compare_s
  403. syntax:         Rxldap_compare_s(ld, dn, attr, val)
  404. return value:   ldaperr
  405. example:
  406. call Rxldap_compare_s ld, dn, attr, val
  407.  
  408. REXX API:       Rxldap_compare_ext
  409. C API:          ldap_compare_ext
  410. syntax:         Rxldap_compare_ext(ld, dn, attr, val, serverctrlsstemname, clinetctrlsstemname, msgidvarname)
  411. return value:   ldaperr
  412. arguments:                   
  413. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  414. clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
  415. msgidvarname = REXX variable name to store msgid
  416. you can ommit:  serverctrlsstemname, clientctrlsstemname
  417. example:
  418. call Rxldap_compare_ext ld, dn, attr, val, 'serverctrls.', 'clinetctrls.', 'msgid'
  419.  
  420. REXX API:       Rxldap_compare_ext_s
  421. C API:          ldap_compare_ext_s
  422. syntax:         Rxldap_compare_ext(ld, dn, attr, val, serverctrlsstemname, clinetctrlsstemname)
  423. return value:   ldaperr
  424. arguments:                   
  425. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  426. clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
  427. you can ommit:  serverctrlsstemname, clientctrlsstemname
  428. example:
  429. call Rxldap_compare_ext_s ld, dn, attr, val, 'serverctrls.', 'clinetctrls.'
  430.  
  431. REXX API:       Rxldap_delete
  432. C API:          ldap_delete
  433. syntax:         Rxldap_delete(ld, dn)
  434. return value:   msgid (success), -1 (fail)
  435. example:
  436. call Rxldap_delete ld, dn
  437.  
  438. REXX API:       Rxldap_delete_s
  439. C API:          ldap_delete_s
  440. syntax:         Rxldap_delete_s(ld, dn)
  441. return value:   ldaperr
  442. example:
  443. call Rxldap_delete_s ld, dn
  444.  
  445. REXX API:       Rxldap_delete_ext
  446. C API:          ldap_delete_ext
  447. syntax:         Rxldap_delete_ext(ld, dn, serverctrlsstemname, clientctrlsstemname, msgidvarname)
  448. return value:   ldaperr
  449. arguments:                   
  450. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  451. clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
  452. msgidvarname = REXX variable name to store msgid
  453. you can ommit:  serverctrlsstemname, clientctrlsstemname
  454. example:
  455. call Rxldap_delete_ext ld, dn, 'serverctrls.', 'clientctrls.', 'msgid'
  456.  
  457. REXX API:       Rxldap_delete_ext_s
  458. C API:          ldap_delete_ext_s
  459. syntax:         Rxldap_delete_ext_s(ld, dn, serverctrlsstemname, clientctrlsstemname)
  460. return value:   ldaperr
  461. arguments:                   
  462. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  463. clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
  464. you can ommit:  serverctrlsstemname, clientctrlsstemname
  465. example:
  466. call Rxldap_delete_ext_s ld, dn, 'serverctrls.', 'clientctrls.'
  467.  
  468. REXX API:       Rxldap_first_etnry
  469. C API:          ldap_first_etnry
  470. syntax:         Rxldap_first_entry(ld, msg)
  471. return value:   msg (success), 0 (error)
  472. example:
  473. call Rxldap_first_entry ld, msg
  474.  
  475. REXX API:       Rxldap_next_etnry
  476. C API:          ldap_next_etnry
  477. syntax:         Rxldap_next_entry(ld, msg)
  478. return value:   msg (success), 0 (error)
  479. example:
  480. call Rxldap_next_entry ld, msg
  481.  
  482. REXX API:       Rxldap_count_etnries
  483. C API:          ldap_count_etnries
  484. syntax:         Rxldap_count_etnriesld, msg)
  485. return value:   number of entries
  486. example:
  487. call Rxldap_count_etnries ld, msg
  488.  
  489. REXX API:       Rxldap_get_errno
  490. C API:          ldap_get_errno
  491. syntax:         Rxldap_get_errno(ld)
  492. return value:   ldaperr
  493. example:
  494. call Rxldap_get_errno ld
  495.  
  496. REXX API:       Rxldap_err2string
  497. C API:          ldap_err2string
  498. syntax:         Rxldap_err2string(ldaperr)
  499. return value:   error message
  500. example:
  501. call Rxldap_err2string ldaperr
  502.  
  503. REXX API:       Rxldap_get_dn
  504. C API:          ldap_get_dn
  505. syntax:         Rxldap_get_dn(ld, msg)
  506. return value:   dn (success), "" (error)
  507. example:
  508. call Rxldap_get_dn ld, msg
  509.  
  510. REXX API:       Rxldap_explode_dn
  511. C API:          ldap_explode_dn
  512. syntax:         Rxldap_explode_dn(dn, notype, dnsstemname)
  513. return value:   dns.0é╠Æl
  514. arguments:                   
  515. dnsstemname = stem name to store parts of DN. (dns.0 = number of items, dns.n = item)
  516. example:
  517. call Rxldap_explode_dn dn, notype, 'dns.'
  518.  
  519. REXX API:       Rxldap_get_values
  520. C API:          ldap_get_values
  521. syntax:         Rxldap_get_values(ld, msg, attr, valstemname)
  522. return value:   vals.0é╠Æl
  523. arguments:                   
  524. valsstemname = stem name to store attribute values. (vals.0 = number of items, vals.n = item value)
  525. example:
  526. call Rxldap_get_values ld, msg, attr, 'vals.'
  527.  
  528. REXX API:       Rxldap_get_values_len
  529. C API:          ldap_get_values_len
  530. syntax:         Rxldap_get_values_len(ld, msg, attr, valstemname)
  531. return value:   vals.0é╠Æl
  532. arguments:                   
  533. valsstemname = stem name to store attribute values. (vals.0 = number of items, vals.n = item value)
  534. example:
  535. call Rxldap_get_values_len ld, msg, attr, 'vals.'
  536.  
  537. REXX API:       Rxldap_init
  538. C API:          ldap_init
  539. syntax:         Rxldap_init(host, port)
  540. return value:   ld
  541. you can ommit:  port
  542. example:
  543. call Rxldap_init host, port
  544.  
  545. REXX API:       Rxldap_msgfree
  546. C API:          ldap_msgfree
  547. syntax:         Rxldap_msgfree(msg)
  548. return value:   msgtype
  549. example:
  550. call Rxldap_msgfree msg
  551.  
  552. REXX API:       Rxldap_ber_free
  553. C API:          ldap_ber_free
  554. syntax:         Rxldap_ber_free(ber)
  555. return value:   ""
  556. example:
  557. call Rxldap_ber_free ber
  558.  
  559. REXX API:       Rxldap_first_message
  560. C API:          ldap_first_message
  561. syntax:         Rxldap_first_message(ld, msg)
  562. return value:   msg (success), 0 (error)
  563. example:
  564. call Rxldap_first_message ld, msg
  565.  
  566. REXX API:       Rxldap_next_message
  567. C API:          ldap_next_message
  568. syntax:         Rxldap_next_message(ld, msg)
  569. return value:   msg (success), 0 (error)
  570. example:
  571. call Rxldap_next_message ld, msg
  572.  
  573. REXX API:       Rxldap_count_messages
  574. C API:          ldap_count_messages
  575. syntax:         Rxldap_count_message(ld, msg)
  576. return value:   number of messages
  577. example:
  578. call Rxldap_count_message ld, msg
  579.  
  580. REXX API:       Rxldap_modify
  581. C API:          ldap_modify
  582. syntax:         Rxldap_modify(ld, dn, modsstemname)
  583. return value:   msgid (success), -1 (error)
  584. arguments:                   
  585. modsstemname = stem name to store mods.
  586. example:
  587. call Rxldap_modify ld, dn, 'mods.'
  588.  
  589. REXX API:       Rxldap_modify_ext
  590. C API:          ldap_modify_ext
  591. syntax:         Rxldap_modify_ext(ld, dn, modsstemname, serverctrlsstemname, clientctrlsstemname, msgidvarname)
  592. return value:   ldaperr
  593. arguments:                   
  594. modsstemname = stem name to store mods.
  595. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  596. clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
  597. msgidvarname = REXX variable name to store msgid
  598. you can ommit:  serverctrlsstemname, clientctrlsstemname
  599. example:
  600. call Rxldap_modify_ext ld, dn, 'mods.', 'serverctrls.', 'clientctrls.', 'msgid'
  601.  
  602. REXX API:       Rxldap_modify_s
  603. C API:          ldap_modify_s
  604. syntax:         Rxldap_modify_s(ld, dn, modsstemname)
  605. return value:   ldaperr
  606. arguments:                   
  607. modsstemname = stem name to store mods.
  608. example:
  609. call Rxldap_modify_s ld, dn, 'mods.'
  610.  
  611. REXX API:       Rxldap_modify_ext_s
  612. C API:          ldap_modify_ext_s
  613. syntax:         Rxldap_modify_ext_s(ld, dn, modsstemname, serverctrlsstemname, clientctrlsstemname)
  614. return value:   ldaperr
  615. arguments:                   
  616. modsstemname = stem name to store mods.
  617. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  618. clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
  619. you can ommit:  serverctrlsstemname, clientctrlsstemname
  620. example:
  621. call Rxldap_modify_ext_s ld, dn, 'mods.', 'serverctrls.', 'clientctrls.'
  622.  
  623. REXX API:       Rxldap_set_option
  624. C API:          ldap_set_option
  625. syntax:         Rxldap_set_option(ld, option, value)
  626. return value:   ldap_set_option's return value
  627. arguments:                   
  628. value = option values. (I tested only the values in the examples)
  629. example:
  630. call Rxldap_set_option ld, 'LDAP_OPT_TIMELIMIT', 10.0
  631. call Rxldap_set_option ld, 'LDAP_OPT_SIZELIMIT', 10.0
  632.  
  633. REXX API:       Rxldap_get_option
  634. C API:          ldap_set_option
  635. syntax:         Rxldap_set_option(ld, option, valvarname)
  636. return value:   ldap_get_option's return value.
  637. arguments:                   
  638. valvarname = REXX variable name to store the option value.(I tested only the values in the examples)
  639. example:
  640. call Rxldap_get_option ld, 'LDAP_OPT_TIMELIMIT', 'timeout'
  641. call Rxldap_get_option ld, 'LDAP_OPT_HOST_NAME', 'host'
  642. call Rxldap_get_option ld, 'LDAP_OPT_SIZELIMIT', 'size'
  643. call Rxldap_get_option ld, 'LDAP_OPT_PROTOCOL_VERSION', 'ver'
  644. call Rxldap_get_option ld, 'LDAP_OPT_API_INFO', 'ai'
  645. say ai.!ldapai_api_version
  646. say ai.!ldapai_protocol_version
  647. say ai.!ldapai_vendor_name
  648. say ai.!ldapai_vendor_version
  649. do i = 1 to ai.!ldapai_extensions.0
  650.    say ai.!ldapai_extensions.i
  651. end /* do */
  652. call Rxldap_get_option ld, 'LDAP_OPT_API_FEATURE_INFO', 'aif'
  653. say aif.!ldapaif_version
  654. say aif.!ldapaif_name
  655.  
  656. REXX API:       Rxldap_parse_result
  657. C API:          ldap_parse_result
  658. syntax:         Rxldap_parse_result(ld, msg, errcodevarname, matcheddnvarname, errmsgvarname, referralsstemname, serverctrlsstemname, freeit)
  659. return value:   ldaperr
  660. arguments:                   
  661. errcodevarname = REXX variable name to store errcode.
  662. matcheddnvarname = REXX variable name to matcheddn.
  663. errmsgvarname = REXX variable name to store errmsg.
  664. referralsstemname = REXX variable name to store referrals.
  665. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  666. freeit = free msg or not. (1: free, 0: not free)
  667. you can ommit:errcodevarname, matcheddnvarname, errmsgvarname, referralsstemname, serverctrlsstemname
  668. example:
  669. call Rxldap_parse_result ld, msg, 'errcode', 'matcheddn', 'errmsg', 'referrals', 'serverctrls', freeit
  670.  
  671. REXX API:       Rxldap_first_reference
  672. C API:          ldap_first_etnry
  673. syntax:         Rxldap_first_reference(ld, msg)
  674. return value:   msg (success), 0 (error)
  675. example:
  676. call Rxldap_first_reference ld, msg
  677.  
  678. REXX API:       Rxldap_next_etnry
  679. C API:          ldap_next_etnry
  680. syntax:         Rxldap_next_reference(ld, msg)
  681. return value:   msg (success), 0 (error)
  682. example:
  683. call Rxldap_next_reference ld, msg
  684.  
  685. REXX API:       Rxldap_count_references
  686. C API:          ldap_count_references
  687. syntax:         Rxldap_count_etnriesld, msg)
  688. return value:   number of entries.
  689. example:
  690. call Rxldap_count_references ld, msg
  691.  
  692. REXX API:       Rxldap_rename
  693. C API:          ldap_rename
  694. syntax:         Rxldap_rename(ld, dn, newrdn, newparent, deleteoldrdn, serverctrlsstemname, clientctrlsstemname, msgidvarname)
  695. return value:   ldaperr
  696. arguments:                   
  697. newrdn = new RDN after operation
  698. newparent = nre parent's RDN after operation
  699. deleteoldrdn = delete old entry or not after operation (1: delete, 0 not delete)
  700. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  701. clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
  702. msgidvarname = REXX variable name to store msgid
  703. you can ommit:newparent, serverctrlsstemname, clientctrlsstemname
  704. example:
  705. call Rxldap_rename ld, dn, newrdn, newparent, deleteoldrdn, 'serverctrls.', 'clientctrls.', 'msgid'
  706.  
  707. REXX API:       Rxldap_rename_s
  708. C API:          ldap_rename_s
  709. syntax:         Rxldap_rename_s(ld, dn, newrdn, newparent, deleteoldrdn, serverctrlsstemname, clientctrlsstemname)
  710. return value:   ldaperr
  711. arguments:                   
  712. newrdn = new RDN after operation
  713. newparent = nre parent's RDN after operation
  714. deleteoldrdn = delete old entry or not after operation (1: delete, 0 not delete)
  715. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  716. clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
  717. you can ommit:newparent, serverctrlsstemname, clientctrlsstemname
  718. example:
  719. call Rxldap_rename_s ld, dn, newrdn, newparent, deleteoldrdn, 'serverctrls.', 'clientctrls.'
  720.  
  721. REXX API:       Rxldap_result
  722. C API:          ldap_result
  723. syntax:         Rxldap_result(ld, msgid, all, timeout, msgvarname)
  724. return value:   msgtype
  725. arguments:                   
  726. msgid = msgid or message type symbols (example: 'LDAP_RES_ANY')
  727. all = 'LDAP_MSG_ONE', 'LDAP_MSG_RECEIVED', 'LDAP_MSG_ALL'
  728. msgvarname = REXX variable name to store msg (attrs.0 = number of items, attrs.n = attribute)
  729. you can ommit:timeout
  730. example:
  731. call Rxldap_result ld, msgid, 'LDAP_MSG_ONE', 10.0, 'msg'
  732.  
  733. REXX API:       Rxldap_msgtype
  734. C API:          ldap_msgtype
  735. syntax:         Rxldap_msgtype(msg)
  736. return value:   msgtype
  737. example:
  738. call Rxldap_msgtype msg
  739.  
  740. REXX API:       Rxldap_msgid
  741. C API:          ldap_msgid
  742. syntax:         Rxldap_msgid(msg)
  743. return value:   msgid
  744. example:
  745. call Rxldap_msgid msg
  746.  
  747. REXX API:       Rxldap_search
  748. C API:          ldap_search
  749. syntax:         Rxldap_search(ld, base, scope, filter, attrsstemname, attrsonly)
  750. return value:   msgid (success), -1 (error)
  751. arguments:
  752. attrsstemname = stem name to store attribute list (attrs.0 = number of items, attrs.n = attribute)
  753. example:
  754. call Rxldap_search ld, base, scope, filter, 'attrs.', 0
  755.  
  756. REXX API:       Rxldap_search_ext
  757. C API:          ldap_search_ext
  758. syntax:         Rxldap_search_ext(ld, base, scope, filter, attrsstemname, attrsonly, serverctrlsstemname, clientctrlsstemname, timeout, sizelimit, msgidvarname)
  759. return value:   ldaperr
  760. arguments:
  761. attrsstemname = stem name to store attribute list (attrs.0 = number of items, attrs.n = attribute)
  762. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  763. clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
  764. sizelimit = maximum message number. If 0, no limit.
  765. msgidvarname = REXX variable name to store msgid
  766. you can ommit:  serverctrlsstemname, clientctrlsstemname
  767. example:
  768. call Rxldap_search_ext ld, base, scope, filter, 'attrs.', 0, 'serverctrls.', 'clientctrls.', 10.0, 0, 'msgid'
  769.  
  770. REXX API:       Rxldap_search_s
  771. C API:          ldap_search_s
  772. syntax:         Rxldap_search_s(ld, base, scope, filter, attrsstemname, attrsonly, msgvarname)
  773. return value:   ldaperr
  774. arguments:
  775. attrsstemname = stem name to store attribute list (attrs.0 = number of items, attrs.n = attribute)
  776. msgvarname = REXX variable name to store msg (attrs.0 = number of items, attrs.n = attribute)üB
  777. example:
  778. call Rxldap_search_s ld, base, scope, filter, 'attrs.', 0, 'msg'
  779.  
  780. REXX API:       Rxldap_search_ext_s
  781. C API:          ldap_search_ext_s
  782. syntax:         Rxldap_search_ext_s(ld, base, scope, filter, attrsstemname, attrsonly, serverctrlsstemname, clientctrlsstemname, timeout, sizelimit, msgvarname)
  783. return value:   ldaperr
  784. arguments:
  785. attrsstemname = stem name to store attribute list (attrs.0 = number of items, attrs.n = attribute)
  786. serverctrlsstemname = stem variable name that has the server contorol's ldapctrl.
  787. clientctrlsstemname = stem variable name that has the client contorol's ldapctrl.
  788. sizelimit = maximum message number. If 0, no limit.
  789. msgvarname = REXX variable name to store msg (attrs.0 = number of items, attrs.n = attribute)
  790. you can ommit:  serverctrlsstemname, clientctrlsstemname
  791. example:
  792. call Rxldap_search_ext_s ld, base, scope, filter, 'attrs.', 0, 'serverctrls.', 'clientctrls.', 10.0, 0, 'msg'
  793.  
  794. REXX API:       Rxldap_search_st
  795. C API:          ldap_search_st
  796. syntax:         Rxldap_search_st(ld, base, scope, filter, attrsstemname, attrsonly, timeout, msgvarname)
  797. return value:   ldaperr
  798. arguments:
  799. attrsstemname = stem name to store attribute list (attrs.0 = number of items, attrs.n = attribute)
  800. msgvarname = REXX variable name to store msg (attrs.0 = number of items, attrs.n = attribute)üB
  801. example:
  802. call Rxldap_search_st ld, base, scope, filter, 'attrs.', 0, 10.0, 'msg'
  803.  
  804. REXX API:       Rxldap_is_ldap_url
  805. C API:          ldap_is_ldap_url
  806. syntax:         Rxldap_is_ldap_url(url)
  807. return value:   zero (not LDAP URL), not zero (LDAP URL)
  808. example:
  809. call Rxldap_is_ldap_url(url)
  810.  
  811. REXX API:       Rxldap_url_desc
  812. C API:          ldap_url_desc
  813. syntax:         Rxldap_url_desc(url, descstemname)
  814. return value:   ldaperr
  815. arguments:
  816. descstemname = stem name to store desc.
  817. example:
  818. call Rxldap_url_desc url, 'desc.'
  819.  
  820. REXX API:       Rxldap_url_search
  821. C API:          ldap_url_search
  822. syntax:         Rxldap_url_search(ld, url, attrsonly)
  823. return value:   msgid (success), -1 (fail)
  824. example:
  825. call Rxldap_url_search ld, url, 0
  826.  
  827. REXX API:       Rxldap_url_search_s
  828. C API:          ldap_url_search_s
  829. syntax:         Rxldap_url_search_s(ld, url, attrsonly, msgvarname)
  830. return value:   ldaperr
  831. example:
  832. call Rxldap_url_search_s ld, url, 0, 'msg'
  833.  
  834. REXX API:       Rxldap_url_search_st
  835. C API:          ldap_url_search_st
  836. syntax:         Rxldap_url_search_st(ld, url, attrsonly, timeout, msgvarname)
  837. return value:   ldaperr
  838. example:
  839. call Rxldap_url_search_st ld, url, 0, 10.0, 'msg'
  840.  
  841. REXX API:       Rxldap_version
  842. C API:          ldap_version
  843. syntax:         Rxldap_version(stemname)
  844. return value:   ldaperr
  845. example:
  846. call Rxldap_version 'a.'
  847. say a.!sdk_version
  848. say a.!protocol_version
  849.  
  850. * Lmitation
  851. - The binaries are built with debug information.
  852. - "ldap_get_errno" is not a formal API. RXLDAP calls ldap_get_option with
  853.   LDAP_OPT_ERROR_NUMBER in the Rxldap_get_errno.
  854. - "ldap_version" is not a formal API. RXLDAP calls ldap_get_option with
  855.   LDAP_OPT_API_INFO in the Rxldap_version.
  856. - "ldap_ver_free" is not a formal API. RXLDAP calls ber_ree in the
  857.   Rxldap_ber_free.
  858. - LDAPv2 API is dropped. RXLDAP never works with LDAPv2 servers.
  859.  
  860. * Packaging
  861. rxldap.dll 
  862. rxldap.def 
  863. rxldap-jp.txt 
  864. rxldap-en.txt 
  865. rxldap.c   
  866. rxldap.sym 
  867. rxstring.h     
  868. testrxldap.cmd (This realy works. Please use it as a sample)
  869. makefile
  870.  
  871. * How to build
  872. nmake32 (DLL)
  873.  
  874. nmake32 DEBUG=1 (Build with debug option)
  875.  
  876. nmake32 pkg (ZIP)
  877.  
  878. nmake32 LDAPSDK=D:\LDAPSDK (Use OpenLDAP SDK for OS/2 at D:\LDAPSDK)
  879.  
  880. * Future enhancement
  881. Support SSL.
  882.