aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/relaxng.py
diff options
context:
space:
mode:
Diffstat (limited to 'rpkid/rpki/relaxng.py')
-rw-r--r--rpkid/rpki/relaxng.py48
1 files changed, 30 insertions, 18 deletions
diff --git a/rpkid/rpki/relaxng.py b/rpkid/rpki/relaxng.py
index f69968be..a7553d51 100644
--- a/rpkid/rpki/relaxng.py
+++ b/rpkid/rpki/relaxng.py
@@ -2366,31 +2366,43 @@ router_certificate = lxml.etree.RelaxNG(lxml.etree.fromstring(r'''<?xml version=
<param name="pattern">.*Z</param>
</data>
</define>
- <!-- Core PDU used in this schema. -->
- <define name="router_certificate_request">
- <element name="router_certificate_request">
- <attribute name="router_id">
- <ref name="router_id"/>
- </attribute>
- <attribute name="asn">
- <ref name="asn_list"/>
+ <!-- Core payload used in this schema. -->
+ <define name="payload">
+ <attribute name="router_id">
+ <ref name="router_id"/>
+ </attribute>
+ <attribute name="asn">
+ <ref name="asn_list"/>
+ </attribute>
+ <optional>
+ <attribute name="valid_until">
+ <ref name="timestamp"/>
</attribute>
- <optional>
- <attribute name="valid_until">
- <ref name="timestamp"/>
- </attribute>
- </optional>
- <ref name="base64"/>
- </element>
+ </optional>
+ <ref name="base64"/>
</define>
+ <!--
+ We allow two forms, one with a wrapper to allow multiple requests in
+ a single file, one without for brevity; the version attribute goes
+ in the outermost element in either case.
+ -->
<start combine="choice">
- <ref name="router_certificate_request"/>
+ <element name="router_certificate_request">
+ <attribute name="version">
+ <ref name="version"/>
+ </attribute>
+ <ref name="payload"/>
+ </element>
</start>
- <!-- Wrapper element to support multiple requests in a single document. -->
<start combine="choice">
<element name="router_certificate_requests">
+ <attribute name="version">
+ <ref name="version"/>
+ </attribute>
<zeroOrMore>
- <ref name="router_certificate_request"/>
+ <element name="router_certificate_request">
+ <ref name="payload"/>
+ </element>
</zeroOrMore>
</element>
</start>