summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/slap.h
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2009-11-04 14:39:44 -0800
committerNathan Kinder <nkinder@redhat.com>2009-11-04 14:39:44 -0800
commitfaf68949bba456988ec4aaa2715c8d9cd664f513 (patch)
treeec8901fa7a8a951c6b6065ee8b76cf902ab673da /ldap/servers/slapd/slap.h
parent1484974a30910c927f1ee17b52443186fffc3df0 (diff)
downloadds-faf68949bba456988ec4aaa2715c8d9cd664f513.tar.gz
ds-faf68949bba456988ec4aaa2715c8d9cd664f513.tar.xz
ds-faf68949bba456988ec4aaa2715c8d9cd664f513.zip
Allow plugin execution order to be defined
This patch adds support for assigning a precedence to each plugin. This precedence value is used to determine what order the plugins should be called in within a given plugin type. The precedence value is an integer between 1 and 99. The value is set in the nsslapd-pluginPrecedence attribute in a plugin config entry in "cn=config". If a plugin does not have a precedence value set, the plugin is treated as if it has a precedence of 50. For more details, see the feature design document at: http://directory.fedoraproject.org/wiki/Plugin_Ordering I also removed an incorrect log message in the linked attrs plugin that I noticed while debugging this patch.
Diffstat (limited to 'ldap/servers/slapd/slap.h')
-rw-r--r--ldap/servers/slapd/slap.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index 76c8df26..35fc1f59 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -691,6 +691,12 @@ struct matchingRuleList {
#define ATTR_PLUGIN_INVOKE_FOR_REPLOP "nsslapd-invokeForReplOp"
#define ATTR_PLUGIN_LOAD_NOW "nsslapd-pluginLoadNow"
#define ATTR_PLUGIN_LOAD_GLOBAL "nsslapd-pluginLoadGlobal"
+#define ATTR_PLUGIN_PRECEDENCE "nsslapd-pluginPrecedence"
+
+/* plugin precedence defines */
+#define PLUGIN_DEFAULT_PRECEDENCE 50
+#define PLUGIN_MIN_PRECEDENCE 1
+#define PLUGIN_MAX_PRECEDENCE 99
/* plugin action states */
enum
@@ -738,16 +744,17 @@ struct pluginconfig{
struct slapdplugin {
void *plg_private; /* data private to plugin */
char *plg_version; /* version of this plugin */
- int plg_argc; /* argc from config file */
+ int plg_argc; /* argc from config file */
char **plg_argv; /* args from config file */
char *plg_libpath; /* library path for dll/so */
- char *plg_initfunc; /* init symbol */
+ char *plg_initfunc; /* init symbol */
IFP plg_close; /* close function */
Slapi_PluginDesc plg_desc; /* vendor's info */
- char *plg_name; /* used for plugin rdn in cn=config */
+ char *plg_name; /* used for plugin rdn in cn=config */
struct slapdplugin *plg_next; /* for plugin lists */
int plg_type; /* discriminates union */
- char *plg_dn; /* config dn for this plugin */
+ char *plg_dn; /* config dn for this plugin */
+ int plg_precedence; /* for plugin execution ordering */
struct slapdplugin *plg_group; /* pointer to the group to which this plugin belongs */
struct pluginconfig plg_conf; /* plugin configuration parameters */
IFP plg_cleanup; /* cleanup function */