From: Eric Leblond <eric@inl.fr>
To: netfilter-devel@vger.kernel.org
Cc: Eric Leblond <eric@inl.fr>
Subject: [ULOGD PATCH 1/5] Add label option to ULOG input plugin.
Date: Mon, 21 Apr 2008 22:43:43 +0200 [thread overview]
Message-ID: <12088106273106-git-send-email-eric@inl.fr> (raw)
In-Reply-To: <12088106273628-git-send-email-eric@inl.fr>
This patch adds support for "label" option to the ULOG plugin. For example, it
can be used by another module to determine if the packet has been dropped,
rejected or accepted.
Signed-off-by: Eric Leblond <eric@inl.fr>
---
input/packet/ulogd_inppkt_ULOG.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/input/packet/ulogd_inppkt_ULOG.c b/input/packet/ulogd_inppkt_ULOG.c
index d30c07e..a58b41f 100644
--- a/input/packet/ulogd_inppkt_ULOG.c
+++ b/input/packet/ulogd_inppkt_ULOG.c
@@ -34,7 +34,7 @@ struct ulog_input {
/* configuration entries */
static struct config_keyset libulog_kset = {
- .num_ces = 3,
+ .num_ces = 4,
.ces = {
{
.key = "bufsize",
@@ -54,6 +54,13 @@ static struct config_keyset libulog_kset = {
.options = CONFIG_OPT_NONE,
.u.value = ULOGD_RMEM_DEFAULT,
},
+ {
+ .key = "label",
+ .type = CONFIG_TYPE_INT,
+ .options = CONFIG_OPT_NONE,
+ .u.value = 0,
+ },
+
}
};
enum ulog_keys {
@@ -70,6 +77,7 @@ enum ulog_keys {
ULOG_KEY_RAW_MAC_LEN,
ULOG_KEY_OOB_FAMILY,
ULOG_KEY_OOB_PROTOCOL,
+ ULOG_KEY_RAW_LABEL,
};
static struct ulogd_key output_keys[] = {
@@ -157,6 +165,11 @@ static struct ulogd_key output_keys[] = {
.flags = ULOGD_RETF_NONE,
.name = "oob.protocol",
},
+ {
+ .type = ULOGD_RET_UINT8,
+ .flags = ULOGD_RETF_NONE,
+ .name = "raw.label",
+ },
};
@@ -171,6 +184,9 @@ static int interp_packet(struct ulogd_pluginstance *ip, ulog_packet_msg_t *pkt)
ret[ULOG_KEY_RAW_MAC_LEN].flags |= ULOGD_RETF_VALID;
}
+ ret[ULOG_KEY_RAW_LABEL].u.value.ui8 = ip->config_kset->ces[3].u.value;
+ ret[ULOG_KEY_RAW_LABEL].flags |= ULOGD_RETF_VALID;
+
/* include pointer to raw ipv4 packet */
ret[ULOG_KEY_RAW_PCKT].u.value.ptr = pkt->payload;
ret[ULOG_KEY_RAW_PCKT].flags |= ULOGD_RETF_VALID;
--
1.5.2.5
next prev parent reply other threads:[~2008-04-21 20:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-21 20:43 [ULOGD PATCH 0/5] Resent work related to 'label' and misc fixes Eric Leblond
2008-04-21 20:43 ` Eric Leblond [this message]
2008-04-21 20:43 ` [ULOGD PATCH 2/5] Add hook output to ULOG input module Eric Leblond
2008-04-27 7:51 ` Pablo Neira Ayuso
2008-04-21 20:43 ` [ULOGD PATCH 3/5] Fix a bug in definition of seq_global_ce macro Eric Leblond
2008-04-27 7:30 ` Pablo Neira Ayuso
2008-04-21 20:43 ` [ULOGD PATCH 4/5] Add label option to NFLOG input plugin Eric Leblond
2008-04-21 20:43 ` [ULOGD PATCH 5/5] Update default configuration to fit last changes 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=12088106273106-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.