]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
IP2BIN filter convert IP address from host storage to a "binary" string which
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>
Tue, 25 Mar 2008 08:49:21 +0000 (08:49 +0000)
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>
Tue, 25 Mar 2008 08:49:21 +0000 (08:49 +0000)
can be use by MySQL. This is not strictly speaking raw data but it was of type
RAW.

Following remark from Hugo Mildenberger, I introduce in this patch a dedicated
type ULOGD_RET_RAWSTR. The main reason not to use a ULOGD_RET_STRING parameter
is that the paramater is not human readable.

Signed-off-by: Eric Leblond <eric@inl.fr>
filter/ulogd_filter_IP2BIN.c
include/ulogd/ulogd.h
util/db.c

index 9b0110e0d7670651b50f01c303e1605d3911b38f..33db6a2f157ecfa101d65f3070fc09e240e37b5b 100644 (file)
@@ -82,32 +82,32 @@ static struct ulogd_key ip2bin_inp[] = {
 
 static struct ulogd_key ip2bin_keys[] = {
        {
-               .type = ULOGD_RET_RAW,
+               .type = ULOGD_RET_RAWSTR,
                .flags = ULOGD_RETF_FREE,
                .name = "ip.saddr.bin",
        },
        {
-               .type = ULOGD_RET_RAW,
+               .type = ULOGD_RET_RAWSTR,
                .flags = ULOGD_RETF_FREE,
                .name = "ip.daddr.bin",
        },
        {
-               .type = ULOGD_RET_RAW,
+               .type = ULOGD_RET_RAWSTR,
                .flags = ULOGD_RETF_FREE,
                .name = "orig.ip.saddr.bin",
        },
        {
-               .type = ULOGD_RET_RAW,
+               .type = ULOGD_RET_RAWSTR,
                .flags = ULOGD_RETF_FREE,
                .name = "orig.ip.daddr.bin",
        },
        {
-               .type = ULOGD_RET_RAW,
+               .type = ULOGD_RET_RAWSTR,
                .flags = ULOGD_RETF_FREE,
                .name = "reply.ip.saddr.bin",
        },
        {
-               .type = ULOGD_RET_RAW,
+               .type = ULOGD_RET_RAWSTR,
                .flags = ULOGD_RETF_FREE,
                .name = "reply.ip.daddr.bin",
        },
index 8c052f207dd0b73c25b5af4606d531b66c296cca..39ac4642d50bb86ae2e821478b2fc149d5f8a26f 100644 (file)
@@ -47,6 +47,7 @@
 /* types with length field */
 #define ULOGD_RET_STRING       0x8020
 #define ULOGD_RET_RAW          0x8030
+#define ULOGD_RET_RAWSTR       0x8040
 
 
 /* FLAGS */
index d57ab6a4d15a130aa4f45f9a4b3b092bac7e3e56..49f6c29b35f1a86f83fb4cb84d790909cebac9bb 100644 (file)
--- a/util/db.c
+++ b/util/db.c
@@ -294,9 +294,12 @@ static int __interp_db(struct ulogd_pluginstance *upi)
                        }
                        sprintf(di->stmt_ins, "',");
                        break;
-               case ULOGD_RET_RAW:
+               case ULOGD_RET_RAWSTR:
                        sprintf(di->stmt_ins, "%s,", res->u.value.ptr);
                        break;
+               case ULOGD_RET_RAW:
+                       ulogd_log(ULOGD_NOTICE,
+                               "Unsupported RAW type is unsupported in SQL output");
                default:
                        ulogd_log(ULOGD_NOTICE,
                                "unknown type %d for %s\n",