| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
funnel_statistics.h
Go to the documentation of this file.
1
10#ifndef FUNNELSTATISTICS_H
11#define FUNNELSTATISTICS_H
12
13#include <QObject>
14#include <QAction>
15#include <QSet>
16#include <QPointer>
17
18#include <epan/funnel.h>
19#include "io_console_dialog.h"
20#include "capture_file.h"
21#include <ui/qt/filter_action.h>
22
23 struct _funnel_ops_t;
24 struct progdlg;
25
29 typedef void (* funnel_packet_menu_callback)(void *, GPtrArray*);
30
31 class FunnelStatistics : public QObject
32{
33 Q_OBJECT
34 public:
35 explicit FunnelStatistics(QObject *parent, CaptureFile &cf);
36 ~FunnelStatistics();
37 void retapPackets();
38 struct progdlg *progressDialogNew(const char *task_title, const char *item_title, bool terminate_is_stop, bool *stop_flag);
39 const char *displayFilter();
40 void emitSetDisplayFilter(const QString filter);
41 void reloadPackets();
42 void redissectPackets();
43 void reloadLuaPlugins();
44 void emitApplyDisplayFilter();
45 void emitOpenCaptureFile(QString cf_path, QString filter);
46 static const QString &actionName() { return action_name_; }
47 void loadInitFunnelMenus();
48
49signals:
50 void openCaptureFile(QString cf_path, QString filter);
51 void setDisplayFilter(QString filter, FilterAction::Action action, FilterAction::ActionType filterType);
52
53 public slots:
54 void funnelActionTriggered();
55 void displayFilterTextChanged(const QString &filter);
56
57 private:
58 static const QString action_name_;
59 struct _funnel_ops_t *funnel_ops_;
60 struct _funnel_ops_id_t *funnel_ops_id_;
61
62 CaptureFile &capture_file_;
63 QByteArray display_filter_;
64 QString prepared_filter_;
65};
66
67 class FunnelAction : public QAction
68{
69 Q_OBJECT
70 public:
71 FunnelAction(QObject *parent = nullptr);
72 FunnelAction(QString title, funnel_menu_callback callback, void *callback_data, bool retap, QObject *parent);
73 FunnelAction(QString title, funnel_packet_menu_callback callback, void *callback_data, bool retap, const char *packet_required_fields, QObject *parent);
74 ~FunnelAction();
75 funnel_menu_callback callback() const;
76 QString title() const;
77 virtual void triggerCallback();
78 void setPacketCallback(funnel_packet_menu_callback packet_callback);
79 void setPacketData(GPtrArray* finfos);
80 void addToMenu(QMenu * ctx_menu, QHash<QString, QMenu *> &menuTextToMenus);
81 void setPacketRequiredFields(const char *required_fields_str);
82 const QSet<QString> getPacketRequiredFields();
83 bool retap();
84 QString getPacketSubmenus();
85
86 public slots:
87 void triggerPacketCallback();
88
89 private:
90 QString title_;
91 QString packetSubmenu_;
92 funnel_menu_callback callback_;
93 void *callback_data_;
94 bool retap_;
95 funnel_packet_menu_callback packetCallback_;
96 GPtrArray* packetData_;
97 QSet<QString> packetRequiredFields_;
98};
99
100 class FunnelConsoleAction : public FunnelAction
101{
102 Q_OBJECT
103 public:
104 FunnelConsoleAction(QString name, funnel_console_eval_cb_t eval_cb,
105 funnel_console_open_cb_t open_cb,
106 funnel_console_close_cb_t close_cb,
107 void *callback_data, QObject *parent);
108 ~FunnelConsoleAction();
109 virtual void triggerCallback();
110
111 private:
112 QString title_;
113 funnel_console_eval_cb_t eval_cb_;
114 funnel_console_open_cb_t open_cb_;
115 funnel_console_close_cb_t close_cb_;
116 void *callback_data_;
117 QPointer<IOConsoleDialog> dialog_;
118};
119
120 extern "C" {
121 void funnel_statistics_reload_menus(void);
122 void funnel_statistics_load_packet_menus(void);
123 bool funnel_statistics_packet_menus_modified(void);
124} // extern "C"
125
126#endif // FUNNELSTATISTICS_H
capture_file.h
CaptureFile
Definition capture_file.h:21
FunnelAction
Definition funnel_statistics.h:68
FunnelConsoleAction
Definition funnel_statistics.h:101
FunnelStatistics
Definition funnel_statistics.h:32
filter_action.h
funnel.h
funnel_console_open_cb_t
void(* funnel_console_open_cb_t)(void(*print_func)(const char *, void *), void *print_data, void *callback_data)
Definition funnel.h:177
funnel_console_eval_cb_t
int(* funnel_console_eval_cb_t)(const char *console_input, char **error_ptr, char **error_hint, void *callback_data)
Definition funnel.h:169
funnel_console_close_cb_t
void(* funnel_console_close_cb_t)(void *callback_data)
Definition funnel.h:182
funnel_packet_menu_callback
void(* funnel_packet_menu_callback)(void *, GPtrArray *)
Definition funnel_statistics.h:29
funnel_statistics_packet_menus_modified
bool funnel_statistics_packet_menus_modified(void)
Definition funnel_statistics.cpp:557
io_console_dialog.h
_funnel_ops_id_t
Definition funnel_statistics.cpp:248
_funnel_ops_t
Definition funnel.h:46
progdlg
Definition progress_frame.h:31