summaryrefslogtreecommitdiff
path: root/package/iptraf/patches/patch-src_packet_c
blob: 87c1c1ff4dd11507452e2e787f756df7c40eed1c (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
--- iptraf-3.0.1.orig/src/packet.c	2007-09-25 11:21:18.000000000 +0200
+++ iptraf-3.0.1/src/packet.c	2024-02-25 18:13:41.165645150 +0100
@@ -36,8 +36,6 @@ details.
 #include <linux/if_ether.h>
 #include <linux/netdevice.h>
 #include <linux/if_fddi.h>
-#include <linux/if_tr.h>
-#include <linux/isdn.h>
 #include <linux/sockios.h>
 #include <msgboxes.h>
 #include "deskman.h"
@@ -107,21 +105,7 @@ unsigned short getlinktype(unsigned shor
             result = LINK_ETHERNET;
         else if (strncmp(ifname, "tap", 3) == 0)
             result = LINK_ETHERNET;
-        else if ((strncmp(ifname, "isdn", 4) == 0) && (isdn_fd != -1)) {
-            isdnent = isdn_table_lookup(isdnlist, ifname, isdn_fd);
-
-            switch (isdnent->encap) {
-            case ISDN_NET_ENCAP_RAWIP:
-                result = LINK_ISDN_RAWIP;
-                break;
-            case ISDN_NET_ENCAP_CISCOHDLC:
-                result = LINK_ISDN_CISCOHDLC;
-                break;
-            default:
-                result = LINK_INVALID;
-                break;
-            }
-        } else if (accept_unsupported_interfaces)
+        else if (accept_unsupported_interfaces)
             result = LINK_ETHERNET;
         break;
     case ARPHRD_LOOPBACK:
@@ -136,9 +120,6 @@ unsigned short getlinktype(unsigned shor
     case ARPHRD_PPP:
         result = LINK_PPP;
         break;
-    case ARPHRD_FDDI:
-        result = LINK_FDDI;
-        break;
     case ARPHRD_IEEE802:
     case ARPHRD_IEEE802_TR:
         result = LINK_TR;
@@ -194,36 +175,6 @@ void adjustpacket(char *tpacket, unsigne
         *packet = tpacket + 4;
         *readlen -= 4;
         break;
-    case LINK_FDDI:
-        *packet = tpacket + sizeof(struct fddihdr);
-        *readlen -= sizeof(struct fddihdr);
-
-        /*
-         * Move IP data into an aligned buffer.  96 bytes should be sufficient
-         * for IP and TCP headers with reasonable numbers of options and some
-         * data.
-         */
-
-        memmove(aligned_buf, *packet, min(SNAPSHOT_LEN, *readlen));
-        *packet = aligned_buf;
-        break;
-    case LINK_TR:
-        /*
-         * Token Ring patch supplied by Tomas Dvorak 
-         */
-
-        /*
-         * Get the start of the IP packet from the Token Ring frame.
-         */
-        dataoffset = get_tr_ip_offset(tpacket);
-        *packet = tpacket + dataoffset;
-        *readlen -= dataoffset;
-        /*
-         * Move IP datagram into an aligned buffer.
-         */
-        memmove(aligned_buf, *packet, min(SNAPSHOT_LEN, *readlen));
-        *packet = aligned_buf;
-        break;
     case LINK_IPIP:
         *packet = tpacket;
         break;
@@ -463,5 +414,4 @@ void pkt_cleanup(void)
     close(isdnfd);
     isdnfd = -1;
     destroyfraglist();
-    destroy_isdn_table(&isdntable);
 }