Add IPX to packet stats during capture.
authorGilbert Ramirez <gram@alumni.rice.edu>
Tue, 30 Nov 1999 23:56:37 +0000 (23:56 -0000)
committerGilbert Ramirez <gram@alumni.rice.edu>
Tue, 30 Nov 1999 23:56:37 +0000 (23:56 -0000)
svn path=/trunk/; revision=1173

capture.c
ethertype.c
packet-eth.c
packet-ipx.c
packet-llc.c
packet-ppp.c
packet.h

index cd226cc1c2c98b5dc61bc3c22de9bc002617bc03..512e4e27b9e725fe2e5ced35f38fa742a836bb07 100644 (file)
--- a/capture.c
+++ b/capture.c
@@ -1,7 +1,7 @@
 /* capture.c
  * Routines for packet capture windows
  *
- * $Id: capture.c,v 1.84 1999/11/30 20:49:45 guy Exp $
+ * $Id: capture.c,v 1.85 1999/11/30 23:56:34 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -480,7 +480,7 @@ int
 capture(void)
 {
   GtkWidget  *cap_w, *main_vb, *count_lb, *tcp_lb, *udp_lb, *icmp_lb,
-             *ospf_lb, *gre_lb, *netbios_lb, *other_lb, *stop_bt;
+             *ospf_lb, *gre_lb, *netbios_lb, *ipx_lb, *other_lb, *stop_bt;
   pcap_t     *pch;
   gchar       err_str[PCAP_ERRBUF_SIZE], label_str[32];
   loop_data   ld;
@@ -499,6 +499,7 @@ capture(void)
   ld.counts.icmp    = 0;
   ld.counts.ospf    = 0;
   ld.counts.gre     = 0;
+  ld.counts.ipx     = 0;
   ld.counts.netbios = 0;
   ld.counts.other   = 0;
   ld.pdh            = NULL;
@@ -630,6 +631,10 @@ capture(void)
   gtk_box_pack_start(GTK_BOX(main_vb), netbios_lb, FALSE, FALSE, 3);
   gtk_widget_show(netbios_lb);
 
+  ipx_lb = gtk_label_new("IPX: 0 (0.0%)");
+  gtk_box_pack_start(GTK_BOX(main_vb), ipx_lb, FALSE, FALSE, 3);
+  gtk_widget_show(ipx_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);
@@ -685,6 +690,10 @@ capture(void)
                pct(ld.counts.netbios, ld.counts.total));
       gtk_label_set(GTK_LABEL(netbios_lb), label_str);
 
+      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, "Other: %d (%.1f%%)", ld.counts.other,
                pct(ld.counts.other, ld.counts.total));
       gtk_label_set(GTK_LABEL(other_lb), label_str);
index f5d7fbf6080156796c39170b8609439ed2871c9e..21b774daeb8066c9b51ff1d0e8e8a4a9b10492d7 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for calling the right protocol for the ethertype.
  * This is called by both packet-eth.c (Ethernet II) and packet-llc.c (SNAP)
  *
- * $Id: ethertype.c,v 1.18 1999/11/26 04:52:36 gram Exp $
+ * $Id: ethertype.c,v 1.19 1999/11/30 23:56:35 gram Exp $
  *
  * Gilbert Ramirez <gram@verdict.uthscsa.edu>
  *
@@ -63,6 +63,9 @@ capture_ethertype(guint16 etype, int offset,
     case ETHERTYPE_IP:
       capture_ip(pd, offset, cap_len, ld);
       break;
+    case ETHERTYPE_IPX:
+      capture_ipx(pd, offset, cap_len, ld);
+      break;
     default:
       ld->other++;
       break;
index 80163375260d0e223e3e81141200a4e7ece81d2f..78a352be9e13f8d8ba6fab2507cc2c9075b077ce 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-eth.c
  * Routines for ethernet packet disassembly
  *
- * $Id: packet-eth.c,v 1.24 1999/11/20 03:27:02 gram Exp $
+ * $Id: packet-eth.c,v 1.25 1999/11/30 23:56:35 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -98,7 +98,7 @@ capture_eth(const u_char *pd, guint32 cap_len, packet_counts *ld) {
 
   switch (ethhdr_type) {
     case ETHERNET_802_3:
-      ld->other++;     /* IPX */
+      capture_ipx(pd, offset, cap_len, ld);
       break;
     case ETHERNET_802_2:
       capture_llc(pd, offset, cap_len, ld);
