summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-04-13 11:50:23 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-04-13 11:50:23 -0700
commit7c03bbb617c8e8c5bc9a553f25b79d43a8e40623 (patch)
tree322afdeb7acdd3126011910bfa115cd7bc388b4e /src/common
parent3ea2bdb717ceb9ef1f2843e3416ccf6ad0a54583 (diff)
downloadvyatta-cfg-7c03bbb617c8e8c5bc9a553f25b79d43a8e40623.tar.gz
vyatta-cfg-7c03bbb617c8e8c5bc9a553f25b79d43a8e40623.zip
fix for bug 2176.
Embedded leaf nodes can now be supported in the cli structure. In additional an arbritrary limit can be set on the number of multinode values allowed. Format in the node.def is: tag: [u32] or multi: [u32] For the special case of a leaf node the value for u32 is 1. In this case the operation applied to the node is to replace the node with the set value. This generates a delete of the old tree structure from the embedded leaf and a set of the new tree structure from the embedded leaf.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/defs.h1
-rw-r--r--src/common/unionfs.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/src/common/defs.h b/src/common/defs.h
index 934364a..8c68c1d 100644
--- a/src/common/defs.h
+++ b/src/common/defs.h
@@ -55,6 +55,7 @@ struct Config
{
boolean _multi;
int _priority;
+ int _limit;
vtw_def _def; //keep this here
char* _help;
char* _default;
diff --git a/src/common/unionfs.c b/src/common/unionfs.c
index b573d17..2220d73 100644
--- a/src/common/unionfs.c
+++ b/src/common/unionfs.c
@@ -225,6 +225,15 @@ retrieve_data(char* rel_data_path, GNode *node, char* root, NODE_OPERATION op)
}
//either multi or tag--shouldn't have made a difference, but arkady was confused.
vn->_config._multi = (def.tag | def.multi);
+ if (def.def_tag > 0) {
+ vn->_config._limit = def.def_tag;
+ }
+ else if (def.def_multi > 0) {
+ vn->_config._limit = def.def_multi;
+ }
+ else {
+ vn->_config._limit = 0;
+ }
}
}