summaryrefslogtreecommitdiffstats
path: root/output/mysql
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/mysql
parent6023b98a2980bab6d854e19cc79ee2560c4e32f1 (diff)
intermediate development snapshot
Diffstat (limited to 'output/mysql')
-rw-r--r--output/mysql/ulogd_MYSQL.c63
1 files changed, 35 insertions, 28 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)