add ssl detection to proto_get_frame_protocols()

svn path=/trunk/; revision=54439
This commit is contained in:
Martin Kaiser 2013-12-24 13:44:00 +00:00
parent 7708c2a19f
commit fba61a31be
9 changed files with 15 additions and 9 deletions

View File

@ -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);

View File

@ -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)

View File

@ -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,

View File

@ -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,

View File

@ -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):

View File

@ -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_)
{

View File

@ -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)
{

View File

@ -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) {

View File

@ -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_)