From: Eric Leblond <eric@inl.fr>
To: netfilter-devel@vger.kernel.org
Cc: Eric Leblond <eric@inl.fr>
Subject: [ULOGD PATCH 2/8] Introduce RAWSTR type to avoid confusion in future developement.
Date: Sun, 9 Mar 2008 23:36:23 +0100 [thread overview]
Message-ID: <12051021893499-git-send-email-eric@inl.fr> (raw)
In-Reply-To: <12051021893015-git-send-email-eric@inl.fr>
IP2BIN filter convert IP address from host storage to a "binary" string which
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 | 12 ++++++------
include/ulogd/ulogd.h | 1 +
util/db.c | 5 ++++-
3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/filter/ulogd_filter_IP2BIN.c b/filter/ulogd_filter_IP2BIN.c
index 9b0110e..33db6a2 100644
--- a/filter/ulogd_filter_IP2BIN.c
+++ b/filter/ulogd_filter_IP2BIN.c
@@ -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",
},
diff --git a/include/ulogd/ulogd.h b/include/ulogd/ulogd.h
index 8c052f2..39ac464 100644
--- a/include/ulogd/ulogd.h
+++ b/include/ulogd/ulogd.h
@@ -47,6 +47,7 @@
/* types with length field */
#define ULOGD_RET_STRING 0x8020
#define ULOGD_RET_RAW 0x8030
+#define ULOGD_RET_RAWSTR 0x8040
/* FLAGS */
diff --git a/util/db.c b/util/db.c
index d57ab6a..49f6c29 100644
--- 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",
--
1.5.4.3
next prev parent reply other threads:[~2008-03-09 22:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-09 22:36 [ULOGD PATCH 0/8] Allow reuse of plugin instance (and misc fixes) Eric Leblond
2008-03-09 22:36 ` [ULOGD PATCH 1/8] Add hook to list of fields in database for packet logging Eric Leblond
2008-03-25 8:41 ` Pablo Neira Ayuso
2008-03-09 22:36 ` Eric Leblond [this message]
2008-03-25 8:42 ` [ULOGD PATCH 2/8] Introduce RAWSTR type to avoid confusion in future developement Pablo Neira Ayuso
2008-03-09 22:36 ` [ULOGD PATCH 3/8] Fix indentation in ulogd_inppkt_NFLOG.c Eric Leblond
2008-03-25 8:43 ` Pablo Neira Ayuso
2008-03-09 22:36 ` [ULOGD PATCH 4/8] Don't call start function multiple time for a single plugin instance Eric Leblond
2008-03-25 8:48 ` Pablo Neira Ayuso
2008-03-09 22:36 ` [ULOGD PATCH 5/8] Add a list of used plugininstance Eric Leblond
2008-03-25 9:50 ` Pablo Neira Ayuso
2008-03-09 22:36 ` [ULOGD PATCH 6/8] Duplicate message to all existing instance of NFLOG Eric Leblond
2008-03-25 9:54 ` Pablo Neira Ayuso
2008-03-09 22:36 ` [ULOGD PATCH 7/8] Add code for duplication of message in ULOG Eric Leblond
2008-03-25 9:59 ` Pablo Neira Ayuso
2008-03-09 22:36 ` [ULOGD PATCH 8/8] Duplication of message in NFCT input plugin Eric Leblond
2008-03-25 10:02 ` Pablo Neira Ayuso
2008-03-25 10:03 ` [ULOGD PATCH 0/8] Allow reuse of plugin instance (and misc fixes) Pablo Neira Ayuso
2008-03-25 15:36 ` Eric Leblond
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=12051021893499-git-send-email-eric@inl.fr \
--to=eric@inl.fr \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.