diff options
author | Michael Mann <mmann78@netscape.net> | 2017-09-22 21:57:50 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-09-23 03:42:14 +0000 |
commit | e7cc0279ab9a11319de521dfdf25057d1ff7ab7f (patch) | |
tree | 3607326ca0c45da15f84cb2f7e60c9042b254eb1 | |
parent | 3c8750dfb3b9cef1af2e29159782b443dfcd32ff (diff) |
Have sequence analysis properly use filters from taps.
Sequence analysis has its own "filtering" system that required its
tap functions to look for some "filter flags". register_tap_listener()
already comes with a filter argument, so use that to simplify logic
of tap functions in dissectors.
Also have Qt GUI for Flow Graph look like other dialogs that have a
"Limit to display filter" checkbox.
Change-Id: I91d9d9599309786892f5b50c98692e52651e7174
Reviewed-on: https://code.wireshark.org/review/23659
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r-- | epan/dissectors/packet-frame.c | 27 | ||||
-rw-r--r-- | epan/dissectors/packet-icmp.c | 39 | ||||
-rw-r--r-- | epan/dissectors/packet-icmpv6.c | 39 | ||||
-rw-r--r-- | epan/dissectors/packet-lbmc.c | 167 | ||||
-rw-r--r-- | epan/dissectors/packet-tcp.c | 49 | ||||
-rw-r--r-- | epan/sequence_analysis.h | 1 | ||||
-rw-r--r-- | sharkd_session.c | 1 | ||||
-rw-r--r-- | ui/cli/tap-flow.c | 2 | ||||
-rw-r--r-- | ui/gtk/flow_graph.c | 14 | ||||
-rw-r--r-- | ui/qt/sequence_dialog.cpp | 17 | ||||
-rw-r--r-- | ui/qt/sequence_dialog.h | 2 | ||||
-rw-r--r-- | ui/qt/sequence_dialog.ui | 19 |
12 files changed, 172 insertions, 205 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index 4312af585b..9310bf7c72 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -168,28 +168,25 @@ static gboolean frame_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *dummy _U_) { seq_analysis_info_t *sainfo = (seq_analysis_info_t *) ptr; + seq_analysis_item_t *sai = sequence_analysis_create_sai_with_addresses(pinfo, sainfo); - if ((sainfo->all_packets) || (pinfo->fd->flags.passed_dfilter == 1)) { + if (!sai) + return FALSE; - seq_analysis_item_t *sai = sequence_analysis_create_sai_with_addresses(pinfo, sainfo); - if (!sai) - return FALSE; + sai->frame_number = pinfo->num; - sai->frame_number = pinfo->num; + sequence_analysis_use_color_filter(pinfo, sai); - sequence_analysis_use_color_filter(pinfo, sai); + sai->port_src=pinfo->srcport; + sai->port_dst=pinfo->destport; - sai->port_src=pinfo->srcport; - sai->port_dst=pinfo->destport; + sequence_analysis_use_col_info_as_label_comment(pinfo, sai); - sequence_analysis_use_col_info_as_label_comment(pinfo, sai); + sai->line_style = 1; + sai->conv_num = 0; + sai->display = TRUE; - sai->line_style = 1; - sai->conv_num = 0; - sai->display = TRUE; - - g_queue_push_tail(sainfo->items, sai); - } + g_queue_push_tail(sainfo->items, sai); return TRUE; } diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c index 5988da0b8b..bddf5cf1d2 100644 --- a/epan/dissectors/packet-icmp.c +++ b/epan/dissectors/packet-icmp.c @@ -380,37 +380,34 @@ static gboolean icmp_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *dummy _U_) { seq_analysis_info_t *sainfo = (seq_analysis_info_t *) ptr; + seq_analysis_item_t *sai = sequence_analysis_create_sai_with_addresses(pinfo, sainfo); - if ((sainfo->all_packets) || (pinfo->fd->flags.passed_dfilter == 1)) { + if (!sai) + return FALSE; - seq_analysis_item_t *sai = sequence_analysis_create_sai_with_addresses(pinfo, sainfo); - if (!sai) - return FALSE; - - sai->frame_number = pinfo->num; + sai->frame_number = pinfo->num; - sequence_analysis_use_color_filter(pinfo, sai); + sequence_analysis_use_color_filter(pinfo, sai); - sai->port_src=pinfo->srcport; - sai->port_dst=pinfo->destport; + sai->port_src=pinfo->srcport; + sai->port_dst=pinfo->destport; - sequence_analysis_use_col_info_as_label_comment(pinfo, sai); + sequence_analysis_use_col_info_as_label_comment(pinfo, sai); - if (pinfo->ptype == PT_NONE) { - icmp_info_t *p_icmp_info = (icmp_info_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_icmp, 0); + if (pinfo->ptype == PT_NONE) { + icmp_info_t *p_icmp_info = (icmp_info_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_icmp, 0); - if (p_icmp_info != NULL) { - sai->port_src = 0; - sai->port_dst = p_icmp_info->type * 256 + p_icmp_info->code; - } + if (p_icmp_info != NULL) { + sai->port_src = 0; + sai->port_dst = p_icmp_info->type * 256 + p_icmp_info->code; } + } - sai->line_style = 1; - sai->conv_num = 0; - sai->display = TRUE; + sai->line_style = 1; + sai->conv_num = 0; + sai->display = TRUE; - g_queue_push_tail(sainfo->items, sai); - } + g_queue_push_tail(sainfo->items, sai); return TRUE; } diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c index 10ef72d888..5a948727c1 100644 --- a/epan/dissectors/packet-icmpv6.c +++ b/epan/dissectors/packet-icmpv6.c @@ -1309,37 +1309,34 @@ static gboolean icmpv6_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *dummy _U_) { seq_analysis_info_t *sainfo = (seq_analysis_info_t *) ptr; + seq_analysis_item_t *sai = sequence_analysis_create_sai_with_addresses(pinfo, sainfo); - if ((sainfo->all_packets) || (pinfo->fd->flags.passed_dfilter == 1)) { + if (!sai) + return FALSE; - seq_analysis_item_t *sai = sequence_analysis_create_sai_with_addresses(pinfo, sainfo); - if (!sai) - return FALSE; + sai->frame_number = pinfo->num; - sai->frame_number = pinfo->num; + sequence_analysis_use_color_filter(pinfo, sai); - sequence_analysis_use_color_filter(pinfo, sai); + sai->port_src=pinfo->srcport; + sai->port_dst=pinfo->destport; - sai->port_src=pinfo->srcport; - sai->port_dst=pinfo->destport; + sequence_analysis_use_col_info_as_label_comment(pinfo, sai); - sequence_analysis_use_col_info_as_label_comment(pinfo, sai); + if (pinfo->ptype == PT_NONE) { + icmp_info_t *p_icmp_info = (icmp_info_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_icmpv6, 0); - if (pinfo->ptype == PT_NONE) { - icmp_info_t *p_icmp_info = (icmp_info_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_icmpv6, 0); - - if (p_icmp_info != NULL) { - sai->port_src = 0; - sai->port_dst = p_icmp_info->type * 256 + p_icmp_info->code; - } + if (p_icmp_info != NULL) { + sai->port_src = 0; + sai->port_dst = p_icmp_info->type * 256 + p_icmp_info->code; } + } - sai->line_style = 1; - sai->conv_num = 0; - sai->display = TRUE; + sai->line_style = 1; + sai->conv_num = 0; + sai->display = TRUE; - g_queue_push_tail(sainfo->items, sai); - } + g_queue_push_tail(sainfo->items, sai); return TRUE; } diff --git a/epan/dissectors/packet-lbmc.c b/epan/dissectors/packet-lbmc.c index bdf5318da2..3aba18cfc1 100644 --- a/epan/dissectors/packet-lbmc.c +++ b/epan/dissectors/packet-lbmc.c @@ -6088,119 +6088,116 @@ lbm_uim_seq_analysis_packet(void *ptr, packet_info *pinfo, epan_dissect_t *edt _ char time_str[COL_MAX_LEN]; int rc; - if ((sainfo->all_packets)||(pinfo->fd->flags.passed_dfilter==1)) + if (stream_info->endpoint_a.type != stream_info->endpoint_b.type) { - if (stream_info->endpoint_a.type != stream_info->endpoint_b.type) + return TRUE; + } + if (stream_info->endpoint_a.type == lbm_uim_instance_stream) + { + rc = memcmp((void *)stream_info->endpoint_a.stream_info.ctxinst.ctxinst, + (void *)stream_info->endpoint_b.stream_info.ctxinst.ctxinst, + LBM_CONTEXT_INSTANCE_BLOCK_SZ); + if (rc <= 0) { - return (1); + swap_endpoints = FALSE; } - if (stream_info->endpoint_a.type == lbm_uim_instance_stream) + else { - rc = memcmp((void *)stream_info->endpoint_a.stream_info.ctxinst.ctxinst, - (void *)stream_info->endpoint_b.stream_info.ctxinst.ctxinst, - LBM_CONTEXT_INSTANCE_BLOCK_SZ); - if (rc <= 0) - { - swap_endpoints = FALSE; - } - else - { - swap_endpoints = TRUE; - } + swap_endpoints = TRUE; + } + } + else + { + if (stream_info->endpoint_a.stream_info.dest.domain < stream_info->endpoint_b.stream_info.dest.domain) + { + swap_endpoints = FALSE; + } + else if (stream_info->endpoint_a.stream_info.dest.domain > stream_info->endpoint_b.stream_info.dest.domain) + { + swap_endpoints = TRUE; } else { - if (stream_info->endpoint_a.stream_info.dest.domain < stream_info->endpoint_b.stream_info.dest.domain) + int compare; + + compare = cmp_address(&(stream_info->endpoint_a.stream_info.dest.addr), &(stream_info->endpoint_b.stream_info.dest.addr)); + if (compare < 0) { swap_endpoints = FALSE; } - else if (stream_info->endpoint_a.stream_info.dest.domain > stream_info->endpoint_b.stream_info.dest.domain) + else if (compare > 0) { swap_endpoints = TRUE; } else { - int compare; - - compare = cmp_address(&(stream_info->endpoint_a.stream_info.dest.addr), &(stream_info->endpoint_b.stream_info.dest.addr)); - if (compare < 0) + if (stream_info->endpoint_a.stream_info.dest.port <= stream_info->endpoint_b.stream_info.dest.port) { swap_endpoints = FALSE; } - else if (compare > 0) - { - swap_endpoints = TRUE; - } else { - if (stream_info->endpoint_a.stream_info.dest.port <= stream_info->endpoint_b.stream_info.dest.port) - { - swap_endpoints = FALSE; - } - else - { - swap_endpoints = TRUE; - } + swap_endpoints = TRUE; } } } - if (swap_endpoints == FALSE) - { - epa = stream_info->endpoint_a; - epb = stream_info->endpoint_b; - } - else - { - epb = stream_info->endpoint_a; - epa = stream_info->endpoint_b; - } + } + if (swap_endpoints == FALSE) + { + epa = stream_info->endpoint_a; + epb = stream_info->endpoint_b; + } + else + { + epb = stream_info->endpoint_a; + epa = stream_info->endpoint_b; + } - sai = g_new0(seq_analysis_item_t, 1); - copy_address(&(sai->src_addr), &(pinfo->src)); - copy_address(&(sai->dst_addr), &(pinfo->dst)); - sai->frame_number = pinfo->num; - sai->port_src = pinfo->srcport; - sai->port_dst = pinfo->destport; + sai = g_new0(seq_analysis_item_t, 1); + copy_address(&(sai->src_addr), &(pinfo->src)); + copy_address(&(sai->dst_addr), &(pinfo->dst)); + sai->frame_number = pinfo->num; + sai->port_src = pinfo->srcport; + sai->port_dst = pinfo->destport; - if (stream_info->description == NULL) - { - sai->frame_label = g_strdup_printf("(%" G_GUINT32_FORMAT ")", stream_info->sqn); - } - else - { - sai->frame_label = g_strdup_printf("%s (%" G_GUINT32_FORMAT ")", stream_info->description, stream_info->sqn); - } - if (epa.type == lbm_uim_instance_stream) - { - ctxinst1 = bytes_to_str(pinfo->pool, epa.stream_info.ctxinst.ctxinst, sizeof(epa.stream_info.ctxinst.ctxinst)); - ctxinst2 = bytes_to_str(pinfo->pool, epb.stream_info.ctxinst.ctxinst, sizeof(epb.stream_info.ctxinst.ctxinst)); - sai->comment = g_strdup_printf("%s <-> %s [%" G_GUINT64_FORMAT "]", - ctxinst1, - ctxinst2, - stream_info->channel); - } - else - { - sai->comment = g_strdup_printf("%" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " <-> %" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " [%" G_GUINT64_FORMAT "]", - epa.stream_info.dest.domain, - address_to_str(pinfo->pool, &(epa.stream_info.dest.addr)), - epa.stream_info.dest.port, - epb.stream_info.dest.domain, - address_to_str(pinfo->pool, &(epb.stream_info.dest.addr)), - epb.stream_info.dest.port, - stream_info->channel); - } + if (stream_info->description == NULL) + { + sai->frame_label = g_strdup_printf("(%" G_GUINT32_FORMAT ")", stream_info->sqn); + } + else + { + sai->frame_label = g_strdup_printf("%s (%" G_GUINT32_FORMAT ")", stream_info->description, stream_info->sqn); + } + if (epa.type == lbm_uim_instance_stream) + { + ctxinst1 = bytes_to_str(pinfo->pool, epa.stream_info.ctxinst.ctxinst, sizeof(epa.stream_info.ctxinst.ctxinst)); + ctxinst2 = bytes_to_str(pinfo->pool, epb.stream_info.ctxinst.ctxinst, sizeof(epb.stream_info.ctxinst.ctxinst)); + sai->comment = g_strdup_printf("%s <-> %s [%" G_GUINT64_FORMAT "]", + ctxinst1, + ctxinst2, + stream_info->channel); + } + else + { + sai->comment = g_strdup_printf("%" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " <-> %" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " [%" G_GUINT64_FORMAT "]", + epa.stream_info.dest.domain, + address_to_str(pinfo->pool, &(epa.stream_info.dest.addr)), + epa.stream_info.dest.port, + epb.stream_info.dest.domain, + address_to_str(pinfo->pool, &(epb.stream_info.dest.addr)), + epb.stream_info.dest.port, + stream_info->channel); + } - /* Fill in the timestamps */ - set_fd_time(pinfo->epan, pinfo->fd, time_str); - sai->time_str = g_strdup(time_str); + /* Fill in the timestamps */ + set_fd_time(pinfo->epan, pinfo->fd, time_str); + sai->time_str = g_strdup(time_str); - sai->conv_num = (guint16)LBM_CHANNEL_ID(stream_info->channel); - sai->display = TRUE; - sai->line_style = 1; + sai->conv_num = (guint16)LBM_CHANNEL_ID(stream_info->channel); + sai->display = TRUE; + sai->line_style = 1; - g_queue_push_tail(sainfo->items, sai); - } + g_queue_push_tail(sainfo->items, sai); return TRUE; } diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index 4c6bded5ff..42e85b1409 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -869,41 +869,38 @@ tcp_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, { seq_analysis_info_t *sainfo = (seq_analysis_info_t *) ptr; const struct tcpheader *tcph = (const struct tcpheader *)tcp_info; + const char* flags; + seq_analysis_item_t *sai = sequence_analysis_create_sai_with_addresses(pinfo, sainfo); - if ((sainfo->all_packets)||(pinfo->fd->flags.passed_dfilter==1)){ - const char* flags; - seq_analysis_item_t *sai = sequence_analysis_create_sai_with_addresses(pinfo, sainfo); - - if (!sai) - return FALSE; + if (!sai) + return FALSE; - sai->frame_number = pinfo->num; + sai->frame_number = pinfo->num; - sai->port_src=pinfo->srcport; - sai->port_dst=pinfo->destport; + sai->port_src=pinfo->srcport; + sai->port_dst=pinfo->destport; - flags = tcp_flags_to_str(NULL, tcph); + flags = tcp_flags_to_str(NULL, tcph); - if ((tcph->th_have_seglen)&&(tcph->th_seglen!=0)){ - sai->frame_label = g_strdup_printf("%s - Len: %u",flags, tcph->th_seglen); - } - else{ - sai->frame_label = g_strdup(flags); - } + if ((tcph->th_have_seglen)&&(tcph->th_seglen!=0)){ + sai->frame_label = g_strdup_printf("%s - Len: %u",flags, tcph->th_seglen); + } + else{ + sai->frame_label = g_strdup(flags); + } - wmem_free(NULL, (void*)flags); + wmem_free(NULL, (void*)flags); - if (tcph->th_flags & TH_ACK) - sai->comment = g_strdup_printf("Seq = %u Ack = %u",tcph->th_seq, tcph->th_ack); - else - sai->comment = g_strdup_printf("Seq = %u",tcph->th_seq); + if (tcph->th_flags & TH_ACK) + sai->comment = g_strdup_printf("Seq = %u Ack = %u",tcph->th_seq, tcph->th_ack); + else + sai->comment = g_strdup_printf("Seq = %u",tcph->th_seq); - sai->line_style = 1; - sai->conv_num = (guint16) tcph->th_stream; - sai->display = TRUE; + sai->line_style = 1; + sai->conv_num = (guint16) tcph->th_stream; + sai->display = TRUE; - g_queue_push_tail(sainfo->items, sai); - } + g_queue_push_tail(sainfo->items, sai); return TRUE; } diff --git a/epan/sequence_analysis.h b/epan/sequence_analysis.h index 64b0a31be3..34d3db7334 100644 --- a/epan/sequence_analysis.h +++ b/epan/sequence_analysis.h @@ -69,7 +69,6 @@ typedef struct _seq_analysis_item { /** defines the graph analysis structure */ typedef struct _seq_analysis_info { const char* name; /**< Name of sequence analysis */ - gboolean all_packets; /**< all packets vs only displayed */ gboolean any_addr; /**< any addr (DL+net) vs net-only */ int nconv; /**< number of conversations in the list */ GQueue* items; /**< list of seq_analysis_info_t */ diff --git a/sharkd_session.c b/sharkd_session.c index 121a459a5f..be5601737f 100644 --- a/sharkd_session.c +++ b/sharkd_session.c @@ -2173,7 +2173,6 @@ sharkd_session_process_tap(char *buf, const jsmntok_t *tokens, int count) graph_analysis = sequence_analysis_info_new(); graph_analysis->name = tok_tap + 5; - graph_analysis->all_packets = TRUE; /* TODO, make configurable */ graph_analysis->any_addr = FALSE; diff --git a/ui/cli/tap-flow.c b/ui/cli/tap-flow.c index 8915df15af..57ffcd32a5 100644 --- a/ui/cli/tap-flow.c +++ b/ui/cli/tap-flow.c @@ -103,8 +103,6 @@ flow_init(const char *opt_argp, void *userdata) filter = opt_argp + 1; } - flow_info->all_packets = TRUE; - sequence_analysis_list_free(flow_info); errp = register_tap_listener(sequence_analysis_get_tap_listener_name(analysis), flow_info, filter, sequence_analysis_get_tap_flags(analysis), diff --git a/ui/gtk/flow_graph.c b/ui/gtk/flow_graph.c index 2214bf7947..018138efaf 100644 --- a/ui/gtk/flow_graph.c +++ b/ui/gtk/flow_graph.c @@ -37,11 +37,13 @@ #include "ui/gtk/main.h" #include "ui/gtk/gui_stat_menu.h" #include "ui/gtk/old-gtk-compat.h" +#include "ui/gtk/gtkglobals.h" void register_tap_listener_flow_graph(void); static seq_analysis_info_t *graph_analysis = NULL; static graph_analysis_data_t *graph_analysis_data = NULL; +static const char* display_filter = NULL; static GtkWidget *flow_graph_dlg = NULL; @@ -57,7 +59,7 @@ static void flow_graph_data_init(void) { graph_analysis = sequence_analysis_info_new(); graph_analysis->name = "any"; - graph_analysis->all_packets = TRUE; + display_filter = NULL; } @@ -111,7 +113,7 @@ toggle_select_all(GtkWidget *widget _U_, gpointer user_data _U_) { /* is the button now active? */ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(select_all_rb))) { - graph_analysis->all_packets = TRUE; + display_filter = NULL; } } @@ -121,7 +123,7 @@ toggle_select_displayed(GtkWidget *widget _U_, gpointer user_data _U_) { /* is the button now active? */ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(select_displayed_rb))) { - graph_analysis->all_packets = FALSE; + display_filter = gtk_entry_get_text(GTK_ENTRY(main_display_filter_widget)); } } @@ -156,7 +158,7 @@ flow_graph_on_ok(GtkButton *button _U_, gpointer user_data) if (analysis != NULL) { - register_tap_listener(sequence_analysis_get_tap_listener_name(analysis), graph_analysis, NULL, sequence_analysis_get_tap_flags(analysis), + register_tap_listener(sequence_analysis_get_tap_listener_name(analysis), graph_analysis, display_filter, sequence_analysis_get_tap_flags(analysis), NULL, sequence_analysis_get_packet_func(analysis), NULL); cf_retap_packets(&cfile); @@ -248,7 +250,7 @@ flow_graph_dlg_create(void) g_signal_connect(select_all_rb, "toggled", G_CALLBACK(toggle_select_all), NULL); ws_gtk_grid_attach_extended(GTK_GRID(range_grid), select_all_rb, 0, 0, 1, 1, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); - if (graph_analysis->all_packets) { + if (display_filter == NULL) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(select_all_rb),TRUE); } gtk_widget_show(select_all_rb); @@ -260,7 +262,7 @@ flow_graph_dlg_create(void) g_signal_connect(select_displayed_rb, "toggled", G_CALLBACK(toggle_select_displayed), NULL); ws_gtk_grid_attach_extended(GTK_GRID(range_grid), select_displayed_rb, 0, 1, 1, 1, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); - if (!graph_analysis->all_packets) { + if (display_filter != NULL) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(select_displayed_rb),TRUE); } gtk_widget_show(select_displayed_rb); diff --git a/ui/qt/sequence_dialog.cpp b/ui/qt/sequence_dialog.cpp index 4842c0ed93..57d55cb220 100644 --- a/ui/qt/sequence_dialog.cpp +++ b/ui/qt/sequence_dialog.cpp @@ -90,7 +90,6 @@ SequenceDialog::SequenceDialog(QWidget &parent, CaptureFile &cf, SequenceInfo *i if (!info_) { info_ = new SequenceInfo(sequence_analysis_info_new()); info_->sainfo()->name = "any"; - info_->sainfo()->all_packets = TRUE; } else { info_->ref(); sequence_analysis_free_nodes(info_->sainfo()); @@ -159,7 +158,6 @@ SequenceDialog::SequenceDialog(QWidget &parent, CaptureFile &cf, SequenceInfo *i ctx_menu_.addAction(ui->actionGoToNextPacket); ctx_menu_.addAction(ui->actionGoToPreviousPacket); - ui->showComboBox->setCurrentIndex(0); ui->addressComboBox->setCurrentIndex(0); sequence_items_t item_data; @@ -434,7 +432,11 @@ void SequenceDialog::fillDiagram() register_analysis_t* analysis = sequence_analysis_find_by_name(info_->sainfo()->name); if (analysis != NULL) { - register_tap_listener(sequence_analysis_get_tap_listener_name(analysis), info_->sainfo(), NULL, sequence_analysis_get_tap_flags(analysis), + const char *filter = NULL; + if (ui->displayFilterCheckBox->checkState() == Qt::Checked) + filter = cap_file_.capFile()->dfilter; + + register_tap_listener(sequence_analysis_get_tap_listener_name(analysis), info_->sainfo(), filter, sequence_analysis_get_tap_flags(analysis), NULL, sequence_analysis_get_packet_func(analysis), NULL); cf_retap_packets(cap_file_.capFile()); @@ -603,15 +605,8 @@ void SequenceDialog::goToAdjacentPacket(bool next) } } -void SequenceDialog::on_showComboBox_activated(int index) +void SequenceDialog::on_displayFilterCheckBox_toggled(bool) { - if (!info_->sainfo()) return; - - if (index == 0) { - info_->sainfo()->all_packets = TRUE; - } else { - info_->sainfo()->all_packets = FALSE; - } fillDiagram(); } diff --git a/ui/qt/sequence_dialog.h b/ui/qt/sequence_dialog.h index c4d8caf5fb..f9d1ec0dee 100644 --- a/ui/qt/sequence_dialog.h +++ b/ui/qt/sequence_dialog.h @@ -85,7 +85,7 @@ private slots: void on_actionGoToPacket_triggered(); void on_actionGoToNextPacket_triggered() { goToAdjacentPacket(true); } void on_actionGoToPreviousPacket_triggered() { goToAdjacentPacket(false); } - void on_showComboBox_activated(int index); + void on_displayFilterCheckBox_toggled(bool checked); void on_flowComboBox_activated(int index); void on_addressComboBox_activated(int index); void on_actionReset_triggered(); diff --git a/ui/qt/sequence_dialog.ui b/ui/qt/sequence_dialog.ui index b726daa1d9..16d43ac5a1 100644 --- a/ui/qt/sequence_dialog.ui +++ b/ui/qt/sequence_dialog.ui @@ -102,24 +102,13 @@ <item> <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Show:</string> + <widget class="QCheckBox" name="displayFilterCheckBox"> + <property name="toolTip"> + <string><html><head/><body><p>Only show flows matching the current display filter</p></body></html></string> </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="showComboBox"> - <item> <property name="text"> - <string>All packets</string> + <string>Limit to display filter</string> </property> - </item> - <item> - <property name="text"> - <string>Displayed packets</string> - </property> - </item> </widget> </item> <item> |