diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/left-right-schema.rnc | 165 | ||||
-rw-r--r-- | scripts/left-right-schema.rng | 673 |
2 files changed, 434 insertions, 404 deletions
diff --git a/scripts/left-right-schema.rnc b/scripts/left-right-schema.rnc index 11538150..a0401d35 100644 --- a/scripts/left-right-schema.rnc +++ b/scripts/left-right-schema.rnc @@ -9,7 +9,7 @@ default namespace = "http://www.hactrn.net/uris/rpki/left-right-spec/" start = element msg { attribute version { xsd:positiveInteger { maxInclusive="1" } }, - ( self | bsc | \parent | child | repository | route_origin | list_resources | report_error )* + ( self_elt | bsc_elt | parent_elt | child_elt | repository_elt | route_origin_elt | list_resources_elt | report_error_elt )* } action = attribute action { "create" | "set" | "get" | "list" | "destroy" } @@ -20,94 +20,107 @@ base64 = xsd:base64Binary { maxLength="512000" } peer_ta = element peer_ta { base64 } -self = element self { - action, type, - attribute self_id { xsd:token { maxLength="1024" } }?, - attribute rekey { "yes" }?, - attribute reissue { "yes" }?, - attribute revoke { "yes" }?, - attribute run_now { "yes" }?, - attribute publish_world_now { "yes" }?, - element extension_preference { - attribute name { xsd:token { maxLength="1024" } }, - xsd:string { maxLength="512000" } - }* +sql_id = xsd:token { maxLength="1024" } + +self_ctls = (attribute rekey { "yes" }?, + attribute reissue { "yes" }?, + attribute revoke { "yes" }?, + attribute run_now { "yes" }?, + attribute publish_world_now { "yes" }?) + +self_payload = element extension_preference { + attribute name { xsd:token { maxLength="1024" } }, + xsd:string { maxLength="512000" } +}* + +self_id = attribute self_id { sql_id } + +self_elt = element self { + action, type, self_id?, self_ctls, self_payload } -bsc = element bsc { - action, type, - attribute self_id { xsd:token { maxLength="1024" } }, - attribute bsc_id { xsd:token { maxLength="1024" } }?, - attribute generate_keypair { "yes" }?, - attribute key_type { xsd:token { maxLength="1024" } }?, - attribute hash_alg { xsd:token { maxLength="1024" } }?, - attribute key_length { xsd:token { maxLength="1024" } }?, - element signing_cert { base64 }*, - element pkcs10_cert_request { base64 }?, - element public_key { base64 }? +bsc_ctls = (attribute generate_keypair { "yes" }, + attribute key_type { xsd:token { maxLength="1024" } }?, + attribute hash_alg { xsd:token { maxLength="1024" } }?, + attribute key_length { xsd:token { maxLength="1024" } }?) + +bsc_id = attribute bsc_id { sql_id } + +bsc_payload = (element signing_cert { base64 }*, + element pkcs10_cert_request { base64 }?, + element public_key { base64 }?) + +bsc_elt = element bsc { + action, type, self_id, bsc_id?, bsc_ctls?, bsc_payload } -\parent = element parent { - action, type, - attribute self_id { xsd:token { maxLength="1024" } }, - attribute parent_id { xsd:token { maxLength="1024" } }?, - attribute peer_contact { xsd:anyURI { maxLength="1024" } }?, - attribute sia_base { xsd:anyURI { maxLength="1024" } }?, - attribute bsc_link { xsd:token { maxLength="1024" } }?, - attribute repository_link { xsd:token { maxLength="1024" } }?, - attribute rekey { "yes" }?, - attribute reissue { "yes" }?, - attribute revoke { "yes" }?, - peer_ta? +parent_id = attribute parent_id { sql_id } + +parent_ctls = (attribute rekey { "yes" }?, + attribute reissue { "yes" }?, + attribute revoke { "yes" }?) + +parent_payload = (attribute peer_contact { xsd:anyURI { maxLength="1024" } }?, + attribute sia_base { xsd:anyURI { maxLength="1024" } }?, + attribute bsc_link { xsd:token { maxLength="1024" } }?, + attribute repository_link { xsd:token { maxLength="1024" } }?, + peer_ta?) + +parent_elt = element parent { + action, type, self_id, parent_id?, parent_ctls, parent_payload } -child = element child { - action, type, - attribute self_id { xsd:token { maxLength="1024" } }, - attribute child_id { xsd:token { maxLength="1024" } }?, - attribute bsc_link { xsd:token { maxLength="1024" } }?, - attribute child_db_id { xsd:token { maxLength="1024" } }?, - attribute reissue { "yes" }?, - peer_ta? +child_id = attribute child_id { sql_id } + +child_ctls = attribute reissue { "yes" }? + +child_payload = (attribute bsc_link { xsd:token { maxLength="1024" } }?, + attribute child_db_id { xsd:token { maxLength="1024" } }?, + peer_ta?) + +child_elt = element child { + action, type, self_id, child_id?, child_ctls, child_payload } -repository = element repository { - action, type, - attribute self_id { xsd:token { maxLength="1024" } }, - attribute repository_id { xsd:token { maxLength="1024" } }?, - attribute peer_contact { xsd:anyURI { maxLength="1024" } }?, - attribute bsc_link { xsd:token { maxLength="1024" } }?, - peer_ta? +repository_id = attribute repository_id { sql_id } + +repository_payload = (attribute peer_contact { xsd:anyURI { maxLength="1024" } }?, + attribute bsc_link { xsd:token { maxLength="1024" } }?, + peer_ta?) + +repository_elt = element repository { + action, type, self_id, repository_id?, repository_payload } -route_origin = element route_origin { - action, type, - attribute self_id { xsd:token { maxLength="1024" } }, - attribute route_origin_id { xsd:token { maxLength="1024" } }?, - attribute suppress_publication { "yes" }?, - attribute asn { xsd:token { maxLength="1024" } }?, - attribute ipv4 { xsd:token { maxLength="1024" } }?, - attribute ipv6 { xsd:token { maxLength="1024" } }? +route_origin_id = attribute route_origin_id { sql_id } + +route_origin_ctls = attribute suppress_publication { "yes" }? + +route_origin_payload = (attribute asn { xsd:token { maxLength="1024" } }?, + attribute ipv4 { xsd:token { maxLength="1024" } }?, + attribute ipv6 { xsd:token { maxLength="1024" } }?) + +route_origin_elt = element route_origin { + action, type, self_id, route_origin_id?, route_origin_ctls, route_origin_payload } -list_resources = element list_resources { - type, - attribute self_id { xsd:token { maxLength="1024" } }, - attribute child_id { xsd:token { maxLength="1024" } }?, - attribute valid_until { xsd:token { maxLength="1024" } }?, - element resource_class { - attribute subject_name { xsd:token { maxLength="1024" } }?, - attribute as { xsd:token { maxLength="1024" } }?, - attribute ipv4 { xsd:token { maxLength="1024" } }?, - attribute ipv6 { xsd:token { maxLength="1024" } }?, - attribute req_as { xsd:token { maxLength="1024" } }?, - attribute req_ipv4 { xsd:token { maxLength="1024" } }?, - attribute req_ipv6 { xsd:token { maxLength="1024" } }? - }* +list_resources_payload = (attribute valid_until { xsd:token { maxLength="1024" } }?, + element resource_class { + attribute subject_name { xsd:token { maxLength="1024" } }?, + attribute as { xsd:token { maxLength="1024" } }?, + attribute ipv4 { xsd:token { maxLength="1024" } }?, + attribute ipv6 { xsd:token { maxLength="1024" } }?, + attribute req_as { xsd:token { maxLength="1024" } }?, + attribute req_ipv4 { xsd:token { maxLength="1024" } }?, + attribute req_ipv6 { xsd:token { maxLength="1024" } }? + }*) + +list_resources_elt = element list_resources { + type, self_id, child_id?, list_resources_payload } -report_error = element report_error { - attribute self_id { xsd:token { maxLength="1024" } }, +report_error_elt = element report_error { + self_id, attribute error_code { xsd:token { maxLength="1024" } }, - xsd:string { maxLength="512000" } + xsd:string { maxLength="512000" }? } diff --git a/scripts/left-right-schema.rng b/scripts/left-right-schema.rng index 7456c806..e7d70fe3 100644 --- a/scripts/left-right-schema.rng +++ b/scripts/left-right-schema.rng @@ -17,14 +17,14 @@ </attribute> <zeroOrMore> <choice> - <ref name="self"/> - <ref name="bsc"/> - <ref name="parent"/> - <ref name="child"/> - <ref name="repository"/> - <ref name="route_origin"/> - <ref name="list_resources"/> - <ref name="report_error"/> + <ref name="self_elt"/> + <ref name="bsc_elt"/> + <ref name="parent_elt"/> + <ref name="child_elt"/> + <ref name="repository_elt"/> + <ref name="route_origin_elt"/> + <ref name="list_resources_elt"/> + <ref name="report_error_elt"/> </choice> </zeroOrMore> </element> @@ -58,390 +58,407 @@ <ref name="base64"/> </element> </define> - <define name="self"> - <element name="self"> - <ref name="action"/> - <ref name="type"/> - <optional> - <attribute name="self_id"> + <define name="sql_id"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </define> + <define name="self_ctls"> + <optional> + <attribute name="rekey"> + <value>yes</value> + </attribute> + </optional> + <optional> + <attribute name="reissue"> + <value>yes</value> + </attribute> + </optional> + <optional> + <attribute name="revoke"> + <value>yes</value> + </attribute> + </optional> + <optional> + <attribute name="run_now"> + <value>yes</value> + </attribute> + </optional> + <optional> + <attribute name="publish_world_now"> + <value>yes</value> + </attribute> + </optional> + </define> + <define name="self_payload"> + <zeroOrMore> + <element name="extension_preference"> + <attribute name="name"> <data type="token"> <param name="maxLength">1024</param> </data> </attribute> - </optional> - <optional> - <attribute name="rekey"> - <value>yes</value> - </attribute> - </optional> - <optional> - <attribute name="reissue"> - <value>yes</value> - </attribute> - </optional> - <optional> - <attribute name="revoke"> - <value>yes</value> - </attribute> - </optional> - <optional> - <attribute name="run_now"> - <value>yes</value> - </attribute> - </optional> + <data type="string"> + <param name="maxLength">512000</param> + </data> + </element> + </zeroOrMore> + </define> + <define name="self_id"> + <attribute name="self_id"> + <ref name="sql_id"/> + </attribute> + </define> + <define name="self_elt"> + <element name="self"> + <ref name="action"/> + <ref name="type"/> <optional> - <attribute name="publish_world_now"> - <value>yes</value> - </attribute> + <ref name="self_id"/> </optional> - <zeroOrMore> - <element name="extension_preference"> - <attribute name="name"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - <data type="string"> - <param name="maxLength">512000</param> - </data> - </element> - </zeroOrMore> + <ref name="self_ctls"/> + <ref name="self_payload"/> </element> </define> - <define name="bsc"> - <element name="bsc"> - <ref name="action"/> - <ref name="type"/> - <attribute name="self_id"> + <define name="bsc_ctls"> + <attribute name="generate_keypair"> + <value>yes</value> + </attribute> + <optional> + <attribute name="key_type"> <data type="token"> <param name="maxLength">1024</param> </data> </attribute> + </optional> + <optional> + <attribute name="hash_alg"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + <optional> + <attribute name="key_length"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + </define> + <define name="bsc_id"> + <attribute name="bsc_id"> + <ref name="sql_id"/> + </attribute> + </define> + <define name="bsc_payload"> + <zeroOrMore> + <element name="signing_cert"> + <ref name="base64"/> + </element> + </zeroOrMore> + <optional> + <element name="pkcs10_cert_request"> + <ref name="base64"/> + </element> + </optional> + <optional> + <element name="public_key"> + <ref name="base64"/> + </element> + </optional> + </define> + <define name="bsc_elt"> + <element name="bsc"> + <ref name="action"/> + <ref name="type"/> + <ref name="self_id"/> <optional> - <attribute name="bsc_id"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="generate_keypair"> - <value>yes</value> - </attribute> - </optional> - <optional> - <attribute name="key_type"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="hash_alg"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="key_length"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <zeroOrMore> - <element name="signing_cert"> - <ref name="base64"/> - </element> - </zeroOrMore> - <optional> - <element name="pkcs10_cert_request"> - <ref name="base64"/> - </element> + <ref name="bsc_id"/> </optional> <optional> - <element name="public_key"> - <ref name="base64"/> - </element> + <ref name="bsc_ctls"/> </optional> + <ref name="bsc_payload"/> </element> </define> - <define name="parent"> - <element name="parent"> - <ref name="action"/> - <ref name="type"/> - <attribute name="self_id"> + <define name="parent_id"> + <attribute name="parent_id"> + <ref name="sql_id"/> + </attribute> + </define> + <define name="parent_ctls"> + <optional> + <attribute name="rekey"> + <value>yes</value> + </attribute> + </optional> + <optional> + <attribute name="reissue"> + <value>yes</value> + </attribute> + </optional> + <optional> + <attribute name="revoke"> + <value>yes</value> + </attribute> + </optional> + </define> + <define name="parent_payload"> + <optional> + <attribute name="peer_contact"> + <data type="anyURI"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + <optional> + <attribute name="sia_base"> + <data type="anyURI"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + <optional> + <attribute name="bsc_link"> <data type="token"> <param name="maxLength">1024</param> </data> </attribute> + </optional> + <optional> + <attribute name="repository_link"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + <optional> + <ref name="peer_ta"/> + </optional> + </define> + <define name="parent_elt"> + <element name="parent"> + <ref name="action"/> + <ref name="type"/> + <ref name="self_id"/> <optional> - <attribute name="parent_id"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="peer_contact"> - <data type="anyURI"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="sia_base"> - <data type="anyURI"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="bsc_link"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="repository_link"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="rekey"> - <value>yes</value> - </attribute> - </optional> - <optional> - <attribute name="reissue"> - <value>yes</value> - </attribute> - </optional> - <optional> - <attribute name="revoke"> - <value>yes</value> - </attribute> - </optional> - <optional> - <ref name="peer_ta"/> + <ref name="parent_id"/> </optional> + <ref name="parent_ctls"/> + <ref name="parent_payload"/> </element> </define> - <define name="child"> - <element name="child"> - <ref name="action"/> - <ref name="type"/> - <attribute name="self_id"> + <define name="child_id"> + <attribute name="child_id"> + <ref name="sql_id"/> + </attribute> + </define> + <define name="child_ctls"> + <optional> + <attribute name="reissue"> + <value>yes</value> + </attribute> + </optional> + </define> + <define name="child_payload"> + <optional> + <attribute name="bsc_link"> <data type="token"> <param name="maxLength">1024</param> </data> </attribute> + </optional> + <optional> + <attribute name="child_db_id"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + <optional> + <ref name="peer_ta"/> + </optional> + </define> + <define name="child_elt"> + <element name="child"> + <ref name="action"/> + <ref name="type"/> + <ref name="self_id"/> <optional> - <attribute name="child_id"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="bsc_link"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="child_db_id"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="reissue"> - <value>yes</value> - </attribute> - </optional> - <optional> - <ref name="peer_ta"/> + <ref name="child_id"/> </optional> + <ref name="child_ctls"/> + <ref name="child_payload"/> </element> </define> - <define name="repository"> - <element name="repository"> - <ref name="action"/> - <ref name="type"/> - <attribute name="self_id"> + <define name="repository_id"> + <attribute name="repository_id"> + <ref name="sql_id"/> + </attribute> + </define> + <define name="repository_payload"> + <optional> + <attribute name="peer_contact"> + <data type="anyURI"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + <optional> + <attribute name="bsc_link"> <data type="token"> <param name="maxLength">1024</param> </data> </attribute> + </optional> + <optional> + <ref name="peer_ta"/> + </optional> + </define> + <define name="repository_elt"> + <element name="repository"> + <ref name="action"/> + <ref name="type"/> + <ref name="self_id"/> <optional> - <attribute name="repository_id"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="peer_contact"> - <data type="anyURI"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="bsc_link"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <ref name="peer_ta"/> + <ref name="repository_id"/> </optional> + <ref name="repository_payload"/> </element> </define> - <define name="route_origin"> - <element name="route_origin"> - <ref name="action"/> - <ref name="type"/> - <attribute name="self_id"> + <define name="route_origin_id"> + <attribute name="route_origin_id"> + <ref name="sql_id"/> + </attribute> + </define> + <define name="route_origin_ctls"> + <optional> + <attribute name="suppress_publication"> + <value>yes</value> + </attribute> + </optional> + </define> + <define name="route_origin_payload"> + <optional> + <attribute name="asn"> <data type="token"> <param name="maxLength">1024</param> </data> </attribute> + </optional> + <optional> + <attribute name="ipv4"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + <optional> + <attribute name="ipv6"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + </define> + <define name="route_origin_elt"> + <element name="route_origin"> + <ref name="action"/> + <ref name="type"/> + <ref name="self_id"/> <optional> - <attribute name="route_origin_id"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="suppress_publication"> - <value>yes</value> - </attribute> - </optional> - <optional> - <attribute name="asn"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="ipv4"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="ipv6"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> + <ref name="route_origin_id"/> </optional> + <ref name="route_origin_ctls"/> + <ref name="route_origin_payload"/> </element> </define> - <define name="list_resources"> - <element name="list_resources"> - <ref name="type"/> - <attribute name="self_id"> + <define name="list_resources_payload"> + <optional> + <attribute name="valid_until"> <data type="token"> <param name="maxLength">1024</param> </data> </attribute> + </optional> + <zeroOrMore> + <element name="resource_class"> + <optional> + <attribute name="subject_name"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + <optional> + <attribute name="as"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + <optional> + <attribute name="ipv4"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + <optional> + <attribute name="ipv6"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + <optional> + <attribute name="req_as"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + <optional> + <attribute name="req_ipv4"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + <optional> + <attribute name="req_ipv6"> + <data type="token"> + <param name="maxLength">1024</param> + </data> + </attribute> + </optional> + </element> + </zeroOrMore> + </define> + <define name="list_resources_elt"> + <element name="list_resources"> + <ref name="type"/> + <ref name="self_id"/> <optional> - <attribute name="child_id"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="valid_until"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> + <ref name="child_id"/> </optional> - <zeroOrMore> - <element name="resource_class"> - <optional> - <attribute name="subject_name"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="as"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="ipv4"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="ipv6"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="req_as"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="req_ipv4"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - <optional> - <attribute name="req_ipv6"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> - </optional> - </element> - </zeroOrMore> + <ref name="list_resources_payload"/> </element> </define> - <define name="report_error"> + <define name="report_error_elt"> <element name="report_error"> - <attribute name="self_id"> - <data type="token"> - <param name="maxLength">1024</param> - </data> - </attribute> + <ref name="self_id"/> <attribute name="error_code"> <data type="token"> <param name="maxLength">1024</param> </data> </attribute> - <data type="string"> - <param name="maxLength">512000</param> - </data> + <optional> + <data type="string"> + <param name="maxLength">512000</param> + </data> + </optional> </element> </define> </grammar> |