summaryrefslogtreecommitdiff
path: root/src/config_tree.mli
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2019-06-30 01:00:01 +0700
committerDaniil Baturin <daniil@baturin.org>2019-06-30 01:25:57 +0700
commitaa3d09c3fff12e379fd189ceaf55644574ff5c43 (patch)
tree95ffb89bb701c14ea0e9533661c3c5c0a6aff8e9 /src/config_tree.mli
downloadvyos1x-config-aa3d09c3fff12e379fd189ceaf55644574ff5c43.tar.gz
vyos1x-config-aa3d09c3fff12e379fd189ceaf55644574ff5c43.zip
Initial import of libraries from Vyconf and old libvyosconfig.
Diffstat (limited to 'src/config_tree.mli')
-rw-r--r--src/config_tree.mli38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/config_tree.mli b/src/config_tree.mli
new file mode 100644
index 0000000..c01e299
--- /dev/null
+++ b/src/config_tree.mli
@@ -0,0 +1,38 @@
+type value_behaviour = AddValue | ReplaceValue
+
+exception Duplicate_value
+exception Node_has_no_value
+exception No_such_value
+exception Useless_set
+
+type config_node_data = {
+ values : string list;
+ comment : string option;
+ tag : bool;
+} [@@deriving yojson]
+
+type t = config_node_data Vytree.t [@@deriving yojson]
+
+val default_data : config_node_data
+
+val make : string -> t
+
+val set : t -> string list -> string option -> value_behaviour -> t
+
+val delete : t -> string list -> string option -> t
+
+val get_values : t -> string list -> string list
+
+val get_value : t -> string list -> string
+
+val set_comment : t -> string list -> string option -> t
+
+val get_comment : t -> string list -> string option
+
+val set_tag : t -> string list -> bool -> t
+
+val is_tag : t -> string list -> bool
+
+val render_commands : t -> string list -> string
+
+val render_config : t -> string