#include <epan/tap.h>
#include <epan/dissectors/packet-gtp.h>
-#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
#include "../file.h"
-#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_utils.h"
#include "gtk/dlg_utils.h"
-#include "gtk/filter_dlg.h"
#include "gtk/service_response_time_table.h"
-#include "gtk/tap_dfilter_dlg.h"
+#include "gtk/tap_param_dlg.h"
#include "gtk/gtkglobals.h"
#include "gtk/main.h"
{
const gtp_msg_hash_t *gtp=psi;
gtpstat_t *fs=(gtpstat_t *)pgtp;
- int index=0;
+ int idx=0;
/* we are only interested in reply packets */
if(gtp->is_request){
}
/* Only use the commands we know how to handle, this is not a comprehensive list */
- /* Redoing the message indexing is bit reduntant,*/
- /* but using message type as such would yield a long gtp_srt_table.*/
- /* Only a fragtion of the messages are matchable req/resp pairs,*/
- /* it's just doesn't feel feasible*/
+ /* Redoing the message indexing is bit reduntant, */
+ /* but using message type as such would yield a long gtp_srt_table. */
+ /* Only a fraction of the messages are matchable req/resp pairs, */
+ /* it just doesn't feel feasible. */
switch(gtp->msgtype){
- case GTP_MSG_ECHO_REQ: index=0;
- break;
- case GTP_MSG_CREATE_PDP_REQ: index=1;
- break;
- case GTP_MSG_UPDATE_PDP_REQ: index=2;
- break;
- case GTP_MSG_DELETE_PDP_REQ: index=3;
- break;
+ case GTP_MSG_ECHO_REQ: idx=0;
+ break;
+ case GTP_MSG_CREATE_PDP_REQ: idx=1;
+ break;
+ case GTP_MSG_UPDATE_PDP_REQ: idx=2;
+ break;
+ case GTP_MSG_DELETE_PDP_REQ: idx=3;
+ break;
default:
return 0;
}
- add_srt_table_data(&fs->gtp_srt_table, index, >p->req_time, pinfo);
+ add_srt_table_data(&fs->gtp_srt_table, idx, >p->req_time, pinfo);
return 1;
}
gtp=g_malloc(sizeof(gtpstat_t));
- gtp->win=window_new(GTK_WINDOW_TOPLEVEL, "gtp-stat");
+ gtp->win = dlg_window_new("gtp-stat"); /* transient_for top_level */
+ gtk_window_set_destroy_with_parent (GTK_WINDOW(gtp->win), TRUE);
+
gtk_window_set_default_size(GTK_WINDOW(gtp->win), 550, 400);
gtpstat_set_title(gtp);
init_srt_table_row(>p->gtp_srt_table, 2, "Update PDP context");
init_srt_table_row(>p->gtp_srt_table, 3, "Delete PDP context");
- error_string=register_tap_listener("gtp", gtp, filter, gtpstat_reset, gtpstat_packet, gtpstat_draw);
+ error_string=register_tap_listener("gtp", gtp, filter, 0, gtpstat_reset, gtpstat_packet, gtpstat_draw);
if(error_string){
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str);
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
g_string_free(error_string, TRUE);
g_free(gtp);
return;
gtk_widget_show_all(gtp->win);
window_present(gtp->win);
- cf_retap_packets(&cfile, FALSE);
+ cf_retap_packets(&cfile);
gdk_window_raise(gtp->win->window);
}
-static tap_dfilter_dlg gtp_stat_dlg = {
+static tap_param gtp_stat_params[] = {
+ { PARAM_FILTER, "Filter", NULL }
+};
+
+static tap_param_dlg gtp_stat_dlg = {
"GTP Control Plane Response Time Statistics",
"gtp",
gtk_gtpstat_init,
- -1
+ -1,
+ G_N_ELEMENTS(gtp_stat_params),
+ gtp_stat_params
};
void