summaryrefslogtreecommitdiffstats
path: root/output
diff options
context:
space:
mode:
authorlaforge <laforge>2004-10-10 21:31:54 +0000
committerlaforge <laforge>2004-10-10 21:31:54 +0000
commitb88db902b05194f0ce444e1f6acb795f5b0fb6b3 (patch)
treed2bad697a33b86886dd058615ca0eaf0b52b7440 /output
parent6023b98a2980bab6d854e19cc79ee2560c4e32f1 (diff)
intermediate development snapshot
Diffstat (limited to 'output')
-rw-r--r--output/mysql/ulogd_MYSQL.c63
-rw-r--r--output/ulogd_output_OPRINT.c10
2 files changed, 42 insertions, 31 deletions
diff --git a/output/mysql/ulogd_MYSQL.c b/output/mysql/ulogd_MYSQL.c
index 894098f..78c799d 100644
--- a/output/mysql/ulogd_MYSQL.c
+++ b/output/mysql/ulogd_MYSQL.c
@@ -65,39 +65,45 @@ static char *stmt_val;
static char *stmt_ins;
/* our configuration directives */
-static config_entry_t db_ce = {
- .key = "db",
- .type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_MANDATORY,
+static struct config_entry mysql_ces[] = {
+ {
+ .key = "db",
+ .type = CONFIG_TYPE_STRING,
+ .options = CONFIG_OPT_MANDATORY,
+ },
+ {
+ .key = "host",
+ .type = CONFIG_TYPE_STRING,
+ .options = CONFIG_OPT_MANDATORY,
+ },
+ {
+ .key = "user",
+ .type = CONFIG_TYPE_STRING,
+ .options = CONFIG_OPT_MANDATORY,
+ },
+ {
+ .key = "pass",
+ .type = CONFIG_TYPE_STRING,
+ .options = CONFIG_OPT_MANDATORY,
+ },
+ {
+ .key = "table",
+ .type = CONFIG_TYPE_STRING,
+ .options = CONFIG_OPT_MANDATORY,
+ },
};
-static config_entry_t host_ce = {
- .next = &db_ce,
- .key = "host",
- .type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_MANDATORY,
+static struct config_keyset mysql_keyset = {
+ .num_ces = sizeof(mysql_ces)/sizeof(struct config_entry),
+ .ces = &mysql_ces,
};
-static config_entry_t user_ce = {
- .next = &host_ce,
- .key = "user",
- .type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_MANDATORY,
-};
-
-static config_entry_t pass_ce = {
- .next = &user_ce,
- .key = "pass",
- .type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_MANDATORY,
-};
-static config_entry_t table_ce = {
- .next = &pass_ce,
- .key = "table",
- .type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_MANDATORY,
-};
+#define db_ce(x) x[0]
+#define host_ce(x) x[1]
+#define user_ce(x) x[2]
+#define pass_ce(x) x[3]
+#define table_ce(x) x[4]
/* our main output function, called by ulogd */
static int mysql_output(ulog_iret_t *result)
@@ -357,6 +363,7 @@ static ulog_output_t mysql_plugin = {
.output = &mysql_output,
.init = &mysql_init,
.fini = &mysql_fini,
+ .config_kset = &mysql_keyset,
};
void _init(void)
diff --git a/output/ulogd_output_OPRINT.c b/output/ulogd_output_OPRINT.c
index ea5ff6a..dfcad05 100644
--- a/output/ulogd_output_OPRINT.c
+++ b/output/ulogd_output_OPRINT.c
@@ -81,9 +81,12 @@ static int oprint_interp(struct ulogd_pluginstance *instance)
return 0;
}
-static config_entry_t outf_ce = { NULL, "file", CONFIG_TYPE_STRING,
- CONFIG_OPT_NONE, 0,
- { string: ULOGD_OPRINT_DEFAULT } };
+static struct config_entry outf_ce = {
+ .key = "file",
+ .type = CONFIG_TYPE_STRING,
+ .options = CONFIG_OPT_NONE,
+ .u.string = ULOGD_OPRINT_DEFAULT
+};
static void sighup_handler_print(int signal)
{
@@ -155,6 +158,7 @@ static struct ulogd_plugin oprint_plugin = {
.destructor = &oprint_fini,
.signal = &sighup_handler_print,
.configs = &outf_ce,
+ .num_configs = 1,
};
void _init(void)