Wireshark  4.3.0
The Wireshark network protocol analyzer
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 <glib.h>
18 
19 #include "ui/text_import.h"
20 
22 
23 #include <QDialog>
24 #include <QPushButton>
25 #include <QRadioButton>
26 #include <QButtonGroup>
27 
28 namespace Ui {
29 class ImportTextDialog;
30 }
31 
32 class ImportTextDialog : public QDialog
33 {
34  Q_OBJECT
35 
36 public:
37  explicit ImportTextDialog(QWidget *parent = 0);
39  QString &capfileName();
40 
41 private:
42  void enableHeaderWidgets(uint encapsulation = WTAP_ENCAP_ETHERNET);
43 
44  /* regex fields */
45  void enableFieldWidgets(bool enable_direction_input = true, bool enable_time_input = true);
46 
47  void check_line_edit(SyntaxLineEdit *le, bool &ok_enable, const QString &num_str, int base, guint max_val, bool is_short, guint *val_ptr);
48  void checkAddress(SyntaxLineEdit *le, bool &ok_enable, const QString &addr_str, ws_in4_addr *val_ptr);
49  void checkIPv6Address(SyntaxLineEdit *le, bool &ok_enable, const QString &addr_str, ws_in6_addr *val_ptr);
50  bool checkDateTimeFormat(const QString &time_format);
51 
52  void loadSettingsFile();
53  void saveSettingsFile();
54  void applyDialogSettings();
55  void storeDialogSettings();
56 
57  void updateImportButtonState();
58 
59  Ui::ImportTextDialog *ti_ui_;
60  QVariantMap settings;
61 
62  QPushButton *import_button_;
63  QButtonGroup *encap_buttons;
64  text_import_info_t import_info_;
65  QString capfile_name_;
66  bool file_ok_;
67  bool timestamp_format_ok_;
68 
69  /* Regex input */
70  bool regex_ok_;
71  bool re_has_dir_;
72  bool in_indication_ok_;
73  bool out_indication_ok_;
74  bool re_has_time_;
75 
76  bool ether_type_ok_;
77  bool proto_ok_;
78  bool source_addr_ok_;
79  bool dest_addr_ok_;
80  bool source_port_ok_;
81  bool dest_port_ok_;
82  bool tag_ok_;
83  bool ppi_ok_;
84  bool payload_ok_;
85  bool max_len_ok_;
86 
87 public slots:
88  int exec();
89 
90 private slots:
91  void on_textFileBrowseButton_clicked();
92  void on_textFileLineEdit_textChanged(const QString &arg1);
93  void on_modeTabWidget_currentChanged(int index);
94  void on_timestampFormatLineEdit_textChanged(const QString &arg1);
95 
96  /* Hex Dump input */
97  void on_noOffsetButton_toggled(bool checked);
98  void on_directionIndicationCheckBox_toggled(bool checked);
99  void on_asciiIdentificationCheckBox_toggled(bool checked);
100 
101  /* Regex input */
102  void on_regexTextEdit_textChanged();
103  void on_dataEncodingComboBox_currentIndexChanged(int index);
104  void on_dirInIndicationLineEdit_textChanged(const QString &arg1);
105  void on_dirOutIndicationLineEdit_textChanged(const QString &arg1);
106 
107  /* Encapsulation input */
108  void on_encapComboBox_currentIndexChanged(int index);
109  void encap_buttonsToggled(QAbstractButton *button, bool checked);
110  void on_ipVersionComboBox_currentIndexChanged(int index);
111  void on_ethertypeLineEdit_textChanged(const QString &ethertype_str);
112  void on_protocolLineEdit_textChanged(const QString &protocol_str);
113  void on_sourceAddressLineEdit_textChanged(const QString &source_addr_str);
114  void on_destinationAddressLineEdit_textChanged(const QString &destination_addr_str);
115  void on_sourcePortLineEdit_textChanged(const QString &source_port_str);
116  void on_destinationPortLineEdit_textChanged(const QString &destination_port_str);
117  void on_tagLineEdit_textChanged(const QString &tag_str);
118  void on_ppiLineEdit_textChanged(const QString &ppi_str);
119 
120  /* Footer input */
121  void on_maxLengthLineEdit_textChanged(const QString &max_frame_len_str);
122  void on_buttonBox_helpRequested();
123 };
124 
125 
126 #endif // IMPORT_TEXT_DIALOG_H
Definition: import_text_dialog.h:33
Definition: syntax_line_edit.h:23
Definition: inet_ipv6.h:21
Definition: text_import.h:65