[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: loadable module support



As I noted in -stable, dynamically linking backend and other
others modules is quite interesting to me.  I think dynamic
linked modules will facilate a number of developments within
OpenLDAP.

You might want to review Howard Chu <howard.chu@platinum.com>
efforts in this area: ITS#97.  Though implemented against
our old backend interface, it might included some useful
details.

Some comments:

At 07:30 PM 4/12/99 +0200, Bastiaan Bakker wrote:
>I'm currently writing a new backend to LDAP-enable the userdatabase
>server in use at Lifeline. For development speed and flexibilty I
>thought it would be nice if OpenLDAP supports dynamically loadable
>modules, like Apache has. This way one could simply enable specific
>backends, authentication methods or features (e.g. phonetic) in the
>config file.

I agree.

>Currently I've a small patch that allows a line in slapd.conf like:
>loadmodule    /opt/ldap/modules/backcorba.so


>This will load any shared object regardless of its function. It's up to
>the module to register itself upon initialization.

If we have multiple dynamic modules to load, how to we determine
which entry points to call to initialize the module (so that it
can register it's functionality)?  Is this done automatically or
do we need to specify the name of entry point in the .conf file?

>So far I've only patched backend.c and some backends to allow for
>dynamic backend loading.
>The ugly if-then list in new_backend() is replaced by a lookup
>in a hashtable.  This yields a pointer to a function that will set the
>appropiate hooks in the Backend structure. The init method of the
>backend modules adds the entry to the hashtable. I haven't included
>support for other modules yet. First I would like to receive some
>feedback on my approach. Specifically my patches require glib/gmodule
>for the loadable module support and the hashtable. In my opinion glib (a
>
>independently maintained spinoff of GTK/GNOME) is a great library for
>doing stuff like this in a platform independent way.

I assume gmodule depends on glib?
Did you add any direct dependency upon glib?
Is gmodule support integrated into libtool?

>Secondly, I'm no
>autoconf guru, so I anyone would like to help me incorporate the
>required changes in the build configuration (for example
>conditiotionally include -rdynamic in the CFLAGS),

I can help here...  I assume -rdynamic is GNU Linker (gld) specific.

>that would be
>appreciated very much. It's my intentiation to leave the loadable module
>
>support completely optional (switchale with ./configure).

This would be wise.

>Please let me know what you think!

Sounds like you have made a good start.  I'd like to very much like
to see such capability added to OpenLDAP.  I'd like for the approach
to be reasonably flexible and support a wide variety of C compilers
and linkers.

Kurt