2021-11-30 13:01:36 +00:00
|
|
|
/** @file
|
2015-07-03 20:52:49 +00:00
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-04-30 07:47:58 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2015-07-03 20:52:49 +00:00
|
|
|
|
|
|
|
#ifndef FUNNELSTATISTICS_H
|
|
|
|
#define FUNNELSTATISTICS_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2020-12-27 04:15:24 +00:00
|
|
|
#include <QAction>
|
|
|
|
#include <QSet>
|
2015-07-03 20:52:49 +00:00
|
|
|
|
2020-12-27 04:15:24 +00:00
|
|
|
#include <epan/funnel.h>
|
2015-07-03 20:52:49 +00:00
|
|
|
#include "capture_file.h"
|
2019-11-07 11:56:22 +00:00
|
|
|
#include <ui/qt/filter_action.h>
|
2015-07-03 20:52:49 +00:00
|
|
|
|
|
|
|
struct _funnel_ops_t;
|
|
|
|
struct progdlg;
|
|
|
|
|
2020-12-27 04:15:24 +00:00
|
|
|
/**
|
|
|
|
* Signature of function that can be called from a custom packet menu entry
|
|
|
|
*/
|
|
|
|
typedef void (* funnel_packet_menu_callback)(gpointer, GPtrArray*);
|
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
class FunnelStatistics : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit FunnelStatistics(QObject *parent, CaptureFile &cf);
|
2020-03-22 18:21:58 +00:00
|
|
|
~FunnelStatistics();
|
2015-07-03 20:52:49 +00:00
|
|
|
void retapPackets();
|
|
|
|
struct progdlg *progressDialogNew(const gchar *task_title, const gchar *item_title, gboolean terminate_is_stop, gboolean *stop_flag);
|
|
|
|
const char *displayFilter();
|
2015-09-11 18:13:23 +00:00
|
|
|
void emitSetDisplayFilter(const QString filter);
|
2015-07-03 20:52:49 +00:00
|
|
|
void reloadPackets();
|
2021-06-21 07:52:46 +00:00
|
|
|
void redissectPackets();
|
2016-01-03 12:48:39 +00:00
|
|
|
void reloadLuaPlugins();
|
2015-07-03 20:52:49 +00:00
|
|
|
void emitApplyDisplayFilter();
|
2015-09-11 18:13:23 +00:00
|
|
|
void emitOpenCaptureFile(QString cf_path, QString filter);
|
2015-07-08 22:44:04 +00:00
|
|
|
static const QString &actionName() { return action_name_; }
|
2015-07-03 20:52:49 +00:00
|
|
|
|
|
|
|
signals:
|
2015-09-11 18:13:23 +00:00
|
|
|
void openCaptureFile(QString cf_path, QString filter);
|
2019-11-07 11:56:22 +00:00
|
|
|
void setDisplayFilter(QString filter, FilterAction::Action action, FilterAction::ActionType filterType);
|
2015-07-03 20:52:49 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void funnelActionTriggered();
|
|
|
|
void displayFilterTextChanged(const QString &filter);
|
|
|
|
|
|
|
|
private:
|
2015-07-08 22:44:04 +00:00
|
|
|
static const QString action_name_;
|
2015-07-03 20:52:49 +00:00
|
|
|
struct _funnel_ops_t *funnel_ops_;
|
2020-03-22 18:21:58 +00:00
|
|
|
struct _funnel_ops_id_t *funnel_ops_id_;
|
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
CaptureFile &capture_file_;
|
|
|
|
QByteArray display_filter_;
|
2019-11-07 11:56:22 +00:00
|
|
|
QString prepared_filter_;
|
2015-07-03 20:52:49 +00:00
|
|
|
};
|
|
|
|
|
2020-12-27 04:15:24 +00:00
|
|
|
class FunnelAction : public QAction
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
FunnelAction(QString title, funnel_menu_callback callback, gpointer callback_data, gboolean retap, QObject *parent);
|
|
|
|
FunnelAction(QString title, funnel_packet_menu_callback callback, gpointer callback_data, gboolean retap, const char *packet_required_fields, QObject *parent);
|
|
|
|
~FunnelAction();
|
|
|
|
funnel_menu_callback callback() const;
|
|
|
|
QString title() const;
|
|
|
|
void triggerCallback();
|
|
|
|
void setPacketCallback(funnel_packet_menu_callback packet_callback);
|
|
|
|
void setPacketData(GPtrArray* finfos);
|
|
|
|
void addToMenu(QMenu * ctx_menu, QHash<QString, QMenu *> menuTextToMenus);
|
|
|
|
void setPacketRequiredFields(const char *required_fields_str);
|
|
|
|
const QSet<QString> getPacketRequiredFields();
|
|
|
|
bool retap();
|
|
|
|
QString getPacketSubmenus();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void triggerPacketCallback();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString title_;
|
|
|
|
QString packetSubmenu_;
|
|
|
|
funnel_menu_callback callback_;
|
|
|
|
gpointer callback_data_;
|
|
|
|
gboolean retap_;
|
|
|
|
funnel_packet_menu_callback packetCallback_;
|
|
|
|
GPtrArray* packetData_;
|
|
|
|
QSet<QString> packetRequiredFields_;
|
|
|
|
};
|
|
|
|
|
2015-08-11 12:08:08 +00:00
|
|
|
extern "C" {
|
|
|
|
void funnel_statistics_reload_menus(void);
|
2020-12-27 04:15:24 +00:00
|
|
|
void funnel_statistics_load_packet_menus(void);
|
|
|
|
gboolean funnel_statistics_packet_menus_modified(void);
|
2015-08-11 12:08:08 +00:00
|
|
|
} // extern "C"
|
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
#endif // FUNNELSTATISTICS_H
|