Plugin project proposal
Zhanna Tsitkova
tsitkova at MIT.EDU
Fri Jul 16 09:10:14 EDT 2010
A general idea of what the plugin interface writer and plugin
interface implementation writer are expected to do is described in
section
http://k5wiki.kerberos.org/wiki/Projects/Plugin_support_improvements#Consequences
One can see that all complexity of the framework is shifted into the
manager and loader.
So, the plugin interface writer's responsibility becomes as simple as
writing the code similar to
:header:
typedef struct {
int version;
char *plugin_name;
krb5_error_code (*fn1)(...);
} plugin_X;
krb5_error_code plugin_X_fn1(plhandle handle, ...);
:source:
krb5_error_code plugin_X_fn1(plhandle handle, ...)
{
plugin_X* api = (plugin_X*) handle.api;
api->plugin_X_fn1(...);
return err;
}
The example of plugin interface implementation writer experience is
given in the message below.
Zhanna
On Jul 15, 2010, at 4:26 PM, Zhanna Tsitkova wrote:
> Well, in the proposed implementation the plugin module writer would
> do the following:
>
> plhandle
> plugin_pwd_qlty_krb_create()
> {
> plhandle handle;
> plugin_pwd_qlty* api = malloc(sizeof(plugin_pwd_qlty));
> api->version = 1;
> ...
> api->pwd_qlty_init = _plugin_pwd_qlty_init;
> api->pwd_qlty_check = _plugin_pwd_qlty_check;
> api->pwd_qlty_cleanup = _plugin_pwd_qlty_clean;
> handle.api = api;
> return handle;
> }
>
> and then define each of the methods:
>
> static kadm5_ret_t
> _plugin_pwd_qlty_check(...l)
> {
> // do actual quality validation and return
> }
>
> In my opinion this approach is friendlier to the writer of the
> plugin implementation. The writer can concentrate on the particular
> functionality without caring the burden of other implementations.
>
> Thanks,
> Zhanna
Zhanna Tsitkova
tsitkova at mit.edu
More information about the krbdev
mailing list