diff --git a/editfwrulesdlg.ui b/editfwrulesdlg.ui
index 4df4368..acb25d2 100644
--- a/editfwrulesdlg.ui
+++ b/editfwrulesdlg.ui
@@ -67,14 +67,28 @@
-
-
-
- Allow DNS queries
-
-
- true
-
-
+
+
-
+
+
+ Allow DNS queries
+
+
+ true
+
+
+
+ -
+
+
+ Allow ICMP traffic
+
+
+ true
+
+
+
+
@@ -133,11 +147,12 @@
policyAllowRadioButton
policyDenyRadioButton
- dnsCheckBox
rulesTreeView
newRuleButton
editRuleButton
deleteRuleButton
+ dnsCheckBox
+ icmpCheckBox
buttonBox
diff --git a/qubesmanager/firewall.py b/qubesmanager/firewall.py
index 59af881..1b51ae3 100644
--- a/qubesmanager/firewall.py
+++ b/qubesmanager/firewall.py
@@ -43,6 +43,7 @@ class EditFwRulesDlg (QDialog, ui_editfwrulesdlg.Ui_EditFwRulesDlg):
self.deleteRuleButton.clicked.connect(self.delete_rule_button_pressed)
self.policyAllowRadioButton.toggled.connect(self.policy_radio_toggled)
self.dnsCheckBox.toggled.connect(self.dns_checkbox_toggled)
+ self.icmpCheckBox.toggled.connect(self.icmp_checkbox_toggled)
def set_model(self, model):
self.__model = model
@@ -51,6 +52,7 @@ class EditFwRulesDlg (QDialog, ui_editfwrulesdlg.Ui_EditFwRulesDlg):
self.rulesTreeView.header().setResizeMode(0, QHeaderView.Stretch)
self.set_allow(model.allow)
self.dnsCheckBox.setChecked(model.allowDns)
+ self.icmpCheckBox.setChecked(model.allowIcmp)
self.setWindowTitle(model.get_vm_name() + " firewall")
def set_allow(self, allow):
@@ -63,6 +65,9 @@ class EditFwRulesDlg (QDialog, ui_editfwrulesdlg.Ui_EditFwRulesDlg):
def dns_checkbox_toggled(self, on):
self.__model.allowDns = on
+ def icmp_checkbox_toggled(self, on):
+ self.__model.allowIcmp = on
+
def new_rule_button_pressed(self):
dialog = NewFwRuleDlg()
self.run_rule_dialog(dialog)
@@ -228,6 +233,7 @@ class QubesFirewallRulesModel(QAbstractItemModel):
self.allow = conf["allow"]
self.allowDns = conf["allowDns"]
+ self.allowIcmp = conf["allowIcmp"]
for rule in conf["rules"]:
self.appendChild(QubesFirewallRuleItem(
@@ -240,7 +246,11 @@ class QubesFirewallRulesModel(QAbstractItemModel):
def apply_rules(self):
assert self.__vm is not None
- conf = { "allow": self.allow, "allowDns": self.allowDns, "rules": list() }
+ conf = { "allow": self.allow,
+ "allowDns": self.allowDns,
+ "allowIcmp": self.allowIcmp,
+ "rules": list()
+ }
for rule in self.children:
conf["rules"].append(