| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
interface_toolbar.h
Go to the documentation of this file.
1
9
10#ifndef INTERFACE_TOOLBAR_H
11#define INTERFACE_TOOLBAR_H
12
13#include <wireshark.h>
14
15#include "ui/iface_toolbar.h"
16#include "funnel_text_dialog.h"
17#include "capture_event.h"
18
19#include <QFrame>
20#include <QList>
21#include <QMap>
22#include <QString>
23
24
25 namespace Ui {
26 class InterfaceToolbar;
27}
28
32 struct interface_values
33{
35 GAsyncQueue *control_out_queue;
36
38 QMap<int, QByteArray> value;
39
41 QMap<int, bool> value_changed;
42
44 QMap<int, QList<QByteArray> > list;
45
47 QMap<int, FunnelTextDialog *> log_dialog;
48
50 QMap<int, QString> log_text;
51
53 QMap<int, bool> widget_disabled;
54};
55
59 class InterfaceToolbar : public QFrame
60{
61 Q_OBJECT
62
63 public:
69 explicit InterfaceToolbar(QWidget *parent = 0, const iface_toolbar *toolbar = NULL);
70
74 ~InterfaceToolbar();
75
80 void startCapture(GArray *ifaces);
81
85 void stopCapture();
86
92 bool hasInterface(QString ifname) const;
93
94 public slots:
98 void interfaceListChanged();
99
107 void controlReceived(QString ifname, int num, int command, QByteArray message);
108
113 void captureEventHandler(CaptureEvent ev);
114
115signals:
119 void closeReader();
120
121 private slots:
123 void connectInterfaceListManager();
124
128 void updateWidgets();
129
133 void onControlButtonClicked();
134
138 void onLogButtonClicked();
139
143 void onHelpButtonClicked();
144
148 void onRestoreButtonClicked();
149
154 void onCheckBoxChanged(int state);
155
160 void onComboBoxChanged(int idx);
161
165 void onLineEditChanged();
166
170 void closeLog();
171
176 void on_interfacesComboBox_currentTextChanged(const QString &ifname);
177
178 private:
183 void initializeControls(const iface_toolbar *toolbar);
184
190 void setDefaultValue(int num, const QByteArray &value);
191
196 void sendChangedValues(QString ifname);
197
203 QWidget *createCheckbox(iface_toolbar_control *control);
204
210 QWidget *createButton(iface_toolbar_control *control);
211
217 QWidget *createSelector(iface_toolbar_control *control);
218
224 QWidget *createString(iface_toolbar_control *control);
225
233 void controlSend(QString ifname, int num, int type, const QByteArray &payload);
234
241 void setWidgetValue(QWidget *widget, int type, QByteArray payload);
242
251 void setInterfaceValue(QString ifname, QWidget *widget, int num, int type, QByteArray payload);
252
254 Ui::InterfaceToolbar *ui;
255
257 QMap<QString, struct interface_values> interface_;
258
260 QMap<int, QByteArray> default_value_;
261
263 QMap<int, QList<QByteArray> > default_list_;
264
266 QMap<int, QWidget *> control_widget_;
267
269 QMap<int, QWidget *> label_widget_;
270
272 QString help_link_;
273
275 bool use_spacer_;
276};
277
278#endif // INTERFACE_TOOLBAR_H
capture_event.h
CaptureEvent
Represents an event occurring during a capture or file operation.
Definition capture_event.h:24
InterfaceToolbar::InterfaceToolbar
InterfaceToolbar(QWidget *parent=0, const iface_toolbar *toolbar=NULL)
Constructs a new InterfaceToolbar.
Definition interface_toolbar.cpp:76
InterfaceToolbar::~InterfaceToolbar
~InterfaceToolbar()
Destroys the InterfaceToolbar.
Definition interface_toolbar.cpp:123
InterfaceToolbar::stopCapture
void stopCapture()
Stops the capture and disables active controls.
Definition interface_toolbar.cpp:834
InterfaceToolbar::hasInterface
bool hasInterface(QString ifname) const
Checks if this toolbar is managing a specific interface.
Definition interface_toolbar.cpp:925
InterfaceToolbar::captureEventHandler
void captureEventHandler(CaptureEvent ev)
Slot triggered when the current CaptureFile has an Event.
Definition interface_toolbar.cpp:754
InterfaceToolbar::closeReader
void closeReader()
Signal emitted to request the reader threads to close.
InterfaceToolbar::controlReceived
void controlReceived(QString ifname, int num, int command, QByteArray message)
Slot triggered when a control message is received from an interface.
Definition interface_toolbar.cpp:565
InterfaceToolbar::startCapture
void startCapture(GArray *ifaces)
Initializes and starts the capture controls for the given interfaces.
Definition interface_toolbar.cpp:787
InterfaceToolbar::interfaceListChanged
void interfaceListChanged()
Slot triggered when the global list of interfaces changes.
Definition interface_toolbar.cpp:975
funnel_text_dialog.h
iface_toolbar.h
iface_toolbar
struct _iface_toolbar iface_toolbar
Describes an interface toolbar and the set of controls it exposes.
iface_toolbar_control
struct _iface_toolbar_control iface_toolbar_control
Describes a single control widget within an interface toolbar.
interface_values
Holds state and values for a specific capture interface's toolbar.
Definition interface_toolbar.h:33
interface_values::list
QMap< int, QList< QByteArray > > list
Definition interface_toolbar.h:44
interface_values::control_out_queue
GAsyncQueue * control_out_queue
Definition interface_toolbar.h:35
interface_values::value_changed
QMap< int, bool > value_changed
Definition interface_toolbar.h:41
interface_values::log_dialog
QMap< int, FunnelTextDialog * > log_dialog
Definition interface_toolbar.h:47
interface_values::value
QMap< int, QByteArray > value
Definition interface_toolbar.h:38
interface_values::log_text
QMap< int, QString > log_text
Definition interface_toolbar.h:50
interface_values::widget_disabled
QMap< int, bool > widget_disabled
Definition interface_toolbar.h:53