| Wireshark 4.7.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 <epan/tvbuff.h>
21#include "wireshark_dialog.h"
22
23#include <QLineEdit>
24#include <QPushButton>
25#include <QTextEdit>
26#include <QTextCodec>
27
28 namespace Ui {
29 class ShowPacketBytesDialog;
30 class ShowPacketBytesTextEdit;
31}
32
33 struct uncompress_list_t {
34 QString name;
35 tvbuff_t *(*function)(tvbuff_t *, unsigned, unsigned);
36};
37
38 class ShowPacketBytesDialog : public WiresharkDialog
39{
40 Q_OBJECT
41
42 public:
43 explicit ShowPacketBytesDialog(QWidget &parent, CaptureFile &cf);
44 ~ShowPacketBytesDialog();
45
46 void addCodecs(const QMap<QString, QTextCodec *> &codecMap);
47
48 protected:
49 bool eventFilter(QObject *obj, QEvent *event);
50 void keyPressEvent(QKeyEvent *event);
51
52 private slots:
53 void on_sbStart_valueChanged(int value);
54 void on_sbEnd_valueChanged(int value);
55 void on_cbDecodeAs_currentIndexChanged(int idx);
56 void on_cbShowAs_currentIndexChanged(int idx);
57 void on_leFind_returnPressed();
58 void on_bFind_clicked();
59 void on_buttonBox_rejected();
60
61 void showSelected(int start, int end);
62 void useRegexFind(bool use_regex);
63 void findText(bool go_back = true);
64 void helpButton();
65 void printBytes();
66 void copyBytes();
67 void saveAs();
68
69 private:
70 void setStartAndEnd(int start, int end);
71 bool enableShowSelected();
72 void updateWidgets(); // Needed for WiresharkDialog?
73 void updateHintLabel();
74 void sanitizeBuffer(QByteArray &ba, bool handle_CR);
75 void symbolizeBuffer(QByteArray &ba);
76 QByteArray decodeQuotedPrintable(const uint8_t *bytes, int length);
77 void rot13(QByteArray &ba);
78 void updateFieldBytes(bool initialization = false);
79 void updatePacketBytes();
80
81 Ui::ShowPacketBytesDialog *ui;
82
83 tvbuff_t *tvb_;
84 QByteArray field_bytes_;
85 QString hint_label_;
86 QString decode_as_name_;
87 QPushButton *print_button_;
88 QPushButton *copy_button_;
89 QPushButton *save_as_button_;
90 bool use_regex_find_;
91 int start_;
92 int end_;
93 QImage image_;
94};
95
96 class ShowPacketBytesTextEdit : public QTextEdit
97{
98 Q_OBJECT
99
100 public:
101 explicit ShowPacketBytesTextEdit(QWidget *parent = nullptr);
102 ~ShowPacketBytesTextEdit() { }
103
104 void setShowSelectedEnabled(bool enabled) { show_selected_enabled_ = enabled; }
105 void setMenusEnabled(bool enabled) { menus_enabled_ = enabled; }
106
107signals:
108 void showSelected(int, int);
109
110 private slots:
111 void contextMenuEvent(QContextMenuEvent *event);
112 void showSelected();
113 void showAll();
114
115 private:
116 bool show_selected_enabled_;
117 bool menus_enabled_;
118};
119
120#endif // SHOW_PACKET_BYTES_DIALOG_H
CaptureFile
Definition capture_file.h:21
ShowPacketBytesDialog
Definition show_packet_bytes_dialog.h:39
ShowPacketBytesTextEdit
Definition show_packet_bytes_dialog.h:97
WiresharkDialog
Definition wireshark_dialog.h:35
tvbuff
Definition tvbuff-int.h:36
uncompress_list_t
Definition show_packet_bytes_dialog.h:33
tvbuff.h
wireshark_dialog.h