[Date Prev][Date Next]
RE: Writing my own backend
First many thanks for your response.
Regarding your suggestion I think I do need a custom backend to provide
LDAP access to our proprietary database, which is not LDAP and no SQL
accessible. I'll continue to ask you some questions about my custom
How front-end knows about backend presence (files to modify, etc.)?
Can you describe backend state machine, the order of function calls? As
I understand module_init() is called first. What it the sequence of
Do you have any information about Operation and SlapReply structures or
about any helper APIs that can be helpful to access them?
Is front-end can provide any information to backend: API, ect. ?
[mailto:owner-openldap-software@OpenLDAP.org] On Behalf Of Pierangelo
Sent: Monday, September 27, 2004 11:53 PM
To: Michael Margulis
Subject: Re: Writing my own backend
> Hi OpenLDAP gurus,
> I'm thinking about development of custom OpenLDAP backend and looking
> for your advice where to start. Is there any document/case study that
> explains how new backend can be integrated to the system, any clues?
Copy from an existing backend; make it dynamic and load it via
so you won't even need to touch existing code.
The essential is the module_init() function that registers your backend
the backend list. Essentially, you need to provide a BackendInfo
structure filled with all the hooks you backend is willing to provide; i
mean: the bi_init, bi_open, ..., bi_db_init, bi_db_config, bi_db_open,
bi_add, bi_delete, ... and so. You can (safely?) leave NULL those that
you do not intend to implement (I guess if some are not defined your
backend is not going to be much useful ;).
The calling convention for the operation-related hooks is uniform, and
looks like (Operation *, SlapReply *). The first structure contains
about the operation, the second brings back the results. You need to
carefully read and understand the structures in slap.h to be able to use
the members of both structures.
A good example is provided by existing backends. I would suggest
back-ldap because it's perhaps the one I'm most familiar with, and
its code is (or at least used to be) really straightforward.
One (humble) suggestion: do you really need your own backend? If all
need is a proof of concept, perhaps back-perl (if you know perl) or
back-shell can be an option; if all you need is a small bit of
functionality on top of an existing backend, look at overlays
(servers/slapd/overlays/slapover.txt) or SLAPI (google).
SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: