namespace doc = "http://svn.resiprocate.org/rep/ietf-drafts/rohan/schema/doc" namespace ietf = "http://svn.resiprocate.org/rep/ietf-drafts/rohan/schema/ietf" namespace sch = "http://www.ascc.net/xml/schematron" namespace xsd = "http://www/w3/org/2001/XMLSchema-datatypes" namespace xml = "http://www.w3.org/XML/1998/namespace" start = element-dhcp element-dhcp = element dhcp { [ doc:description [ xml:lang = "en" "Configuration schema for DHCP server" ] doc:author [ "Rohan Mahy" ] ] global-timer-elements & element-subnet* & element-shared-network* } global-timer-elements = ( [ sch:rule [ context = "/dhcp" sch:assert [ test = "default-lease-time <= max-lease-time" "Default lease time cannot be larger than maximum lease time" ] ] ] element default-lease-time { xsd:unsignedInt }? >> doc:units ["seconds"] >> doc:default ["600"] & element max-lease-time { xsd:unsignedInt }? >> doc:units ["seconds"] >> doc:default ["7200"] ) element-shared-network = element shared-network { attribute name { token }, element-subnet+ } element-subnet = element subnet { element-net & element-dynamic-address-ranges? & element-dhcp-options? & element max-lease-time { xsd:unsignedInt }? & element leases { [ doc:info-type ["status"] ] element-lease* }? } element-dynamic-address-ranges = element dynamic-bootp { element-range* >> doc:order ["any"] } element-net = element net { attribute prefix { xsd:short { minInclusive = "0" maxInclusive = "32" } }, ipv4-address-content } element-range = element range { attribute from { ipv4-address-content }, attribute to { ipv4-address-content } } element-dhcp-options = element dhcp-options { element-router-option? & element-domain-option? } element-lease = element lease { element ip-address { ipv4-address-content } & element starts { xsd:dateTime } & element ends { xsd:dateTime } & element mac-address { mac-address-content } } element-router-option = element router { ipv4-address-content }+ >> doc:order ["user"] element-domain-option = element domain-name { token } ipv4-address-content = xsd:token { pattern = "((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[1-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[1-9])" } mac-address-content = xsd:token { pattern = "(([0-9a-fA-F]{2}):?){5}[0-9a-fA-F]{2}" } # Add a new interleaved element for custom DHCP options. Use co-occurence constraints element-dhcp-options &= element-custom-option* element-custom-option = ( element custom { attribute option { xsd:unsignedByte }, attribute type { "ipaddr" }, ipv4-address-content }, element custom { attribute option { xsd:unsignedByte }, attribute type { "string" }, string } ) # Add a new interleaved interface-filter element to subnet description element-subnet &= element-interface-filter element-interface-filter = element interface-filter { [ sch:rule [ context = "//dhcp:interface-filter" sch:assert [ test = "/int:interfaces/int:interface[@int:ifIndex=current()]" "Interface filters can only reference existing interfaces" ] ] ] token }