* [LARTC] How to mark a device not to be used with IMQ?
@ 2002-03-22 12:31 Nils Lichtenfeld
2002-03-22 14:02 ` Martin Devera
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: Nils Lichtenfeld @ 2002-03-22 12:31 UTC (permalink / raw)
To: lartc
Hello ML!
How to mark a device not to be used with IMQ?
And how can I get a list of devices (not) used with IMQ?
Is by default every device unmarked for non IMQ use, even the dial up ones
(pppo/ippp0) ?
Thank you!
Greetings Nils
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] How to mark a device not to be used with IMQ?
2002-03-22 12:31 [LARTC] How to mark a device not to be used with IMQ? Nils Lichtenfeld
@ 2002-03-22 14:02 ` Martin Devera
2002-03-22 14:18 ` Nils Lichtenfeld
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Martin Devera @ 2002-03-22 14:02 UTC (permalink / raw)
To: lartc
all are used everytime.
you have to use filters to direct unneeded packets
into fake queue (X:0 in case on HTB, some hiprio
band in case of prio ...).
devik
On Fri, 22 Mar 2002, Nils Lichtenfeld wrote:
> Hello ML!
>
> How to mark a device not to be used with IMQ?
>
> And how can I get a list of devices (not) used with IMQ?
>
> Is by default every device unmarked for non IMQ use, even the dial up ones
> (pppo/ippp0) ?
>
> Thank you!
> Greetings Nils
>
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] How to mark a device not to be used with IMQ?
2002-03-22 12:31 [LARTC] How to mark a device not to be used with IMQ? Nils Lichtenfeld
2002-03-22 14:02 ` Martin Devera
@ 2002-03-22 14:18 ` Nils Lichtenfeld
2002-03-22 23:50 ` Martin Devera
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Nils Lichtenfeld @ 2002-03-22 14:18 UTC (permalink / raw)
To: lartc
Hello Martin!
> all are used everytime.
> you have to use filters to direct unneeded packets
> into fake queue (X:0 in case on HTB, some hiprio
> band in case of prio ...).
I understand what you mean... but i thought there has to be a way from what I
read on the IMQ-site (http://luxik.cdi.cz/~devik/qos/imq.htm):
--- snipp ---
Each non-marked skb is intercepted in dev_queue_xmit and queued to IMQ if it is
up. Immediately it tries to dequeue it (software pump).
--- snapp ---
"Each non-marked skb" <-- Thats what made me think that there is a way to "mark"
a device...
Thanks!
Greetings Nils
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] How to mark a device not to be used with IMQ?
2002-03-22 12:31 [LARTC] How to mark a device not to be used with IMQ? Nils Lichtenfeld
2002-03-22 14:02 ` Martin Devera
2002-03-22 14:18 ` Nils Lichtenfeld
@ 2002-03-22 23:50 ` Martin Devera
2002-03-23 1:42 ` Patrick McHardy
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Martin Devera @ 2002-03-22 23:50 UTC (permalink / raw)
To: lartc
> I understand what you mean... but i thought there has to be a way from what I
> read on the IMQ-site (http://luxik.cdi.cz/~devik/qos/imq.htm):
>
> --- snipp ---
>
> Each non-marked skb is intercepted in dev_queue_xmit and queued to IMQ if it is
> up. Immediately it tries to dequeue it (software pump).
>
> --- snapp ---
>
> "Each non-marked skb" <-- Thats what made me think that there is a way to "mark"
> a device...
this is only internal mark to know whether the skb was
already in IMQ. You could use it but you would have to
add new user parameter to the interface structure.
I didn't want to do it as I want the pach to be as simple
as possible.
devik
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] How to mark a device not to be used with IMQ?
2002-03-22 12:31 [LARTC] How to mark a device not to be used with IMQ? Nils Lichtenfeld
` (2 preceding siblings ...)
2002-03-22 23:50 ` Martin Devera
@ 2002-03-23 1:42 ` Patrick McHardy
2002-03-23 1:49 ` Patrick McHardy
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Patrick McHardy @ 2002-03-23 1:42 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]
Martin Devera schrieb:
>
> > I understand what you mean... but i thought there has to be a way from what I
> > read on the IMQ-site (http://luxik.cdi.cz/~devik/qos/imq.htm):
> >
> > --- snipp ---
> >
> > Each non-marked skb is intercepted in dev_queue_xmit and queued to IMQ if it is
> > up. Immediately it tries to dequeue it (software pump).
> >
> > --- snapp ---
> >
> > "Each non-marked skb" <-- Thats what made me think that there is a way to "mark"
> > a device...
>
> this is only internal mark to know whether the skb was
> already in IMQ. You could use it but you would have to
> add new user parameter to the interface structure.
> I didn't want to do it as I want the pach to be as simple
> as possible.
> devik
Hi.
The same problem was bugging me a couple of days ago so i wrote an
iptables target which
allows you to exclude packets from beeing enqueued to the imq device.
The patch is tested with iptables-1.2.6a but should work with almost any
recent version.
After applying it you have to execute a "chmod +x
extensions/.IMQX-test", then
make patch-o-matic as usual.
Martin, maybe you want to put it on your imq page ?
Bye,
Patrick
[-- Attachment #2: IMQX_iptables-1.2.6a.patch --]
[-- Type: text/plain, Size: 6149 bytes --]
diff -urN iptables-1.2.6a-clean/extensions/.IMQX-test iptables-1.2.6a/extensions/.IMQX-test
--- iptables-1.2.6a-clean/extensions/.IMQX-test Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/extensions/.IMQX-test Sat Mar 23 02:37:20 2002
@@ -0,0 +1,3 @@
+#!/bin/sh
+# True if IMQX target patch is applied.
+[ -f $KERNEL_DIR/net/ipv4/netfilter/ipt_IMQX.c ] && echo IMQX
diff -urN iptables-1.2.6a-clean/extensions/libipt_IMQX.c iptables-1.2.6a/extensions/libipt_IMQX.c
--- iptables-1.2.6a-clean/extensions/libipt_IMQX.c Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/extensions/libipt_IMQX.c Sat Mar 23 02:37:49 2002
@@ -0,0 +1,81 @@
+/* Shared library add-on to iptables to add IMQX target support. */
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <getopt.h>
+
+#include <iptables.h>
+#include <linux/netfilter_ipv4/ip_tables.h>
+
+/* Function which prints out usage message. */
+static void
+help(void)
+{
+ printf(
+"IMQX target v%s has no options\n",
+NETFILTER_VERSION);
+}
+
+static struct option opts[] = {
+ { 0 }
+};
+
+/* Initialize the target. */
+static void
+init(struct ipt_entry_target *t, unsigned int *nfcache)
+{
+}
+
+/* Function which parses command options; returns true if it
+ ate an option */
+static int
+parse(int c, char **argv, int invert, unsigned int *flags,
+ const struct ipt_entry *entry,
+ struct ipt_entry_target **target)
+{
+ if (c)
+ return 0;
+
+ return 1;
+}
+
+static void
+final_check(unsigned int flags)
+{
+}
+
+/* Prints out the targinfo. */
+static void
+print(const struct ipt_ip *ip,
+ const struct ipt_entry_target *target,
+ int numeric)
+{
+ printf("IMQX");
+}
+
+/* Saves the union ipt_targinfo in parsable form to stdout. */
+static void
+save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
+{
+}
+
+static
+struct iptables_target mark
+= { NULL,
+ "IMQX",
+ NETFILTER_VERSION,
+ 0,
+ 0,
+ &help,
+ &init,
+ &parse,
+ &final_check,
+ &print,
+ &save,
+ opts
+};
+
+void _init(void)
+{
+ register_target(&mark);
+}
diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch iptables-1.2.6a/patch-o-matic/extra/IMQX.patch
--- iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/patch-o-matic/extra/IMQX.patch Sat Mar 23 02:37:20 2002
@@ -0,0 +1,60 @@
+diff -urN linux-2.4.18-clean/net/ipv4/netfilter/ipt_IMQX.c linux-2.4.18/net/ipv4/netfilter/ipt_IMQX.c
+--- linux-2.4.18-clean/net/ipv4/netfilter/ipt_IMQX.c Thu Jan 1 01:00:00 1970
++++ linux-2.4.18/net/ipv4/netfilter/ipt_IMQX.c Sat Mar 23 01:48:23 2002
+@@ -0,0 +1,56 @@
++/* This is a module which is used for setting the from_imq field of an skb. */
++#include <linux/module.h>
++#include <linux/skbuff.h>
++#include <linux/ip.h>
++#include <net/checksum.h>
++
++#include <linux/netfilter_ipv4/ip_tables.h>
++
++static unsigned int
++target(struct sk_buff **pskb,
++ unsigned int hooknum,
++ const struct net_device *in,
++ const struct net_device *out,
++ const void *targinfo,
++ void *userinfo)
++{
++ (*pskb)->from_imq = 1;
++ (*pskb)->nfcache |= NFC_ALTERED;
++
++ return IPT_CONTINUE;
++}
++
++static int
++checkentry(const char *tablename,
++ const struct ipt_entry *e,
++ void *targinfo,
++ unsigned int targinfosize,
++ unsigned int hook_mask)
++{
++ if (strcmp(tablename, "mangle") != 0) {
++ printk(KERN_WARNING "IMQX: can only be called from \"mangle\" table, not \"%s\"\n", tablename);
++ return 0;
++ }
++
++ return 1;
++}
++
++static struct ipt_target ipt_imqx_reg
++= { { NULL, NULL }, "IMQX", target, checkentry, NULL, THIS_MODULE };
++
++static int __init init(void)
++{
++ if (ipt_register_target(&ipt_imqx_reg))
++ return -EINVAL;
++
++ return 0;
++}
++
++static void __exit fini(void)
++{
++ ipt_unregister_target(&ipt_imqx_reg);
++}
++
++module_init(init);
++module_exit(fini);
++MODULE_LICENSE("GPL");
diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.config.in iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.config.in
--- iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.config.in Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.config.in Sat Mar 23 02:37:20 2002
@@ -0,0 +1,4 @@
+ dep_tristate ' MARK target support' CONFIG_IP_NF_TARGET_MARK $CONFIG_IP_NF_MANGLE
+ if [ "$CONFIG_IMQ" == "y" ]; then
+ dep_tristate ' IMQX target support' CONFIG_IP_NF_TARGET_IMQX $CONFIG_IP_NF_MANGLE
+ fi
diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.configure.help iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.configure.help
--- iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.configure.help Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.configure.help Sat Mar 23 02:37:20 2002
@@ -0,0 +1,8 @@
+CONFIG_IP_NF_TARGET_MARK
+IMQX target support
+CONFIG_IP_NF_TARGET_IMQX
+ IMQX allows you to exclude packets from beeing enqueued
+ to the IMQ device
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.help iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.help
--- iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.help Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.help Sat Mar 23 02:37:20 2002
@@ -0,0 +1,14 @@
+Author: Patrick McHardy <kaber@trash.net>
+Status: working
+
+This patch adds IMQX (IMQ eXclude) target for excluding
+traffic from beeing enqueued to the IMQ device.
+
+Usage:
+
+ IMQX
+ This target excludes traffic from beeing enqueued
+ to the IMQ device.
+
+Example:
+ iptables -t mangle -A POSTROUTING -o eth0 -j IMQX
diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.makefile iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.makefile
--- iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.makefile Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.makefile Sat Mar 23 02:37:20 2002
@@ -0,0 +1,2 @@
+obj-$(CONFIG_IP_NF_TARGET_MARK) += ipt_MARK.o
+obj-$(CONFIG_IP_NF_TARGET_IMQX) += ipt_IMQX.o
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] How to mark a device not to be used with IMQ?
2002-03-22 12:31 [LARTC] How to mark a device not to be used with IMQ? Nils Lichtenfeld
` (3 preceding siblings ...)
2002-03-23 1:42 ` Patrick McHardy
@ 2002-03-23 1:49 ` Patrick McHardy
2002-03-23 12:23 ` Nils Lichtenfeld
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Patrick McHardy @ 2002-03-23 1:49 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: TEXT/PLAIN, Size: 79 bytes --]
Ahh stupid netscape fucked up the attachment :)
Hope this works ..
Bye Patrick
[-- Attachment #2: Type: TEXT/PLAIN, Size: 6349 bytes --]
diff -urN iptables-1.2.6a-clean/extensions/.IMQX-test iptables-1.2.6a/extensions/.IMQX-test
--- iptables-1.2.6a-clean/extensions/.IMQX-test Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/extensions/.IMQX-test Sat Mar 23 02:37:20 2002
@@ -0,0 +1,3 @@
+#!/bin/sh
+# True if IMQX target patch is applied.
+[ -f $KERNEL_DIR/net/ipv4/netfilter/ipt_IMQX.c ] && echo IMQX
diff -urN iptables-1.2.6a-clean/extensions/libipt_IMQX.c iptables-1.2.6a/extensions/libipt_IMQX.c
--- iptables-1.2.6a-clean/extensions/libipt_IMQX.c Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/extensions/libipt_IMQX.c Sat Mar 23 02:37:49 2002
@@ -0,0 +1,81 @@
+/* Shared library add-on to iptables to add IMQX target support. */
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <getopt.h>
+
+#include <iptables.h>
+#include <linux/netfilter_ipv4/ip_tables.h>
+
+/* Function which prints out usage message. */
+static void
+help(void)
+{
+ printf(
+"IMQX target v%s has no options\n",
+NETFILTER_VERSION);
+}
+
+static struct option opts[] = {
+ { 0 }
+};
+
+/* Initialize the target. */
+static void
+init(struct ipt_entry_target *t, unsigned int *nfcache)
+{
+}
+
+/* Function which parses command options; returns true if it
+ ate an option */
+static int
+parse(int c, char **argv, int invert, unsigned int *flags,
+ const struct ipt_entry *entry,
+ struct ipt_entry_target **target)
+{
+ if (c)
+ return 0;
+
+ return 1;
+}
+
+static void
+final_check(unsigned int flags)
+{
+}
+
+/* Prints out the targinfo. */
+static void
+print(const struct ipt_ip *ip,
+ const struct ipt_entry_target *target,
+ int numeric)
+{
+ printf("IMQX");
+}
+
+/* Saves the union ipt_targinfo in parsable form to stdout. */
+static void
+save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
+{
+}
+
+static
+struct iptables_target mark
+= { NULL,
+ "IMQX",
+ NETFILTER_VERSION,
+ 0,
+ 0,
+ &help,
+ &init,
+ &parse,
+ &final_check,
+ &print,
+ &save,
+ opts
+};
+
+void _init(void)
+{
+ register_target(&mark);
+}
diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch iptables-1.2.6a/patch-o-matic/extra/IMQX.patch
--- iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/patch-o-matic/extra/IMQX.patch Sat Mar 23 02:37:20 2002
@@ -0,0 +1,60 @@
+diff -urN linux-2.4.18-clean/net/ipv4/netfilter/ipt_IMQX.c linux-2.4.18/net/ipv4/netfilter/ipt_IMQX.c
+--- linux-2.4.18-clean/net/ipv4/netfilter/ipt_IMQX.c Thu Jan 1 01:00:00 1970
++++ linux-2.4.18/net/ipv4/netfilter/ipt_IMQX.c Sat Mar 23 01:48:23 2002
+@@ -0,0 +1,56 @@
++/* This is a module which is used for setting the from_imq field of an skb. */
++#include <linux/module.h>
++#include <linux/skbuff.h>
++#include <linux/ip.h>
++#include <net/checksum.h>
++
++#include <linux/netfilter_ipv4/ip_tables.h>
++
++static unsigned int
++target(struct sk_buff **pskb,
++ unsigned int hooknum,
++ const struct net_device *in,
++ const struct net_device *out,
++ const void *targinfo,
++ void *userinfo)
++{
++ (*pskb)->from_imq = 1;
++ (*pskb)->nfcache |= NFC_ALTERED;
++
++ return IPT_CONTINUE;
++}
++
++static int
++checkentry(const char *tablename,
++ const struct ipt_entry *e,
++ void *targinfo,
++ unsigned int targinfosize,
++ unsigned int hook_mask)
++{
++ if (strcmp(tablename, "mangle") != 0) {
++ printk(KERN_WARNING "IMQX: can only be called from \"mangle\" table, not \"%s\"\n", tablename);
++ return 0;
++ }
++
++ return 1;
++}
++
++static struct ipt_target ipt_imqx_reg
++= { { NULL, NULL }, "IMQX", target, checkentry, NULL, THIS_MODULE };
++
++static int __init init(void)
++{
++ if (ipt_register_target(&ipt_imqx_reg))
++ return -EINVAL;
++
++ return 0;
++}
++
++static void __exit fini(void)
++{
++ ipt_unregister_target(&ipt_imqx_reg);
++}
++
++module_init(init);
++module_exit(fini);
++MODULE_LICENSE("GPL");
diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.config.in iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.config.in
--- iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.config.in Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.config.in Sat Mar 23 02:37:20 2002
@@ -0,0 +1,4 @@
+ dep_tristate ' MARK target support' CONFIG_IP_NF_TARGET_MARK $CONFIG_IP_NF_MANGLE
+ if [ "$CONFIG_IMQ" == "y" ]; then
+ dep_tristate ' IMQX target support' CONFIG_IP_NF_TARGET_IMQX $CONFIG_IP_NF_MANGLE
+ fi
diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.configure.help iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.configure.help
--- iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.configure.help Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.configure.help Sat Mar 23 02:37:20 2002
@@ -0,0 +1,8 @@
+CONFIG_IP_NF_TARGET_MARK
+IMQX target support
+CONFIG_IP_NF_TARGET_IMQX
+ IMQX allows you to exclude packets from beeing enqueued
+ to the IMQ device
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.help iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.help
--- iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.help Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.help Sat Mar 23 02:37:20 2002
@@ -0,0 +1,14 @@
+Author: Patrick McHardy <kaber@trash.net>
+Status: working
+
+This patch adds IMQX (IMQ eXclude) target for excluding
+traffic from beeing enqueued to the IMQ device.
+
+Usage:
+
+ IMQX
+ This target excludes traffic from beeing enqueued
+ to the IMQ device.
+
+Example:
+ iptables -t mangle -A POSTROUTING -o eth0 -j IMQX
diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.makefile iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.makefile
--- iptables-1.2.6a-clean/patch-o-matic/extra/IMQX.patch.makefile Thu Jan 1 01:00:00 1970
+++ iptables-1.2.6a/patch-o-matic/extra/IMQX.patch.makefile Sat Mar 23 02:37:20 2002
@@ -0,0 +1,2 @@
+obj-$(CONFIG_IP_NF_TARGET_MARK) += ipt_MARK.o
+obj-$(CONFIG_IP_NF_TARGET_IMQX) += ipt_IMQX.o
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] How to mark a device not to be used with IMQ?
2002-03-22 12:31 [LARTC] How to mark a device not to be used with IMQ? Nils Lichtenfeld
` (4 preceding siblings ...)
2002-03-23 1:49 ` Patrick McHardy
@ 2002-03-23 12:23 ` Nils Lichtenfeld
2002-03-23 13:09 ` Patrick McHardy
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Nils Lichtenfeld @ 2002-03-23 12:23 UTC (permalink / raw)
To: lartc
Hello Patrick!
From: "Patrick McHardy" <kaber@trash.net>
> > this is only internal mark to know whether the skb was
> > already in IMQ. You could use it but you would have to
> > add new user parameter to the interface structure.
> > I didn't want to do it as I want the pach to be as simple
> > as possible.
> > devik
> The same problem was bugging me a couple of days ago so i wrote an
> iptables target which
> allows you to exclude packets from beeing enqueued to the imq device.
> The patch is tested with iptables-1.2.6a but should work with almost any
> recent version.
> After applying it you have to execute a "chmod +x
> extensions/.IMQX-test", then
> make patch-o-matic as usual.
This sounds great and might be usefull in the future. We are still using 2.2.19
here so no iptables atm.
By the way: Imagine the IMQ-device is allready up and a new ISDN-device is
comming up, will the packages of the new ISDN-device automatically be send to
IMQ or do I have to take the IMQ-device down and up again?
Thanks!
Greetings Nils
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] How to mark a device not to be used with IMQ?
2002-03-22 12:31 [LARTC] How to mark a device not to be used with IMQ? Nils Lichtenfeld
` (5 preceding siblings ...)
2002-03-23 12:23 ` Nils Lichtenfeld
@ 2002-03-23 13:09 ` Patrick McHardy
2002-03-23 15:18 ` Martin Devera
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Patrick McHardy @ 2002-03-23 13:09 UTC (permalink / raw)
To: lartc
Nils Lichtenfeld schrieb:
> Hello Patrick!
Hi Nils,
> From: "Patrick McHardy" <kaber@trash.net>
> > > this is only internal mark to know whether the skb was
> > > already in IMQ. You could use it but you would have to
> > > add new user parameter to the interface structure.
> > > I didn't want to do it as I want the pach to be as simple
> > > as possible.
> > > devik
>
> > The same problem was bugging me a couple of days ago so i wrote an
> > iptables target which
> > allows you to exclude packets from beeing enqueued to the imq device.
> > The patch is tested with iptables-1.2.6a but should work with almost any
> > recent version.
> > After applying it you have to execute a "chmod +x
> > extensions/.IMQX-test", then
> > make patch-o-matic as usual.
>
> This sounds great and might be usefull in the future. We are still using 2.2.19
> here so no iptables atm.
I think you can easily write an ipchains modul which accomplishes the
same,
all you have to do is to set 'from_imq" to 1 in the skb.
A good start might be the MARK target, modifying (the iptables one) for
imq
took only a couple of minutes.
> By the way: Imagine the IMQ-device is allready up and a new ISDN-device is
> comming up, will the packages of the new ISDN-device automatically be send to
> IMQ or do I have to take the IMQ-device down and up again?
From net/core/core.c:
int dev_queue_xmit(struct sk_buff *skb)
...
#ifdef CONFIG_IMQ
/* special intermediate queue up ? */
if (imq_dev.flags&IFF_UP && !skb->from_imq) {
spin_lock_bh(&imq_dev.queue_lock);
q = imq_dev.qdisc;
if (q->enqueue) {
int ret = q->enqueue(skb, q);
qdisc_run(&imq_dev);
spin_unlock_bh(&imq_dev.queue_lock);
return ret = NET_XMIT_BYPASS ? NET_XMIT_SUCCESS : ret;
}
spin_unlock_bh(&imq_dev.queue_lock);
}
#endif
...
So i would say everything will be going to the IMQ device automatically.
Bye,
Patrick
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] How to mark a device not to be used with IMQ?
2002-03-22 12:31 [LARTC] How to mark a device not to be used with IMQ? Nils Lichtenfeld
` (6 preceding siblings ...)
2002-03-23 13:09 ` Patrick McHardy
@ 2002-03-23 15:18 ` Martin Devera
2002-03-23 15:29 ` Martin Devera
2002-03-23 15:41 ` Patrick McHardy
9 siblings, 0 replies; 11+ messages in thread
From: Martin Devera @ 2002-03-23 15:18 UTC (permalink / raw)
To: lartc
> By the way: Imagine the IMQ-device is allready up and a new ISDN-device is
> comming up, will the packages of the new ISDN-device automatically be send to
> IMQ or do I have to take the IMQ-device down and up again?
automatically.
devik
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] How to mark a device not to be used with IMQ?
2002-03-22 12:31 [LARTC] How to mark a device not to be used with IMQ? Nils Lichtenfeld
` (7 preceding siblings ...)
2002-03-23 15:18 ` Martin Devera
@ 2002-03-23 15:29 ` Martin Devera
2002-03-23 15:41 ` Patrick McHardy
9 siblings, 0 replies; 11+ messages in thread
From: Martin Devera @ 2002-03-23 15:29 UTC (permalink / raw)
To: lartc
> The same problem was bugging me a couple of days ago so i wrote an
> iptables target which
> allows you to exclude packets from beeing enqueued to the imq device.
Hi Patrick,
good work ! It never came to my mind to use iptables for
it but it is elegant solution :)
> Martin, maybe you want to put it on your imq page ?
sure. Only thing is that it could be better if I give
you account here so that you can edit this part yourself.
It's because I don't know iptables much and don't want
to mess something :)
By the way because there is growing demand it could be
interesting to put all incoming packets into IMQ device
too. It can be selectable by iptables. But first I have
to finish new htb.
If you would like to implement it I can dump my ideas to
you ;)
devik
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] How to mark a device not to be used with IMQ?
2002-03-22 12:31 [LARTC] How to mark a device not to be used with IMQ? Nils Lichtenfeld
` (8 preceding siblings ...)
2002-03-23 15:29 ` Martin Devera
@ 2002-03-23 15:41 ` Patrick McHardy
9 siblings, 0 replies; 11+ messages in thread
From: Patrick McHardy @ 2002-03-23 15:41 UTC (permalink / raw)
To: lartc
Hi Martin,
> good work ! It never came to my mind to use iptables for
> it but it is elegant solution :)
Thanks :)
> > Martin, maybe you want to put it on your imq page ?
>
> sure. Only thing is that it could be better if I give
> you account here so that you can edit this part yourself.
> It's because I don't know iptables much and don't want
> to mess something :)
Sure, although there's little to mess with :)
> By the way because there is growing demand it could be
> interesting to put all incoming packets into IMQ device
> too. It can be selectable by iptables. But first I have
> to finish new htb.
New htb is coming ? I'm looking forward to it ..
I tought it might be a good idea instead of using a from_imq flag
a to_imq flag would be more useful in combination with an iptables
target .. of course an ipchains target would have to be provided
too.
> If you would like to implement it I can dump my ideas to
> you ;)
Sure, sounds interesting.
Is your goal beeing able to do global ingress traffic control ?
Bye,
Patrick
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2002-03-23 15:41 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-22 12:31 [LARTC] How to mark a device not to be used with IMQ? Nils Lichtenfeld
2002-03-22 14:02 ` Martin Devera
2002-03-22 14:18 ` Nils Lichtenfeld
2002-03-22 23:50 ` Martin Devera
2002-03-23 1:42 ` Patrick McHardy
2002-03-23 1:49 ` Patrick McHardy
2002-03-23 12:23 ` Nils Lichtenfeld
2002-03-23 13:09 ` Patrick McHardy
2002-03-23 15:18 ` Martin Devera
2002-03-23 15:29 ` Martin Devera
2002-03-23 15:41 ` 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.