From: Jean-Philippe Rey <jprey@ecp.fr>
To: netfilter-devel@lists.netfilter.org
Subject: ip_conntrack_amanda, passing amanda udp port as parameter
Date: Tue, 21 Sep 2004 08:34:56 +0200 [thread overview]
Message-ID: <414FCB90.80807@ecp.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 525 bytes --]
Hello Folks,
We are using netfilter and ip_conntrack_amanda. However for historical
reasons, amanda is using a different port than 10080. As the port is hard
coded in ip_conntrack_amanda, I wrote a patch in order to be able to select
the port through a parameter.
As I think this may be helpfull to others I send you this patch here. Feel
free to do wathever you like with it.
--
Jean-Philippe Rey Professeur informatique - École Centrale Paris
jprey@ecp.fr 92295 Châtenay-Malabry Cedex - France
[-- Attachment #2: amanda_port.patch --]
[-- Type: text/plain, Size: 3646 bytes --]
diff -ur kernel-source-2.4.27/net/ipv4/netfilter/ip_conntrack_amanda.c kernel-source-2.4.27-1/net/ipv4/netfilter/ip_conntrack_amanda.c
--- kernel-source-2.4.27/net/ipv4/netfilter/ip_conntrack_amanda.c 2004-02-18 14:36:32.000000000 +0100
+++ kernel-source-2.4.27-1/net/ipv4/netfilter/ip_conntrack_amanda.c 2004-09-06 23:50:49.000000000 +0200
@@ -8,11 +8,11 @@
* 2 of the License, or (at your option) any later version.
*
* Module load syntax:
- * insmod ip_conntrack_amanda.o [master_timeout=n]
+ * insmod ip_conntrack_amanda.o [master_timeout=n][master_port=m]
*
* Where master_timeout is the timeout (in seconds) of the master
- * connection (port 10080). This defaults to 5 minutes but if
- * your clients take longer than 5 minutes to do their work
+ * connection (port m, default to 10080). This defaults to 5 minutes
+ * but if your clients take longer than 5 minutes to do their work
* before getting back to the Amanda server, you can increase
* this value.
*
@@ -29,12 +29,15 @@
#include <linux/netfilter_ipv4/ip_conntrack_amanda.h>
static unsigned int master_timeout = 300;
+static unsigned int master_port = 10080;
MODULE_AUTHOR("Brian J. Murrell <netfilter@interlinx.bc.ca>");
MODULE_DESCRIPTION("Amanda connection tracking module");
MODULE_LICENSE("GPL");
MODULE_PARM(master_timeout, "i");
+MODULE_PARM(master_port, "i");
MODULE_PARM_DESC(master_timeout, "timeout for the master connection");
+MODULE_PARM_DESC(master_port, "udp port for the master connection");
static struct { char *match; int len; } conns[] = {
{ "DATA ", 5},
@@ -126,7 +129,7 @@
static int __init init(void)
{
- amanda_helper.tuple.src.u.udp.port = htons(10080);
+ amanda_helper.tuple.src.u.udp.port = htons(master_port);
amanda_helper.tuple.dst.protonum = IPPROTO_UDP;
amanda_helper.mask.src.u.udp.port = 0xFFFF;
amanda_helper.mask.dst.protonum = 0xFFFF;
@@ -137,6 +140,9 @@
amanda_helper.help = help;
amanda_helper.name = "amanda";
+ printk(KERN_INFO "ip_conntrack_amanda: port=%d, timeout=%ds\n",
+ master_port, master_timeout);
+
return ip_conntrack_helper_register(&amanda_helper);
}
diff -ur kernel-source-2.4.27/net/ipv4/netfilter/ip_nat_amanda.c kernel-source-2.4.27-1/net/ipv4/netfilter/ip_nat_amanda.c
--- kernel-source-2.4.27/net/ipv4/netfilter/ip_nat_amanda.c 2004-02-18 14:36:32.000000000 +0100
+++ kernel-source-2.4.27-1/net/ipv4/netfilter/ip_nat_amanda.c 2004-09-06 23:50:57.000000000 +0200
@@ -8,7 +8,7 @@
* 2 of the License, or (at your option) any later version.
*
* Module load syntax:
- * insmod ip_nat_amanda.o
+ * insmod ip_nat_amanda.o [master_port=m]
*/
#include <linux/kernel.h>
@@ -26,10 +26,13 @@
#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
#include <linux/netfilter_ipv4/ip_conntrack_amanda.h>
+static unsigned int master_port = 10080;
MODULE_AUTHOR("Brian J. Murrell <netfilter@interlinx.bc.ca>");
MODULE_DESCRIPTION("Amanda NAT helper");
MODULE_LICENSE("GPL");
+MODULE_PARM(master_port, "i");
+MODULE_PARM_DESC(master_port, "udp port for the master connection");
static unsigned int
amanda_nat_expected(struct sk_buff **pskb,
@@ -132,7 +135,7 @@
struct ip_nat_helper *hlpr = &ip_nat_amanda_helper;
hlpr->tuple.dst.protonum = IPPROTO_UDP;
- hlpr->tuple.src.u.udp.port = htons(10080);
+ hlpr->tuple.src.u.udp.port = htons(master_port);
hlpr->mask.src.u.udp.port = 0xFFFF;
hlpr->mask.dst.protonum = 0xFFFF;
hlpr->help = help;
@@ -141,6 +144,8 @@
hlpr->expect = amanda_nat_expected;
hlpr->name = "amanda";
+ printk(KERN_INFO, "ip_nat_amanda: port=%d\n", master_port);
+
return ip_nat_helper_register(hlpr);
}
reply other threads:[~2004-09-21 6:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=414FCB90.80807@ecp.fr \
--to=jprey@ecp.fr \
--cc=netfilter-devel@lists.netfilter.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.