diff options
-rw-r--r-- | scripts/up-down-protocol-samples/Makefile | 2 | ||||
-rw-r--r-- | scripts/up-down-tighter-schema.pl | 18 | ||||
-rw-r--r-- | scripts/up-down-tighter-schema.rnc | 18 | ||||
-rw-r--r-- | scripts/up-down-tighter-schema.rng | 14 |
4 files changed, 31 insertions, 21 deletions
diff --git a/scripts/up-down-protocol-samples/Makefile b/scripts/up-down-protocol-samples/Makefile index 2fbc209a..64340098 100644 --- a/scripts/up-down-protocol-samples/Makefile +++ b/scripts/up-down-protocol-samples/Makefile @@ -1,6 +1,6 @@ XMLLINT = xmllint --noout --relaxng JING = java -jar /usr/local/share/java/classes/jing.jar -SCHEMA = ../up-down-schema.rng +SCHEMA = ../up-down-tighter-schema.rng all: jing xmllint diff --git a/scripts/up-down-tighter-schema.pl b/scripts/up-down-tighter-schema.pl index a243b1f8..e31a62d9 100644 --- a/scripts/up-down-tighter-schema.pl +++ b/scripts/up-down-tighter-schema.pl @@ -14,11 +14,17 @@ my $as_set = '[0-9]+(,[0-9]+)?'; -my $ipv4 = '([0-9]+\.){3}[0-9]+'; -my $ipv4p = "${ipv4}/[0-9]+"; +my $octet = '[0-9]|1[0-9]|2[0-4]|25[0-5]'; +my $ipv4 = "(${octet}\.){3}${octet}"; +my $ipv4p = "${ipv4}/([0-9]|[12][0-9]|3[0-2])"; my $ipv4r = "${ipv4}-${ipv4}"; my $ipv4_set = "${ipv4p}|${ipv4r}"; +my $nibble = '0|[1-9a-fA-F][0-9a-fA-F]{0,3}'; +my $ipv6 = "::|(${nibble}:){0,7}(:|${nibble})"; +my $ipv6p = "${ipv6}/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])"; +my $ipv6r = "${ipv6}-${ipv6}"; +my $ipv6_set = "${ipv6r}|${ipv6p}"; my $rnc = qq{# \$Id\$ # Automatically generated from $0 @@ -51,7 +57,7 @@ my $rnc = qq{# \$Id\$ attribute cert_ski { xsd:token { maxLength="1024" } }, attribute resource_set_as { xsd:string { maxLength="512000" pattern="${as_set}" } }, attribute resource_set_ipv4 { xsd:string { maxLength="512000" pattern="${ipv4_set}" } }, - attribute resource_set_ipv6 { xsd:string { maxLength="512000" } }, + attribute resource_set_ipv6 { xsd:string { maxLength="512000" pattern="${ipv6_set}" } }, attribute suggested_sia_head { xsd:string { maxLength="1024" } }?, element certificate { attribute cert_url { xsd:anyURI { maxLength="1024" } }, @@ -60,10 +66,10 @@ my $rnc = qq{# \$Id\$ attribute cert_serial { xsd:positiveInteger }, attribute resource_set_as { xsd:string { maxLength="512000" pattern="${as_set}" } }, attribute resource_set_ipv4 { xsd:string { maxLength="512000" pattern="${ipv4_set}" } }, - attribute resource_set_ipv6 { xsd:string { maxLength="512000" } }, + attribute resource_set_ipv6 { xsd:string { maxLength="512000" pattern="${ipv6_set}" } }, attribute req_resource_set_as { xsd:string { maxLength="512000" pattern="${as_set}" } }?, attribute req_resource_set_ipv4 { xsd:string { maxLength="512000" pattern="${ipv4_set}" } }?, - attribute req_resource_set_ipv6 { xsd:string { maxLength="512000" } }?, + attribute req_resource_set_ipv6 { xsd:string { maxLength="512000" pattern="${ipv6_set}" } }?, attribute status { "undersize" | "match" | "oversize" }, xsd:base64Binary { maxLength="512000" } }*, @@ -74,7 +80,7 @@ my $rnc = qq{# \$Id\$ attribute class_name { xsd:token { maxLength="1024" } }, attribute req_resource_set_as { xsd:string { maxLength="512000" pattern="${as_set}" } }?, attribute req_resource_set_ipv4 { xsd:string { maxLength="512000" pattern="${ipv4_set}" } }?, - attribute req_resource_set_ipv6 { xsd:string { maxLength="512000" } }?, + attribute req_resource_set_ipv6 { xsd:string { maxLength="512000" pattern="${ipv6_set}" } }?, xsd:base64Binary { maxLength="512000" } } issue_response = class diff --git a/scripts/up-down-tighter-schema.rnc b/scripts/up-down-tighter-schema.rnc index bffcc41a..06ddd19e 100644 --- a/scripts/up-down-tighter-schema.rnc +++ b/scripts/up-down-tighter-schema.rnc @@ -1,5 +1,5 @@ # $Id$ -# Automatically generated from up-down-tighter-schema.pl +# Automatically generated from ./up-down-tighter-schema.pl default namespace = "http://www.apnic.net/specs/rescerts/up-down/" @@ -28,8 +28,8 @@ attribute cert_url { xsd:anyURI { maxLength="1024" } }, attribute cert_ski { xsd:token { maxLength="1024" } }, attribute resource_set_as { xsd:string { maxLength="512000" pattern="[0-9]+(,[0-9]+)?" } }, - attribute resource_set_ipv4 { xsd:string { maxLength="512000" pattern="([0-9]+\.){3}[0-9]+/[0-9]+|([0-9]+\.){3}[0-9]+-([0-9]+\.){3}[0-9]+" } }, - attribute resource_set_ipv6 { xsd:string { maxLength="512000" } }, + attribute resource_set_ipv4 { xsd:string { maxLength="512000" pattern="([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]/([0-9]|[12][0-9]|3[0-2])|([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]-([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]" } }, + attribute resource_set_ipv6 { xsd:string { maxLength="512000" pattern="::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})-::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})|::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])" } }, attribute suggested_sia_head { xsd:string { maxLength="1024" } }?, element certificate { attribute cert_url { xsd:anyURI { maxLength="1024" } }, @@ -37,11 +37,11 @@ attribute cert_aki { xsd:token { maxLength="1024" } }, attribute cert_serial { xsd:positiveInteger }, attribute resource_set_as { xsd:string { maxLength="512000" pattern="[0-9]+(,[0-9]+)?" } }, - attribute resource_set_ipv4 { xsd:string { maxLength="512000" pattern="([0-9]+\.){3}[0-9]+/[0-9]+|([0-9]+\.){3}[0-9]+-([0-9]+\.){3}[0-9]+" } }, - attribute resource_set_ipv6 { xsd:string { maxLength="512000" } }, + attribute resource_set_ipv4 { xsd:string { maxLength="512000" pattern="([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]/([0-9]|[12][0-9]|3[0-2])|([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]-([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]" } }, + attribute resource_set_ipv6 { xsd:string { maxLength="512000" pattern="::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})-::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})|::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])" } }, attribute req_resource_set_as { xsd:string { maxLength="512000" pattern="[0-9]+(,[0-9]+)?" } }?, - attribute req_resource_set_ipv4 { xsd:string { maxLength="512000" pattern="([0-9]+\.){3}[0-9]+/[0-9]+|([0-9]+\.){3}[0-9]+-([0-9]+\.){3}[0-9]+" } }?, - attribute req_resource_set_ipv6 { xsd:string { maxLength="512000" } }?, + attribute req_resource_set_ipv4 { xsd:string { maxLength="512000" pattern="([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]/([0-9]|[12][0-9]|3[0-2])|([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]-([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]" } }?, + attribute req_resource_set_ipv6 { xsd:string { maxLength="512000" pattern="::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})-::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})|::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])" } }?, attribute status { "undersize" | "match" | "oversize" }, xsd:base64Binary { maxLength="512000" } }*, @@ -51,8 +51,8 @@ issue_request = element request { attribute class_name { xsd:token { maxLength="1024" } }, attribute req_resource_set_as { xsd:string { maxLength="512000" pattern="[0-9]+(,[0-9]+)?" } }?, - attribute req_resource_set_ipv4 { xsd:string { maxLength="512000" pattern="([0-9]+\.){3}[0-9]+/[0-9]+|([0-9]+\.){3}[0-9]+-([0-9]+\.){3}[0-9]+" } }?, - attribute req_resource_set_ipv6 { xsd:string { maxLength="512000" } }?, + attribute req_resource_set_ipv4 { xsd:string { maxLength="512000" pattern="([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]/([0-9]|[12][0-9]|3[0-2])|([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]-([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]" } }?, + attribute req_resource_set_ipv6 { xsd:string { maxLength="512000" pattern="::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})-::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})|::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])" } }?, xsd:base64Binary { maxLength="512000" } } issue_response = class diff --git a/scripts/up-down-tighter-schema.rng b/scripts/up-down-tighter-schema.rng index 50dbbe90..ef4b9644 100644 --- a/scripts/up-down-tighter-schema.rng +++ b/scripts/up-down-tighter-schema.rng @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- $Id$ - Automatically generated from up-down-tighter-schema.pl + Automatically generated from ./up-down-tighter-schema.pl --> <grammar ns="http://www.apnic.net/specs/rescerts/up-down/" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <start> @@ -105,12 +105,13 @@ <attribute name="resource_set_ipv4"> <data type="string"> <param name="maxLength">512000</param> - <param name="pattern">([0-9]+\.){3}[0-9]+/[0-9]+|([0-9]+\.){3}[0-9]+-([0-9]+\.){3}[0-9]+</param> + <param name="pattern">([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]/([0-9]|[12][0-9]|3[0-2])|([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]-([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]</param> </data> </attribute> <attribute name="resource_set_ipv6"> <data type="string"> <param name="maxLength">512000</param> + <param name="pattern">::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})-::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})|::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])</param> </data> </attribute> <optional> @@ -149,12 +150,13 @@ <attribute name="resource_set_ipv4"> <data type="string"> <param name="maxLength">512000</param> - <param name="pattern">([0-9]+\.){3}[0-9]+/[0-9]+|([0-9]+\.){3}[0-9]+-([0-9]+\.){3}[0-9]+</param> + <param name="pattern">([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]/([0-9]|[12][0-9]|3[0-2])|([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]-([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]</param> </data> </attribute> <attribute name="resource_set_ipv6"> <data type="string"> <param name="maxLength">512000</param> + <param name="pattern">::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})-::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})|::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])</param> </data> </attribute> <optional> @@ -169,7 +171,7 @@ <attribute name="req_resource_set_ipv4"> <data type="string"> <param name="maxLength">512000</param> - <param name="pattern">([0-9]+\.){3}[0-9]+/[0-9]+|([0-9]+\.){3}[0-9]+-([0-9]+\.){3}[0-9]+</param> + <param name="pattern">([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]/([0-9]|[12][0-9]|3[0-2])|([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]-([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]</param> </data> </attribute> </optional> @@ -177,6 +179,7 @@ <attribute name="req_resource_set_ipv6"> <data type="string"> <param name="maxLength">512000</param> + <param name="pattern">::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})-::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})|::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])</param> </data> </attribute> </optional> @@ -218,7 +221,7 @@ <attribute name="req_resource_set_ipv4"> <data type="string"> <param name="maxLength">512000</param> - <param name="pattern">([0-9]+\.){3}[0-9]+/[0-9]+|([0-9]+\.){3}[0-9]+-([0-9]+\.){3}[0-9]+</param> + <param name="pattern">([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]/([0-9]|[12][0-9]|3[0-2])|([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]-([0-9]|1[0-9]|2[0-4]|25[0-5].){3}[0-9]|1[0-9]|2[0-4]|25[0-5]</param> </data> </attribute> </optional> @@ -226,6 +229,7 @@ <attribute name="req_resource_set_ipv6"> <data type="string"> <param name="maxLength">512000</param> + <param name="pattern">::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})-::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})|::|(0|[1-9a-fA-F][0-9a-fA-F]{0,3}:){0,7}(:|0|[1-9a-fA-F][0-9a-fA-F]{0,3})/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])</param> </data> </attribute> </optional> |