From: Eric Leblond <eric@inl.fr>
To: netfilter-devel@vger.kernel.org
Cc: Eric Leblond <eric@inl.fr>
Subject: [ULOGD PATCH 4/6] Use IP2STR keys in PRINTFLOW module.
Date: Wed, 26 Mar 2008 23:49:09 +0100 [thread overview]
Message-ID: <12065717523264-git-send-email-eric@inl.fr> (raw)
In-Reply-To: <12065717514081-git-send-email-eric@inl.fr>
The PRINTFLOW module had its own code for string conversion of IPv6 address.
This patch change the input key of the module to use conversion made by the
IP2STR module.
Signed-off-by: Eric Leblond <eric@inl.fr>
---
:100644 100644 6c2ffd5... 272ee4f... M util/printflow.c
util/printflow.c | 20 ++++++++------------
1 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/util/printflow.c b/util/printflow.c
index 6c2ffd5..272ee4f 100644
--- a/util/printflow.c
+++ b/util/printflow.c
@@ -52,12 +52,12 @@ struct ulogd_key printflow_keys[FLOW_IDS] = {
{
.type = ULOGD_RET_IPADDR,
.flags = ULOGD_RETF_NONE,
- .name = "orig.ip.saddr",
+ .name = "orig.ip.saddr.str",
},
{
.type = ULOGD_RET_IPADDR,
.flags = ULOGD_RETF_NONE,
- .name = "orig.ip.daddr",
+ .name = "orig.ip.daddr.str",
},
{
.type = ULOGD_RET_UINT8,
@@ -87,12 +87,12 @@ struct ulogd_key printflow_keys[FLOW_IDS] = {
{
.type = ULOGD_RET_IPADDR,
.flags = ULOGD_RETF_NONE,
- .name = "reply.ip.saddr",
+ .name = "reply.ip.saddr.str",
},
{
.type = ULOGD_RET_IPADDR,
.flags = ULOGD_RETF_NONE,
- .name = "reply.ip.daddr",
+ .name = "reply.ip.daddr.str",
},
{
.type = ULOGD_RET_UINT8,
@@ -162,12 +162,10 @@ int printflow_print(struct ulogd_key *res, char *buf)
buf_cur += sprintf(buf_cur, "ORIG: ");
if (pp_is_valid(res, PRINTFLOW_ORIG_IP_SADDR))
- buf_cur += sprintf(buf_cur, "SRC=%s ", inet_ntoa(
- (struct in_addr) {htonl(GET_VALUE(res, PRINTFLOW_ORIG_IP_SADDR).ui32)}));
+ buf_cur += sprintf(buf_cur, "SRC=%s ", GET_VALUE(res, PRINTFLOW_ORIG_IP_SADDR).ptr);
if (pp_is_valid(res, PRINTFLOW_ORIG_IP_DADDR))
- buf_cur += sprintf(buf_cur, "DST=%s ", inet_ntoa(
- (struct in_addr) {htonl(GET_VALUE(res, PRINTFLOW_ORIG_IP_DADDR).ui32)}));
+ buf_cur += sprintf(buf_cur, "DST=%s ", GET_VALUE(res, PRINTFLOW_ORIG_IP_DADDR).ptr);
if (!pp_is_valid(res, PRINTFLOW_ORIG_IP_PROTOCOL))
goto orig_out;
@@ -211,12 +209,10 @@ orig_out:
buf_cur += sprintf(buf_cur, ", REPLY: ");
if (pp_is_valid(res, PRINTFLOW_REPLY_IP_SADDR))
- buf_cur += sprintf(buf_cur, "SRC=%s ", inet_ntoa(
- (struct in_addr) {htonl(GET_VALUE(res, PRINTFLOW_REPLY_IP_SADDR).ui32)}));
+ buf_cur += sprintf(buf_cur, "SRC=%s ", GET_VALUE(res, PRINTFLOW_REPLY_IP_SADDR).ptr);
if (pp_is_valid(res, PRINTFLOW_REPLY_IP_DADDR))
- buf_cur += sprintf(buf_cur, "DST=%s ", inet_ntoa(
- (struct in_addr) {htonl(GET_VALUE(res, PRINTFLOW_REPLY_IP_DADDR).ui32)}));
+ buf_cur += sprintf(buf_cur, "DST=%s ", GET_VALUE(res, PRINTFLOW_REPLY_IP_DADDR).ptr);
if (!pp_is_valid(res, PRINTFLOW_REPLY_IP_PROTOCOL))
goto reply_out;
--
1.5.2.5
next prev parent reply other threads:[~2008-03-26 22:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-26 22:49 [ULOGD PATCH 0/6] Making NFCT plugin IPv6 compliant Eric Leblond
2008-03-26 22:49 ` [ULOGD PATCH 1/6] Make arp related key optionnal Eric Leblond
2008-04-05 15:31 ` Pablo Neira Ayuso
2008-03-26 22:49 ` [ULOGD PATCH 2/6] Fix display of IPv6 address Eric Leblond
2008-04-05 15:31 ` Pablo Neira Ayuso
2008-03-26 22:49 ` [ULOGD PATCH 3/6] Fix typo in error message Eric Leblond
2008-04-05 15:32 ` Pablo Neira Ayuso
2008-03-26 22:49 ` Eric Leblond [this message]
2008-04-05 15:35 ` [ULOGD PATCH 4/6] Use IP2STR keys in PRINTFLOW module Pablo Neira Ayuso
2008-03-26 22:49 ` [ULOGD PATCH 5/6] Port of NFCT plugin to new libnetfilter_conntrack API Eric Leblond
2008-04-05 15:45 ` Pablo Neira Ayuso
2008-03-26 22:49 ` [ULOGD PATCH 6/6] Fix display of DESTROY event 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=12065717523264-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.