Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
follow_stream_dialog.h
Go to the documentation of this file.
1
9
10#ifndef FOLLOW_STREAM_DIALOG_H
11#define FOLLOW_STREAM_DIALOG_H
12
13#include <config.h>
14
15#include <stdio.h>
16
17#ifdef HAVE_UNISTD_H
18#include <unistd.h>
19#endif
20
21#include "file.h"
22
23#include "epan/follow.h"
24
25#include "wireshark_dialog.h"
26
27#include <QFile>
28#include <QMap>
29#include <QPushButton>
30
31namespace Ui {
32class FollowStreamDialog;
33}
34
39{
40 Q_OBJECT
41
42public:
50 explicit FollowStreamDialog(QWidget &parent, CaptureFile &cf, int proto_id, const QString& previous_filter);
51
56
61 void addCodecs(const QMap<QString, const char *> &codecMap);
62
70 bool follow(bool use_stream_index = false, unsigned stream_num = 0, unsigned sub_stream_num = 0);
71
72protected:
79 bool eventFilter(QObject *obj, QEvent *event) override;
80
85 void keyPressEvent(QKeyEvent *event) override;
86
87
91 void endRetapPackets() override;
92
96 void captureFileClosed() override;
97
103 virtual QString labelHint(int pkt = 0);
104
109 int client_packet_count() const { return client_packet_count_; }
110
115 int server_packet_count() const { return server_packet_count_; }
116
121 int turns() const { return turns_; }
122
127 const follow_info_t& followInfo() const { return follow_info_; }
128
133 virtual QString serverToClientString() const;
134
139 virtual QString clientToServerString() const;
140
145 virtual QString bothDirectionsString() const;
146
147
148private slots:
153 void cbCharsetCurrentIndexChanged(int idx);
154
159 void deltaComboBoxCurrentIndexChanged(int idx);
160
165 void cbDirectionsCurrentIndexChanged(int idx);
166
170 void bFindClicked();
171
175 void leFindReturnPressed();
176
180 void helpButton();
181
185 void backButton();
186
190 void close();
191
196 void useRegexFind(bool use_regex);
197
202 void findText(bool go_back = true);
203
207 void saveAs();
208
212 void printStream();
213
218 void fillHintLabel(int pkt = 0);
219
224 void goToPacketForTextPos(int pkt = 0);
225
230 void streamNumberSpinBoxValueChanged(int stream_num);
231
236 void subStreamNumberSpinBoxValueChanged(int sub_stream_num);
237
241 void buttonBoxRejected();
242
243signals:
249 void updateFilter(QString filter, bool force);
250
255 void goToPacket(int packet_num);
256
257private:
262 static void resetStream(void *tapData);
263
267 void removeStreamControls();
268
272 void resetStream(void);
273
278 void updateWidgets(bool follow_in_progress);
279
283 void updateWidgets() override { updateWidgets(false); } // Needed for WiresharkDialog?
284
294 void showBuffer(QByteArray &buffer, size_t nchars, bool is_from_server,
295 uint32_t packet_num, nstime_t abs_ts, uint32_t *global_pos);
296
300 void readStream();
301
305 void readFollowStream();
306
310 void followStream();
311
319 void addText(QString text, bool is_from_server, uint32_t packet_num, bool colorize = true);
320
321 void filterMenuAboutToShow(QMenu *, bool);
322
324 Ui::FollowStreamDialog *ui;
325
327 QPushButton *b_filter_prepare_;
328
330 QPushButton *b_filter_apply_;
331
333 QPushButton *b_find_;
334
336 QPushButton *b_print_;
337
339 QPushButton *b_save_;
340
342 QPushButton *b_back_;
343
345 follow_info_t follow_info_;
346
348 register_follow_t* follower_;
349
351 QString previous_filter_;
352
354 QString output_filter_;
355
357 QString follow_filter_;
358
360 int client_buffer_count_;
361
363 int server_buffer_count_;
364
366 int client_packet_count_;
367
369 int server_packet_count_;
370
372 uint32_t last_packet_;
373
375 bool last_from_server_;
376
378 nstime_t last_ts_;
379
381 int turns_;
382
384 bool use_regex_find_;
385
387 bool terminating_;
388
390 int previous_sub_stream_num_;
391};
392
393#endif // FOLLOW_STREAM_DIALOG_H
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
bool follow(bool use_stream_index=false, unsigned stream_num=0, unsigned sub_stream_num=0)
Initiates the stream following process.
Definition follow_stream_dialog.cpp:1030
void goToPacket(int packet_num)
Signal emitted to navigate to a specific packet in the main window.
void updateFilter(QString filter, bool force)
Signal emitted to update the main display filter.
const follow_info_t & followInfo() const
Retrieves the core follow_info structure.
Definition follow_stream_dialog.h:127
~FollowStreamDialog()
Destroys the FollowStreamDialog.
Definition follow_stream_dialog.cpp:181
virtual QString clientToServerString() const
Gets the string representation for the client-to-server direction.
Definition follow_stream_dialog.cpp:996
FollowStreamDialog(QWidget &parent, CaptureFile &cf, int proto_id, const QString &previous_filter)
Constructs a new FollowStreamDialog.
Definition follow_stream_dialog.cpp:65
bool eventFilter(QObject *obj, QEvent *event) override
Filters events for the dialog text display.
Definition follow_stream_dialog.cpp:642
virtual QString bothDirectionsString() const
Gets the string representation for both directions.
Definition follow_stream_dialog.cpp:1022
void keyPressEvent(QKeyEvent *event) override
Handles key press events in the dialog.
Definition follow_stream_dialog.cpp:662
void captureFileClosed() override
Slot triggered when the underlying capture file is closed.
Definition follow_stream_dialog.cpp:1157
int server_packet_count() const
Gets the number of packets sent by the server.
Definition follow_stream_dialog.h:115
virtual QString labelHint(int pkt=0)
Generates a hint label based on the current packet.
Definition follow_stream_dialog.cpp:209
void endRetapPackets() override
Called when retap is complete.
Definition follow_stream_dialog.cpp:1136
virtual QString serverToClientString() const
Gets the string representation for the server-to-client direction.
Definition follow_stream_dialog.cpp:970
void addCodecs(const QMap< QString, const char * > &codecMap)
Adds a map of character encodings to the dialog's codec selection.
Definition follow_stream_dialog.cpp:187
int turns() const
Gets the number of direction changes (turns) in the stream.
Definition follow_stream_dialog.h:121
int client_packet_count() const
Gets the number of packets sent by the client.
Definition follow_stream_dialog.h:109
virtual void updateWidgets()
Updates the state and contents of the dialog's widgets.
Definition wireshark_dialog.cpp:92
WiresharkDialog(QWidget &parent, CaptureFile &capture_file)
Constructs a new WiresharkDialog object.
Definition wireshark_dialog.cpp:30
struct _follow_info follow_info_t
Aggregates all state for following and reassembling a single stream across both client and server dir...
Sliding window buffer tracking per-stream burst and bandwidth statistics.
Definition mcast_stream.h:34
Definition nstime.h:26