Port iptraf to -ng
[openwrt/svn-archive/archive.git] / net / iptraf / patches / 02-ifaces.patch
1 diff -urN iptraf-3.0.0/src/dirs.h iptraf-3.0.0.new/src/dirs.h
2 --- iptraf-3.0.0/src/dirs.h 2005-09-13 08:42:54.000000000 +0200
3 +++ iptraf-3.0.0.new/src/dirs.h 2006-04-16 16:08:27.000000000 +0200
4 @@ -155,7 +155,6 @@
5 */
6
7 #define ETHFILE get_path(T_WORKDIR, "ethernet.desc")
8 -#define FDDIFILE get_path(T_WORKDIR, "fddi.desc")
9
10 /*
11 * The rvnamed program file
12 diff -urN iptraf-3.0.0/src/hostmon.c iptraf-3.0.0.new/src/hostmon.c
13 --- iptraf-3.0.0/src/hostmon.c 2005-09-13 08:42:54.000000000 +0200
14 +++ iptraf-3.0.0.new/src/hostmon.c 2006-04-16 16:29:27.000000000 +0200
15 @@ -30,7 +30,6 @@
16 #include <netinet/in.h>
17 #include <linux/if_packet.h>
18 #include <linux/if_ether.h>
19 -#include <linux/if_fddi.h>
20 #include <linux/if_tr.h>
21 #include <net/if_arp.h>
22 #include <stdlib.h>
23 @@ -293,8 +292,6 @@
24 wprintw(table->tabwin, "Ethernet");
25 else if (entry->un.desc.linktype == LINK_PLIP)
26 wprintw(table->tabwin, "PLIP");
27 - else if (entry->un.desc.linktype == LINK_FDDI)
28 - wprintw(table->tabwin, "FDDI");
29
30 wprintw(table->tabwin, " HW addr: %s", entry->un.desc.ascaddr);
31
32 @@ -722,7 +719,7 @@
33 unsigned long long updtime_usec = 0;
34
35 struct desclist elist; /* Ethernet description list */
36 - struct desclist flist; /* FDDI description list */
37 + struct desclist flist; /* Other links description list */
38 struct desclist *list = NULL;
39
40 FILE *logfile = NULL;
41 @@ -786,7 +783,6 @@
42
43 initethtab(&table, options->actmode);
44 loaddesclist(&elist, LINK_ETHERNET, WITHETCETHERS);
45 - loaddesclist(&flist, LINK_FDDI, WITHETCETHERS);
46
47 if (logging) {
48 if (strcmp(current_logfile, "") == 0) {
49 @@ -900,9 +896,7 @@
50 if (pkt_result != PACKET_OK)
51 continue;
52
53 - if ((linktype == LINK_ETHERNET) || (linktype == LINK_FDDI)
54 - || (linktype == LINK_PLIP) || (linktype == LINK_TR) ||
55 - (linktype == LINK_VLAN)) {
56 + if ((linktype == LINK_ETHERNET) || (linktype == LINK_PLIP) || (linktype == LINK_TR) || (linktype == LINK_VLAN)) {
57
58 if (fromaddr.sll_protocol == htons(ETH_P_IP))
59 is_ip = 1;
60 @@ -920,12 +914,6 @@
61 memcpy(scratch_daddr, ((struct ethhdr *) buf)->h_dest,
62 ETH_ALEN);
63 list = &elist;
64 - } else if (linktype == LINK_FDDI) {
65 - memcpy(scratch_saddr, ((struct fddihdr *) buf)->saddr,
66 - FDDI_K_ALEN);
67 - memcpy(scratch_daddr, ((struct fddihdr *) buf)->daddr,
68 - FDDI_K_ALEN);
69 - list = &flist;
70 } else if (linktype == LINK_TR) {
71 memcpy(scratch_saddr, ((struct trh_hdr *) buf)->saddr,
72 TR_ALEN);
73 diff -urN iptraf-3.0.0/src/ifaces.c iptraf-3.0.0.new/src/ifaces.c
74 --- iptraf-3.0.0/src/ifaces.c 2005-09-13 08:42:54.000000000 +0200
75 +++ iptraf-3.0.0.new/src/ifaces.c 2006-04-16 16:10:10.000000000 +0200
76 @@ -37,7 +37,7 @@
77 extern int daemonized;
78
79 char ifaces[][6] =
80 - { "lo", "eth", "sl", "ppp", "ippp", "plip", "fddi", "isdn", "dvb",
81 + { "lo", "eth", "sl", "ppp", "ippp", "plip", "isdn", "dvb",
82 "pvc", "hdlc", "ipsec", "sbni", "tr", "wvlan", "wlan", "sm2", "sm3",
83 "pent", "lec", "brg", "tun", "tap", "cipcb", "tunl", "vlan"
84 };
85 diff -urN iptraf-3.0.0/src/landesc.c iptraf-3.0.0.new/src/landesc.c
86 --- iptraf-3.0.0/src/landesc.c 2005-09-13 08:42:54.000000000 +0200
87 +++ iptraf-3.0.0.new/src/landesc.c 2006-04-16 16:10:29.000000000 +0200
88 @@ -83,8 +83,6 @@
89
90 if (linktype == LINK_ETHERNET)
91 fd = fopen(ETHFILE, "r");
92 - else if (linktype == LINK_FDDI)
93 - fd = fopen(FDDIFILE, "r");
94
95 if (fd == NULL) {
96 return;
97 @@ -205,8 +203,6 @@
98
99 if (linktype == LINK_ETHERNET)
100 fd = fopen(ETHFILE, "w");
101 - else if (linktype == LINK_FDDI)
102 - fd = fopen(FDDIFILE, "w");
103
104 if (fd < 0) {
105 etherr();
106 diff -urN iptraf-3.0.0/src/links.h iptraf-3.0.0.new/src/links.h
107 --- iptraf-3.0.0/src/links.h 2005-09-13 08:42:54.000000000 +0200
108 +++ iptraf-3.0.0.new/src/links.h 2006-04-16 16:10:39.000000000 +0200
109 @@ -6,7 +6,6 @@
110 #define LINK_ISDN_RAWIP 6
111 #define LINK_ISDN_CISCOHDLC 7
112 #define LINK_CISCOHDLC 7
113 -#define LINK_FDDI 8
114 #define LINK_FRAD 9
115 #define LINK_DLCI 10
116 #define LINK_TR 11
117 diff -urN iptraf-3.0.0/src/log.c iptraf-3.0.0.new/src/log.c
118 --- iptraf-3.0.0/src/log.c 2005-09-13 08:42:54.000000000 +0200
119 +++ iptraf-3.0.0.new/src/log.c 2006-04-16 16:10:53.000000000 +0200
120 @@ -491,8 +491,6 @@
121 ptmp->un.desc.ascaddr);
122 else if (ptmp->un.desc.linktype == LINK_PLIP)
123 fprintf(fd, "\nPLIP address: %s", ptmp->un.desc.ascaddr);
124 - else if (ptmp->un.desc.linktype == LINK_FDDI)
125 - fprintf(fd, "\nFDDI address: %s", ptmp->un.desc.ascaddr);
126
127 if (ptmp->un.desc.withdesc)
128 fprintf(fd, " (%s)", ptmp->un.desc.desc);
129 diff -urN iptraf-3.0.0/src/options.c iptraf-3.0.0.new/src/options.c
130 --- iptraf-3.0.0/src/options.c 2005-09-13 08:42:54.000000000 +0200
131 +++ iptraf-3.0.0.new/src/options.c 2006-04-16 16:23:52.000000000 +0200
132 @@ -68,8 +68,6 @@
133 tx_additem(menu, NULL, NULL);
134 tx_additem(menu, " ^E^thernet/PLIP host descriptions...",
135 "Manages descriptions for Ethernet and PLIP addresses");
136 - tx_additem(menu, " ^F^DDI/Token Ring host descriptions...",
137 - "Manages descriptions for FDDI and FDDI addresses");
138 tx_additem(menu, NULL, NULL);
139 tx_additem(menu, " E^x^it configuration", "Returns to main menu");
140 }
141 @@ -371,9 +369,6 @@
142 case 14:
143 ethdescmgr(LINK_ETHERNET);
144 break;
145 - case 15:
146 - ethdescmgr(LINK_FDDI);
147 - break;
148 }
149
150 indicatesetting(row, options, statwin);
151 diff -urN iptraf-3.0.0/src/othptab.c iptraf-3.0.0.new/src/othptab.c
152 --- iptraf-3.0.0/src/othptab.c 2005-09-13 08:42:54.000000000 +0200
153 +++ iptraf-3.0.0.new/src/othptab.c 2006-04-16 16:24:21.000000000 +0200
154 @@ -19,7 +19,6 @@
155 #include <asm/types.h>
156 #include <linux/if_ether.h>
157 #include <linux/if_tr.h>
158 -#include <linux/if_fddi.h>
159 #include <winops.h>
160 #include "arphdr.h"
161 #include "options.h"
162 @@ -139,11 +138,6 @@
163 new_entry->smacaddr);
164 convmacaddr(((struct ethhdr *) packet)->h_dest,
165 new_entry->dmacaddr);
166 - } else if (linkproto == LINK_FDDI) {
167 - convmacaddr(((struct fddihdr *) packet)->saddr,
168 - new_entry->smacaddr);
169 - convmacaddr(((struct fddihdr *) packet)->daddr,
170 - new_entry->dmacaddr);
171 } else if (linkproto == LINK_TR) {
172 convmacaddr(((struct trh_hdr *) packet)->saddr,
173 new_entry->smacaddr);
174 @@ -373,8 +367,7 @@
175 strcat(msgstring, scratchpad);
176
177 if ((entry->linkproto == LINK_ETHERNET) ||
178 - (entry->linkproto == LINK_PLIP) ||
179 - (entry->linkproto == LINK_FDDI)) {
180 + (entry->linkproto == LINK_PLIP)) {
181 sprintf(scratchpad, " from %s to %s on %s",
182 entry->smacaddr, entry->dmacaddr, entry->iface);
183
184 diff -urN iptraf-3.0.0/src/packet.c iptraf-3.0.0.new/src/packet.c
185 --- iptraf-3.0.0/src/packet.c 2005-09-13 08:42:54.000000000 +0200
186 +++ iptraf-3.0.0.new/src/packet.c 2006-04-16 16:11:55.000000000 +0200
187 @@ -35,7 +35,6 @@
188 #include <sys/ioctl.h>
189 #include <linux/if_packet.h>
190 #include <linux/if_ether.h>
191 -#include <linux/if_fddi.h>
192 #include <linux/if_tr.h>
193 #include <linux/isdn.h>
194 #include <linux/sockios.h>
195 @@ -81,8 +80,6 @@
196 result = LINK_ETHERNET;
197 else if (strncmp(ifname, "plip", 4) == 0)
198 result = LINK_PLIP;
199 - else if (strncmp(ifname, "fddi", 4) == 0) /* For some Ethernet- */
200 - result = LINK_ETHERNET; /* emulated FDDI ifaces */
201 else if (strncmp(ifname, "dvb", 3) == 0)
202 result = LINK_ETHERNET;
203 else if (strncmp(ifname, "sbni", 4) == 0)
204 @@ -136,9 +133,6 @@
205 case ARPHRD_PPP:
206 result = LINK_PPP;
207 break;
208 - case ARPHRD_FDDI:
209 - result = LINK_FDDI;
210 - break;
211 case ARPHRD_IEEE802:
212 case ARPHRD_IEEE802_TR:
213 result = LINK_TR;
214 @@ -194,19 +188,6 @@
215 *packet = tpacket + 4;
216 *readlen -= 4;
217 break;
218 - case LINK_FDDI:
219 - *packet = tpacket + sizeof(struct fddihdr);
220 - *readlen -= sizeof(struct fddihdr);
221 -
222 - /*
223 - * Move IP data into an aligned buffer. 96 bytes should be sufficient
224 - * for IP and TCP headers with reasonable numbers of options and some
225 - * data.
226 - */
227 -
228 - memmove(aligned_buf, *packet, min(SNAPSHOT_LEN, *readlen));
229 - *packet = aligned_buf;
230 - break;
231 case LINK_TR:
232 /*
233 * Token Ring patch supplied by Tomas Dvorak
234 diff -urN iptraf-3.0.0/src/promisc.c iptraf-3.0.0.new/src/promisc.c
235 --- iptraf-3.0.0/src/promisc.c 2005-09-13 08:42:54.000000000 +0200
236 +++ iptraf-3.0.0.new/src/promisc.c 2006-04-16 16:12:56.000000000 +0200
237 @@ -81,8 +81,8 @@
238 */
239
240 if ((strncmp(buf, "eth", 3) == 0) ||
241 - (strncmp(buf, "fddi", 4) == 0) ||
242 (strncmp(buf, "tr", 2) == 0) ||
243 + (strncmp(buf, "vlan", 4) == 0) ||
244 (strncmp(ptmp->params.ifname, "wvlan", 4) == 0) ||
245 (strncmp(ptmp->params.ifname, "lec", 3) == 0) ||
246 (accept_unsupported_interfaces)) {
247 @@ -195,7 +195,7 @@
248
249 while (ptmp != NULL) {
250 if (((strncmp(ptmp->params.ifname, "eth", 3) == 0) ||
251 - (strncmp(ptmp->params.ifname, "fddi", 4) == 0) ||
252 + (strncmp(ptmp->params.ifname, "vlan", 4) == 0) ||
253 (strncmp(ptmp->params.ifname, "tr", 2) == 0) ||
254 (strncmp(ptmp->params.ifname, "wvlan", 4) == 0) ||
255 (strncmp(ptmp->params.ifname, "lec", 3) == 0)) &&
256 diff -urN iptraf-3.0.0/src/rvnamed.h iptraf-3.0.0.new/src/rvnamed.h
257 --- iptraf-3.0.0/src/rvnamed.h 2005-09-13 08:42:54.000000000 +0200
258 +++ iptraf-3.0.0.new/src/rvnamed.h 2006-04-16 16:13:39.000000000 +0200
259 @@ -1,9 +1,9 @@
260 #include <netinet/in.h>
261 #include <arpa/inet.h>
262
263 -#define CHILDSOCKNAME "/dev/rvndcldcomsk"
264 -#define PARENTSOCKNAME "/dev/rvndpntcomsk"
265 -#define IPTSOCKNAME "/dev/rvndiptcomsk"
266 +#define CHILDSOCKNAME "/tmp/rvndcldcomsk"
267 +#define PARENTSOCKNAME "/tmp/rvndpntcomsk"
268 +#define IPTSOCKNAME "/tmp/rvndiptcomsk"
269
270 #define SOCKET_PREFIX "isock"
271
272 diff -urN iptraf-3.0.0/src/tcptable.c iptraf-3.0.0.new/src/tcptable.c
273 --- iptraf-3.0.0/src/tcptable.c 2005-09-13 08:42:54.000000000 +0200
274 +++ iptraf-3.0.0.new/src/tcptable.c 2006-04-16 16:13:54.000000000 +0200
275 @@ -600,8 +600,6 @@
276
277 if ((linkproto == LINK_ETHERNET) || (linkproto == LINK_PLIP)) {
278 convmacaddr(((struct ethhdr *) packet)->h_source, newmacaddr);
279 - } else if (linkproto == LINK_FDDI) {
280 - convmacaddr(((struct fddihdr *) packet)->saddr, newmacaddr);
281 } else if (linkproto == LINK_TR) {
282 convmacaddr(((struct trh_hdr *) packet)->saddr, newmacaddr);
283 }
284 diff -urN iptraf-3.0.0/src/tcptable.h iptraf-3.0.0.new/src/tcptable.h
285 --- iptraf-3.0.0/src/tcptable.h 2005-09-13 08:42:54.000000000 +0200
286 +++ iptraf-3.0.0.new/src/tcptable.h 2006-04-16 16:14:03.000000000 +0200
287 @@ -22,7 +22,6 @@
288 #include <asm/types.h>
289 #include <linux/if_packet.h>
290 #include <linux/if_ether.h>
291 -#include <linux/if_fddi.h>
292 #include <linux/if_tr.h>
293 #include <net/if.h>
294 #include <netinet/ip.h>