summaryrefslogtreecommitdiff
path: root/src/cli_parse.y
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-04-15 13:39:40 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-04-15 13:39:40 -0700
commit6e99cd44d88e70cce50f1e6fa105525809d8409e (patch)
tree9c10ca5af9f4e3e243321e36d0925b13dfef3538 /src/cli_parse.y
parent634c79ab395af94972fcf778ec80ae7d79dc5561 (diff)
downloadvyatta-cfg-6e99cd44d88e70cce50f1e6fa105525809d8409e.tar.gz
vyatta-cfg-6e99cd44d88e70cce50f1e6fa105525809d8409e.zip
Multiple (i.e. one or two) datatypes can now be supported on a node.def type definition.
type: ipv4,ipv6 Will now allow for the value to validated against both data types (or the first success). In the case of both failing the following message format will be returned: vyatta@vyatta# set load-balancing wan rule 1 "1" is not a valid value of type "bool" "1" is not a valid value of type "ipv4" Note, that any combination of types with text being one of the types is not supported. The reason being is that with text any value is allowed, therefore it doesn't really make sense to validate a datatype on text + ipv4 when text will always be successful.
Diffstat (limited to 'src/cli_parse.y')
-rw-r--r--src/cli_parse.y6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cli_parse.y b/src/cli_parse.y
index 89c6638..db56d3e 100644
--- a/src/cli_parse.y
+++ b/src/cli_parse.y
@@ -129,6 +129,12 @@ tag: /* empty */
}
}
;
+type: TYPE TYPE_DEF COMMA TYPE_DEF
+ {
+ parse_defp->def_type = $2;
+ parse_defp->def_type2 = $4;
+ }
+ ;
type: TYPE TYPE_DEF SEMI STRING
{ parse_defp->def_type = $2;