All of lore.kernel.org
 help / color / mirror / Atom feed
* [ULOGD PATCH 0/5] Resent work related to 'label' and misc fixes
@ 2008-04-21 20:43 Eric Leblond
  2008-04-21 20:43 ` [ULOGD PATCH 1/5] Add label option to ULOG input plugin Eric Leblond
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Eric Leblond @ 2008-04-21 20:43 UTC (permalink / raw)
  To: netfilter-devel


Hello,

This patchset contains work related to the label option:
 * 0001-Add-label-option-to-ULOG-input-plugin.patch
 * 0004-Add-label-option-to-NFLOG-input-plugin.patch
 * 0005-Update-default-configuration-to-fit-last-changes.patch

It also adds hook support to ULOG:
 * 0002-Add-hook-output-to-ULOG-input-module.patch
and fixes a macro in NFLOG:
 * 0003-Fix-a-bug-in-definition-of-seq_global_ce-macro.patch

Patches providing 'label' support to databases will be sent by Pierre
Chifflier in an other patchset.

BR,
--
Eric Leblond
INL: http://www.inl.fr/
NuFW: http://www.nufw.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ULOGD PATCH 1/5] Add label option to ULOG input plugin.
  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
  2008-04-21 20:43 ` [ULOGD PATCH 2/5] Add hook output to ULOG input module Eric Leblond
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Eric Leblond @ 2008-04-21 20:43 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Eric Leblond

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [ULOGD PATCH 2/5] Add hook output to ULOG input module.
  2008-04-21 20:43 [ULOGD PATCH 0/5] Resent work related to 'label' and misc fixes Eric Leblond
  2008-04-21 20:43 ` [ULOGD PATCH 1/5] Add label option to ULOG input plugin Eric Leblond
@ 2008-04-21 20:43 ` 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
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Eric Leblond @ 2008-04-21 20:43 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Eric Leblond

This patch adds oob.hook to the list of output key sof ULOG input plugin.

Signed-off-by: Eric Leblond <eric@inl.fr>
---
 input/packet/ulogd_inppkt_ULOG.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/input/packet/ulogd_inppkt_ULOG.c b/input/packet/ulogd_inppkt_ULOG.c
