aboutsummaryrefslogtreecommitdiff
path: root/schemas/relaxng/rrdp.rng
blob: 9ff2ff1e78afc76c8dcfcbc4ba6e9dae340f9f64 (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?xml version="1.0" encoding="UTF-8"?>
<!--
  $Id: rrdp.rnc 5888 2014-07-09 05:39:54Z sra $
  
  RelaxNG schema for RPKI Repository Delta Protocol (RRDP).
  
  Copyright (C) 2014  Dragon Research Labs ("DRL")
  
  Permission to use, copy, modify, and distribute this software for any
  purpose with or without fee is hereby granted, provided that the above
  copyright notice and this permission notice appear in all copies.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND DRL DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS.  IN NO EVENT SHALL DRL BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
-->
<grammar ns="http://www.ripe.net/rpki/rrdp" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <define name="version">
    <data type="positiveInteger">
      <param name="maxInclusive">1</param>
    </data>
  </define>
  <define name="serial">
    <data type="nonNegativeInteger"/>
  </define>
  <define name="uri">
    <data type="anyURI"/>
  </define>
  <define name="uuid">
    <data type="string">
      <param name="pattern">[\-0-9a-fA-F]+</param>
    </data>
  </define>
  <define name="hash">
    <data type="string">
      <param name="pattern">[0-9a-fA-F]+</param>
    </data>
  </define>
  <define name="base64">
    <data type="base64Binary"/>
  </define>
  <!-- Notification file: lists current snapshots and deltas -->
  <start combine="choice">
    <element name="notification">
      <attribute name="version">
        <ref name="version"/>
      </attribute>
      <attribute name="session_id">
        <ref name="uuid"/>
      </attribute>
      <attribute name="serial">
        <ref name="serial"/>
      </attribute>
      <element name="snapshot">
        <attribute name="uri">
          <ref name="uri"/>
        </attribute>
        <attribute name="hash">
          <ref name="hash"/>
        </attribute>
      </element>
      <zeroOrMore>
        <element name="delta">
          <attribute name="serial">
            <ref name="serial"/>
          </attribute>
          <attribute name="uri">
            <ref name="uri"/>
          </attribute>
          <attribute name="hash">
            <ref name="hash"/>
          </attribute>
        </element>
      </zeroOrMore>
    </element>
  </start>
  <!-- Snapshot segment: think DNS AXFR. -->
  <start combine="choice">
    <element name="snapshot">
      <attribute name="version">
        <ref name="version"/>
      </attribute>
      <attribute name="session_id">
        <ref name="uuid"/>
      </attribute>
      <attribute name="serial">
        <ref name="serial"/>
      </attribute>
      <zeroOrMore>
        <element name="publish">
          <attribute name="uri">
            <ref name="uri"/>
          </attribute>
          <ref name="base64"/>
        </element>
      </zeroOrMore>
    </element>
  </start>
  <!-- Delta segment: think DNS IXFR. -->
  <start combine="choice">
    <element name="delta">
      <attribute name="version">
        <ref name="version"/>
      </attribute>
      <attribute name="session_id">
        <ref name="uuid"/>
      </attribute>
      <attribute name="serial">
        <ref name="serial"/>
      </attribute>
      <oneOrMore>
        <ref name="delta_element"/>
      </oneOrMore>
    </element>
  </start>
  <define name="delta_element" combine="choice">
    <element name="publish">
      <attribute name="uri">
        <ref name="uri"/>
      </attribute>
      <optional>
        <attribute name="hash">
          <ref name="hash"/>
        </attribute>
      </optional>
      <ref name="base64"/>
    </element>
  </define>
  <define name="delta_element" combine="choice">
    <element name="withdraw">
      <attribute name="uri">
        <ref name="uri"/>
      </attribute>
      <attribute name="hash">
        <ref name="hash"/>
      </attribute>
    </element>
  </define>
</grammar>
<!--
  Local Variables:
  indent-tabs-mode: nil
  comment-start: "# "
  comment-start-skip: "#[ \t]*"
  End:
-->