All of lore.kernel.org
 help / color / mirror / Atom feed
From: KOVACS Krisztian <hidden@sch.bme.hu>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org
Subject: [iptables PATCH 2/2] [TPROXY] Add userspace component of the	socket match
Date: Wed, 08 Oct 2008 09:15:41 +0200	[thread overview]
Message-ID: <20081008071541.9224.68351.stgit@nessa.odu> (raw)
In-Reply-To: <20081008071541.9224.66180.stgit@nessa.odu>

From: Balazs Scheidler <bazsi@balabit.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..213bb9c
--- /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 <iptables.h>
+
+static void socket_help(void)
+{
+	printf("socket v%s has no options\n\n", XTABLES_VERSION);
+}
+
+static int socket_parse(int c, char **argv, int invert, unsigned int *flags,
+			const void *entry, struct xt_entry_match **match)
+{
+	return 0;
+}
+
+static void socket_check(unsigned int flags)
+{
+}
+
+static struct xtables_match socket_reg = {
+	.name	       = "socket",
+	.version       = XTABLES_VERSION,
+	.family	       = AF_INET,
+	.size	       = XT_ALIGN(0),
+	.userspacesize = XT_ALIGN(0),
+	.parse	       = socket_parse,
+	.final_check   = socket_check,
+	.help	       = socket_help,
+};
+
+void _init(void)
+{
+	xtables_register_match(&socket_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.



  reply	other threads:[~2008-10-08  7:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-08  7:15 [iptables PATCH 1/2] [TPROXY] Add userspace component of the TPROXY target KOVACS Krisztian
2008-10-08  7:15 ` KOVACS Krisztian [this message]
2008-10-08 12:12   ` [iptables PATCH 2/2] [TPROXY] Add userspace component of the socket match Jan Engelhardt
2008-10-08 12:33     ` Patrick McHardy
2008-10-08 12:03 ` [iptables PATCH 1/2] [TPROXY] Add userspace component of the TPROXY target Jan Engelhardt
2008-10-13 13:13 ` Patrick McHardy
2008-10-15  8:01   ` KOVACS Krisztian

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=20081008071541.9224.68351.stgit@nessa.odu \
    --to=hidden@sch.bme.hu \
    --cc=kaber@trash.net \
    --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.