adding some stuff for repomirror

This commit is contained in:
brent s. 2020-06-13 03:46:57 -04:00
parent faf6e9f96f
commit 6d3a9f5d3a
Signed by: bts
GPG Key ID: 8C004C2F93481F6B
6 changed files with 158 additions and 3 deletions

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:include schemaLocation="../types/repomirror.xsd"/>
<xs:include schemaLocation="../types/net.xsd"/>
<xs:include schemaLocation="../types/unix.xsd"/>

<!-- Commented out; we don't bother with SSH variants. See also e_repomir_upstream -->
<!--
<xs:complexType name="e_repomir_sync_proto">
<xs:simpleContent>
<xs:extension base="t_repomir_synctype">
<xs:attribute name="ssh" use="optional" default="false" type="xs:boolean"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
-->


<xs:complexType name="e_repomir_upstream">
<xs:all minOccurs="1">
<!-- <xs:element name="syncType" type="e_repomir_sync_proto" minOccurs="1"/> -->
<xs:element name="syncType" type="t_repomir_synctype" minOccurs="1"/>
<xs:element name="domain" type="xs:token" minOccurs="1"/>
<xs:element name="port" minOccurs="0" type="t_net_port"/>
<xs:element name="path" minOccurs="1" type="t_unix_filepath"/>
</xs:all>

</xs:complexType>

</xs:schema>

View File

@ -117,6 +117,13 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="t_net_port">
<xs:restriction base="xs:positiveInteger">
<xs:minExclusive value="0"/>
<xs:maxInclusive value="65535"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="t_net_proto">
<!-- TODO: expand? Remove gre? -->
<xs:restriction base="xs:string">

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:simpleType name="t_repomir_synctype">
<xs:restriction base="xs:token">
<xs:enumeration value="rsync"/>
<xs:enumeration value="ftp"/>
</xs:restriction>
</xs:simpleType>

</xs:schema>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:include schemaLocation="linux.xsd"/>
<xs:include schemaLocation="net.xsd"/>

<!-- IEEE 802.1Q -->
<xs:simpleType name="t_router_vlan">
<xs:restriction base="xs:nonNegativeInteger">
<xs:minInclusive value="0"/><!-- Technically redundant. -->
<!--
This is actually a vendor-specific thing; the official IEEE 802.1Q spec does NOT specify that VLAN ID 1 is
reserved for management.
-->
<!-- <xs:minInclusive value="1"/> -->
<xs:maxInclusive value="4094"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="t_router_bridge_iface">
<xs:list itemType="t_linux_iface_name"/>
</xs:simpleType>

<xs:complexType name="t_router_iface">
<xs:simpleContent>
<xs:extension base="t_linux_iface_name">
<xs:attribute name="vlan" type="t_router_vlan" use="optional"/>
<xs:attribute name="bridge" type="t_router_bridge_iface" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

</xs:schema>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema targetNamespace="https://git.square-r00t.net/RepoMirror/"
xmlns="https://git.square-r00t.net/RepoMirror/"
xmlns:tunnel="https://git.square-r00t.net/RepoMirror/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:include schemaLocation="../lib/types/net.xsd"/>
<xs:include schemaLocation="../lib/types/repomirror.xsd"/>
<xs:include schemaLocation="../lib/types/std.xsd"/>
<xs:include schemaLocation="../lib/elements/repomirror.xsd"/>

<!-- ROOT -->
<xs:element name="mirror">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="distro">
<xs:complexType>
<xs:sequence minOccurs="1">
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="upstream" type="e_repomir_upstream"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="name" type="xs:ID" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>

View File

@ -6,11 +6,46 @@
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:include schemaLocation="../../lib/types/linux.xsd"/>
<xs:include schemaLocation="../../lib/types/net.xsd"/>
<xs:include schemaLocation="../../lib/types/router.xsd"/>

<xs:element name="networks">
<xs:complexType>
<xs:sequence minOccurs="1">
<xs:element name="network" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:all>

<xs:element name="dnsMasqTag" type="xs:token" minOccurs="0"/>
<xs:element name="iface" type="t_router_iface"/>
<xs:element name="addrs" minOccurs="0">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="ip4" type="t_net_qualified_addr_ip4"/>
<xs:element name="ip6">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="t_net_qualified_addr_ip6">
<xs:attribute name="dhcp" use="optional" type="xs:boolean" default="false"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="notes" minOccurs="0">
<xs:complexType>
<xs:sequence minOccurs="1">
<xs:element name="note" minOccurs="1" maxOccurs="unbounded" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="name" type="xs:ID" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>