aboutsummaryrefslogtreecommitdiffstats
path: root/main/iptraf/iptraf-3.0.0-interface.patch
blob: d64c9638130829526aaf58532ec66affc2478134 (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
--- iptraf-3.0.0/src/packet.c.interface	2005-09-13 08:42:54.000000000 +0200
+++ iptraf-3.0.0/src/packet.c	2008-04-22 15:27:30.000000000 +0200
@@ -102,11 +102,19 @@ unsigned short getlinktype(unsigned shor
         else if (strncmp(ifname, "tun", 3) == 0)
             result = LINK_ETHERNET;
         else if (strncmp(ifname, "vlan", 3) == 0)
-            result = LINK_VLAN;
+            result = LINK_ETHERNET;
+        else if (strncmp(ifname, "bond", 4) == 0)
+            result = LINK_ETHERNET;
         else if (strncmp(ifname, "brg", 3) == 0)
             result = LINK_ETHERNET;
         else if (strncmp(ifname, "tap", 3) == 0)
             result = LINK_ETHERNET;
+        else if (strncmp(ifname, "ctc", 3) == 0)
+            result = LINK_ETHERNET;
+        else if (strncmp(ifname, "hsi", 3) == 0)
+            result = LINK_ETHERNET;
+        else if (strncmp(ifname, "ath", 3) == 0)
+            result = LINK_ETHERNET;
         else if ((strncmp(ifname, "isdn", 4) == 0) && (isdn_fd != -1)) {
             isdnent = isdn_table_lookup(isdnlist, ifname, isdn_fd);
 
@@ -235,6 +243,7 @@ void adjustpacket(char *tpacket, unsigne
          */
         memmove(aligned_buf, *packet, min(SNAPSHOT_LEN, *readlen));
         *packet = aligned_buf;
+	break;
     default:
         *packet = (char *) NULL;        /* return a NULL packet to signal */
         break;                  /* an unrecognized link protocol */
@@ -344,9 +353,14 @@ int processpacket(char *tpacket, char **
      * Get IPTraf link type based on returned information and move past
      * data link header.
      */
-    *linktype =
-        getlinktype(fromaddr->sll_hatype, ifname, isdnfd, &isdntable);
     fromaddr->sll_protocol = ntohs(fromaddr->sll_protocol);
+    if (fromaddr->sll_protocol != ETH_P_8021Q)
+        *linktype =
+            getlinktype(fromaddr->sll_hatype, ifname, isdnfd, &isdntable);
+    else {
+        *linktype = LINK_VLAN;
+        fromaddr->sll_protocol = ntohs(*((unsigned short*)(tpacket+ETH_HLEN+2)));
+    }
     adjustpacket(tpacket, *linktype, packet, aligned_buf, br);
 
     if (*packet == NULL)
--- iptraf-3.0.0/src/ifaces.c.interface	2005-09-13 08:42:54.000000000 +0200
+++ iptraf-3.0.0/src/ifaces.c	2008-04-22 15:35:40.000000000 +0200
@@ -32,14 +32,15 @@ details.
 #include "error.h"
 
 extern int accept_unsupported_interfaces;
-#define NUM_SUPPORTED_IFACES 26
+#define NUM_SUPPORTED_IFACES 30
 
 extern int daemonized;
 
 char ifaces[][6] =
     { "lo", "eth", "sl", "ppp", "ippp", "plip", "fddi", "isdn", "dvb",
     "pvc", "hdlc", "ipsec", "sbni", "tr", "wvlan", "wlan", "sm2", "sm3",
-    "pent", "lec", "brg", "tun", "tap", "cipcb", "tunl", "vlan"
+    "pent", "lec", "brg", "tun", "tap", "cipcb", "tunl", "vlan", "hsi",
+    "ctc", "ath", "bond"
 };
 
 char *ltrim(char *buf)