namespace rng = "http://relaxng.org/ns/structure/1.0" namespace xsd = "http://www/w3/org/2001/XMLSchema-datatypes" namespace xml = "http://www.w3.org/XML/1998/namespace" namespace sch = "http://www.ascc.net/xml/schematron" namespace dc = "http://purl.org/dc/terms" namespace dml = "http://example.org/ns/dml" namespace dhcp = "http://example.org/ns/dhcp" namespace tz = "http://example.org/ns/dhcp/timezone" namespace int = "http://example.org/ns/int" namespace compat ="http://relaxng.org/ns/compatibility/annotations/1.0" default namespace = "http://example.org/ns/dhcp" start = element-dhcp >> dc:title [ "Example schema for DHCP server" ] >> dml:version ["1.0"] >> dc:type ["Dataset"] >> dc:creator [ "Rohan Mahy" ] >> dml:organization [ "as an individual" ] >> dml:contact [ "mailto:rohan@ekabal.com" ] >> dc:created [ "2008-02-13" ] element-dhcp = element dhcp { global-timer-elements, subnet-elements, element-shared-network* >> dml:key ["@name"] } global-timer-elements = ( [ sch:pattern [ sch:rule [ context = "//dhcp:dhcp" sch:assert [ test = "dhcp:default-lease-time <= dhcp:max-lease-time" "Default lease time cannot be larger than maximum lease time" ] ] ] ] element default-lease-time { xsd:unsignedInt }? >> compat:defaultValue ["3600"] >> dml:units ["s"], element max-lease-time { xsd:unsignedInt }? >> dml:units ["s"] ) element-shared-network = element shared-network { attribute name { token }, subnet-elements } subnet-elements = element-subnet* >> dml:key ["concat(network, '/', prefix-length)"] >> dml:manual-validation-rule [ "Verify that none of the subnets overlap with other subnets." ] element-subnet = element subnet { element-network, element-prefix-length, element-range? >> dml:existence [] >> dml:manual-validation-rule [ "Verify the range is within the subnet." ], element-dhcp-options?, element max-lease-time { xsd:unsignedInt }? >> dml:units ["s"] >> dml:status ["deprecated"], element leases { element-lease* >> sch:key ["@ip-address"] }? >> dml:infoType ["status"], element-interface-filter? } element-network = element network { ipv4-address-content } element-prefix-length = element prefix-length { xsd:short { minInclusive = "0" maxInclusive = "32" } } element-range = element range { element low { ipv4-address-content }?, element high { ipv4-address-content }? } element-dhcp-options = element dhcp-options { element-router-list-option? & element-domain-list-option? & element-custom-option* >> dml:key ["@option"] } element-dhcp-option &= element tz:timezone { token }? # this is an example of simple inline extensibility element-lease = element lease { attribute ip-address { ipv4-address-content }, element starts { xsd:dateTime }, element ends { xsd:dateTime }, element mac-address { mac-address-content } } element-router-list-option = element router-list { element router { ipv4-address-content }+ >> dml:order ["user-order"] } element-domain-list-option = element domain-list { element domain { token }+ } element-custom-option = element custom { attribute option { xsd:unsignedByte }, ( element ip-address { ipv4-address-content } | element string { string } ) } element-interface-filter = element interface-filter { element interface { token }+ >> dml:keyref ["//int:interface"] } ipv4-address-content = xsd:token { pattern = "((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])" } mac-address-content = xsd:token { pattern = "(([0-9a-fA-F]{2}):?){5}[0-9a-fA-F]{2}" }