aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/sip_stat.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2004-04-22 20:09:41 +0000
committerAnders Broman <anders.broman@ericsson.com>2004-04-22 20:09:41 +0000
commit44907a0d53b36f3637674d0dbe759b23312d6159 (patch)
treeadb830128af21536f2fc944f61c9b8fea8ceb35d /gtk/sip_stat.c
parentc05bcd7c28e60505492b151688494f91609096d6 (diff)
From Martin Mathieson
add 2 hidden display filters for SIP - namely: (1) sip.error (for all responses with code >= 300) (2) sip.resend (for all packets that appear to have been retransmitted). A field showing a count of these is shown in the SIP stats window. svn path=/trunk/; revision=10662
Diffstat (limited to 'gtk/sip_stat.c')
-rw-r--r--gtk/sip_stat.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/gtk/sip_stat.c b/gtk/sip_stat.c
index be72540daa..f0e6cf2780 100644
--- a/gtk/sip_stat.c
+++ b/gtk/sip_stat.c
@@ -1,7 +1,7 @@
/* sip_stat.c
* sip_stat 2004 Martin Mathieson
*
- * $Id: sip_stat.c,v 1.4 2004/04/12 09:48:18 ulfl Exp $
+ * $Id: sip_stat.c,v 1.5 2004/04/22 20:08:46 etxrab Exp $
* Copied from http_stat.c
*
* Ethereal - Network traffic analyzer
@@ -55,7 +55,9 @@ typedef struct _sip_stats_t {
GHashTable *hash_responses;
GHashTable *hash_requests;
guint32 packets; /* number of sip packets, including continuations */
+ guint32 resent_packets;
GtkWidget *packets_label;
+ GtkWidget *resent_label;
GtkWidget *request_box; /* container for INVITE, ... */
@@ -328,6 +330,7 @@ sipstat_reset(void *psp)
if (sp)
{
sp->packets = 0;
+ sp->resent_packets = 0;
g_hash_table_foreach(sp->hash_responses, (GHFunc)sip_reset_hash_responses, NULL);
g_hash_table_foreach(sp->hash_requests, (GHFunc)sip_reset_hash_requests, NULL);
}
@@ -343,6 +346,13 @@ sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, void
/* Total number of packets, including continuation packets */
sp->packets++;
+ /* Update resent count if flag set */
+ if (value->resend)
+ {
+ sp->resent_packets++;
+ }
+
+
/* Looking at both requests and responses */
if (value->response_code != 0)
{
@@ -445,6 +455,11 @@ sipstat_draw(void *psp)
"SIP stats (%d packets)", sp->packets);
gtk_label_set(GTK_LABEL(sp->packets_label), string_buff);
+ /* Set resend count label */
+ g_snprintf(string_buff, sizeof(string_buff),
+ "(%d resent packets)", sp->resent_packets);
+ gtk_label_set(GTK_LABEL(sp->resent_label), string_buff);
+
/* Draw responses and requests from their tables */
g_hash_table_foreach(sp->hash_responses, (GHFunc)sip_draw_hash_responses, NULL);
g_hash_table_foreach(sp->hash_requests, (GHFunc)sip_draw_hash_requests, NULL);
@@ -552,6 +567,11 @@ gtk_sipstat_init(char *optarg)
sp->packets_label = gtk_label_new("SIP stats (0 SIP packets)");
gtk_container_add(GTK_CONTAINER(main_vb), sp->packets_label);
+ sp->resent_packets = 0;
+ sp->resent_label = gtk_label_new("(0 resent packets)");
+ gtk_container_add(GTK_CONTAINER(main_vb), sp->resent_label);
+ gtk_widget_show(sp->resent_label);
+
/* Informational response frame */
informational_fr = gtk_frame_new("Informational SIP 1xx");