#include <epan/dissectors/packet-wsp.h>
#include "../simple_dialog.h"
-#include "../register.h"
#include "../globals.h"
#include "../stat_menu.h"
/* Maybe we should display the hexadecimal value ? */
- /* g_snprintf(string_buff, 256, "%s (0X%x)", data->name, *key); */
+ /* g_snprintf(string_buff, sizeof(string_buff), "%s (0X%x)", data->name, *key); */
tmp = gtk_label_new( data->name /* string_buff */ );
gtk_table_attach_defaults(GTK_TABLE(data->sp->table_status_code), tmp, x, x+1, y, y+1);
gtk_label_set_justify(GTK_LABEL(tmp), GTK_JUSTIFY_LEFT);
gtk_widget_show(tmp);
- g_snprintf( string_buff, 256, "%9d", data->packets );
+ g_snprintf( string_buff, sizeof(string_buff), "%9d", data->packets );
data->widget = gtk_label_new( string_buff );
gtk_table_attach_defaults(GTK_TABLE(data->sp->table_status_code), data->widget, x+1, x+2, y, y+1);
gtk_label_set_justify(GTK_LABEL(data->widget), GTK_JUSTIFY_LEFT);
data->sp->index++;
} else {
/* Just update the label string */
- g_snprintf( string_buff, 256, "%9d", data->packets );
+ g_snprintf( string_buff, sizeof(string_buff), "%9d", data->packets );
gtk_label_set_text( GTK_LABEL(data->widget), string_buff);
}
}
{
wspstat_t *sp=psp;
const wsp_info_value_t *value=pri;
- gint index = pdut2index(value->pdut);
+ gint idx = pdut2index(value->pdut);
int retour=0;
if (value->status_code != 0) {
- if (index!=0) {
- sp->pdu_stats[ index ].packets++;
+ if (idx!=0) {
+ sp->pdu_stats[ idx ].packets++;
retour = 1;
}
return retour;
wspstat_t *sp=psp;
guint32 i;
char str[256];
- guint index;
+ guint idx;
for(i=1;i<=sp->num_pdus ; i++)
{
- g_snprintf(str, 256, "%9d", sp->pdu_stats[i ].packets);
+ g_snprintf(str, sizeof(str), "%9d", sp->pdu_stats[i ].packets);
gtk_label_set_text( GTK_LABEL(sp->pdu_stats[i].widget), str);
}
- index=sp->index;
+ idx=sp->index;
g_hash_table_foreach( sp->hash, (GHFunc) wsp_draw_statuscode, NULL );
- if (index != sp->index){
+ if (idx != sp->index){
/* We have inserted a new entry corresponding to a status code ,
* let's resize the table */
gtk_table_resize ( GTK_TABLE(sp->table_status_code), sp->index % 2 , 4);
}
static void
-add_table_entry(wspstat_t *sp, const char *str, int x, int y, int index)
+add_table_entry(wspstat_t *sp, const char *str, int x, int y, int idx)
{
GtkWidget *tmp;
gtk_table_attach_defaults(GTK_TABLE(sp->table_pdu_types), tmp, x, x+1, y, y+1);
gtk_label_set_justify(GTK_LABEL(tmp), GTK_JUSTIFY_LEFT);
gtk_widget_show(tmp);
- if (index != 0) {
- sp->pdu_stats [index] .widget = GTK_LABEL( tmp ) ;
+ if (idx != 0) {
+ sp->pdu_stats [idx] .widget = GTK_LABEL( tmp ) ;
}
}
x=2;
}
/* Maybe we should display the hexadecimal value ? */
- /* g_snprintf(buffer, 50, "%s (0X%x)", match_strval( index2pdut( i ), vals_pdu_type), index2pdut(i) );*/
+ /* g_snprintf(buffer, sizeof(buffer), "%s (0X%x)", match_strval( index2pdut( i ), vals_pdu_type), index2pdut(i) );*/
add_table_entry( sp,
match_strval(index2pdut(i), vals_pdu_type), /* or buffer, */
x,
}
sp = g_malloc( sizeof(wspstat_t) );
- sp->win = window_new(GTK_WINDOW_TOPLEVEL, "wsp-stat");
+ sp->win = dlg_window_new("wsp-stat"); /* transient_for top_level */
+ gtk_window_set_destroy_with_parent (GTK_WINDOW(sp->win), TRUE);
+
sp->hash = g_hash_table_new( g_int_hash, g_int_equal);
for (i=0 ; vals_status[i].strptr ; i++ )
{
"wsp",
sp,
filter,
+ 0,
wspstat_reset,
wspstat_packet,
wspstat_draw);
gtk_widget_show_all(sp->win);
window_present(sp->win);
- cf_retap_packets(&cfile, FALSE);
+ cf_retap_packets(&cfile);
gdk_window_raise(sp->win->window);
}
void
register_tap_listener_gtkwspstat(void)
{
- register_dfilter_stat(&wsp_stat_dlg, "WAP-WSP",
+ register_dfilter_stat(&wsp_stat_dlg, "_WAP-WSP",
REGISTER_STAT_GROUP_TELEPHONY);
}