[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch for hdlc and bonding



helo,

this is a small patch which adds hdlc, cipe, tunnels and bond monitoring
to iptraf-2.7.0

regards,
Raymond Hall
-- 
"Even if World War I consisted of nothing but a very, very large number
of quarks in a very, very complicated pattern of motion, no insight is
gained by describing it that way"
Steven Pinker, on reductionism. "The Blank Slate" p. 70
diff -ru iptraf-2.7.0/src/ifaces.c iptraf-2.7.0-msg/src/ifaces.c
--- iptraf-2.7.0/src/ifaces.c	2002-05-08 04:43:27.000000000 -0500
+++ iptraf-2.7.0-msg/src/ifaces.c	2003-01-23 14:21:21.000000000 -0600
@@ -32,14 +32,14 @@
 #include "error.h"
 
 extern int accept_unsupported_interfaces;
-#define NUM_SUPPORTED_IFACES 20
+#define NUM_SUPPORTED_IFACES 23
 
 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" };
+      "pent", "lec", "cipcb", "tunl", "bond" };
 
 char *ltrim(char *buf)
 {
diff -ru iptraf-2.7.0/src/links.h iptraf-2.7.0-msg/src/links.h
--- iptraf-2.7.0/src/links.h	2001-12-17 20:45:16.000000000 -0600
+++ iptraf-2.7.0-msg/src/links.h	2003-01-23 14:21:21.000000000 -0600
@@ -5,9 +5,11 @@
 #define LINK_LOOPBACK		5
 #define LINK_ISDN_RAWIP		6
 #define LINK_ISDN_CISCOHDLC	7
+#define LINK_CISCOHDLC		LINK_ISDN_CISCOHDLC
 #define LINK_FDDI		8
 #define LINK_FRAD		9
 #define LINK_DLCI		10
 #define LINK_TR			11
+#define LINK_IPIP		12
 #define LINK_INVALID		0
 
diff -ru iptraf-2.7.0/src/packet.c iptraf-2.7.0-msg/src/packet.c
--- iptraf-2.7.0/src/packet.c	2002-05-08 04:44:08.000000000 -0500
+++ iptraf-2.7.0-msg/src/packet.c	2003-01-23 14:21:20.000000000 -0600
@@ -140,6 +140,12 @@
     case ARPHRD_DLCI:
         result = LINK_DLCI;
         break; 
+    case ARPHRD_HDLC:
+	result = LINK_CISCOHDLC;
+	break;
+    case ARPHRD_TUNNEL:
+	result = LINK_IPIP;
+	break;
     default:
 	result = LINK_INVALID;
 	break;
@@ -209,6 +215,9 @@
         memmove(aligned_buf, *packet, min(SNAPSHOT_LEN, *readlen));
         *packet = aligned_buf;
         break;
+    case LINK_IPIP:
+	*packet = tpacket;
+	break;
     default:
 	*packet = (char *) NULL;	/* return a NULL packet to signal */
 	break;			/* an unrecognized link protocol */