index a58b41f..064321a 100644
--- a/input/packet/ulogd_inppkt_ULOG.c
+++ b/input/packet/ulogd_inppkt_ULOG.c
@@ -74,6 +74,7 @@ enum ulog_keys {
 	ULOG_KEY_OOB_MARK,
 	ULOG_KEY_OOB_IN,
 	ULOG_KEY_OOB_OUT,
+	ULOG_KEY_OOB_HOOK,
 	ULOG_KEY_RAW_MAC_LEN,
 	ULOG_KEY_OOB_FAMILY,
 	ULOG_KEY_OOB_PROTOCOL,
@@ -150,6 +151,15 @@ static struct ulogd_key output_keys[] = {
 		.flags = ULOGD_RETF_NONE,
 		.name = "oob.out", 
 	},
+	{
+		.type = ULOGD_RET_UINT8,
+		.flags = ULOGD_RETF_NONE,
+		.name = "oob.hook",
+		.ipfix = {
+			.vendor = IPFIX_VENDOR_NETFILTER,
+			.field_id = IPFIX_NF_hook,
+		},
+	},
 	{ 
 		.type = ULOGD_RET_UINT16, 
 		.flags = ULOGD_RETF_NONE, 
@@ -217,6 +227,9 @@ static int interp_packet(struct ulogd_pluginstance *ip, ulog_packet_msg_t *pkt)
 	ret[ULOG_KEY_OOB_OUT].u.value.ptr = pkt->outdev_name;
 	ret[ULOG_KEY_OOB_OUT].flags |= ULOGD_RETF_VALID;
 
+	ret[ULOG_KEY_OOB_HOOK].u.value.ui8 = pkt->hook;
+	ret[ULOG_KEY_OOB_HOOK].flags |= ULOGD_RETF_VALID;
+
 	/* ULOG is IPv4 only */
 	ret[ULOG_KEY_OOB_FAMILY].u.value.ui8 = AF_INET;
 	ret[ULOG_KEY_OOB_FAMILY].flags |= ULOGD_RETF_VALID;
-- 
1.5.2.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [ULOGD PATCH 3/5] Fix a bug in definition of seq_global_ce macro.
  2008-04-21 20:43 [ULOGD PATCH 0/5] Resent work related to 'label' and misc fixes Eric Leblond
  2008-04-21 20:43 ` [ULOGD PATCH 1/5] Add label option to ULOG input plugin Eric Leblond
  2008-04-21 20:43 ` [ULOGD PATCH 2/5] Add hook output to ULOG input module Eric Leblond
@ 2008-04-21 20:43 ` 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
  4 siblings, 1 reply; 8+ messages in thread
From: Eric Leblond @ 2008-04-21 20:43 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Eric Leblond

Signed-off-by: Eric Leblond <eric@inl.fr>
---
 input/packet/ulogd_inppkt_NFLOG.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/input/packet/ulogd_inppkt_NFLOG.c b/input/packet/ulogd_inppkt_NFLOG.c
index b0827a8..43e1bc4 100644
--- a/input/packet/ulogd_inppkt_NFLOG.c
+++ b/input/packet/ulogd_inppkt_NFLOG.c
@@ -86,8 +86,8 @@ static struct config_keyset libulog_kset = {
 #define rmem_ce(x)	(x->ces[2])
 #define af_ce(x)	(x->ces[3])
 #define unbind_ce(x)	(x->ces[4])
-#define seq_ce(x)	(x->ces[4])
-#define seq_global_ce(x)	(x->ces[5])
+#define seq_ce(x)	(x->ces[5])
+#define seq_global_ce(x)	(x->ces[6])
 
 enum nflog_keys {
 	NFLOG_KEY_RAW_MAC = 0,
-- 
1.5.2.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [ULOGD PATCH 4/5] Add label option to NFLOG input plugin.
  2008-04-21 20:43 [ULOGD PATCH 0/5] Resent work related to 'label' and misc fixes Eric Leblond
                   ` (2 preceding siblings ...)
  2008-04-21 20:43 ` [ULOGD PATCH 3/5] Fix a bug in definition of seq_global_ce macro Eric Leblond
@ 2008-04-21 20:43 ` Eric Leblond
  2008-04-21 20:43 ` [ULOGD PATCH 5/5] Update default configuration to fit last changes Eric Leblond
  4 siblings, 0 replies; 8+ messages in thread
From: Eric Leblond @ 2008-04-21 20:43 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Eric Leblond

This patch adds support for "label" option to the NFLOG 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_NFLOG.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/input/packet/ulogd_inppkt_NFLOG.c b/input/packet/ulogd_inppkt_NFLOG.c
index 43e1bc4..13f59a7 100644
--- a/input/packet/ulogd_inppkt_NFLOG.c
+++ b/input/packet/ulogd_inppkt_NFLOG.c
@@ -34,7 +34,7 @@ struct nflog_input {
 /* configuration entries */
 
 static struct config_keyset libulog_kset = {
-	.num_ces = 7,
+	.num_ces = 8,
 	.ces = {
 		{
 			.key 	 = "bufsize",
@@ -78,6 +78,13 @@ static struct config_keyset libulog_kset = {
 			.options = CONFIG_OPT_NONE,
 			.u.value = 0,
 		},
+		{
+			.key	 = "label",
+			.type	 = CONFIG_TYPE_INT,
+			.options = CONFIG_OPT_NONE,
+			.u.value = 0,
+		},
+
 	}
 };
 
@@ -88,6 +95,7 @@ static struct config_keyset libulog_kset = {
 #define unbind_ce(x)	(x->ces[4])
 #define seq_ce(x)	(x->ces[5])
 #define seq_global_ce(x)	(x->ces[6])
+#define label_ce(x)	(x->ces[7])
 
 enum nflog_keys {
 	NFLOG_KEY_RAW_MAC = 0,
@@ -108,6 +116,7 @@ enum nflog_keys {
 	NFLOG_KEY_OOB_PROTOCOL,
 	NFLOG_KEY_OOB_UID,
 	NFLOG_KEY_OOB_GID,
+	NFLOG_KEY_RAW_LABEL,
 };
 
 static struct ulogd_key output_keys[] = {
@@ -252,6 +261,12 @@ static struct ulogd_key output_keys[] = {
 		.flags = ULOGD_RETF_NONE,
 		.name = "oob.gid",
 	},
+	{
+		.type = ULOGD_RET_UINT8,
+		.flags = ULOGD_RETF_NONE,
+		.name = "raw.label",
+	},
+
 };
 
 static inline int 
@@ -275,6 +290,9 @@ interp_packet(struct ulogd_pluginstance *upi, struct nflog_data *ldata)
 	ret[NFLOG_KEY_OOB_FAMILY].u.value.ui8 = af_ce(upi->config_kset).u.value;
 	ret[NFLOG_KEY_OOB_FAMILY].flags |= ULOGD_RETF_VALID;
 
+	ret[NFLOG_KEY_RAW_LABEL].u.value.ui8 = label_ce(upi->config_kset).u.value;
+	ret[NFLOG_KEY_RAW_LABEL].flags |= ULOGD_RETF_VALID;
+
 	if (ph) {
 		/* FIXME */
 		ret[NFLOG_KEY_OOB_HOOK].u.value.ui8 = ph->hook;
-- 
1.5.2.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [ULOGD PATCH 5/5] Update default configuration to fit last changes
  2008-04-21 20:43 [ULOGD PATCH 0/5] Resent work related to 'label' and misc fixes Eric Leblond
                   ` (3 preceding siblings ...)
  2008-04-21 20:43 ` [ULOGD PATCH 4/5] Add label option to NFLOG input plugin Eric Leblond
@ 2008-04-21 20:43 ` Eric Leblond
  4 siblings, 0 replies; 8+ messages in thread
From: Eric Leblond @ 2008-04-21 20:43 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Eric Leblond

Default stacks needed to be modified to be in sync MAC2STR plugin which
is used by database output modules. The new label configuration variable
has been added to some ULOG and NFLOG instances to show that it exists.

Signed-off-by: Eric Leblond <eric@inl.fr>
---
 ulogd.conf.in |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/ulogd.conf.in b/ulogd.conf.in
index 3def8d1..08dc229 100644
--- a/ulogd.conf.in
+++ b/ulogd.conf.in
@@ -97,6 +97,7 @@ group=0
 [log2]
 group=1 # Group has to be different from the one use in log1
 addressfamily=10 # 10 is value of AF_INET6
+label=1 # label can be used to define the decision applied to packet
 
 # ebtables logging through NFLOG
 [log3]
@@ -106,6 +107,7 @@ addressfamily=7 # 7 is value of AF_BRIDGE
 [ulog1]
 # netlink multicast group (the same as the iptables --ulog-nlgroup param)
 nlgroup=1
+#label=0 # optionnal argument
 
 [emu1]
 file="/var/log/ulogd_syslogemu.log"
-- 
1.5.2.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [ULOGD PATCH 3/5] Fix a bug in definition of seq_global_ce macro.
  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
  0 siblings, 0 replies; 8+ messages in thread
From: Pablo Neira Ayuso @ 2008-04-27  7:30 UTC (permalink / raw)
  To: Eric Leblond; +Cc: netfilter-devel

Eric Leblond wrote:
> Signed-off-by: Eric Leblond <eric@inl.fr>

This one applied. Thanks Eric.

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ULOGD PATCH 2/5] Add hook output to ULOG input module.
  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
  0 siblings, 0 replies; 8+ messages in thread
From: Pablo Neira Ayuso @ 2008-04-27  7:51 UTC (permalink / raw)
  To: Eric Leblond; +Cc: netfilter-devel

Eric Leblond wrote:
> This patch adds oob.hook to the list of output key sof ULOG input plugin.

Applied. Thanks.

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-04-27  7:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-21 20:43 [ULOGD PATCH 0/5] Resent work related to 'label' and misc fixes Eric Leblond
2008-04-21 20:43 ` [ULOGD PATCH 1/5] Add label option to ULOG input plugin Eric Leblond
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

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.