Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
follow_stream_dialog.h
Go to the documentation of this file.
1
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#include <QTextCodec>
31
32namespace Ui {
34}
35
40{
41 Q_OBJECT
42
43public:
50 explicit FollowStreamDialog(QWidget &parent, CaptureFile &cf, int proto_id);
51
56
61 void addCodecs(const QMap<QString, QTextCodec *> &codecMap);
62
71 bool follow(QString previous_filter = QString(), bool use_stream_index = false, unsigned stream_num = 0, unsigned sub_stream_num = 0);
72
73protected:
80 bool eventFilter(QObject *obj, QEvent *event);
81
86 void keyPressEvent(QKeyEvent *event);
87
91 void captureFileClosed();
92
98 virtual QString labelHint(int pkt = 0);
99
104 int client_packet_count() const { return client_packet_count_; }
105
110 int server_packet_count() const { return server_packet_count_; }
111
116 int turns() const { return turns_; }
117
122 const follow_info_t& followInfo() const { return follow_info_; }
123
128 virtual QString serverToClientString() const;
129
134 virtual QString clientToServerString() const;
135
140 virtual QString bothDirectionsString() const;
141
142
143private slots:
148 void cbCharsetCurrentIndexChanged(int idx);
149
154 void deltaComboBoxCurrentIndexChanged(int idx);
155
160 void cbDirectionsCurrentIndexChanged(int idx);
161
165 void bFindClicked();
166
170 void leFindReturnPressed();
171
175 void helpButton();
176
180 void backButton();
181
185 void close();
186
190 void filterOut();
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() { 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
322 Ui::FollowStreamDialog *ui;
323
325 QPushButton *b_filter_out_;
326
328 QPushButton *b_find_;
329
331 QPushButton *b_print_;
332
334 QPushButton *b_save_;
335
337 QPushButton *b_back_;
338
340 follow_info_t follow_info_;
341
343 register_follow_t* follower_;
344
346 QString previous_filter_;
347
349 QString filter_out_filter_;
350
352 QString output_filter_;
353
355 int client_buffer_count_;
356
358 int server_buffer_count_;
359
361 int client_packet_count_;
362
364 int server_packet_count_;
365
367 uint32_t last_packet_;
368
370 bool last_from_server_;
371
373 nstime_t last_ts_;
374
376 int turns_;
377
379 bool use_regex_find_;
380
382 bool terminating_;
383
385 int previous_sub_stream_num_;
386};
387
388#endif // FOLLOW_STREAM_DIALOG_H
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
A dialog window for viewing the contents of a network stream.
Definition follow_stream_dialog.h:40
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.
bool follow(QString previous_filter=QString(), bool use_stream_index=false, unsigned stream_num=0, unsigned sub_stream_num=0)
Initiates the stream following process.
Definition follow_stream_dialog.cpp:1017
const follow_info_t & followInfo() const
Retrieves the core follow_info structure.
Definition follow_stream_dialog.h:122
~FollowStreamDialog()
Destroys the FollowStreamDialog.
Definition follow_stream_dialog.cpp:167
virtual QString clientToServerString() const
Gets the string representation for the client-to-server direction.
Definition follow_stream_dialog.cpp:983
void captureFileClosed()
Slot triggered when the underlying capture file is closed.
Definition follow_stream_dialog.cpp:1181
void keyPressEvent(QKeyEvent *event)
Handles key press events in the dialog.
Definition follow_stream_dialog.cpp:651
bool eventFilter(QObject *obj, QEvent *event)
Filters events for the dialog text display.
Definition follow_stream_dialog.cpp:631
virtual QString bothDirectionsString() const
Gets the string representation for both directions.
Definition follow_stream_dialog.cpp:1009
void addCodecs(const QMap< QString, QTextCodec * > &codecMap)
Adds a map of character encodings to the dialog's codec selection.
Definition follow_stream_dialog.cpp:173
int server_packet_count() const
Gets the number of packets sent by the server.
Definition follow_stream_dialog.h:110
virtual QString labelHint(int pkt=0)
Generates a hint label based on the current packet.
Definition follow_stream_dialog.cpp:195
virtual QString serverToClientString() const
Gets the string representation for the server-to-client direction.
Definition follow_stream_dialog.cpp:957
int turns() const
Gets the number of direction changes (turns) in the stream.
Definition follow_stream_dialog.h:116
int client_packet_count() const
Gets the number of packets sent by the client.
Definition follow_stream_dialog.h:104
Base class for Wireshark specific dialogs that require interaction with a CaptureFile.
Definition wireshark_dialog.h:38
Aggregates all state for following and reassembling a single stream across both client and server dir...
Definition follow.h:65
Definition mcast_stream.h:30
Definition nstime.h:26
Definition follow.c:23