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