Ethereal-dev: [ethereal-dev] Vines patches

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Joerg Mayer <jmayer@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Jan 2000 21:48:50 +0100 (MET)
Hello,

I've done a minor update to the vines code. Please check it in.
While I was doing it, I noticed that the capture statistics are shown
in a rather inconsistent way (there's ospf, udp, tcp, netbios etc but
no ip). Does anyone object to the following: toplevel protocols (the first
layer 2 or 3 protocol I can find) first, after that those IP protocols
that have a non-zero counter?

  Ciao
     Jörg

PS: A while ago someone mentioned on the list he had written a nice
  grapher for some statistics - what has happend to this project?

--
Joerg Mayer                                 eMail: <jmayer@xxxxxxxxxxxxx>
Give an engineer a problem and a curious form of time dilation occurs /AC
--- capture.c.distrib	Wed Jan 19 20:42:59 2000
+++ capture.c	Wed Jan 19 20:47:18 2000
@@ -480,7 +480,7 @@
 capture(void)
 {
   GtkWidget  *cap_w, *main_vb, *count_lb, *tcp_lb, *udp_lb, *icmp_lb,
-             *ospf_lb, *gre_lb, *netbios_lb, *ipx_lb, *other_lb, *stop_bt;
+             *ospf_lb, *gre_lb, *netbios_lb, *ipx_lb, *vines_lb, *other_lb, *stop_bt;
   pcap_t     *pch;
   gchar       err_str[PCAP_ERRBUF_SIZE], label_str[32];
   loop_data   ld;
@@ -501,6 +501,7 @@
   ld.counts.gre     = 0;
   ld.counts.ipx     = 0;
   ld.counts.netbios = 0;
+  ld.counts.vines   = 0;
   ld.counts.other   = 0;
   ld.pdh            = NULL;
 
@@ -635,6 +636,10 @@
   gtk_box_pack_start(GTK_BOX(main_vb), ipx_lb, FALSE, FALSE, 3);
   gtk_widget_show(ipx_lb);
 
+  vines_lb = gtk_label_new("VINES: 0 (0.0%)");
+  gtk_box_pack_start(GTK_BOX(main_vb), vines_lb, FALSE, FALSE, 3);
+  gtk_widget_show(vines_lb);
+
   other_lb = gtk_label_new("Other: 0 (0.0%)");
   gtk_box_pack_start(GTK_BOX(main_vb), other_lb, FALSE, FALSE, 3);
   gtk_widget_show(other_lb);
@@ -693,6 +698,10 @@
       sprintf(label_str, "IPX: %d (%.1f%%)", ld.counts.ipx,
 		pct(ld.counts.ipx, ld.counts.total));
       gtk_label_set(GTK_LABEL(ipx_lb), label_str);
+
+      sprintf(label_str, "VINES: %d (%.1f%%)", ld.counts.vines,
+		pct(ld.counts.vines, ld.counts.total));
+      gtk_label_set(GTK_LABEL(vines_lb), label_str);
 
       sprintf(label_str, "Other: %d (%.1f%%)", ld.counts.other,
 		pct(ld.counts.other, ld.counts.total));
--- ethertype.c.distrib	Wed Jan 19 20:57:09 2000
+++ ethertype.c	Wed Jan 19 20:58:06 2000
@@ -69,6 +69,9 @@
     case ETHERTYPE_VLAN:
       capture_vlan(pd, offset, cap_len, ld);
       break;
+    case ETHERTYPE_VINES:
+      capture_vines(pd, offset, cap_len, ld);
+      break;
     default:
       ld->other++;
       break;
--- packet-ip.c.distrib	Thu Jan 13 22:16:10 2000
+++ packet-ip.c	Wed Jan 19 21:05:20 2000
@@ -329,6 +329,9 @@
     case IP_PROTO_GRE:
       ld->gre++;
       break;
+    case IP_PROTO_VINES:
+      ld->gre++;
+      break;
     default:
       ld->other++;
   }
@@ -711,6 +714,7 @@
                                            {IP_PROTO_ESP,  "ESP" },
                                            {IP_PROTO_IPV6, "IPv6"},
                                            {IP_PROTO_PIM,  "PIM" },
