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 /epan/dissectors/packet-tcp.c | |
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>
Diffstat (limited to 'epan/dissectors/packet-tcp.c')
-rw-r--r-- | epan/dissectors/packet-tcp.c | 49 |
1 files changed, 23 insertions, 26 deletions
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; } |