summaryrefslogtreecommitdiffstats
path: root/userspace/patches/incremental-patches/ebtables-v2.0pre3.002.diff
blob: 175f9df5b169a5fc5ab81266c009ef967b6c16bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
--- ebtables-v2.0pre3.001/ebtables.c	Fri Apr 19 22:07:46 2002
+++ ebtables-v2.0pre3.002/ebtables.c	Fri Apr 19 23:43:05 2002
@@ -62,6 +62,8 @@
 	{ "policy"        , required_argument, 0, 'P' },
 	{ "in-interface"  , required_argument, 0, 'i' },
 	{ "in-if"         , required_argument, 0, 'i' },
+	{ "logical-in"    , required_argument, 0, 1   },
+	{ "logical-out"   , required_argument, 0, 2   },
 	{ "out-interface" , required_argument, 0, 'o' },
 	{ "out-if"        , required_argument, 0, 'o' },
 	{ "version"       , no_argument      , 0, 'V' },
@@ -481,6 +483,16 @@
 				printf("! ");
 			printf("in-if: %s, ", hlp->in);
 		}
+		if (hlp->logical_in[0] != '\0') {
+			if (hlp->invflags & EBT_ILOGICALIN)
+				printf("! ");
+			printf("logical in-if: %s, ", hlp->logical_in);
+		}
+		if (hlp->logical_out[0] != '\0') {
+			if (hlp->invflags & EBT_ILOGICALOUT)
+				printf("! ");
+			printf("logical out-if: %s, ", hlp->logical_out);
+		}
 		if (hlp->out[0] != '\0') {
 			if (hlp->invflags & EBT_IOUT)
 				printf("! ");
@@ -560,6 +572,8 @@
 "--dst    -d [!] address       : destination mac address\n"
 "--in-if  -i [!] name          : network input interface name\n"
 "--out-if -o [!] name          : network output interface name\n"
+"--logical-in  [!] name        : logical bridge input interface name\n"
+"--logical-out [!] name        : logical bridge output interface name\n"
 "--version -V                  : print package version\n"
 "\n" ,
 	prog_name,
@@ -1095,15 +1109,17 @@
 	*flags |= mask;
 }
 
-#define OPT_COMMAND  0x01
-#define OPT_TABLE    0x02
-#define OPT_IN       0x04
-#define OPT_OUT      0x08
-#define OPT_JUMP     0x10
-#define OPT_PROTOCOL 0x20
-#define OPT_SOURCE   0x40
-#define OPT_DEST     0x80
-#define OPT_ZERO     0x100
+#define OPT_COMMAND    0x01
+#define OPT_TABLE      0x02
+#define OPT_IN         0x04
+#define OPT_OUT        0x08
+#define OPT_JUMP       0x10
+#define OPT_PROTOCOL   0x20
+#define OPT_SOURCE     0x40
+#define OPT_DEST       0x80
+#define OPT_ZERO       0x100
+#define OPT_LOGICALIN  0x200
+#define OPT_LOGICALOUT 0x400
 // the main thing
 int main(int argc, char *argv[])
 {
@@ -1261,7 +1277,9 @@
 			break;
 
 		case 'i': // input interface
+		case 1  : // logical input interface
 		case 'o': // output interface
+		case 2  : // logical output interface
 		case 'j': // target
 		case 'p': // net family protocol
 		case 's': // source mac
@@ -1287,6 +1305,23 @@
 				strcpy(new_entry->in, argv[optind - 1]);
 				break;
 			}