index 930e38ccebe3760ac4b98c3d74ca53541d068408..4e8353431a8542ebb43d664df5308e3d1e2be798 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for NetWare's IPX
  * Gilbert Ramirez <gram@verdict.uthscsa.edu>
  *
- * $Id: packet-ipx.c,v 1.38 1999/11/30 09:01:55 guy Exp $
+ * $Id: packet-ipx.c,v 1.39 1999/11/30 23:56:35 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@unicom.net>
@@ -315,6 +315,12 @@ ipxnet_to_str_punct(const guint32 ad, char punct) {
   return p;
 }
 
+void
+capture_ipx(const u_char *pd, int offset, guint32 cap_len, packet_counts *ld)
+{
+       ld->ipx++;
+}
+
 void
 dissect_ipx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
 
index d24156caaef99ef569fd5630846ba3a1120284de..e6cad93c60ba380ab9b0b21471cd7e3d6326158a 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for IEEE 802.2 LLC layer
  * Gilbert Ramirez <gramirez@tivoli.com>
  *
- * $Id: packet-llc.c,v 1.28 1999/11/16 11:42:38 guy Exp $
+ * $Id: packet-llc.c,v 1.29 1999/11/30 23:56:36 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@unicom.net>
@@ -99,7 +99,7 @@ static struct sap_info        saps[] = {
        { 0xAA, NULL,           NULL },
        { 0xBA, NULL,           NULL },
        { 0xBC, NULL,           NULL },
-       { 0xE0, NULL,           dissect_ipx },
+       { 0xE0, capture_ipx,    dissect_ipx },
        { 0xF0, capture_netbios, dissect_netbios },
        { 0xF4, NULL,           NULL },
        { 0xF5, NULL,           NULL },
index c03d2353d1857e738cbbba16a760506f1c5c87af..04a936e147a14ad8061f4af8c4a54589923d36da 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-ppp.c
  * Routines for ppp packet disassembly
  *
- * $Id: packet-ppp.c,v 1.22 1999/11/16 11:42:47 guy Exp $
+ * $Id: packet-ppp.c,v 1.23 1999/11/30 23:56:36 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -525,6 +525,9 @@ capture_ppp( const u_char *pd, guint32 cap_len, packet_counts *ld ) {
     case PPP_IP:
       capture_ip(pd, 4, cap_len, ld);
       break;
+    case PPP_IPX:
+      capture_ipx(pd, 4, cap_len, ld);
+      break;
     default:
       ld->other++;
       break;
index 228f57b926ce030d6d843c621ee2b4f331abaabc..2d51703ff53363aba2da9c43c85fa505c45d5329 100644 (file)
--- a/packet.h
+++ b/packet.h
@@ -1,7 +1,7 @@
 /* packet.h
  * Definitions for packet disassembly structures and routines
  *
- * $Id: packet.h,v 1.153 1999/11/29 19:43:25 nneul Exp $
+ * $Id: packet.h,v 1.154 1999/11/30 23:56:37 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -102,6 +102,7 @@ typedef struct _packet_counts {
   gint           ospf;
   gint           gre;
   gint           netbios;
+  gint           ipx;
   gint           other;
   gint           total;
 } packet_counts;
@@ -286,6 +287,7 @@ void capture_tr(const u_char *, guint32, packet_counts *);
 void capture_netbios(const u_char *, int, guint32, packet_counts *);
 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 *);
 
 /*
  * Routines in packet-*.c