aboutsummaryrefslogtreecommitdiff
path: root/scripts/left-right-schema.rnc
blob: 81667d00384903cbba125c3c6606d0c88aeb686e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# $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: