Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
interface_toolbar_reader.h
Go to the documentation of this file.
1
10#ifndef INTERFACE_TOOLBAR_READER_H
11#define INTERFACE_TOOLBAR_READER_H
12
13#include <QObject>
14#include <QByteArray>
15
16#ifdef _WIN32
17#include <windows.h>
18#endif
19
20namespace Ui {
22}
23
27class InterfaceToolbarReader : public QObject
28{
29 Q_OBJECT
30
31public:
38 InterfaceToolbarReader(QString ifname, void *control_in, QObject *parent = 0) :
39 QObject(parent),
40 ifname_(ifname),
41#ifdef _WIN32
42 control_in_((HANDLE)control_in)
43#else
44 control_in_((char *)control_in),
45 fd_in_(-1)
46#endif
47 {
48 }
49
50public slots:
54 void loop();
55
56signals:
64 void received(QString ifname, int num, int command, QByteArray payload);
65
69 void finished();
70
71private:
72#ifdef _WIN32
79 int async_pipe_read(void *data, int nbyte);
80#endif
81
88 int pipe_read(char *data, int nbyte);
89
91 QString ifname_;
92
93#ifdef _WIN32
95 HANDLE control_in_;
96#else
98 QString control_in_;
100 int fd_in_;
101#endif
102};
103
104#endif // INTERFACE_TOOLBAR_READER_H
A reader thread component that listens to a control pipe for incoming messages from an interface.
Definition interface_toolbar_reader.h:28
InterfaceToolbarReader(QString ifname, void *control_in, QObject *parent=0)
Constructs a new InterfaceToolbarReader.
Definition interface_toolbar_reader.h:38
void loop()
The main polling loop that continuously reads from the control pipe.
Definition interface_toolbar_reader.cpp:110
void received(QString ifname, int num, int command, QByteArray payload)
Signal emitted when a complete control message is successfully read.
void finished()
Signal emitted when the reader loop finishes or terminates.