diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-05-26 22:08:16 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-05-26 22:08:16 +0000 |
commit | 41f7100539a0193251d52608269e7f2e9fb6cecc (patch) | |
tree | 104dd2f3a370164270431bcd6da4a5924b937f67 | |
parent | 8efa4b855148d736698cbba2b14b86ed02adfc65 (diff) |
Support for SCTP in the capture dialog, from Michael Tuexen.
svn path=/trunk/; revision=2012
-rw-r--r-- | AUTHORS | 2 | ||||
-rw-r--r-- | capture.c | 13 | ||||
-rw-r--r-- | packet-ip.c | 5 | ||||
-rw-r--r-- | packet.h | 3 |
4 files changed, 18 insertions, 5 deletions
@@ -318,7 +318,7 @@ Mark Burton <markb@ordern.com> { } Michael Tuexen <Michael.Tuexen@icn.siemens.de> { - SCTP support in "ipprotostr()" + SCTP support in "ipprotostr()" and in the capture dialog } Alain Magloire <alainm@rcsm.ece.mcgill.ca> was kind enough to @@ -1,7 +1,7 @@ /* capture.c * Routines for packet capture windows * - * $Id: capture.c,v 1.105 2000/05/25 07:42:23 gram Exp $ + * $Id: capture.c,v 1.106 2000/05/26 22:08:13 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -546,7 +546,7 @@ cap_file_input_cb(gpointer data, gint source, GdkInputCondition condition) int capture(void) { - GtkWidget *cap_w, *main_vb, *count_lb, *tcp_lb, *udp_lb, *icmp_lb, + GtkWidget *cap_w, *main_vb, *count_lb, *sctp_lb, *tcp_lb, *udp_lb, *icmp_lb, *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]; @@ -583,6 +583,7 @@ capture(void) ld.max = cf.count; ld.linktype = WTAP_ENCAP_UNKNOWN; ld.sync_packets = 0; + ld.counts.sctp = 0; ld.counts.tcp = 0; ld.counts.udp = 0; ld.counts.icmp = 0; @@ -697,6 +698,10 @@ capture(void) gtk_box_pack_start(GTK_BOX(main_vb), count_lb, FALSE, FALSE, 3); gtk_widget_show(count_lb); + sctp_lb = gtk_label_new("SCTP: 0 (0.0%)"); + gtk_box_pack_start(GTK_BOX(main_vb), sctp_lb, FALSE, FALSE, 3); + gtk_widget_show(sctp_lb); + tcp_lb = gtk_label_new("TCP: 0 (0.0%)"); gtk_box_pack_start(GTK_BOX(main_vb), tcp_lb, FALSE, FALSE, 3); gtk_widget_show(tcp_lb); @@ -797,6 +802,10 @@ capture(void) sprintf(label_str, "Count: %d", ld.counts.total); gtk_label_set(GTK_LABEL(count_lb), label_str); + sprintf(label_str, "SCTP: %d (%.1f%%)", ld.counts.sctp, + pct(ld.counts.sctp, ld.counts.total)); + gtk_label_set(GTK_LABEL(sctp_lb), label_str); + sprintf(label_str, "TCP: %d (%.1f%%)", ld.counts.tcp, pct(ld.counts.tcp, ld.counts.total)); gtk_label_set(GTK_LABEL(tcp_lb), label_str); diff --git a/packet-ip.c b/packet-ip.c index ad7ec380c6..0ee1fc7208 100644 --- a/packet-ip.c +++ b/packet-ip.c @@ -1,7 +1,7 @@ /* packet-ip.c * Routines for IP and miscellaneous IP protocol packet disassembly * - * $Id: packet-ip.c,v 1.87 2000/05/24 07:51:10 guy Exp $ + * $Id: packet-ip.c,v 1.88 2000/05/26 22:08:14 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -362,6 +362,9 @@ capture_ip(const u_char *pd, int offset, packet_counts *ld) { return; } switch (pd[offset + 9]) { + case IP_PROTO_SCTP: + ld->sctp++; + break; case IP_PROTO_TCP: ld->tcp++; break; @@ -1,7 +1,7 @@ /* packet.h * Definitions for packet disassembly structures and routines * - * $Id: packet.h,v 1.188 2000/05/19 23:06:11 gram Exp $ + * $Id: packet.h,v 1.189 2000/05/26 22:08:16 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -100,6 +100,7 @@ typedef struct _column_info { #define COL_MAX_INFO_LEN 4096 typedef struct _packet_counts { + gint sctp; gint tcp; gint udp; gint icmp; |