+                                           {IP_PROTO_VINES,"VINES"},
                                            {0,             NULL  } };
 
 static const value_string precedence_vals[] = {
@@ -820,6 +824,7 @@
     case IP_PROTO_AH:
     case IP_PROTO_IPV6:
     case IP_PROTO_PIM:
+    case IP_PROTO_VINES:
       /* Names are set in the associated dissect_* routines */
       break;
     default:
@@ -947,6 +952,9 @@
       break;
     case IP_PROTO_OSPF:
       dissect_ospf(pd, offset, fd, tree);
+      break;
+    case IP_PROTO_VINES:
+      dissect_vines_frp(pd, offset, fd, tree);
       break;
     case IP_PROTO_RSVP:
       dissect_rsvp(pd, offset, fd, tree);
--- packet-ip.h.distrib	Sun Nov 21 15:45:34 1999
+++ packet-ip.h	Thu Jan 13 22:20:19 2000
@@ -51,7 +51,8 @@
 #define IP_PROTO_NONE		59		/* IP6 no next header */
 #define IP_PROTO_DSTOPTS	60		/* IP6 no next header */
 #define IP_PROTO_EON		80		/* ISO cnlp */
-#define IP_PROTO_EIGRP   88
+#define IP_PROTO_VINES		83		/* Vines over raw IP */
+#define IP_PROTO_EIGRP		88
 #define IP_PROTO_OSPF		89
 #define IP_PROTO_ENCAP		98		/* encapsulation header */
 #define IP_PROTO_PIM		103		/* Protocol Independent Mcast */
--- packet-ppp.c.distrib	Wed Jan 19 21:03:43 2000
+++ packet-ppp.c	Wed Jan 19 21:04:21 2000
@@ -528,6 +528,9 @@
     case PPP_IPX:
       capture_ipx(pd, 4, cap_len, ld);
       break;
+    case PPP_VINES:
+      capture_ipx(pd, 4, cap_len, ld);
+      break;
     default:
       ld->other++;
       break;
--- packet-vines.c.distrib	Thu Nov 18 02:28:41 1999
+++ packet-vines.c	Wed Jan 19 20:53:03 2000
@@ -44,11 +44,18 @@
 static gint ett_vines_frp = -1;
 static gint ett_vines_spp = -1;
 
+void
+capture_vines(const u_char *pd, int offset, guint32 cap_len, packet_counts *ld)
+{
+  ld->vines++;
+}
+
+
+
 /* AFAIK Vines FRP (Fragmentation Protocol) is used on all media except Ethernet
  * and TR (and probably FDDI) - Fragmentation on these media types is not possible
  * FIXME: Do we need to use this header with PPP too?
  */
-
 void
 dissect_vines_frp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
   guint8   vines_frp_ctrl, vines_frp_seqno; 
@@ -231,6 +238,9 @@
     	case VIP_PROTO_SPP:
 		dissect_vines_spp(pd, offset, fd, tree);
     		break;
+	default:
+		dissect_data(pd, offset, fd, tree);
+		break;
   		}
 	}
 #define VINES_VSPP_DATA 1
@@ -314,6 +324,8 @@
     	proto_tree_add_text(vspp_tree, offset+12,   2, "Ack number: 0x%04x", viph.vspp_ack);
     	proto_tree_add_text(vspp_tree, offset+14,   2, "Window: 0x%04x", viph.vspp_win);
 		}
+	offset += 16; /* sizeof SPP */
+	dissect_data(pd, offset, fd, tree);
 	}
 
 void
--- packet.h.distrib	Wed Jan 19 20:48:37 2000
+++ packet.h	Wed Jan 19 20:50:29 2000
@@ -103,6 +103,7 @@
   gint           gre;
   gint           netbios;
   gint           ipx;
+  gint           vines;
   gint           other;
   gint           total;
 } packet_counts;
@@ -290,6 +291,7 @@
 void capture_llc(const u_char *, int, guint32, packet_counts *);
 void capture_ip(const u_char *, int, guint32, packet_counts *);
 void capture_ipx(const u_char *, int, guint32, packet_counts *);
+void capture_vines(const u_char *, int, guint32, packet_counts *);
 void capture_vlan(const u_char *, int, guint32, packet_counts *);
 
 /*