replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
[metze/wireshark/wip.git] / ui / qt / firewall_rules_dialog.h
1 /* firewall_rules_dialog.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later*/
8
9 #ifndef FIREWALL_RULES_DIALOG_H
10 #define FIREWALL_RULES_DIALOG_H
11
12 #include "epan/address.h"
13
14 #include <wireshark_dialog.h>
15
16 namespace Ui {
17 class FirewallRulesDialog;
18 }
19
20 class QAbstractButton;
21
22 typedef void (*syntax_func)(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
23
24 class FirewallRulesDialog : public WiresharkDialog
25 {
26     Q_OBJECT
27
28 public:
29     explicit FirewallRulesDialog(QWidget &parent, CaptureFile &cf);
30     ~FirewallRulesDialog();
31
32 private slots:
33     void on_productComboBox_currentIndexChanged(int new_idx);
34     void on_inboundCheckBox_toggled(bool);
35     void on_denyCheckBox_toggled(bool);
36     void on_buttonBox_helpRequested();
37
38     void on_buttonBox_clicked(QAbstractButton *button);
39
40 private:
41     Ui::FirewallRulesDialog *ui;
42
43     QString file_name_;
44     int packet_num_;
45
46     size_t prod_;
47     address dl_src_;
48     address dl_dst_;
49     address net_src_;
50     address net_dst_;
51     port_type ptype_;
52     guint32 src_port_;
53     guint32 dst_port_;
54
55     void updateWidgets();
56     void addRule(QString description, syntax_func rule_func, address *addr, guint32 port);
57 };
58
59 #endif // FIREWALL_RULES_DIALOG_H
60
61 /*
62  * Editor modelines
63  *
64  * Local Variables:
65  * c-basic-offset: 4
66  * tab-width: 8
67  * indent-tabs-mode: nil
68  * End:
69  *
70  * ex: set shiftwidth=4 tabstop=8 expandtab:
71  * :indentSize=4:tabSize=8:noTabs=true:
72  */