Add ICMP to the set of packet types counted in the window shown while a

capture is in progress.

svn path=/trunk/; revision=491
This commit is contained in:
Guy Harris 1999-08-14 23:47:20 +00:00
parent 499f907269
commit 9e58014e7f
3 changed files with 17 additions and 4 deletions

View File

@ -1,7 +1,7 @@
/* capture.c
* Routines for packet capture windows
*
* $Id: capture.c,v 1.46 1999/08/10 20:13:21 guy Exp $
* $Id: capture.c,v 1.47 1999/08/14 23:47:19 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -417,7 +417,7 @@ capture_prep_close_cb(GtkWidget *close_bt, gpointer parent_w)
void
capture(void) {
GtkWidget *cap_w, *main_vb, *count_lb, *tcp_lb, *udp_lb,
GtkWidget *cap_w, *main_vb, *count_lb, *tcp_lb, *udp_lb, *icmp_lb,
*ospf_lb, *gre_lb, *netbios_lb, *other_lb, *stop_bt;
pcap_t *pch;
gchar err_str[PCAP_ERRBUF_SIZE], label_str[32];
@ -433,6 +433,7 @@ capture(void) {
ld.sync_packets = 0;
ld.counts.tcp = 0;
ld.counts.udp = 0;
ld.counts.icmp = 0;
ld.counts.ospf = 0;
ld.counts.gre = 0;
ld.counts.netbios = 0;
@ -516,6 +517,10 @@ capture(void) {
gtk_box_pack_start(GTK_BOX(main_vb), udp_lb, FALSE, FALSE, 3);
gtk_widget_show(udp_lb);
icmp_lb = gtk_label_new("ICMP: 0 (0.0%)");
gtk_box_pack_start(GTK_BOX(main_vb), icmp_lb, FALSE, FALSE, 3);
gtk_widget_show(icmp_lb);
ospf_lb = gtk_label_new("OSPF: 0 (0.0%)");
gtk_box_pack_start(GTK_BOX(main_vb), ospf_lb, FALSE, FALSE, 3);
gtk_widget_show(ospf_lb);
@ -568,6 +573,10 @@ capture(void) {
pct(ld.counts.udp, ld.counts.total));
gtk_label_set(GTK_LABEL(udp_lb), label_str);
sprintf(label_str, "ICMP: %d (%.1f%%)", ld.counts.icmp,
pct(ld.counts.icmp, ld.counts.total));
gtk_label_set(GTK_LABEL(icmp_lb), label_str);
sprintf(label_str, "OSPF: %d (%.1f%%)", ld.counts.ospf,
pct(ld.counts.ospf, ld.counts.total));
gtk_label_set(GTK_LABEL(ospf_lb), label_str);

View File

@ -1,7 +1,7 @@
/* packet-ip.c
* Routines for IP and miscellaneous IP protocol packet disassembly
*
* $Id: packet-ip.c,v 1.35 1999/08/10 04:57:47 guy Exp $
* $Id: packet-ip.c,v 1.36 1999/08/14 23:47:18 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -241,6 +241,9 @@ capture_ip(const u_char *pd, int offset, guint32 cap_len, packet_counts *ld) {
case IP_PROTO_UDP:
ld->udp++;
break;
case IP_PROTO_ICMP:
ld->icmp++;
break;
case IP_PROTO_OSPF:
ld->ospf++;
break;

View File

@ -1,7 +1,7 @@
/* packet.h
* Definitions for packet disassembly structures and routines
*
* $Id: packet.h,v 1.82 1999/08/14 04:23:22 guy Exp $
* $Id: packet.h,v 1.83 1999/08/14 23:47:20 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -95,6 +95,7 @@ typedef struct _column_info {
typedef struct _packet_counts {
gint tcp;
gint udp;
gint icmp;
gint ospf;
gint gre;
gint netbios;