2011-06-26 09:13:10 +00:00
|
|
|
<?xml version="1.0"?>
|
2009-07-15 17:37:20 +00:00
|
|
|
<!-- A Relax NG schema for network interfaces -->
|
|
|
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
|
2010-01-02 01:40:26 +00:00
|
|
|
xmlns:v="http://netcf.org/xml/version/1.0"
|
2009-07-15 17:37:20 +00:00
|
|
|
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
2010-01-02 01:40:26 +00:00
|
|
|
<!-- Versions for this schema are simple integers that are incremented
|
2015-03-19 15:53:00 +00:00
|
|
|
every time a changed (but backwards compatible) version
|
2010-01-02 01:40:26 +00:00
|
|
|
is released. The current version is indicated with the v:serial
|
|
|
|
attribute on the start element.
|
|
|
|
-->
|
|
|
|
<start v:serial="4">
|
2009-07-15 17:37:20 +00:00
|
|
|
<choice>
|
|
|
|
<ref name="ethernet-interface"/>
|
|
|
|
<ref name="bridge-interface"/>
|
|
|
|
<ref name="bond-interface"/>
|
|
|
|
<ref name="vlan-interface"/>
|
|
|
|
</choice>
|
|
|
|
</start>
|
|
|
|
|
2011-06-26 09:13:10 +00:00
|
|
|
<include href='basictypes.rng'/>
|
2009-07-15 17:37:20 +00:00
|
|
|
<!--
|
|
|
|
FIXME: How do we handle VLAN's ? Should they be their own interface
|
|
|
|
or should we treat them as an option on the base interface ? For
|
|
|
|
example, for vlan eth0.42, it would make sense to make that part of
|
|
|
|
the definition of the eth0 interface.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Ethernet adapter
|
|
|
|
-->
|
|
|
|
<define name="basic-ethernet-content">
|
2014-06-19 10:48:31 +00:00
|
|
|
<interleave>
|
|
|
|
<attribute name="type">
|
|
|
|
<value>ethernet</value>
|
|
|
|
</attribute>
|
|
|
|
<ref name="name-attr"/>
|
|
|
|
<!-- If no MAC is given when the interface is defined, it is determined
|
|
|
|
by using the device name.
|
|
|
|
FIXME: What if device name and MAC don't specify the same NIC ? -->
|
|
|
|
<optional>
|
|
|
|
<element name="mac">
|
|
|
|
<attribute name="address"><ref name="macAddr"/></attribute>
|
|
|
|
</element>
|
|
|
|
</optional>
|
|
|
|
<ref name="link-speed-state"/>
|
|
|
|
<!-- FIXME: Allow (some) ethtool options -->
|
|
|
|
</interleave>
|
2009-07-15 17:37:20 +00:00
|
|
|
</define>
|
|
|
|
|
|
|
|
<!-- Ethernet adapter without IP addressing, e.g. for a bridge -->
|
|
|
|
<define name="bare-ethernet-interface">
|
|
|
|
<element name="interface">
|
2014-06-19 10:48:31 +00:00
|
|
|
<interleave>
|
|
|
|
<ref name="basic-ethernet-content"/>
|
|
|
|
</interleave>
|
2009-07-15 17:37:20 +00:00
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name="ethernet-interface">
|
|
|
|
<element name="interface">
|
2014-06-19 10:48:31 +00:00
|
|
|
<interleave>
|
|
|
|
<ref name="startmode"/>
|
|
|
|
<ref name="basic-ethernet-content"/>
|
|
|
|
<ref name="mtu"/>
|
|
|
|
<ref name="interface-addressing"/>
|
|
|
|
</interleave>
|
2009-07-15 17:37:20 +00:00
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
VLAN's
|
|
|
|
-->
|
|
|
|
<define name="vlan-interface-common">
|
|
|
|
<attribute name="type">
|
|
|
|
<value>vlan</value>
|
|
|
|
</attribute>
|
|
|
|
<!-- The name attribute is only useful for reporting back and is always
|
|
|
|
of the form DEVICE.VLAN
|
|
|
|
-->
|
|
|
|
<optional><ref name="name-attr"/></optional>
|
2014-06-13 14:07:05 +00:00
|
|
|
<ref name="link-speed-state"/>
|
2009-07-15 17:37:20 +00:00
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name="vlan-device">
|
|
|
|
<element name="vlan">
|
|
|
|
<attribute name="tag"><ref name="vlan-id"/></attribute>
|
|
|
|
<element name="interface">
|
2011-06-26 09:13:10 +00:00
|
|
|
<attribute name="name"><ref name="deviceName"/></attribute>
|
2009-07-15 17:37:20 +00:00
|
|
|
</element>
|
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name="bare-vlan-interface">
|
|
|
|
<element name="interface">
|
2014-06-19 10:48:31 +00:00
|
|
|
<interleave>
|
|
|
|
<ref name="vlan-interface-common"/>
|
|
|
|
<ref name="vlan-device"/>
|
|
|
|
</interleave>
|
2009-07-15 17:37:20 +00:00
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name="vlan-interface">
|
|
|
|
<element name="interface">
|
2014-06-19 10:48:31 +00:00
|
|
|
<interleave>
|
|
|
|
<ref name="vlan-interface-common"/>
|
|
|
|
<ref name="startmode"/>
|
|
|
|
<ref name="mtu"/>
|
|
|
|
<ref name="interface-addressing"/>
|
|
|
|
<ref name="vlan-device"/>
|
|
|
|
</interleave>
|
2009-07-15 17:37:20 +00:00
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Bridges
|
|
|
|
-->
|
|
|
|
<define name="bridge-interface">
|
|
|
|
<element name="interface">
|
2014-06-19 10:48:31 +00:00
|
|
|
<interleave>
|
|
|
|
<attribute name="type">
|
|
|
|
<value>bridge</value>
|
|
|
|
</attribute>
|
|
|
|
<ref name="name-attr"/>
|
|
|
|
<ref name="startmode"/>
|
|
|
|
<ref name="mtu"/>
|
|
|
|
<ref name="interface-addressing"/>
|
|
|
|
<element name="bridge">
|
|
|
|
<optional>
|
|
|
|
<attribute name="stp">
|
2014-09-08 06:06:35 +00:00
|
|
|
<ref name="virOnOff"/>
|
2014-06-19 10:48:31 +00:00
|
|
|
</attribute>
|
|
|
|
</optional>
|
2018-06-07 07:08:41 +00:00
|
|
|
<!-- Bridge forward delay
|
|
|
|
(see 'ip link set <dev> type bridge forward_delay') -->
|
2014-06-19 10:48:31 +00:00
|
|
|
<optional v:since="2">
|
|
|
|
<attribute name="delay"><ref name="timeval"/></attribute>
|
|
|
|
</optional>
|
|
|
|
<zeroOrMore>
|
|
|
|
<choice>
|
|
|
|
<ref name="bare-ethernet-interface"/>
|
|
|
|
<ref name="bare-vlan-interface"/>
|
|
|
|
<ref v:since="2" name="bare-bond-interface"/>
|
|
|
|
</choice>
|
|
|
|
</zeroOrMore>
|
|
|
|
</element>
|
|
|
|
</interleave>
|
2009-07-15 17:37:20 +00:00
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
<!-- Jim Fehlig would like support for other bridge attributes, in
|
|
|
|
particular hellotime, forwarddelay, and maxage
|
|
|
|
-->
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Bonds
|
|
|
|
-->
|
2010-01-02 01:40:26 +00:00
|
|
|
<define name="bond-interface-common">
|
|
|
|
<attribute name="type">
|
|
|
|
<value>bond</value>
|
|
|
|
</attribute>
|
|
|
|
<ref name="name-attr"/>
|
2014-06-13 14:07:05 +00:00
|
|
|
<ref name="link-speed-state"/>
|
2010-01-02 01:40:26 +00:00
|
|
|
</define>
|
2009-07-15 17:37:20 +00:00
|
|
|
|
2010-01-02 01:40:26 +00:00
|
|
|
<define name="bond-element">
|
|
|
|
<element name="bond">
|
|
|
|
<optional>
|
|
|
|
<attribute name="mode">
|
|
|
|
<choice>
|
|
|
|
<value>balance-rr</value>
|
|
|
|
<!-- The primary interface is the first interface child
|
|
|
|
of the bond element -->
|
|
|
|
<value>active-backup</value>
|
|
|
|
<value>balance-xor</value>
|
|
|
|
<value>broadcast</value>
|
|
|
|
<value>802.3ad</value>
|
|
|
|
<value>balance-tlb</value>
|
|
|
|
<value>balance-alb</value>
|
|
|
|
</choice>
|
|
|
|
</attribute>
|
|
|
|
</optional>
|
2009-07-15 17:37:20 +00:00
|
|
|
|
2010-01-02 01:40:26 +00:00
|
|
|
<!-- FIXME: add more attributes
|
2009-07-15 17:37:20 +00:00
|
|
|
|
2010-01-02 01:40:26 +00:00
|
|
|
mode == 802.3ad
|
|
|
|
ad_select
|
|
|
|
lacp_rate
|
|
|
|
xmit_hash_policy
|
2009-07-15 17:37:20 +00:00
|
|
|
|
2010-01-02 01:40:26 +00:00
|
|
|
mode == active-backup
|
|
|
|
fail_over_mac
|
|
|
|
num_grat_arp when mode == active-backup (since 3.3.0)
|
|
|
|
num_unsol_na when mode == active-backup (ipv6, since 3.4.0)
|
2009-07-15 17:37:20 +00:00
|
|
|
|
2010-01-02 01:40:26 +00:00
|
|
|
mode == balance-xor
|
|
|
|
xmit_hash_policy (since 2.6.3/3.2.2)
|
|
|
|
-->
|
|
|
|
|
2014-06-19 10:48:31 +00:00
|
|
|
<interleave>
|
|
|
|
<optional>
|
|
|
|
<choice>
|
|
|
|
<element name="miimon">
|
|
|
|
<!-- miimon frequency in ms -->
|
|
|
|
<attribute name="freq"><ref name="unsignedInt"/></attribute>
|
|
|
|
<optional>
|
|
|
|
<attribute name="downdelay"><ref name="unsignedInt"/></attribute>
|
|
|
|
</optional>
|
|
|
|
<optional>
|
|
|
|
<attribute name="updelay"><ref name="unsignedInt"/></attribute>
|
|
|
|
</optional>
|
|
|
|
<optional>
|
|
|
|
<!-- use_carrier -->
|
|
|
|
<attribute name="carrier">
|
|
|
|
<choice>
|
|
|
|
<!-- use MII/ETHTOOL ioctl -->
|
|
|
|
<value>ioctl</value>
|
|
|
|
<!-- use netif_carrier_ok() -->
|
|
|
|
<value>netif</value>
|
|
|
|
</choice>
|
|
|
|
</attribute>
|
|
|
|
</optional>
|
|
|
|
</element>
|
|
|
|
<element name="arpmon">
|
|
|
|
<attribute name="interval"><ref name="unsignedInt"/></attribute>
|
|
|
|
<attribute name="target"><ref name="ipv4Addr"/></attribute>
|
|
|
|
<optional>
|
|
|
|
<attribute name="validate">
|
|
|
|
<choice>
|
|
|
|
<value>none</value>
|
|
|
|
<value>active</value>
|
|
|
|
<value>backup</value>
|
|
|
|
<value>all</value>
|
|
|
|
</choice>
|
|
|
|
</attribute>
|
|
|
|
</optional>
|
|
|
|
</element>
|
|
|
|
</choice>
|
|
|
|
</optional>
|
2010-11-15 18:31:31 +00:00
|
|
|
|
2014-06-19 10:48:31 +00:00
|
|
|
<oneOrMore>
|
|
|
|
<!-- The slave interfaces -->
|
|
|
|
<ref name="bare-ethernet-interface"/>
|
|
|
|
</oneOrMore>
|
|
|
|
</interleave>
|
2010-01-02 01:40:26 +00:00
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name="bare-bond-interface">
|
|
|
|
<element name="interface">
|
2014-06-19 10:48:31 +00:00
|
|
|
<interleave>
|
|
|
|
<ref name="bond-interface-common"/>
|
|
|
|
<ref name="bond-element"/>
|
|
|
|
</interleave>
|
2010-01-02 01:40:26 +00:00
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name="bond-interface">
|
|
|
|
<element name="interface">
|
2014-06-19 10:48:31 +00:00
|
|
|
<interleave>
|
|
|
|
<ref name="bond-interface-common"/>
|
|
|
|
<ref name="startmode"/>
|
|
|
|
<ref name="mtu"/>
|
|
|
|
<ref name="interface-addressing"/>
|
|
|
|
<ref name="bond-element"/>
|
|
|
|
</interleave>
|
2009-07-15 17:37:20 +00:00
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<!-- Basic attributes for all interface types -->
|
|
|
|
<define name="name-attr">
|
|
|
|
<!-- The device name, like eth0 or br2 -->
|
2011-06-26 09:13:10 +00:00
|
|
|
<attribute name="name"><ref name="deviceName"/></attribute>
|
2009-07-15 17:37:20 +00:00
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name="mtu">
|
|
|
|
<optional>
|
|
|
|
<element name="mtu">
|
2012-03-06 14:08:02 +00:00
|
|
|
<attribute name="size"><ref name="unsignedInt"/></attribute>
|
2009-07-15 17:37:20 +00:00
|
|
|
</element>
|
|
|
|
</optional>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name="startmode">
|
2017-03-27 04:40:18 +00:00
|
|
|
<optional>
|
|
|
|
<element name="start">
|
|
|
|
<attribute name="mode">
|
|
|
|
<choice>
|
|
|
|
<value>onboot</value>
|
|
|
|
<value>none</value>
|
|
|
|
<value>hotplug</value>
|
|
|
|
<!-- Jim Fehlig lists the following that SuSe supports:
|
|
|
|
manual, ifplug, nfsroot -->
|
|
|
|
</choice>
|
|
|
|
</attribute>
|
|
|
|
</element>
|
|
|
|
</optional>
|
2009-07-15 17:37:20 +00:00
|
|
|
</define>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Assignment of addresses to an interface, allowing for
|
|
|
|
different protocols
|
|
|
|
-->
|
|
|
|
<define name="interface-addressing">
|
|
|
|
<choice>
|
2010-01-02 01:40:26 +00:00
|
|
|
<group>
|
2009-07-15 17:37:20 +00:00
|
|
|
<optional>
|
2010-01-02 01:40:26 +00:00
|
|
|
<ref name="protocol-ipv4"/>
|
2009-07-15 17:37:20 +00:00
|
|
|
</optional>
|
2010-01-02 01:40:26 +00:00
|
|
|
<optional v:since="3">
|
|
|
|
<ref name="protocol-ipv6"/>
|
|
|
|
</optional>
|
|
|
|
</group>
|
|
|
|
<group>
|
|
|
|
<optional v:since="3">
|
|
|
|
<ref name="protocol-ipv6"/>
|
|
|
|
</optional>
|
|
|
|
<optional>
|
|
|
|
<ref name="protocol-ipv4"/>
|
|
|
|
</optional>
|
|
|
|
</group>
|
|
|
|
</choice>
|
|
|
|
</define>
|
2009-07-15 17:37:20 +00:00
|
|
|
|
2010-01-02 01:40:26 +00:00
|
|
|
<define name="protocol-ipv4">
|
|
|
|
<element name="protocol">
|
|
|
|
<attribute name="family">
|
|
|
|
<value>ipv4</value>
|
|
|
|
</attribute>
|
2014-06-19 10:48:31 +00:00
|
|
|
<interleave>
|
2015-05-21 15:26:52 +00:00
|
|
|
<optional>
|
2014-06-19 10:48:31 +00:00
|
|
|
<ref name="dhcp-element"/>
|
2015-05-21 15:26:52 +00:00
|
|
|
</optional>
|
|
|
|
<zeroOrMore>
|
|
|
|
<element name="ip">
|
|
|
|
<attribute name="address"><ref name="ipv4Addr"/></attribute>
|
2010-01-02 01:40:26 +00:00
|
|
|
<optional>
|
2015-05-21 15:26:52 +00:00
|
|
|
<attribute name="prefix"><ref name="ipv4Prefix"/></attribute>
|
2010-01-02 01:40:26 +00:00
|
|
|
</optional>
|
2015-05-21 15:26:52 +00:00
|
|
|
</element>
|
|
|
|
</zeroOrMore>
|
|
|
|
<optional>
|
|
|
|
<element name="route">
|
|
|
|
<attribute name="gateway"><ref name="ipv4Addr"/></attribute>
|
|
|
|
</element>
|
|
|
|
</optional>
|
2014-06-19 10:48:31 +00:00
|
|
|
</interleave>
|
2010-01-02 01:40:26 +00:00
|
|
|
</element>
|
|
|
|
</define>
|
2009-07-15 17:37:20 +00:00
|
|
|
|
2010-01-02 01:40:26 +00:00
|
|
|
<define name="protocol-ipv6">
|
|
|
|
<element name="protocol">
|
|
|
|
<attribute name="family">
|
|
|
|
<value>ipv6</value>
|
|
|
|
</attribute>
|
2014-06-19 10:48:31 +00:00
|
|
|
<interleave>
|
|
|
|
<optional>
|
|
|
|
<element name="autoconf"><empty/></element>
|
|
|
|
</optional>
|
|
|
|
<optional>
|
|
|
|
<ref name="dhcp-element"/>
|
|
|
|
</optional>
|
|
|
|
<zeroOrMore>
|
|
|
|
<element name="ip">
|
|
|
|
<attribute name="address"><ref name="ipv6Addr"/></attribute>
|
|
|
|
<optional>
|
|
|
|
<attribute name="prefix"><ref name="ipv6Prefix"/></attribute>
|
|
|
|
</optional>
|
|
|
|
</element>
|
|
|
|
</zeroOrMore>
|
|
|
|
<optional>
|
|
|
|
<element name="route">
|
|
|
|
<attribute name="gateway"><ref name="ipv6Addr"/></attribute>
|
|
|
|
</element>
|
|
|
|
</optional>
|
|
|
|
</interleave>
|
2010-01-02 01:40:26 +00:00
|
|
|
</element>
|
2009-07-15 17:37:20 +00:00
|
|
|
</define>
|
2010-01-02 01:40:26 +00:00
|
|
|
|
|
|
|
<define name="dhcp-element">
|
|
|
|
<element name="dhcp">
|
|
|
|
<optional>
|
|
|
|
<attribute name="peerdns">
|
2014-09-08 06:06:35 +00:00
|
|
|
<ref name="virYesNo"/>
|
2010-01-02 01:40:26 +00:00
|
|
|
</attribute>
|
|
|
|
</optional>
|
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
2009-07-15 17:37:20 +00:00
|
|
|
<!-- Jim Fehlig (<jfehlig@novell.com>) suggest the
|
|
|
|
following additions to DHCP:
|
|
|
|
|
|
|
|
WRT dhcp element, would it make sense to consider hostname (hostname
|
|
|
|
to send to server) and if to change the local hostname to the
|
|
|
|
hostname delivered via dhcp? E.g. hostname="foo" (default
|
|
|
|
`hostname`) sethostname
|
|
|
|
|
|
|
|
Also route:
|
|
|
|
setrouting (default "yes")
|
|
|
|
setdefaultroute (default "yes")
|
|
|
|
|
|
|
|
and NIS:
|
|
|
|
nis (default "yes")
|
|
|
|
setnisdomain (default "yes")
|
|
|
|
|
|
|
|
What about dhcpv6? A separate <dhcp6 /> element?
|
|
|
|
-->
|
|
|
|
|
|
|
|
<!-- Jim Fehlig suggest adding static routing info
|
|
|
|
|
|
|
|
As for routing info, how about a separate route element:
|
|
|
|
|
|
|
|
<route gateway="192.168.0.1" /> # destination=default
|
|
|
|
<route destination="default" gateway="192.168.0.1" />
|
|
|
|
<route destination="10.0.0.0/8" gateway="192.168.0.2" />
|
|
|
|
<route destination="2001:DB8:C::/64" gateway="2001:DB8:C::1" />
|
|
|
|
<route destination="2001:DB8::/32"> # unrecheable route (loopback)
|
|
|
|
|
|
|
|
It would perhaps make sense to use iproute2 names, that is prefix
|
|
|
|
instead of destination and nexthop instead of gateway.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<!-- Type library -->
|
|
|
|
|
2010-01-02 01:40:26 +00:00
|
|
|
<define name="timeval">
|
|
|
|
<data type="double">
|
|
|
|
<param name="minInclusive">0</param>
|
|
|
|
</data>
|
|
|
|
</define>
|
|
|
|
|
2009-07-15 17:37:20 +00:00
|
|
|
<define name='vlan-id'>
|
|
|
|
<data type="unsignedInt">
|
2014-08-13 08:10:43 +00:00
|
|
|
<param name="maxInclusive">4095</param>
|
2009-07-15 17:37:20 +00:00
|
|
|
</data>
|
|
|
|
</define>
|
|
|
|
</grammar>
|