All of lore.kernel.org
 help / color / mirror / Atom feed
* [iptables PATCH 2/2] Add iptables support for the socket match
@ 2008-10-15  8:10 KOVACS Krisztian
  2008-10-15  9:51 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: KOVACS Krisztian @ 2008-10-15  8:10 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: netfilter-devel

Add user-space code for the socket match.

Signed-off-by: KOVACS Krisztian <hidden@sch.bme.hu>
---

 extensions/libxt_socket.c   |   39 +++++++++++++++++++++++++++++++++++++++
 extensions/libxt_socket.man |    2 ++
 2 files changed, 41 insertions(+), 0 deletions(-)
 create mode 100644 extensions/libxt_socket.c
 create mode 100644 extensions/libxt_socket.man


diff --git a/extensions/libxt_socket.c b/extensions/libxt_socket.c
new file mode 100644
index 0000000..26ac9e3
--- /dev/null
+++ b/extensions/libxt_socket.c
@@ -0,0 +1,39 @@
+/*
+ * Shared library add-on to iptables to add early socket matching support.
+ *
+ * Copyright (C) 2007 BalaBit IT Ltd.
+ */
+#include <stdio.h>
+#include <getopt.h>
+#include <xtables.h>
+
+static void socket_mt_help(void)
+{
+	printf("socket v%s has no options\n\n", XTABLES_VERSION);
+}
+
+static int socket_mt_parse(int c, char **argv, int invert, unsigned int *flags,
+			const void *entry, struct xt_entry_match **match)
+{
+	return 0;
+}
+
+static void socket_mt_check(unsigned int flags)
+{
+}
+
+static struct xtables_match socket_mt_reg = {
+	.name	       = "socket",
+	.version       = XTABLES_VERSION,
+	.family	       = AF_INET,
+	.size	       = XT_ALIGN(0),
+	.userspacesize = XT_ALIGN(0),
+	.parse	       = socket_mt_parse,
+	.final_check   = socket_mt_check,
+	.help	       = socket_mt_help,
+};
+
+void _init(void)
+{
+	xtables_register_match(&socket_mt_reg);
+}
diff --git a/extensions/libxt_socket.man b/extensions/libxt_socket.man
new file mode 100644
index 0000000..50c8854
--- /dev/null
+++ b/extensions/libxt_socket.man
@@ -0,0 +1,2 @@
+This matches if an open socket can be found by doing a socket lookup on the
+packet.

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

* Re: [iptables PATCH 2/2] Add iptables support for the socket match
  2008-10-15  8:10 [iptables PATCH 2/2] Add iptables support for the socket match KOVACS Krisztian
@ 2008-10-15  9:51 ` Patrick McHardy
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2008-10-15  9:51 UTC (permalink / raw)
  To: KOVACS Krisztian; +Cc: netfilter-devel

KOVACS Krisztian wrote:
> Add user-space code for the socket match.

Also applied, thanks.

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

end of thread, other threads:[~2008-10-15  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-15  8:10 [iptables PATCH 2/2] Add iptables support for the socket match KOVACS Krisztian
2008-10-15  9:51 ` Patrick McHardy

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.