network.rng 3.2 KB
Newer Older
1 2 3
<!-- A Relax NG schema for the libvirt network XML format -->
<element name="network" xmlns="http://relaxng.org/ns/structure/1.0"
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
4
  <interleave>
C
Cole Robinson 已提交
5

6 7
  <!-- The name of the network, used to refer to it through the API
       and in virsh -->
C
Cole Robinson 已提交
8 9 10 11 12
  <element name="name">
    <text/>
  </element>

  <!-- <uuid> element -->
13 14 15
  <optional>
    <element name="uuid"><text/></element>
  </optional>
C
Cole Robinson 已提交
16 17

  <!-- <bridge> element -->
18 19 20 21 22
  <optional>
    <!-- The name of the network to be set up; this will back
         the network on the host -->
    <element name="bridge">
      <optional>
C
Cole Robinson 已提交
23 24 25
        <attribute name="name">
          <text/>
        </attribute>
26
      </optional>
C
Cole Robinson 已提交
27

28 29 30 31 32 33 34 35
      <optional>
        <attribute name="stp">
          <choice>
            <value>on</value>
            <value>off</value>
          </choice>
        </attribute>
      </optional>
C
Cole Robinson 已提交
36

37
      <optional>
C
Cole Robinson 已提交
38 39 40
        <attribute name="delay">
          <data type="integer"/>
        </attribute>
41
      </optional>
C
Cole Robinson 已提交
42

43 44
    </element>
  </optional>
C
Cole Robinson 已提交
45 46

  <!-- <forward> element -->
47 48 49 50
  <optional>
    <!-- The device through which the bridge is connected to the
         rest of the network -->
    <element name="forward">
C
Cole Robinson 已提交
51 52 53 54 55 56
      <optional>
        <attribute name="dev">
          <text/>
        </attribute>
      </optional>

57 58 59 60
      <optional>
        <attribute name="mode">
          <choice>
            <value>nat</value>
C
Cole Robinson 已提交
61
            <value>route</value>
62 63 64 65 66
          </choice>
        </attribute>
      </optional>
    </element>
  </optional>
C
Cole Robinson 已提交
67 68

  <!-- <domain> element -->
69 70 71 72 73
  <optional>
    <element name="domain">
      <attribute name="name"><text/></attribute>
    </element>
  </optional>
C
Cole Robinson 已提交
74 75

  <!-- <ip> element -->
76 77 78 79 80 81 82 83 84 85 86 87
  <optional>
    <!-- The IP element sets up NAT'ing and an optional DHCP server
         local to the host. -->
    <!-- FIXME: address, netmask and the start and end of the ranges
         are IP addresses, and should be validated as such in the scheme -->
    <element name="ip">
      <optional>
        <attribute name="address"><text/></attribute>
      </optional>
      <optional>
        <attribute name="netmask"><text/></attribute>
      </optional>
88
      <optional>
89 90 91
        <element name="tftp">
          <attribute name="root"><text/></attribute>
        </element>
92
      </optional>
93 94 95 96 97 98 99 100 101
      <!-- Define the range(s) of IP addresses that the DHCP
           server should hand out -->
      <element name="dhcp">
        <zeroOrMore>
          <element name="range">
            <attribute name="start"><text/></attribute>
            <attribute name="end"><text/></attribute>
          </element>
        </zeroOrMore>
102 103 104 105 106 107 108
        <zeroOrMore>
          <element name="host">
            <attribute name="mac"><text/></attribute>
            <attribute name="name"><text/></attribute>
            <attribute name="ip"><text/></attribute>
          </element>
        </zeroOrMore>
109 110 111
        <optional>
          <element name="bootp">
            <attribute name="file"><text/></attribute>
112 113 114
            <optional>
              <attribute name="server"><text/></attribute>
            </optional>
115 116
          </element>
        </optional>
117 118 119
      </element>
    </element>
  </optional>
120
  </interleave>
121
</element>