netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Corubba Smith <corubba@gmx.de>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH ulogd2,v2 6/6] all: remove trivial configure hooks
Date: Wed, 12 Mar 2025 15:56:48 +0100	[thread overview]
Message-ID: <dd2a515b-54e8-42bb-a032-68c70a0f9672@gmx.de> (raw)
In-Reply-To: <1a5fff4d-4cef-48e3-a77c-bb4f7098f35b@gmx.de>

These are now covered by the default implementation.

Signed-off-by: Corubba Smith <corubba@gmx.de>
---
Changes in v2:
  - None

 filter/ulogd_filter_MARK.c           | 10 ----------
 input/flow/ulogd_inpflow_NFCT.c      | 13 -------------
 input/packet/ulogd_inppkt_NFLOG.c    | 10 ----------
 input/packet/ulogd_inppkt_ULOG.c     |  6 ------
 input/packet/ulogd_inppkt_UNIXSOCK.c | 10 ----------
 output/pcap/ulogd_output_PCAP.c      |  7 -------
 output/ulogd_output_GRAPHITE.c       |  8 --------
 output/ulogd_output_LOGEMU.c         |  8 --------
 output/ulogd_output_NACCT.c          | 13 -------------
 output/ulogd_output_XML.c            | 13 -------------
 10 files changed, 98 deletions(-)

diff --git a/filter/ulogd_filter_MARK.c b/filter/ulogd_filter_MARK.c
index d5a8181..b977780 100644
--- a/filter/ulogd_filter_MARK.c
+++ b/filter/ulogd_filter_MARK.c
@@ -88,15 +88,6 @@ static int interp_mark(struct ulogd_pluginstance *pi)
 	return ULOGD_IRET_OK;
 }

-static int configure(struct ulogd_pluginstance *upi,
-		     struct ulogd_pluginstance_stack *stack)
-{
-	ulogd_log(ULOGD_DEBUG, "parsing config file section `%s', "
-		  "plugin `%s'\n", upi->id, upi->plugin->name);
-
-	return ulogd_parse_configfile(upi->id, upi->config_kset);
-}
-
 static struct ulogd_plugin mark_pluging = {
 	.name = "MARK",
 	.input = {
@@ -109,7 +100,6 @@ static struct ulogd_plugin mark_pluging = {
 		},
 	.interp = &interp_mark,
 	.config_kset = &libulog_kset,
-	.configure = &configure,
 	.version = VERSION,
 };

diff --git a/input/flow/ulogd_inpflow_NFCT.c b/input/flow/ulogd_inpflow_NFCT.c
index 5213cc3..93edb76 100644
--- a/input/flow/ulogd_inpflow_NFCT.c
+++ b/input/flow/ulogd_inpflow_NFCT.c
@@ -1049,18 +1049,6 @@ static void polling_timer_cb(struct ulogd_timer *t, void *data)
 	ulogd_add_timer(&cpi->timer, pollint_ce(upi->config_kset).u.value);
 }

-static int configure_nfct(struct ulogd_pluginstance *upi,
-			  struct ulogd_pluginstance_stack *stack)
-{
-	int ret;
-
-	ret = ulogd_parse_configfile(upi->id, upi->config_kset);
-	if (ret < 0)
-		return ret;
-
-	return 0;
-}
-
 static void overrun_timeout(struct ulogd_timer *a, void *data)
 {
 	int family = AF_UNSPEC;
@@ -1577,7 +1565,6 @@ static struct ulogd_plugin nfct_plugin = {
 	},
 	.config_kset 	= &nfct_kset,
 	.interp 	= NULL,
-	.configure	= &configure_nfct,
 	.start		= &constructor_nfct,
 	.stop		= &destructor_nfct,
 	.signal		= &signal_nfct,
diff --git a/input/packet/ulogd_inppkt_NFLOG.c b/input/packet/ulogd_inppkt_NFLOG.c
index f716136..62b3963 100644
--- a/input/packet/ulogd_inppkt_NFLOG.c
+++ b/input/packet/ulogd_inppkt_NFLOG.c
@@ -551,15 +551,6 @@ release_ct:
 	return ret;
 }

