new
add
9.0
top
← prev up next →

ldap-ffi: a Racket LDAP client built on top of libldap C APIπŸ”— i

Dmitry Bulaev <dmitryhertz@gmail.com>

This package provides an FFI binding to the libldap: the Lightweight Directory Access Protocol (LDAP) client library which is used for access to X.500 directory services.

class

ldap% :class?

superclass:object%

constructor

[hosthost]
[ [versionversion]
[root-dnroot-dn]
[passwordpassword]])(is-a?/c ldap% )
host:string?
version:(or/c23)=3
root-dn:(or/cstring? #f)=#f
password:(or/cstring? #f)=#f
Constructs a new ldap object, initializes libldap and set the version (LDAPv3 is default version).

method

(send a-ldap set-option keyvalue)#t

key:positive?
value:positive?
Set LDAP related options.

If the set-option fails, then an instance of exn:fail:libldap is raised.

method

(send a-ldap bind [mechanism])#t

mechanism:(or/c012)=0
Authenticate to the directory server.

If the bind fails, then an instance of exn:fail:libldap is raised.

method

(send a-ldap modify user-dnmod-list)#t

user-dn:string?
mod-list:(listof(list/cnumber? string? (listofstring? )))
Modify an entry.

If the modify fails, then an instance of exn:fail:libldap is raised.

method

(send a-ldap add user-dnmod-list)#t

user-dn:string?
mod-list:(listof(list/cnumber? string? (listofstring? )))
Add a new entry.

If the add fails, then an instance of exn:fail:libldap is raised.

method

(send a-ldap delete dn)#t

dn:string?
Delete an entry.

If the delete fails, then an instance of exn:fail:libldap is raised.

method

(send a-ldap search base-dnfltrscope)#t

base-dn:string?
fltr:string?
scope:(or/c012)
Search for the LDAP directory entries and write retrieved data to the internal box storage.

If the search fails, then an instance of exn:fail:libldap is raised.

method

(send a-ldap search* base-dnfltrscope)(listoflist? )

base-dn:string?
fltr:string?
scope:(or/c012)
Equivalent to search but returs (listoflist? ) (instead of #t) then clears the object’s internal ldap-message storage.

If the search* fails, then an instance of exn:fail:libldap is raised.

method

(send a-ldap compare dnattrvalue)boolean?

dn:string?
attr:string?
value:string?
Check whether or not an entry contains the same attribute value as given.

If the compare fails, then an instance of exn:fail:libldap is raised.

method

(send a-ldap get-data )(listoflist? )

Return retrieved data from the internal box storage. It doesn’t make a request to the LDAP server.

method

(send a-ldap count-entries )(or/czero? positive? )

Return the number of retrieved entries or 0 otherwise.

method

(send a-ldap set-password useroldpwnewpw)boolean?

user:string?
oldpw:string?
newpw:string?
Set a new password.

If the set-password fails, then an instance of exn:fail:libldap is raised.

method

(send a-ldap rename-dn dn
newrdn
new-superior
delete-old-rdn)#t
dn:string?
newrdn:string?
new-superior:string?
delete-old-rdn:(or/c01)
Rename the DN of an LDAP entry or move it from one superior to another.

If the rename-dn fails, then an instance of exn:fail:libldap is raised.

method

(send a-ldap unbind )#t

Close the connection to the directory server.

If the unbind fails, then an instance of exn:fail:libldap is raised.

method

(send a-ldap clear )void?

Clear the object’s internal box storage where the latest returned ldap-message storages itself.

#:extra-constructor-namemake-exn:fail:ldap )
An exception structure type for reporting errors from the underlying libldap library.

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /