| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
funnel_statistics.h
Go to the documentation of this file.
1
9
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
34 class FunnelStatistics : public QObject
35{
36 Q_OBJECT
37 public:
43 explicit FunnelStatistics(QObject *parent, CaptureFile &cf);
44
48 ~FunnelStatistics();
49
53 void retapPackets();
54
63 struct progdlg *progressDialogNew(const char *task_title, const char *item_title, bool terminate_is_stop, bool *stop_flag);
64
69 const char *displayFilter();
70
75 void emitSetDisplayFilter(const QString filter);
76
80 void reloadPackets();
81
85 void redissectPackets();
86
90 void reloadLuaPlugins();
91
95 void emitApplyDisplayFilter();
96
102 void emitOpenCaptureFile(QString cf_path, QString filter);
103
108 static const QString &actionName() { return action_name_; }
109
113 void loadInitFunnelMenus();
114
115signals:
121 void openCaptureFile(QString cf_path, QString filter);
122
129 void setDisplayFilter(QString filter, FilterAction::Action action, FilterAction::ActionType filterType);
130
131 public slots:
135 void funnelActionTriggered();
136
141 void displayFilterTextChanged(const QString &filter);
142
143 private:
145 static const QString action_name_;
146
148 struct _funnel_ops_t *funnel_ops_;
149
151 struct _funnel_ops_id_t *funnel_ops_id_;
152
154 CaptureFile &capture_file_;
155
157 QByteArray display_filter_;
158
160 QString prepared_filter_;
161};
162
166 class FunnelAction : public QAction
167{
168 Q_OBJECT
169 public:
174 FunnelAction(QObject *parent = nullptr);
175
184 FunnelAction(QString title, funnel_menu_callback callback, void *callback_data, bool retap, QObject *parent);
185
195 FunnelAction(QString title, funnel_packet_menu_callback callback, void *callback_data, bool retap, const char *packet_required_fields, QObject *parent);
196
200 ~FunnelAction();
201
206 funnel_menu_callback callback() const;
207
212 QString title() const;
213
217 virtual void triggerCallback();
218
223 void setPacketCallback(funnel_packet_menu_callback packet_callback);
224
229 void setPacketData(GPtrArray* finfos);
230
236 void addToMenu(QMenu * ctx_menu, QHash<QString, QMenu *> &menuTextToMenus);
237
242 void setPacketRequiredFields(const char *required_fields_str);
243
248 const QSet<QString> getPacketRequiredFields();
249
254 bool retap();
255
260 QString getPacketSubmenus();
261
262 public slots:
266 void triggerPacketCallback();
267
268 private:
270 QString title_;
271
273 QString packetSubmenu_;
274
276 funnel_menu_callback callback_;
277
279 void *callback_data_;
280
282 bool retap_;
283
285 funnel_packet_menu_callback packetCallback_;
286
288 GPtrArray* packetData_;
289
291 QSet<QString> packetRequiredFields_;
292};
293
297 class FunnelConsoleAction : public FunnelAction
298{
299 Q_OBJECT
300 public:
310 FunnelConsoleAction(QString name, funnel_console_eval_cb_t eval_cb,
311 funnel_console_open_cb_t open_cb,
312 funnel_console_close_cb_t close_cb,
313 void *callback_data, QObject *parent);
314
318 ~FunnelConsoleAction();
319
323 virtual void triggerCallback() override;
324
325 private:
327 QString title_;
328
330 funnel_console_eval_cb_t eval_cb_;
331
333 funnel_console_open_cb_t open_cb_;
334
336 funnel_console_close_cb_t close_cb_;
337
339 void *callback_data_;
340
342 QPointer<IOConsoleDialog> dialog_;
343};
344
345 extern "C" {
346
352 void funnel_statistics_reload_menus(void);
353
357 void funnel_statistics_load_packet_menus(void);
358
364 bool funnel_statistics_packet_menus_modified(void);
365} // extern "C"
366
367#endif // FUNNELSTATISTICS_H
capture_file.h
CaptureFile
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
FilterAction::Action
Action
Defines an action to be taken with a filter.
Definition filter_action.h:30
FilterAction::ActionType
ActionType
Defines how the new filter should be combined with the existing one.
Definition filter_action.h:43
FunnelAction::title
QString title() const
Retrieves the title of the action.
Definition funnel_statistics.cpp:127
FunnelAction::getPacketSubmenus
QString getPacketSubmenus()
Retrieves the path/hierarchy for packet submenus.
Definition funnel_statistics.cpp:203
FunnelAction::setPacketData
void setPacketData(GPtrArray *finfos)
Sets the packet data required by the packet callback.
Definition funnel_statistics.cpp:161
FunnelAction::retap
bool retap()
Checks if executing this action requires a retap.
Definition funnel_statistics.cpp:198
FunnelAction::triggerPacketCallback
void triggerPacketCallback()
Slot triggered to execute the packet-specific callback.
Definition funnel_statistics.cpp:192
FunnelAction::addToMenu
void addToMenu(QMenu *ctx_menu, QHash< QString, QMenu * > &menuTextToMenus)
Adds this action to a specific context menu hierarchy.
Definition funnel_statistics.cpp:165
FunnelAction::setPacketCallback
void setPacketCallback(funnel_packet_menu_callback packet_callback)
Sets the packet-specific menu callback.
Definition funnel_statistics.cpp:137
FunnelAction::FunnelAction
FunnelAction(QObject *parent=nullptr)
Constructs an empty FunnelAction.
Definition funnel_statistics.cpp:64
FunnelAction::getPacketRequiredFields
const QSet< QString > getPacketRequiredFields()
Retrieves the set of required packet fields.
Definition funnel_statistics.cpp:156
FunnelAction::triggerCallback
virtual void triggerCallback()
Triggers the associated callback based on the action type.
Definition funnel_statistics.cpp:131
FunnelAction::~FunnelAction
~FunnelAction()
Destroys the FunnelAction.
Definition funnel_statistics.cpp:120
FunnelAction::callback
funnel_menu_callback callback() const
Retrieves the standard menu callback.
Definition funnel_statistics.cpp:123
FunnelAction::setPacketRequiredFields
void setPacketRequiredFields(const char *required_fields_str)
Sets the fields required for the packet callback to be active.
Definition funnel_statistics.cpp:141
FunnelConsoleAction::triggerCallback
virtual void triggerCallback() override
Triggers the console action, initializing and displaying the dialog.
Definition funnel_statistics.cpp:229
FunnelConsoleAction::FunnelConsoleAction
FunnelConsoleAction(QString name, funnel_console_eval_cb_t eval_cb, funnel_console_open_cb_t open_cb, funnel_console_close_cb_t close_cb, void *callback_data, QObject *parent)
Constructs a new FunnelConsoleAction.
Definition funnel_statistics.cpp:207
FunnelConsoleAction::~FunnelConsoleAction
~FunnelConsoleAction()
Destroys the FunnelConsoleAction.
Definition funnel_statistics.cpp:225
FunnelStatistics::loadInitFunnelMenus
void loadInitFunnelMenus()
Loads and initializes the funnel menus based on registered plugins.
Definition funnel_statistics.cpp:599
FunnelStatistics::emitApplyDisplayFilter
void emitApplyDisplayFilter()
Emits a signal to apply the prepared display filter.
Definition funnel_statistics.cpp:344
FunnelStatistics::reloadLuaPlugins
void reloadLuaPlugins()
Reloads all registered Lua plugins.
Definition funnel_statistics.cpp:339
FunnelStatistics::openCaptureFile
void openCaptureFile(QString cf_path, QString filter)
Signal emitted to request opening a capture file.
FunnelStatistics::FunnelStatistics
FunnelStatistics(QObject *parent, CaptureFile &cf)
Constructs a new FunnelStatistics object.
Definition funnel_statistics.cpp:257
FunnelStatistics::emitSetDisplayFilter
void emitSetDisplayFilter(const QString filter)
Emits a signal to set the display filter in the main UI.
Definition funnel_statistics.cpp:322
FunnelStatistics::~FunnelStatistics
~FunnelStatistics()
Destroys the FunnelStatistics object.
Definition funnel_statistics.cpp:300
FunnelStatistics::retapPackets
void retapPackets()
Retaps all packets in the capture file.
Definition funnel_statistics.cpp:307
FunnelStatistics::emitOpenCaptureFile
void emitOpenCaptureFile(QString cf_path, QString filter)
Emits a signal to open a new capture file.
Definition funnel_statistics.cpp:349
FunnelStatistics::displayFilter
const char * displayFilter()
Retrieves the current display filter.
Definition funnel_statistics.cpp:317
FunnelStatistics::actionName
static const QString & actionName()
Retrieves the standard action name for the funnel statistics.
Definition funnel_statistics.h:108
FunnelStatistics::displayFilterTextChanged
void displayFilterTextChanged(const QString &filter)
Slot triggered when the text in the display filter field changes.
Definition funnel_statistics.cpp:362
FunnelStatistics::reloadPackets
void reloadPackets()
Triggers a reload of the packets in the capture file.
Definition funnel_statistics.cpp:328
FunnelStatistics::funnelActionTriggered
void funnelActionTriggered()
Slot triggered when a funnel action is executed from the UI.
Definition funnel_statistics.cpp:354
FunnelStatistics::setDisplayFilter
void setDisplayFilter(QString filter, FilterAction::Action action, FilterAction::ActionType filterType)
Signal emitted to request setting a display filter.
FunnelStatistics::redissectPackets
void redissectPackets()
Triggers redissection of the packets.
Definition funnel_statistics.cpp:333
FunnelStatistics::progressDialogNew
struct progdlg * progressDialogNew(const char *task_title, const char *item_title, bool terminate_is_stop, bool *stop_flag)
Creates a new progress dialog for funnel operations.
Definition funnel_statistics.cpp:312
filter_action.h
funnel.h
funnel_packet_menu_callback
void(* funnel_packet_menu_callback)(void *, GPtrArray *)
Definition funnel.h:335
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:396
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:388
funnel_console_close_cb_t
void(* funnel_console_close_cb_t)(void *callback_data)
Definition funnel.h:401
funnel_packet_menu_callback
void(* funnel_packet_menu_callback)(void *, GPtrArray *)
Definition funnel_statistics.h:29
funnel_statistics_reload_menus
void funnel_statistics_reload_menus(void)
Reloads the menus for funnel statistics.
Definition funnel_statistics.cpp:547
funnel_statistics_load_packet_menus
void funnel_statistics_load_packet_menus(void)
Loads the packet menus for funnel statistics.
Definition funnel_statistics.cpp:570
funnel_statistics_packet_menus_modified
bool funnel_statistics_packet_menus_modified(void)
Checks if the packet menus for funnel statistics have been modified.
Definition funnel_statistics.cpp:560
io_console_dialog.h
_funnel_ops_id_t
Definition funnel_statistics.cpp:253
_funnel_ops_t
Vtable of GUI operations provided to the Lua funnel API, abstracting all UI interactions behind funct...
Definition funnel.h:53
progdlg
Define the structure describing a progress dialog.
Definition progress_frame.h:28