# $Id$ # # RelaxNG (Compact Syntax) Schema for RPKI left-right protocol. # # libxml2 (including xmllint) only groks the XML syntax of RelaxNG, so # run the output of this script through a converter like trang to get # XML syntax. default namespace = "http://www.hactrn.net/uris/rpki/left-right-spec/" grammar { start = element msg { attribute version { xsd:positiveInteger { maxInclusive="1" } }, attribute type { "control_request" | "control_response" | "data_request" | "data_response" | "error" }, \payload } \payload = ( \self | \bsc | \parent | \child | \repository | \route_origin | \list_resources | \report_error )* \self = element self { attribute action { xsd:token { maxLength="1024" } }, 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" } }* } \bsc = element bsc { attribute action { xsd:token { maxLength="1024" } }, 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 { xsd:base64Binary { maxLength="512000" } }*, element pkcs10_cert_request { xsd:base64Binary { maxLength="512000" } }?, element public_key { xsd:base64Binary { maxLength="512000" } }? } \parent = element parent { attribute action { xsd:token { maxLength="1024" } }, 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" }?, element peer_ta { xsd:base64Binary { maxLength="512000" } }? } \child = element child { attribute action { xsd:token { maxLength="1024" } }, 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" }?, element peer_ta { xsd:base64Binary { maxLength="512000" } }? } \repository = element repository { attribute action { xsd:token { maxLength="1024" } }, 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" } }?, element peer_ta { xsd:base64Binary { maxLength="512000" } }? } \route_origin = element route_origin { attribute action { xsd:token { maxLength="1024" } }, 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" } }? } \list_resources = element list_resources { 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" } }? }* } \report_error = element report_error { attribute self_id { xsd:token { maxLength="1024" } }, attribute error_code { xsd:token { maxLength="1024" } }, xsd:string { maxLength="512000" } } } # Local Variables: # compile-command: "trang left-right-schema.rnc left-right-schema.rng" # End: