summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Chifflier <chifflier@inl.fr>2009-04-16 14:20:40 +0200
committerEric Leblond <eric@inl.fr>2009-04-17 07:38:37 +0200
commita03ac74abde5fb2236d9d9aa57a3ba10f8e7bdc4 (patch)
tree2660467653e58a97b027c147d7088db3893a29be
parent0ff525cb0506b2c043bc9df6d7e7b486c865bc38 (diff)
ulogd: configure all plugins before resolving keys.
Split the 'resolve keys' step in two parts: first call the configure fonction for all plugins (in reverse order), then loop again to resolve the keys. This allows dynamic construction of the input and output keys, even for filter plugins. Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
-rw-r--r--src/ulogd.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/ulogd.c b/src/ulogd.c
index 1428373..dc0407e 100644
--- a/src/ulogd.c
+++ b/src/ulogd.c
@@ -640,14 +640,8 @@ create_stack_resolve_keys(struct ulogd_pluginstance_stack *stack)
int i = 0;
struct ulogd_pluginstance *pi_cur;
- /* PASS 2: */
- ulogd_log(ULOGD_DEBUG, "connecting input/output keys of stack:\n");
+ /* pre-configuration pass */
llist_for_each_entry_reverse(pi_cur, &stack->list, list) {
- struct ulogd_pluginstance *pi_prev =
- llist_entry(pi_cur->list.prev,
- struct ulogd_pluginstance,
- list);
- i++;
ulogd_log(ULOGD_DEBUG, "traversing plugin `%s'\n",
pi_cur->plugin->name);
/* call plugin to tell us which keys it requires in
@@ -662,6 +656,18 @@ create_stack_resolve_keys(struct ulogd_pluginstance_stack *stack)
return ret;
}
}
+ }
+
+ /* PASS 2: */
+ ulogd_log(ULOGD_DEBUG, "connecting input/output keys of stack:\n");
+ llist_for_each_entry_reverse(pi_cur, &stack->list, list) {
+ struct ulogd_pluginstance *pi_prev =
+ llist_entry(pi_cur->list.prev,
+ struct ulogd_pluginstance,
+ list);
+ i++;
+ ulogd_log(ULOGD_DEBUG, "traversing plugin `%s'\n",
+ pi_cur->plugin->name);
if (i == 1) {
/* first round: output plugin */