-static int configure(struct ulogd_pluginstance *upi,
-		     struct ulogd_pluginstance_stack *stack)
-{
-	ulogd_log(ULOGD_DEBUG, "parsing config file section `%s', "
-		  "plugin `%s'\n", upi->id, upi->plugin->name);
-
-	return ulogd_parse_configfile(upi->id, upi->config_kset);
-}
-
 static int become_system_logging(struct ulogd_pluginstance *upi, uint8_t pf)
 {
 	struct nflog_input *ui = (struct nflog_input *) upi->private;
@@ -723,7 +714,6 @@ struct ulogd_plugin libulog_plugin = {
 		.num_keys = ARRAY_SIZE(output_keys),
 	},
 	.priv_size 	= sizeof(struct nflog_input),
-	.configure 	= &configure,
 	.start 		= &start,
 	.stop 		= &stop,
 	.config_kset 	= &libulog_kset,
diff --git a/input/packet/ulogd_inppkt_ULOG.c b/input/packet/ulogd_inppkt_ULOG.c
index 44bc71d..2eb994c 100644
--- a/input/packet/ulogd_inppkt_ULOG.c
+++ b/input/packet/ulogd_inppkt_ULOG.c
@@ -266,11 +266,6 @@ static int ulog_read_cb(int fd, unsigned int what, void *param)
 	return 0;
 }

-static int configure(struct ulogd_pluginstance *upi,
-		     struct ulogd_pluginstance_stack *stack)
-{
-	return ulogd_parse_configfile(upi->id, upi->config_kset);
-}
 static int init(struct ulogd_pluginstance *upi)
 {
 	struct ulog_input *ui = (struct ulog_input *) &upi->private;
@@ -325,7 +320,6 @@ struct ulogd_plugin libulog_plugin = {
 		.keys = output_keys,
 		.num_keys = ARRAY_SIZE(output_keys),
 	},
-	.configure = &configure,
 	.start = &init,
 	.stop = &fini,
 	.config_kset = &libulog_kset,
diff --git a/input/packet/ulogd_inppkt_UNIXSOCK.c b/input/packet/ulogd_inppkt_UNIXSOCK.c
index b328500..0d9ba60 100644
--- a/input/packet/ulogd_inppkt_UNIXSOCK.c
+++ b/input/packet/ulogd_inppkt_UNIXSOCK.c
@@ -713,15 +713,6 @@ static int unixsock_server_read_cb(int fd, unsigned int what, void *param)
 	return 0;
 }

-static int configure(struct ulogd_pluginstance *upi,
-		     struct ulogd_pluginstance_stack *stack)
-{
-	ulogd_log(ULOGD_DEBUG, "parsing config file section `%s', "
-		  "plugin `%s'\n", upi->id, upi->plugin->name);
-
-	return ulogd_parse_configfile(upi->id, upi->config_kset);
-}
-
 static int start(struct ulogd_pluginstance *upi)
 {
 	struct unixsock_input *ui = (struct unixsock_input *) upi->private;
@@ -809,7 +800,6 @@ struct ulogd_plugin libunixsock_plugin = {
 		.num_keys = ARRAY_SIZE(output_keys),
 	},
 	.priv_size 	= sizeof(struct unixsock_input),
-	.configure 	= &configure,
 	.start 		= &start,
 	.stop 		= &stop,
 	.config_kset 	= &libunixsock_kset,
diff --git a/output/pcap/ulogd_output_PCAP.c b/output/pcap/ulogd_output_PCAP.c
index 474992e..ec29a9e 100644
--- a/output/pcap/ulogd_output_PCAP.c
+++ b/output/pcap/ulogd_output_PCAP.c
@@ -257,12 +257,6 @@ static void signal_pcap(struct ulogd_pluginstance *upi, int signal)
 	}
 }

-static int configure_pcap(struct ulogd_pluginstance *upi,
-			  struct ulogd_pluginstance_stack *stack)
-{
-	return ulogd_parse_configfile(upi->id, upi->config_kset);
-}
-
 static int start_pcap(struct ulogd_pluginstance *upi)
 {
 	return append_create_outfile(upi);
@@ -291,7 +285,6 @@ static struct ulogd_plugin pcap_plugin = {
 	.config_kset	= &pcap_kset,
 	.priv_size	= sizeof(struct pcap_instance),

-	.configure	= &configure_pcap,
 	.start		= &start_pcap,
 	.stop		= &stop_pcap,
 	.signal		= &signal_pcap,
diff --git a/output/ulogd_output_GRAPHITE.c b/output/ulogd_output_GRAPHITE.c
index e54b24d..6942123 100644
--- a/output/ulogd_output_GRAPHITE.c
+++ b/output/ulogd_output_GRAPHITE.c
@@ -210,13 +210,6 @@ static int fini_graphite(struct ulogd_pluginstance *pi) {
 	return 0;
 }

-static int configure_graphite(struct ulogd_pluginstance *pi,
-			    struct ulogd_pluginstance_stack *stack)
-{
-	ulogd_log(ULOGD_DEBUG, "parsing config file section %s\n", pi->id);
-	return ulogd_parse_configfile(pi->id, pi->config_kset);
-}
-
 static struct ulogd_plugin graphite_plugin = {
 	.name = "GRAPHITE",
 	.input = {
@@ -230,7 +223,6 @@ static struct ulogd_plugin graphite_plugin = {
 	.config_kset 	= &graphite_kset,
 	.priv_size 	= sizeof(struct graphite_instance),

-	.configure	= &configure_graphite,
 	.start	 	= &start_graphite,
 	.stop	 	= &fini_graphite,

diff --git a/output/ulogd_output_LOGEMU.c b/output/ulogd_output_LOGEMU.c
index f5d1def..372cac3 100644
--- a/output/ulogd_output_LOGEMU.c
+++ b/output/ulogd_output_LOGEMU.c
@@ -174,13 +174,6 @@ static int fini_logemu(struct ulogd_pluginstance *pi) {
 	return 0;
 }

-static int configure_logemu(struct ulogd_pluginstance *pi,
-			    struct ulogd_pluginstance_stack *stack)
-{
-	ulogd_log(ULOGD_DEBUG, "parsing config file section %s\n", pi->id);
-	return ulogd_parse_configfile(pi->id, pi->config_kset);
-}
-
 static struct ulogd_plugin logemu_plugin = {
 	.name = "LOGEMU",
 	.input = {
@@ -194,7 +187,6 @@ static struct ulogd_plugin logemu_plugin = {
 	.config_kset 	= &logemu_kset,
 	.priv_size 	= sizeof(struct logemu_instance),

-	.configure	= &configure_logemu,
 	.start	 	= &start_logemu,
 	.stop	 	= &fini_logemu,

diff --git a/output/ulogd_output_NACCT.c b/output/ulogd_output_NACCT.c
index 080a576..fa7c501 100644
--- a/output/ulogd_output_NACCT.c
+++ b/output/ulogd_output_NACCT.c
@@ -197,18 +197,6 @@ sighup_handler_print(struct ulogd_pluginstance *pi, int signal)
 	}
 }

-static int
-nacct_conf(struct ulogd_pluginstance *pi,
-		   struct ulogd_pluginstance_stack *stack)
-{
-	int ret;
-
-	if ((ret = ulogd_parse_configfile(pi->id, pi->config_kset)) < 0)
-		return ret;
-
-	return 0;
-}
-
 static int
 nacct_init(struct ulogd_pluginstance *pi)
 {
@@ -243,7 +231,6 @@ static struct ulogd_plugin nacct_plugin = {
 	.output = {
 		.type = ULOGD_DTYPE_SINK,
 	},
-	.configure = &nacct_conf,
 	.interp	= &nacct_interp,
 	.start 	= &nacct_init,
 	.stop	= &nacct_fini,
diff --git a/output/ulogd_output_XML.c b/output/ulogd_output_XML.c
index 55c7a7c..b657436 100644
--- a/output/ulogd_output_XML.c
+++ b/output/ulogd_output_XML.c
@@ -185,18 +185,6 @@ static int xml_output(struct ulogd_pluginstance *upi)
 	return ULOGD_IRET_OK;
 }

-static int xml_configure(struct ulogd_pluginstance *upi,
-			 struct ulogd_pluginstance_stack *stack)
-{
-	int ret;
-
-	ret = ulogd_parse_configfile(upi->id, upi->config_kset);
-	if (ret < 0)
-		return ret;
-
-	return 0;
-}
-
 static int xml_fini(struct ulogd_pluginstance *pi)
 {
 	struct xml_priv *op = (struct xml_priv *) &pi->private;
@@ -333,7 +321,6 @@ static struct ulogd_plugin xml_plugin = {
 	.config_kset	= &xml_kset,
 	.priv_size	= sizeof(struct xml_priv),

-	.configure	= &xml_configure,
 	.start		= &xml_start,
 	.stop		= &xml_fini,
 	.interp		= &xml_output,
--
2.48.1

      parent reply	other threads:[~2025-03-12 14:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 14:52 [PATCH ulogd2,v2 1/6] ulogd: add ulogd_parse_configfile public function Corubba Smith
2025-03-12 14:53 ` [PATCH ulogd2,v2 2/6] all: use config_parse_file function in all plugins Corubba Smith
2025-03-12 14:54 ` [PATCH ulogd2,v2 3/6] ulogd: raise error on unknown config key Corubba Smith
2025-03-12 15:21   ` Florian Westphal
2025-03-12 18:48     ` Corubba Smith
2025-03-12 18:55       ` Florian Westphal
2025-03-12 14:55 ` [PATCH ulogd2,v2 4/6] ulogd: improve integer option parsing Corubba Smith
2025-03-12 14:55 ` [PATCH ulogd2,v2 5/6] ulogd: provide default configure implementation Corubba Smith
2025-03-12 14:56 ` Corubba Smith [this message]

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=dd2a515b-54e8-42bb-a032-68c70a0f9672@gmx.de \
    --to=corubba@gmx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).