Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
show_packet_bytes_dialog.h
Go to the documentation of this file.
1
10#ifndef SHOW_PACKET_BYTES_DIALOG_H
11#define SHOW_PACKET_BYTES_DIALOG_H
12
13#include <config.h>
14#include <stdio.h>
15
16#ifdef HAVE_UNISTD_H
17#include <unistd.h>
18#endif
19
20#include "file.h"
21#include "wireshark_dialog.h"
22
23#include <QLineEdit>
24#include <QPushButton>
25#include <QTextEdit>
26#include <QTextCodec>
27
28namespace Ui {
31}
32
34 QString name;
35 tvbuff_t *(*function)(tvbuff_t *, int, int);
36};
37
39{
40 Q_OBJECT
41
42public:
43 explicit ShowPacketBytesDialog(QWidget &parent, CaptureFile &cf);
45
46 void addCodecs(const QMap<QString, QTextCodec *> &codecMap);
47
48protected:
49 bool eventFilter(QObject *obj, QEvent *event);
50 void keyPressEvent(QKeyEvent *event);
51 void captureFileClosing();
52 void captureFileClosed();
53
54private slots:
55 void on_sbStart_valueChanged(int value);
56 void on_sbEnd_valueChanged(int value);
57 void on_cbDecodeAs_currentIndexChanged(int idx);
58 void on_cbShowAs_currentIndexChanged(int idx);
59 void on_leFind_returnPressed();
60 void on_bFind_clicked();
61 void on_buttonBox_rejected();
62
63 void showSelected(int start, int end);
64 void useRegexFind(bool use_regex);
65 void findText(bool go_back = true);
66 void helpButton();
67 void printBytes();
68 void copyBytes();
69 void saveAs();
70
71private:
72 void setStartAndEnd(int start, int end);
73 bool enableShowSelected();
74 void updateWidgets(); // Needed for WiresharkDialog?
75 void updateHintLabel();
76 void sanitizeBuffer(QByteArray &ba, bool handle_CR);
77 void symbolizeBuffer(QByteArray &ba);
78 QByteArray decodeQuotedPrintable(const uint8_t *bytes, int length);
79 void rot13(QByteArray &ba);
80 void updateFieldBytes(bool initialization = false);
81 void updatePacketBytes();
82
83 Ui::ShowPacketBytesDialog *ui;
84
85 const field_info *finfo_;
86 QByteArray field_bytes_;
87 QString hint_label_;
88 QString decode_as_name_;
89 QPushButton *print_button_;
90 QPushButton *copy_button_;
91 QPushButton *save_as_button_;
92 bool use_regex_find_;
93 int start_;
94 int end_;
95 QImage image_;
96};
97
98class ShowPacketBytesTextEdit : public QTextEdit
99{
100 Q_OBJECT
101
102public:
103 explicit ShowPacketBytesTextEdit(QWidget *parent = 0) :
104 QTextEdit(parent), show_selected_enabled_(true), menus_enabled_(true) { }
106
107 void setShowSelectedEnabled(bool enabled) { show_selected_enabled_ = enabled; }
108 void setMenusEnabled(bool enabled) { menus_enabled_ = enabled; }
109
110signals:
111 void showSelected(int, int);
112
113private slots:
114 void contextMenuEvent(QContextMenuEvent *event);
115 void showSelected();
116 void showAll();
117
118private:
119 bool show_selected_enabled_;
120 bool menus_enabled_;
121};
122
123#endif // SHOW_PACKET_BYTES_DIALOG_H
Definition capture_file.h:21
Definition show_packet_bytes_dialog.h:39
void captureFileClosed()
Called when the capture file was closed. This can be used to enable or disable widgets according to t...
Definition show_packet_bytes_dialog.cpp:927
void captureFileClosing()
Called when the capture file is about to close. This can be used to disconnect taps and similar actio...
Definition show_packet_bytes_dialog.cpp:920
Definition show_packet_bytes_dialog.h:99
Definition wireshark_dialog.h:35
Definition proto.h:811
Definition tvbuff-int.h:35
Definition show_packet_bytes_dialog.h:33