English Language flag
// Log In
// CVSweb
Project: FreeWRT
// Summary // Activity // Search // Tracker // Lists // News // SCM // Wiki

SCM Repository

ViewVC logotype

Diff of /branches/freewrt_1_0/package/iptables/patches/05-imq1.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3768 by wbx, Thu Sep 28 10:42:55 2006 UTC revision 3769 by dnehring, Wed Jun 25 10:52:44 2008 UTC
# Line 1  Line 1 
1  diff -urN iptables.old/extensions/.IMQ-test iptables.dev/extensions/.IMQ-test  --- iptables-1.3.6.orig/extensions.orig/.IMQ-test6      Thu Jan  1 01:00:00 1970
2  --- iptables.old/extensions/.IMQ-test   1970-01-01 01:00:00.000000000 +0100  +++ iptables-1.3.6/extensions/.IMQ-test6        Mon Jun 16 10:12:47 2003
3  +++ iptables.dev/extensions/.IMQ-test   2005-10-09 01:00:36.358959750 +0200  @@ -0,0 +1,3 @@
4  @@ -0,0 +1,3 @@  +#!/bin/sh
5  +#!/bin/sh  +# True if IMQ target patch is applied.
6  +# True if IMQ target patch is applied.  +[ -f $KERNEL_DIR/net/ipv6/netfilter/ip6t_IMQ.c ] && echo IMQ
7  +[ -f $KERNEL_DIR/net/ipv4/netfilter/ipt_IMQ.c ] && echo IMQ  --- iptables-1.3.6.orig/extensions.orig/libip6t_IMQ.c   Thu Jan  1 01:00:00 1970
8  diff -urN iptables.old/extensions/.IMQ-test6 iptables.dev/extensions/.IMQ-test6  +++ iptables-1.3.6/extensions/libip6t_IMQ.c     Mon Jun 16 10:12:47 2003
9  --- iptables.old/extensions/.IMQ-test6  1970-01-01 01:00:00.000000000 +0100  @@ -0,0 +1,101 @@
10  +++ iptables.dev/extensions/.IMQ-test6  2005-10-09 01:00:36.358959750 +0200  +/* Shared library add-on to iptables to add IMQ target support. */
11  @@ -0,0 +1,3 @@  +#include <stdio.h>
12  +#!/bin/sh  +#include <string.h>
13  +# True if IMQ target patch is applied.  +#include <stdlib.h>
14  +[ -f $KERNEL_DIR/net/ipv6/netfilter/ip6t_IMQ.c ] && echo IMQ  +#include <getopt.h>
15  diff -urN iptables.old/extensions/libip6t_IMQ.c iptables.dev/extensions/libip6t_IMQ.c  +
16  --- iptables.old/extensions/libip6t_IMQ.c       1970-01-01 01:00:00.000000000 +0100  +#include <ip6tables.h>
17  +++ iptables.dev/extensions/libip6t_IMQ.c       2005-10-09 01:00:36.358959750 +0200  +#include <linux/netfilter_ipv6/ip6_tables.h>
18  @@ -0,0 +1,101 @@  +#include <linux/netfilter_ipv6/ip6t_IMQ.h>
19  +/* Shared library add-on to iptables to add IMQ target support. */  +
20  +#include <stdio.h>  +/* Function which prints out usage message. */
21  +#include <string.h>  +static void
22  +#include <stdlib.h>  +help(void)
23  +#include <getopt.h>  +{
24  +  +       printf(
25  +#include <ip6tables.h>  +"IMQ target v%s options:\n"
26  +#include <linux/netfilter_ipv6/ip6_tables.h>  +"  --todev <N>         enqueue to imq<N>, defaults to 0\n",
27  +#include <linux/netfilter_ipv6/ip6t_IMQ.h>  +IPTABLES_VERSION);
28  +  +}
29  +/* Function which prints out usage message. */  +
30  +static void  +static struct option opts[] = {
31  +help(void)  +       { "todev", 1, 0, '1' },
32  +{  +       { 0 }
33  +       printf(  +};
34  +"IMQ target v%s options:\n"  +
35  +"  --todev <N>         enqueue to imq<N>, defaults to 0\n",  +/* Initialize the target. */
36  +IPTABLES_VERSION);  +static void
37  +}  +init(struct ip6t_entry_target *t, unsigned int *nfcache)
38  +  +{
39  +static struct option opts[] = {  +       struct ip6t_imq_info *mr = (struct ip6t_imq_info*)t->data;
40  +       { "todev", 1, 0, '1' },  +
41  +       { 0 }  +       mr->todev = 0;
42  +};  +       *nfcache |= NFC_UNKNOWN;
43  +  +}
44  +/* Initialize the target. */  +
45  +static void  +/* Function which parses command options; returns true if it
46  +init(struct ip6t_entry_target *t, unsigned int *nfcache)  +   ate an option */
47  +{  +static int
48  +       struct ip6t_imq_info *mr = (struct ip6t_imq_info*)t->data;  +parse(int c, char **argv, int invert, unsigned int *flags,
49  +  +      const struct ip6t_entry *entry,
50  +       mr->todev = 0;  +      struct ip6t_entry_target **target)
51  +       *nfcache |= NFC_UNKNOWN;  +{
52  +}  +       struct ip6t_imq_info *mr = (struct ip6t_imq_info*)(*target)->data;
53  +  +      
54  +/* Function which parses command options; returns true if it  +       switch(c) {
55  +   ate an option */  +       case '1':
56  +static int  +               if (check_inverse(optarg, &invert, NULL, 0))
57  +parse(int c, char **argv, int invert, unsigned int *flags,  +                       exit_error(PARAMETER_PROBLEM,
58  +      const struct ip6t_entry *entry,  +                                  "Unexpected `!' after --todev");
59  +      struct ip6t_entry_target **target)  +               mr->todev=atoi(optarg);
60  +{  +               break;
61  +       struct ip6t_imq_info *mr = (struct ip6t_imq_info*)(*target)->data;  +       default:
62  +        +               return 0;
63  +       switch(c) {  +       }
64  +       case '1':  +       return 1;
65  +               if (check_inverse(optarg, &invert, NULL, 0))  +}
66  +                       exit_error(PARAMETER_PROBLEM,  +
67  +                                  "Unexpected `!' after --todev");  +static void
68  +               mr->todev=atoi(optarg);  +final_check(unsigned int flags)
69  +               break;  +{
70  +       default:  +}
71  +               return 0;  +
72  +       }  +/* Prints out the targinfo. */
73  +       return 1;  +static void
74  +}  +print(const struct ip6t_ip6 *ip,
75  +  +      const struct ip6t_entry_target *target,
76  +static void  +      int numeric)
77  +final_check(unsigned int flags)  +{
78  +{  +       struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
79  +}  +
80  +  +       printf("IMQ: todev %u ", mr->todev);
81  +/* Prints out the targinfo. */  +}
82  +static void  +
83  +print(const struct ip6t_ip6 *ip,  +/* Saves the union ipt_targinfo in parsable form to stdout. */
84  +      const struct ip6t_entry_target *target,  +static void
85  +      int numeric)  +save(const struct ip6t_ip6 *ip, const struct ip6t_entry_target *target)
86  +{  +{
87  +       struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;  +       struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
88  +  +
89  +       printf("IMQ: todev %u ", mr->todev);  +       printf("--todev %u", mr->todev);
90  +}  +}
91  +  +
92  +/* Saves the union ipt_targinfo in parsable form to stdout. */  +static struct ip6tables_target imq = {
93  +static void  +       .next           = NULL,
94  +save(const struct ip6t_ip6 *ip, const struct ip6t_entry_target *target)  +       .name           = "IMQ",
95  +{  +       .version        = IPTABLES_VERSION,
96  +       struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;  +       .size           = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
97  +  +       .userspacesize  = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
98  +       printf("--todev %u", mr->todev);  +       .help           = &help,
99  +}  +       .init           = &init,
100  +  +       .parse          = &parse,
101  +static struct ip6tables_target imq = {  +       .final_check    = &final_check,
102  +       .next           = NULL,  +       .print          = &print,
103  +       .name           = "IMQ",  +       .save           = &save,
104  +       .version        = IPTABLES_VERSION,  +       .extra_opts     = opts
105  +       .size           = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),  +};
106  +       .userspacesize  = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),  +
107  +       .help           = &help,  +static __attribute__((constructor)) void _init(void)
108  +       .init           = &init,  +{
109  +       .parse          = &parse,  +       register_target6(&imq);
110  +       .final_check    = &final_check,  +}
111  +       .print          = &print,  --- iptables-1.3.6.orig/extensions.orig/.IMQ-test       Thu Jan  1 01:00:00 1970
112  +       .save           = &save,  +++ iptables-1.3.6/extensions/.IMQ-test Mon Jun 16 10:12:47 2003
113  +       .extra_opts     = opts  @@ -0,0 +1,3 @@
114  +};  +#!/bin/sh
115  +  +# True if IMQ target patch is applied.
116  +void _init(void)  +[ -f $KERNEL_DIR/net/ipv4/netfilter/ipt_IMQ.c ] && echo IMQ
117  +{  --- iptables-1.3.6.orig/extensions.orig/libipt_IMQ.c    Thu Jan  1 01:00:00 1970
118  +       register_target6(&imq);  +++ iptables-1.3.6/extensions/libipt_IMQ.c      Mon Jun 16 10:12:47 2003
119  +}  @@ -0,0 +1,101 @@
120  diff -urN iptables.old/extensions/libipt_IMQ.c iptables.dev/extensions/libipt_IMQ.c  +/* Shared library add-on to iptables to add IMQ target support. */
121  --- iptables.old/extensions/libipt_IMQ.c        1970-01-01 01:00:00.000000000 +0100  +#include <stdio.h>
122  +++ iptables.dev/extensions/libipt_IMQ.c        2005-10-09 01:00:36.358959750 +0200  +#include <string.h>
123  @@ -0,0 +1,101 @@  +#include <stdlib.h>
124  +/* Shared library add-on to iptables to add IMQ target support. */  +#include <getopt.h>
125  +#include <stdio.h>  +
126  +#include <string.h>  +#include <iptables.h>
127  +#include <stdlib.h>  +#include <linux/netfilter_ipv4/ip_tables.h>
128  +#include <getopt.h>  +#include <linux/netfilter_ipv4/ipt_IMQ.h>
129  +  +
130  +#include <iptables.h>  +/* Function which prints out usage message. */
131  +#include <linux/netfilter_ipv4/ip_tables.h>  +static void
132  +#include <linux/netfilter_ipv4/ipt_IMQ.h>  +help(void)
133  +  +{
134  +/* Function which prints out usage message. */  +       printf(
135  +static void  +"IMQ target v%s options:\n"
136  +help(void)  +"  --todev <N>         enqueue to imq<N>, defaults to 0\n",
137  +{  +IPTABLES_VERSION);
138  +       printf(  +}
139  +"IMQ target v%s options:\n"  +
140  +"  --todev <N>         enqueue to imq<N>, defaults to 0\n",  +static struct option opts[] = {
141  +IPTABLES_VERSION);  +       { "todev", 1, 0, '1' },
142  +}  +       { 0 }
143  +  +};
144  +static struct option opts[] = {  +
145  +       { "todev", 1, 0, '1' },  +/* Initialize the target. */
146  +       { 0 }  +static void
147  +};  +init(struct ipt_entry_target *t, unsigned int *nfcache)
148  +  +{
149  +/* Initialize the target. */  +       struct ipt_imq_info *mr = (struct ipt_imq_info*)t->data;
150  +static void  +
151  +init(struct ipt_entry_target *t, unsigned int *nfcache)  +       mr->todev = 0;
152  +{  +       *nfcache |= NFC_UNKNOWN;
153  +       struct ipt_imq_info *mr = (struct ipt_imq_info*)t->data;  +}
154  +  +
155  +       mr->todev = 0;  +/* Function which parses command options; returns true if it
156  +       *nfcache |= NFC_UNKNOWN;  +   ate an option */
157  +}  +static int
158  +  +parse(int c, char **argv, int invert, unsigned int *flags,
159  +/* Function which parses command options; returns true if it  +      const struct ipt_entry *entry,
160  +   ate an option */  +      struct ipt_entry_target **target)
161  +static int  +{
162  +parse(int c, char **argv, int invert, unsigned int *flags,  +       struct ipt_imq_info *mr = (struct ipt_imq_info*)(*target)->data;
163  +      const struct ipt_entry *entry,  +      
164  +      struct ipt_entry_target **target)  +       switch(c) {
165  +{  +       case '1':
166  +       struct ipt_imq_info *mr = (struct ipt_imq_info*)(*target)->data;  +               if (check_inverse(optarg, &invert, NULL, 0))
167  +        +                       exit_error(PARAMETER_PROBLEM,
168  +       switch(c) {  +                                  "Unexpected `!' after --todev");
169  +       case '1':  +               mr->todev=atoi(optarg);
170  +               if (check_inverse(optarg, &invert, NULL, 0))  +               break;
171  +                       exit_error(PARAMETER_PROBLEM,  +       default:
172  +                                  "Unexpected `!' after --todev");  +               return 0;
173  +               mr->todev=atoi(optarg);  +       }
174  +               break;  +       return 1;
175  +       default:  +}
176  +               return 0;  +
177  +       }  +static void
178  +       return 1;  +final_check(unsigned int flags)
179  +}  +{
180  +  +}
181  +static void  +
182  +final_check(unsigned int flags)  +/* Prints out the targinfo. */
183  +{  +static void
184  +}  +print(const struct ipt_ip *ip,
185  +  +      const struct ipt_entry_target *target,
186  +/* Prints out the targinfo. */  +      int numeric)
187  +static void  +{
188  +print(const struct ipt_ip *ip,  +       struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
189  +      const struct ipt_entry_target *target,  +
190  +      int numeric)  +       printf("IMQ: todev %u ", mr->todev);
191  +{  +}
192  +       struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;  +
193  +  +/* Saves the union ipt_targinfo in parsable form to stdout. */
194  +       printf("IMQ: todev %u ", mr->todev);  +static void
195  +}  +save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
196  +  +{
197  +/* Saves the union ipt_targinfo in parsable form to stdout. */  +       struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
198  +static void  +
199  +save(const struct ipt_ip *ip, const struct ipt_entry_target *target)  +       printf("--todev %u", mr->todev);
200  +{  +}
201  +       struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;  +
202  +  +static struct iptables_target imq = {
203  +       printf("--todev %u", mr->todev);  +       .next           = NULL,
204  +}  +       .name           = "IMQ",
205  +  +       .version        = IPTABLES_VERSION,
206  +static struct iptables_target imq = {  +       .size           = IPT_ALIGN(sizeof(struct ipt_imq_info)),
207  +       .next           = NULL,  +       .userspacesize  = IPT_ALIGN(sizeof(struct ipt_imq_info)),
208  +       .name           = "IMQ",  +       .help           = &help,
209  +       .version        = IPTABLES_VERSION,  +       .init           = &init,
210  +       .size           = IPT_ALIGN(sizeof(struct ipt_imq_info)),  +       .parse          = &parse,
211  +       .userspacesize  = IPT_ALIGN(sizeof(struct ipt_imq_info)),  +       .final_check    = &final_check,
212  +       .help           = &help,  +       .print          = &print,
213  +       .init           = &init,  +       .save           = &save,
214  +       .parse          = &parse,  +       .extra_opts     = opts
215  +       .final_check    = &final_check,  +};
216  +       .print          = &print,  +
217  +       .save           = &save,  +static __attribute__((constructor)) void _init(void)
218  +       .extra_opts     = opts  +{
219  +};  +       register_target(&imq);
220  +  +}
221  +void _init(void)  
 +{  
 +       register_target(&imq);  
 +}  

Legend:
Removed from v.3768  
changed lines
  Added in v.3769

root@freewrt.org:443
ViewVC Help
Powered by ViewVC 1.1.20