summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Config.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta/Config.pm')
-rwxr-xr-xlib/Vyatta/Config.pm23
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/Vyatta/Config.pm b/lib/Vyatta/Config.pm
index 8067e05..371fe32 100755
--- a/lib/Vyatta/Config.pm
+++ b/lib/Vyatta/Config.pm
@@ -53,8 +53,9 @@ sub get_path_comps {
}
############################################################
-# low-level API functions that have been converted to use
-# the cstore library.
+# low-level API functions that use the cstore library directly.
+# they are either new functions or old ones that have been
+# converted to use cstore.
############################################################
######
@@ -94,6 +95,24 @@ sub existsOrig {
return; # note: this return is needed.
}
+## isDefault("path to node")
+# Returns true if specified node is "default" in working config.
+sub isDefault {
+ my ($self, $path) = @_;
+ return 1
+ if ($self->{_cstore}->cfgPathDefault($self->get_path_comps($path), undef));
+ return; # note: this return is needed.
+}
+
+## isDefaultOrig("path to node")
+# Returns true if specified node is "default" in active config.
+sub isDefaultOrig {
+ my ($self, $path) = @_;
+ return 1
+ if ($self->{_cstore}->cfgPathDefault($self->get_path_comps($path), 1));
+ return; # note: this return is needed.
+}
+
## listNodes("level")
# return array of all child nodes at "level" in working config.
sub listNodes {