Added an option to limit the list to match the current display filter.
svn path=/trunk/; revision=25281
This commit is contained in:
parent
20186d4947
commit
355dfa770d
1 changed files with 47 additions and 4 deletions
|
@ -98,6 +98,7 @@ typedef struct wlan_ep {
|
||||||
|
|
||||||
static GtkWidget *wlanstat_dlg_w = NULL;
|
static GtkWidget *wlanstat_dlg_w = NULL;
|
||||||
static GtkWidget *wlanstat_pane = NULL;
|
static GtkWidget *wlanstat_pane = NULL;
|
||||||
|
static GtkWidget *wlanstat_name_lb = NULL;
|
||||||
|
|
||||||
/* used to keep track of the statistics for an entire program interface */
|
/* used to keep track of the statistics for an entire program interface */
|
||||||
typedef struct _wlan_stat_t {
|
typedef struct _wlan_stat_t {
|
||||||
|
@ -109,6 +110,7 @@ typedef struct _wlan_stat_t {
|
||||||
guint32 num_entries;
|
guint32 num_entries;
|
||||||
guint32 num_details;
|
guint32 num_details;
|
||||||
gboolean resolve_names;
|
gboolean resolve_names;
|
||||||
|
gboolean use_dfilter;
|
||||||
gboolean show_only_existing;
|
gboolean show_only_existing;
|
||||||
address selected_bssid;
|
address selected_bssid;
|
||||||
gboolean selected_bssid_valid;
|
gboolean selected_bssid_valid;
|
||||||
|
@ -136,14 +138,38 @@ wlanstat_reset (void *phs)
|
||||||
wlanstat_t* wlan_stat = (wlanstat_t *)phs;
|
wlanstat_t* wlan_stat = (wlanstat_t *)phs;
|
||||||
wlan_ep_t* list = wlan_stat->ep_list;
|
wlan_ep_t* list = wlan_stat->ep_list;
|
||||||
wlan_ep_t* tmp = NULL;
|
wlan_ep_t* tmp = NULL;
|
||||||
|
char title[256];
|
||||||
|
GString *error_string;
|
||||||
|
const char *filter = NULL;
|
||||||
|
|
||||||
if (wlanstat_dlg_w != NULL) {
|
if (wlanstat_dlg_w != NULL) {
|
||||||
char title[256];
|
|
||||||
g_snprintf (title, 255, "Wireshark: WLAN Traffic Statistics: %s",
|
g_snprintf (title, 255, "Wireshark: WLAN Traffic Statistics: %s",
|
||||||
cf_get_display_name(&cfile));
|
cf_get_display_name(&cfile));
|
||||||
gtk_window_set_title(GTK_WINDOW(wlanstat_dlg_w), title);
|
gtk_window_set_title(GTK_WINDOW(wlanstat_dlg_w), title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wlan_stat->use_dfilter) {
|
||||||
|
filter = gtk_entry_get_text(GTK_ENTRY(main_display_filter_widget));
|
||||||
|
}
|
||||||
|
|
||||||
|
error_string = set_tap_dfilter (wlan_stat, filter);
|
||||||
|
if (error_string) {
|
||||||
|
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str);
|
||||||
|
g_string_free(error_string, TRUE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wlan_stat->use_dfilter) {
|
||||||
|
if (filter && strlen(filter)) {
|
||||||
|
g_snprintf(title, 255, "WLAN Traffic Statistics - Filter: %s", filter);
|
||||||
|
} else {
|
||||||
|
g_snprintf(title, 255, "WLAN Traffic Statistics - No Filter");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
g_snprintf(title, 255, "WLAN Traffic Statistics");
|
||||||
|
}
|
||||||
|
gtk_label_set_text(GTK_LABEL(wlanstat_name_lb), title);
|
||||||
|
|
||||||
/* remove all entries from the clist */
|
/* remove all entries from the clist */
|
||||||
gtk_clist_clear (GTK_CLIST(wlan_stat->table));
|
gtk_clist_clear (GTK_CLIST(wlan_stat->table));
|
||||||
gtk_clist_clear (GTK_CLIST(wlan_stat->details));
|
gtk_clist_clear (GTK_CLIST(wlan_stat->details));
|
||||||
|
@ -710,6 +736,16 @@ wlan_resolve_toggle_dest(GtkWidget *widget, gpointer data)
|
||||||
wlanstat_draw(hs);
|
wlanstat_draw(hs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
wlan_filter_toggle_dest(GtkWidget *widget, gpointer data)
|
||||||
|
{
|
||||||
|
wlanstat_t *hs = (wlanstat_t *)data;
|
||||||
|
|
||||||
|
hs->use_dfilter = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget));
|
||||||
|
|
||||||
|
cf_retap_packets(&cfile, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
wlan_existing_toggle_dest(GtkWidget *widget, gpointer data)
|
wlan_existing_toggle_dest(GtkWidget *widget, gpointer data)
|
||||||
{
|
{
|
||||||
|
@ -1099,12 +1135,12 @@ wlanstat_dlg_create (void)
|
||||||
{
|
{
|
||||||
wlanstat_t *hs;
|
wlanstat_t *hs;
|
||||||
GString *error_string;
|
GString *error_string;
|
||||||
GtkWidget *top_label;
|
|
||||||
GtkWidget *scrolled_window;
|
GtkWidget *scrolled_window;
|
||||||
GtkWidget *bbox;
|
GtkWidget *bbox;
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *hbox;
|
GtkWidget *hbox;
|
||||||
GtkWidget *resolv_cb;
|
GtkWidget *resolv_cb;
|
||||||
|
GtkWidget *filter_cb;
|
||||||
GtkWidget *existing_cb;
|
GtkWidget *existing_cb;
|
||||||
GtkWidget *close_bt;
|
GtkWidget *close_bt;
|
||||||
GtkWidget *help_bt;
|
GtkWidget *help_bt;
|
||||||
|
@ -1120,6 +1156,7 @@ wlanstat_dlg_create (void)
|
||||||
hs->ep_list = NULL;
|
hs->ep_list = NULL;
|
||||||
hs->number_of_packets = 0;
|
hs->number_of_packets = 0;
|
||||||
hs->resolve_names = TRUE;
|
hs->resolve_names = TRUE;
|
||||||
|
hs->use_dfilter = FALSE;
|
||||||
hs->show_only_existing = FALSE;
|
hs->show_only_existing = FALSE;
|
||||||
|
|
||||||
g_snprintf (title, 255, "Wireshark: WLAN Traffic Statistics: %s",
|
g_snprintf (title, 255, "Wireshark: WLAN Traffic Statistics: %s",
|
||||||
|
@ -1131,8 +1168,8 @@ wlanstat_dlg_create (void)
|
||||||
gtk_container_add(GTK_CONTAINER(wlanstat_dlg_w), vbox);
|
gtk_container_add(GTK_CONTAINER(wlanstat_dlg_w), vbox);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER(vbox), 12);
|
gtk_container_set_border_width (GTK_CONTAINER(vbox), 12);
|
||||||
|
|
||||||
top_label = gtk_label_new ("WLAN Traffic Statistics");
|
wlanstat_name_lb = gtk_label_new ("WLAN Traffic Statistics");
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), top_label, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), wlanstat_name_lb, FALSE, FALSE, 0);
|
||||||
|
|
||||||
wlanstat_pane = gtk_vpaned_new();
|
wlanstat_pane = gtk_vpaned_new();
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), wlanstat_pane, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), wlanstat_pane, TRUE, TRUE, 0);
|
||||||
|
@ -1257,6 +1294,12 @@ wlanstat_dlg_create (void)
|
||||||
|
|
||||||
g_signal_connect(resolv_cb, "toggled", G_CALLBACK(wlan_resolve_toggle_dest), hs);
|
g_signal_connect(resolv_cb, "toggled", G_CALLBACK(wlan_resolve_toggle_dest), hs);
|
||||||
|
|
||||||
|
filter_cb = gtk_check_button_new_with_mnemonic("Limit to display filter");
|
||||||
|
gtk_container_add(GTK_CONTAINER(hbox), filter_cb);
|
||||||
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(filter_cb), FALSE);
|
||||||
|
gtk_tooltips_set_tip(tooltips, filter_cb, "Limit the list to entries matching the current display filter.", NULL);
|
||||||
|
g_signal_connect(filter_cb, "toggled", G_CALLBACK(wlan_filter_toggle_dest), hs);
|
||||||
|
|
||||||
existing_cb = gtk_check_button_new_with_mnemonic("Only show existing networks");
|
existing_cb = gtk_check_button_new_with_mnemonic("Only show existing networks");
|
||||||
gtk_container_add(GTK_CONTAINER(hbox), existing_cb);
|
gtk_container_add(GTK_CONTAINER(hbox), existing_cb);
|
||||||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(existing_cb), FALSE);
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(existing_cb), FALSE);
|
||||||
|
|
Loading…
Reference in a new issue