We will need access to these attributes of the object from outside
virfirewall.c.
Signed-off-by: Laine Stump <laine(a)redhat.com>
---
src/libvirt_private.syms | 3 +++
src/util/virfirewall.c | 30 ++++++++++++++++++++++++++++++
src/util/virfirewall.h | 10 ++++++++++
3 files changed, 43 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 1247b67a39..73cccf38a1 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2380,7 +2380,10 @@ virFirewallRuleAddArg;
virFirewallRuleAddArgFormat;
virFirewallRuleAddArgList;
virFirewallRuleAddArgSet;
+virFirewallRuleGetArg;
virFirewallRuleGetArgCount;
+virFirewallRuleGetIgnoreErrors;
+virFirewallRuleGetLayer;
virFirewallRuleToString;
virFirewallStartRollback;
virFirewallStartTransaction;
diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c
index e8e74621c8..15c8db3702 100644
--- a/src/util/virfirewall.c
+++ b/src/util/virfirewall.c
@@ -388,6 +388,36 @@ size_t virFirewallRuleGetArgCount(virFirewallRule *rule)
}
+const char *
+virFirewallRuleGetArg(virFirewallRule *rule,
+ int index)
+{
+ if (!rule || rule->argsLen <= index)
+ return NULL;
+ return rule->args[index];
+}
+
+
+virFirewallLayer
+virFirewallRuleGetLayer(virFirewallRule *rule)
+{
+ if (!rule)
+ return VIR_FIREWALL_LAYER_LAST;
+
+ return rule->layer;
+}
+
+
+bool
+virFirewallRuleGetIgnoreErrors(virFirewallRule *rule)
+{
+ if (!rule)
+ return false;
+
+ return rule->ignoreErrors;
+}
+
+
/**
* virFirewallStartTransaction:
* @firewall: the firewall ruleset
diff --git a/src/util/virfirewall.h b/src/util/virfirewall.h
index 187748b2bf..0f40dae859 100644
--- a/src/util/virfirewall.h
+++ b/src/util/virfirewall.h
@@ -89,6 +89,16 @@ void virFirewallRuleAddArgList(virFirewall *firewall,
size_t virFirewallRuleGetArgCount(virFirewallRule *rule);
+const char *
+virFirewallRuleGetArg(virFirewallRule *rule,
+ int index);
+
+virFirewallLayer
+virFirewallRuleGetLayer(virFirewallRule *rule);
+
+bool
+virFirewallRuleGetIgnoreErrors(virFirewallRule *rule);
+
char *virFirewallRuleToString(const char *cmd,
virFirewallRule *rule);
--
2.39.2