aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1999-11-30 23:56:37 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1999-11-30 23:56:37 +0000
commit3fa90ff0cf66d3743759b5685974de73c1dfd04e (patch)
tree3dc82c8e5623e8a0eb38ef65e8f7c607f1fd05a5
parentada449cf1bfb23e336e2ba5ce848bca48a3ee07d (diff)
Add IPX to packet stats during capture.
svn path=/trunk/; revision=1173
-rw-r--r--capture.c13
-rw-r--r--ethertype.c5
-rw-r--r--packet-eth.c4
-rw-r--r--packet-ipx.c8
-rw-r--r--packet-llc.c4
-rw-r--r--packet-ppp.c5
-rw-r--r--packet.h4
7 files changed, 33 insertions, 10 deletions
diff --git a/capture.c b/capture.c
index cd226cc1c2..512e4e27b9 100644
--- 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);
diff --git a/ethertype.c b/ethertype.c
index f5d7fbf608..21b774daeb 100644
--- a/ethertype.c
+++ b/ethertype.c
@@ -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;
diff --git a/packet-eth.c b/packet-eth.c
index 8016337526..78a352be9e 100644
--- a/packet-eth.c
+++ b/packet-eth.c
@@ -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);
diff --git a/packet-ipx.c b/packet-ipx.c
index 930e38cceb..4e8353431a 100644
--- a/packet-ipx.c
+++ b/packet-ipx.c
@@ -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>
@@ -316,6 +316,12 @@ ipxnet_to_str_punct(const guint32 ad, char punct) {
}
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) {
proto_tree *ipx_tree;
diff --git a/packet-llc.c b/packet-llc.c
index d24156caae..e6cad93c60 100644
--- a/packet-llc.c
+++ b/packet-llc.c
@@ -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 },
diff --git a/packet-ppp.c b/packet-ppp.c
index c03d2353d1..04a936e147 100644
--- a/packet-ppp.c
+++ b/packet-ppp.c
@@ -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;
diff --git a/packet.h b/packet.h
index 228f57b926..2d51703ff5 100644
--- 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