summaryrefslogtreecommitdiff
path: root/interface-definitions
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2017-09-16 20:04:28 +0200
committerDaniil Baturin <daniil@baturin.org>2017-09-16 20:04:28 +0200
commit793c2707b976f3efff886dcae283b54466402f9b (patch)
tree72105a74722a3b9c1faa654926a7e1a073d6f96c /interface-definitions
parent046123c4f7e0ada2aa6b66558735f6cd704b3663 (diff)
downloadvyos-1x-793c2707b976f3efff886dcae283b54466402f9b.tar.gz
vyos-1x-793c2707b976f3efff886dcae283b54466402f9b.zip
[LLDP] T393: add constraints and error messages to the LLDP interface definition.
Diffstat (limited to 'interface-definitions')
-rw-r--r--interface-definitions/lldp.xml31
1 files changed, 31 insertions, 0 deletions
diff --git a/interface-definitions/lldp.xml b/interface-definitions/lldp.xml
index 193d1c00c..a0c610dfa 100644
--- a/interface-definitions/lldp.xml
+++ b/interface-definitions/lldp.xml
@@ -131,11 +131,19 @@
<format>128</format>
<description>Script</description>
</valueHelp>
+ <constraintErrorMessage>ca-type must between 0-128</constraintErrorMessage>
+ <constraint>
+ <validator name="numeric" argument="--range 0-128"/>
+ </constraint>
</properties>
<children>
<leafNode name="ca-value">
<properties>
<help>Civic address value for ca-type [REQUIRED]</help>
+ <constraintErrorMessage>ca-value must be less than 256 characters</constraintErrorMessage>
+ <constraint>
+ <regex>^[A-Za-z0-9\ \-\_\.\,]{0,255}$</regex>
+ </constraint>
</properties>
</leafNode>
</children>
@@ -147,6 +155,10 @@
<format>&lt;AA&gt;</format>
<description>Two letter ISO 3166 country code</description>
</valueHelp>
+ <constraintErrorMessage>country-code must be 2 characters</constraintErrorMessage>
+ <constraint>
+ <regex>^[a-zA-Z]{2}$</regex>
+ </constraint>
</properties>
</leafNode>
</children>
@@ -163,6 +175,10 @@
<format>[+-]&lt;meters&gt;</format>
<description>Altitude in meters</description>
</valueHelp>
+ <constraintErrorMessage>Altitude should be a positive or negative number</constraintErrorMessage>
+ <constraint>
+ <validator name="numeric"/>
+ </constraint>
</properties>
</leafNode>
<leafNode name="datum">
@@ -180,6 +196,13 @@
<format>MLLW</format>
<description>NAD83/MLLW</description>
</valueHelp>
+ <completionHelp>
+ <list>WGS84 NAD83 MLLW</list>
+ </completionHelp>
+ <constraintErrorMessage>Datum should be WGS84, NAD83, or MLLW</constraintErrorMessage>
+ <constraint>
+ <regex>^(WGS84|NAD83|MLLW)$</regex>
+ </constraint>
</properties>
</leafNode>
<leafNode name="latitude">
@@ -189,6 +212,10 @@
<format>&lt;latitude&gt;</format>
<description>Latitude (example "37.524449N")</description>
</valueHelp>
+ <constraintErrorMessage>Latitude should be a number followed by S or N</constraintErrorMessage>
+ <constraint>
+ <regex>^(\d+)(\.\d+)?[nNsS]$</regex>
+ </constraint>
</properties>
</leafNode>
<leafNode name="longitude">
@@ -198,6 +225,10 @@
<format>&lt;longitude&gt;</format>
<description>Longitude (example "122.267255W")</description>
</valueHelp>
+ <constraintErrorMessage>Longiture should be a number followed by E or W</constraintErrorMessage>
+ <constraint>
+ <regex>^(\d+)(\.\d+)?[eEwW]$</regex>
+ </constraint>
</properties>
</leafNode>
</children>