[netcf-devel] [PATCH 1/3] Extend the schema for IPv6 addressing

David Lutterkort lutter at redhat.com
Thu Sep 24 23:32:21 UTC 2009


---
 data/xml/interface.rng |   53 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 52 insertions(+), 1 deletions(-)

diff --git a/data/xml/interface.rng b/data/xml/interface.rng
index 6b8f79d..bb8500f 100644
--- a/data/xml/interface.rng
+++ b/data/xml/interface.rng
@@ -7,7 +7,7 @@
        is released. The current version is indicated with the v:serial
        attribute on the start element.
   -->
-  <start v:serial="2">
+  <start v:serial="3">
     <choice>
       <ref name="ethernet-interface"/>
       <ref name="bridge-interface"/>
@@ -276,6 +276,11 @@
         <ref name="protocol-ipv4"/>
       </element>
     </optional>
+    <optional v:since="3">
+      <element name="protocol">
+        <ref name="protocol-ipv6"/>
+      </element>
+    </optional>
   </define>
 
   <define name="protocol-ipv4">
@@ -305,6 +310,38 @@
       </group>
     </choice>
   </define>
+
+  <define name="protocol-ipv6">
+    <attribute name="family">
+      <value>ipv6</value>
+    </attribute>
+    <optional>
+      <element name="autoconf"><empty/></element>
+    </optional>
+    <optional>
+      <element name="dhcp">
+        <optional>
+          <attribute name="peerdns">
+            <ref name="yes-or-no"/>
+          </attribute>
+        </optional>
+      </element>
+    </optional>
+    <zeroOrMore>
+      <element name="ip">
+        <attribute name="address"><ref name="ipv6-addr"/></attribute>
+        <optional>
+          <attribute name="prefix"><ref name="ipv6-prefix"/></attribute>
+        </optional>
+      </element>
+    </zeroOrMore>
+    <optional>
+      <element name="route">
+        <attribute name="gateway"><ref name="ipv6-addr"/></attribute>
+      </element>
+    </optional>
+  </define>
+
   <!-- Jim Fehlig (<jfehlig at novell.com>) suggest the
        following additions to DHCP:
 
@@ -402,6 +439,20 @@
     </data>
   </define>
 
+  <!-- Based on http://blog.mes-stats.fr/2008/10/09/regex-ipv4-et-ipv6 -->
+  <define name='ipv6-addr'>
+    <data type='string'>
+      <!-- To understand this better, take apart the toplevel '|'s -->
+      <param name="pattern">(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\.){3}(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))))|(([0-9A-Fa-f]{1,4}:){0,5}:((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\.){3}(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))))|(::([0-9A-Fa-f]{1,4}:){0,5}((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\.){3}(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)</param>
+    </data>
+  </define>
+
+  <define name='ipv6-prefix'>
+    <data type='unsignedInt'>
+      <param name="maxInclusive">128</param>
+    </data>
+  </define>
+
   <define name='vlan-id'>
     <data type="unsignedInt">
       <param name="maxInclusive">4096</param>
-- 
1.6.2.5



More information about the netcf-devel mailing list