+			if (c == 1) {
+				check_option(&replace.flags, OPT_LOGICALIN);
+				if (replace.selected_hook > 2)
+					print_error("Use logical in-interface "
+					   "only in INPUT, FORWARD and "
+					   "PREROUTING chains");
+				if (check_inverse(optarg))
+					new_entry->invflags |= EBT_ILOGICALIN;
+
+				if (optind > argc)
+					print_error("No logical in-interface "
+					            "specified");
+				if (strlen(argv[optind - 1]) >= IFNAMSIZ)
+					print_error("Illegal interfacelength");
+				strcpy(new_entry->logical_in, argv[optind - 1]);
+				break;
+			}
 			if (c == 'o') {
 				check_option(&replace.flags, OPT_OUT);
 				if (replace.selected_hook < 2)
@@ -1304,6 +1339,26 @@
 					print_error("Illegal interface "
 					            "length");
 				strcpy(new_entry->out, argv[optind - 1]);
+				break;
+			}
+			if (c == 2) {
+				check_option(&replace.flags, OPT_LOGICALOUT);
+				if (replace.selected_hook < 2)
+					print_error("Use logical out-interface "
+					   "only in OUTPUT, FORWARD and "
+					   "POSTROUTING chains");
+				if (check_inverse(optarg))
+					new_entry->invflags |= EBT_ILOGICALOUT;
+
+				if (optind > argc)
+					print_error("No logical out-interface "
+					            "specified");
+
+				if (strlen(argv[optind - 1]) >= IFNAMSIZ)
+					print_error("Illegal interface "
+					            "length");
+				strcpy(new_entry->logical_out,
+				   argv[optind - 1]);
 				break;
 			}
 			if (c == 'j') {
--- ebtables-v2.0pre3.001/communication.c	Fri Apr 19 22:07:46 2002
+++ ebtables-v2.0pre3.002/communication.c	Fri Apr 19 22:57:13 2002
@@ -115,6 +115,10 @@
 			tmp->ethproto = e->ethproto;
 			memcpy(tmp->in, e->in, sizeof(tmp->in));
 			memcpy(tmp->out, e->out, sizeof(tmp->out));
+			memcpy(tmp->logical_in, e->logical_in,
+			   sizeof(tmp->logical_in));
+			memcpy(tmp->logical_out, e->logical_out,
+			   sizeof(tmp->logical_out));
 			memcpy(tmp->sourcemac, e->sourcemac,
 			   sizeof(tmp->sourcemac));
 			memcpy(tmp->destmac, e->destmac, sizeof(tmp->destmac));
@@ -298,6 +302,10 @@
 		new->ethproto = e->ethproto;
 		memcpy(new->in, e->in, sizeof(new->in));
 		memcpy(new->out, e->out, sizeof(new->out));
+		memcpy(new->logical_in, e->logical_in,
+		   sizeof(new->logical_in));
+		memcpy(new->logical_out, e->logical_out,
+		   sizeof(new->logical_out));
 		memcpy(new->sourcemac, e->sourcemac, sizeof(new->sourcemac));
 		memcpy(new->destmac, e->destmac, sizeof(new->destmac));
 		new->m_list = NULL;
--- ebtables-v2.0pre3.001/ebtables.8	Fri Apr 19 22:07:46 2002
+++ ebtables-v2.0pre3.002/ebtables.8	Fri Apr 19 23:28:06 2002
@@ -184,6 +184,14 @@
 .B --in-if
 is an alias for this option.
 .TP
+.BR "--logical-in " "[!] \fIname\fP"
+The (logical) bridge interface via which a frame is received (for the
+.BR INPUT ,
+.B FORWARD
+and
+.B PREROUTING
+chains).
+.TP
 .BR "-o, --out-interface " "[!] \fIname\fP"
 The interface via which a frame is going to be sent (for the
 .BR OUTPUT ,
@@ -193,6 +201,15 @@
 chains). The flag
 .B --out-if
 is an alias for this option.
+.TP
+.BR "--logical-out " "[!] \fIname\fP"
+The (logical) bridge interface via which a frame is going to be sent (for
+the
+.BR OUTPUT ,
+.B FORWARD
+and
+.B POSTROUTING
+chains).
 .TP
 .BR "-s, --source " "[!] \fIaddress\fP"
 The source mac address. The flag
--- ebtables-v2.0pre3.001/include/ebtables_u.h	Wed Apr 10 22:29:01 2002
+++ ebtables-v2.0pre3.002/include/ebtables_u.h	Fri Apr 19 22:55:15 2002
@@ -82,7 +82,9 @@
 	__u32 invflags;
 	__u16 ethproto;
 	__u8 in[IFNAMSIZ];
+	__u8 logical_in[IFNAMSIZ];
 	__u8 out[IFNAMSIZ];
+	__u8 logical_out[IFNAMSIZ];
 	__u8 sourcemac[ETH_ALEN];
 	__u8 destmac[ETH_ALEN];
 	struct ebt_u_match_list *m_list;