Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
import_text_dialog.h
Go to the documentation of this file.
1
10#ifndef IMPORT_TEXT_DIALOG_H
11#define IMPORT_TEXT_DIALOG_H
12
13#include <config.h>
14
15#include <stdio.h>
16
17#include "ui/text_import.h"
18
20
21#include <QDialog>
22#include <QPushButton>
23#include <QRadioButton>
24#include <QButtonGroup>
25
26namespace Ui {
28}
29
33class ImportTextDialog : public QDialog
34{
35 Q_OBJECT
36
37public:
42 explicit ImportTextDialog(QWidget *parent = 0);
43
48
53 QString &capfileName();
54
55private:
60 void enableHeaderWidgets(uint encapsulation = WTAP_ENCAP_ETHERNET);
61
62 /* regex fields */
68 void enableFieldWidgets(bool enable_direction_input = true, bool enable_time_input = true);
69
80 void check_line_edit(SyntaxLineEdit *le, bool &ok_enable, const QString &num_str, int base, unsigned max_val, bool is_short, unsigned *val_ptr);
81
89 void checkAddress(SyntaxLineEdit *le, bool &ok_enable, const QString &addr_str, ws_in4_addr *val_ptr);
90
98 void checkIPv6Address(SyntaxLineEdit *le, bool &ok_enable, const QString &addr_str, ws_in6_addr *val_ptr);
99
105 bool checkDateTimeFormat(const QString &time_format);
106
110 void loadSettingsFile();
111
115 void saveSettingsFile();
116
120 void applyDialogSettings();
121
125 void storeDialogSettings();
126
130 void updateImportButtonState();
131
133 Ui::ImportTextDialog *ti_ui_;
134
136 QVariantMap settings;
137
139 QPushButton *import_button_;
140
142 QButtonGroup *encap_buttons;
143
145 text_import_info_t import_info_;
146
148 QString capfile_name_;
149
151 bool file_ok_;
152
154 bool timestamp_format_ok_;
155
156 /* Regex input */
157
159 bool regex_ok_;
160
162 bool re_has_dir_;
163
165 bool in_indication_ok_;
166
168 bool out_indication_ok_;
169
171 bool re_has_time_;
172
174 bool ether_type_ok_;
175
177 bool proto_ok_;
178
180 bool source_addr_ok_;
181
183 bool dest_addr_ok_;
184
186 bool source_port_ok_;
187
189 bool dest_port_ok_;
190
192 bool tag_ok_;
193
195 bool ppi_ok_;
196
198 bool payload_ok_;
199
201 bool max_len_ok_;
202
203public slots:
208 int exec();
209
210private slots:
214 void on_textFileBrowseButton_clicked();
215
220 void on_textFileLineEdit_textChanged(const QString &arg1);
221
226 void on_modeTabWidget_currentChanged(int index);
227
232 void on_timestampFormatLineEdit_textChanged(const QString &arg1);
233
234 /* Hex Dump input */
239 void on_noOffsetButton_toggled(bool checked);
240
245 void on_directionIndicationCheckBox_toggled(bool checked);
246
251 void on_asciiIdentificationCheckBox_toggled(bool checked);
252
257 void on_littleEndianCheckBox_toggled(bool checked);
258
259 /* Regex input */
263 void on_regexTextEdit_textChanged();
264
269 void on_dataEncodingComboBox_currentIndexChanged(int index);
270
275 void on_dirInIndicationLineEdit_textChanged(const QString &arg1);
276
281 void on_dirOutIndicationLineEdit_textChanged(const QString &arg1);
282
283 /* Encapsulation input */
288 void on_encapComboBox_currentIndexChanged(int index);
289
295 void encap_buttonsToggled(QAbstractButton *button, bool checked);
296
301 void on_ipVersionComboBox_currentIndexChanged(int index);
302
307 void on_ethertypeLineEdit_textChanged(const QString &ethertype_str);
308
313 void on_protocolLineEdit_textChanged(const QString &protocol_str);
314
319 void on_sourceAddressLineEdit_textChanged(const QString &source_addr_str);
320
325 void on_destinationAddressLineEdit_textChanged(const QString &destination_addr_str);
326
331 void on_sourcePortLineEdit_textChanged(const QString &source_port_str);
332
337 void on_destinationPortLineEdit_textChanged(const QString &destination_port_str);
338
343 void on_tagLineEdit_textChanged(const QString &tag_str);
344
349 void on_ppiLineEdit_textChanged(const QString &ppi_str);
350
351 /* Footer input */
356 void on_maxLengthLineEdit_textChanged(const QString &max_frame_len_str);
357
361 void on_buttonBox_helpRequested();
362};
363
364
365#endif // IMPORT_TEXT_DIALOG_H
A dialog for importing packets from a text file (hex dump or regex formats).
Definition import_text_dialog.h:34
QString & capfileName()
Retrieves the generated capture file name resulting from the import.
Definition import_text_dialog.cpp:402
~ImportTextDialog()
Destroys the ImportTextDialog.
Definition import_text_dialog.cpp:178
int exec()
Shows the dialog as a modal window, blocking until the user closes it.
Definition import_text_dialog.cpp:406
QLineEdit subclass that adds syntax-state colouring, error messaging, and partial token-based autocom...
Definition syntax_line_edit.h:28
uint32_t ws_in4_addr
Represents a 32-bit IPv4 address in network byte order.
Definition inet_addr.h:22
Represents a 128-bit IPv6 address.
Definition inet_addr.h:27
Complete configuration and runtime state for a text-to-pcap import operation.
Definition text_import.h:84