bandwidth: Define schema and create documentation

Define new 'bandwidth' element with possible child element 'inbound'
and 'outbound' addressing incoming and outgoing traffic respectively:

<bandwidth>
  <inbound average='1000' peak='2000' burst='5120'/>
  <outbound average='500'/>
</bandwidth>

Leaving any element out means not to shape traffic in that
direction.
The units for average and peak (rate) are in kilobytes per second,
for burst (size) are just in kilobytes.
This element can be inserted into domain's 'interface' and
'network'.
This commit is contained in:
Michal Privoznik
2011-07-22 16:07:23 +02:00
committed by Daniel Veillard
parent 239322cbd4
commit a8923162c9
5 changed files with 118 additions and 0 deletions

View File

@@ -1189,6 +1189,9 @@
<optional>
<ref name="deviceBoot"/>
</optional>
<optional>
<ref name="bandwidth"/>
</optional>
</interleave>
</define>
<!--

View File

@@ -147,6 +147,9 @@
</zeroOrMore>
</element>
</optional>
<optional>
<ref name="bandwidth"/>
</optional>
<!-- <ip> element -->
<zeroOrMore>

View File

@@ -47,4 +47,52 @@
</group>
</choice>
</define>
<define name="bandwidth">
<element name="bandwidth">
<interleave>
<optional>
<element name="inbound">
<ref name="bandwidth-attributes"/>
<empty/>
</element>
</optional>
<optional>
<element name="outbound">
<ref name="bandwidth-attributes"/>
<empty/>
</element>
</optional>
</interleave>
</element>
</define>
<define name="bandwidth-attributes">
<attribute name="average">
<ref name="speed"/>
</attribute>
<optional>
<attribute name="peak">
<ref name="speed"/>
</attribute>
</optional>
<optional>
<attribute name='burst'>
<ref name="BurstSize"/>
</attribute>
</optional>
</define>
<define name="speed">
<data type="unsignedInt">
<param name="pattern">[0-9]+</param>
<param name="minInclusive">1</param>
</data>
</define>
<define name="BurstSize">
<data type="unsignedInt">
<param name="pattern">[0-9]+</param>
<param name="minInclusive">1</param>
</data>
</define>
</grammar>