[16009] in Kerberos_V5_Development
Re: Plugin project proposal
daemon@ATHENA.MIT.EDU (Zhanna Tsitkova)
Fri Jul 16 09:10:19 2010
Message-Id: <0B067FD4-024D-41A6-889F-23687B912975@mit.edu>
From: Zhanna Tsitkova <tsitkova@mit.edu>
To: Zhanna Tsitkova <tsitkova@mit.edu>
In-Reply-To: <8DD7AD829AB61E499A433D6E558110A302348A7E01@EXPO7.exchange.mit.edu>
Mime-Version: 1.0 (Apple Message framework v930.3)
Date: Fri, 16 Jul 2010 09:10:14 -0400
Cc: krbdev@mit.edu
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: krbdev-bounces@mit.edu
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@mit.edu
_______________________________________________
krbdev mailing list krbdev@mit.edu
https://mailman.mit.edu/mailman/listinfo/krbdev