From fba61a31becc8be0789fbb5376c1fe909b9cfa4f Mon Sep 17 00:00:00 2001 From: Martin Kaiser Date: Tue, 24 Dec 2013 13:44:00 +0000 Subject: [PATCH] add ssl detection to proto_get_frame_protocols() svn path=/trunk/; revision=54439 --- epan/proto.c | 5 ++++- epan/proto.h | 5 ++++- ui/gtk/follow_tcp.c | 2 +- ui/gtk/follow_udp.c | 2 +- ui/gtk/main_menubar.c | 2 +- ui/qt/follow_stream_dialog.cpp | 2 +- ui/qt/main_window.cpp | 2 +- ui/qt/main_window_slots.cpp | 2 +- ui/qt/packet_list.cpp | 2 +- 9 files changed, 15 insertions(+), 9 deletions(-) diff --git a/epan/proto.c b/epan/proto.c index 6ec330ca17..02f713277a 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -4755,7 +4755,8 @@ proto_get_protocol_filter_name(const int proto_id) } void -proto_get_frame_protocols(const wmem_list_t *layers, gboolean *is_ip, gboolean *is_tcp, gboolean *is_udp, gboolean *is_sctp) { +proto_get_frame_protocols(const wmem_list_t *layers, + gboolean *is_ip, gboolean *is_tcp, gboolean *is_udp, gboolean *is_sctp, gboolean *is_ssl) { wmem_list_frame_t *protos = wmem_list_head(layers); int proto_id; const char *proto_name; @@ -4777,6 +4778,8 @@ proto_get_frame_protocols(const wmem_list_t *layers, gboolean *is_ip, gboolean * *is_udp = TRUE; } else if (is_sctp && !strcmp(proto_name, "sctp")) { *is_sctp = TRUE; + } else if (is_ssl && !strcmp(proto_name, "ssl")) { + *is_ssl = TRUE; } protos = wmem_list_frame_next(protos); diff --git a/epan/proto.h b/epan/proto.h index 67ffb790de..d22c8c27e8 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -1820,8 +1820,11 @@ WS_DLL_PUBLIC const char *proto_get_protocol_filter_name(const int proto_id); * unchanged. May be NULL. * @param is_sctp Set to TRUE if the layer list contains SCTP, otherwise * unchanged. May be NULL. + * @param is_ssl Set to TRUE if the layer list contains SSL/TLS, otherwise + * unchanged. May be NULL. */ -WS_DLL_PUBLIC void proto_get_frame_protocols(const wmem_list_t *layers, gboolean *is_ip, gboolean *is_tcp, gboolean *is_udp, gboolean *is_sctp); +WS_DLL_PUBLIC void proto_get_frame_protocols(const wmem_list_t *layers, + gboolean *is_ip, gboolean *is_tcp, gboolean *is_udp, gboolean *is_sctp, gboolean *is_ssl); /** Enable / Disable protocol of the given item number. @param proto_id protocol id (0-indexed) diff --git a/ui/gtk/follow_tcp.c b/ui/gtk/follow_tcp.c index 1e62085f16..8145d31db7 100644 --- a/ui/gtk/follow_tcp.c +++ b/ui/gtk/follow_tcp.c @@ -107,7 +107,7 @@ follow_tcp_stream_cb(GtkWidget * w _U_, gpointer data _U_) char stream_window_title[256]; gboolean is_tcp = FALSE; - proto_get_frame_protocols(cfile.edt->pi.layers, NULL, &is_tcp, NULL, NULL); + proto_get_frame_protocols(cfile.edt->pi.layers, NULL, &is_tcp, NULL, NULL, NULL); if (!is_tcp) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, diff --git a/ui/gtk/follow_udp.c b/ui/gtk/follow_udp.c index 3ba4348845..8e5ff492f6 100644 --- a/ui/gtk/follow_udp.c +++ b/ui/gtk/follow_udp.c @@ -96,7 +96,7 @@ follow_udp_stream_cb(GtkWidget *w _U_, gpointer data _U_) GString *msg; gboolean is_udp = FALSE; - proto_get_frame_protocols(cfile.edt->pi.layers, NULL, NULL, &is_udp, NULL); + proto_get_frame_protocols(cfile.edt->pi.layers, NULL, NULL, &is_udp, NULL, NULL); if (!is_udp) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, diff --git a/ui/gtk/main_menubar.c b/ui/gtk/main_menubar.c index 559d368338..e8b119e3b8 100644 --- a/ui/gtk/main_menubar.c +++ b/ui/gtk/main_menubar.c @@ -192,7 +192,7 @@ build_conversation_filter(int action, gboolean show_dialog) char *buf; gboolean is_ip = FALSE, is_tcp = FALSE, is_udp = FALSE; - proto_get_frame_protocols(pi->layers, &is_ip, &is_tcp, &is_udp, NULL); + proto_get_frame_protocols(pi->layers, &is_ip, &is_tcp, &is_udp, NULL, NULL); switch(action) { case(CONV_CBA): diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp index 1d922f8bfa..dd1ccce0f0 100644 --- a/ui/qt/follow_stream_dialog.cpp +++ b/ui/qt/follow_stream_dialog.cpp @@ -824,7 +824,7 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_tcp_index) return false; } - proto_get_frame_protocols(cap_file_->edt->pi.layers, NULL, &is_tcp, &is_udp, NULL); + proto_get_frame_protocols(cap_file_->edt->pi.layers, NULL, &is_tcp, &is_udp, NULL, NULL); switch (follow_type_) { diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index b33c2b4eac..d3e08a2c0d 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -1388,7 +1388,7 @@ void MainWindow::setMenusForFollowStream() main_ui_->actionAnalyzeFollowUDPStream->setEnabled(false); main_ui_->actionAnalyzeFollowSSLStream->setEnabled(false); - proto_get_frame_protocols(cap_file_->edt->pi.layers, NULL, &is_tcp, &is_udp, NULL); + proto_get_frame_protocols(cap_file_->edt->pi.layers, NULL, &is_tcp, &is_udp, NULL, NULL); if (is_tcp) { diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index b0fb1b53ba..140b4ce923 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -776,7 +776,7 @@ void MainWindow::setMenusForSelectedPacket() if (cap_file_->edt) { - proto_get_frame_protocols(cap_file_->edt->pi.layers, NULL, &is_tcp, NULL, &is_sctp); + proto_get_frame_protocols(cap_file_->edt->pi.layers, NULL, &is_tcp, NULL, &is_sctp, NULL); } } // if (cfile.edt && cfile.edt->tree) { diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index f2a75b875b..d3135b41d0 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -472,7 +472,7 @@ void PacketList::contextMenuEvent(QContextMenuEvent *event) /* walk the list of a available protocols in the packet to see what we have */ if ((cap_file_ != NULL) && (cap_file_->edt != NULL)) { - proto_get_frame_protocols(cap_file_->edt->pi.layers, NULL, &is_tcp, &is_udp, NULL); + proto_get_frame_protocols(cap_file_->edt->pi.layers, NULL, &is_tcp, &is_udp, NULL, NULL); } foreach (act, filter_actions_)