00001
00002
00003 import lxml.etree
00004
00005
00006
00007 left_right = lxml.etree.RelaxNG(lxml.etree.fromstring('''<?xml version="1.0" encoding="UTF-8"?>
00008 <!--
00009 $Id: left-right-schema.rnc 3109 2010-03-16 23:55:07Z sra $
00010
00011 RelaxNG Schema for RPKI left-right protocol.
00012
00013 libxml2 (including xmllint) only groks the XML syntax of RelaxNG, so
00014 run the compact syntax through trang to get XML syntax.
00015
00016 Copyright (C) 2009-2010 Internet Systems Consortium ("ISC")
00017
00018 Permission to use, copy, modify, and distribute this software for any
00019 purpose with or without fee is hereby granted, provided that the above
00020 copyright notice and this permission notice appear in all copies.
00021
00022 THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
00023 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00024 AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
00025 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
00026 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00027 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00028 PERFORMANCE OF THIS SOFTWARE.
00029
00030 Portions copyright (C) 2007-2008 American Registry for Internet Numbers ("ARIN")
00031
00032 Permission to use, copy, modify, and distribute this software for any
00033 purpose with or without fee is hereby granted, provided that the above
00034 copyright notice and this permission notice appear in all copies.
00035
00036 THE SOFTWARE IS PROVIDED "AS IS" AND ARIN DISCLAIMS ALL WARRANTIES WITH
00037 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00038 AND FITNESS. IN NO EVENT SHALL ARIN BE LIABLE FOR ANY SPECIAL, DIRECT,
00039 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
00040 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00041 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00042 PERFORMANCE OF THIS SOFTWARE.
00043 -->
00044 <grammar ns="http://www.hactrn.net/uris/rpki/left-right-spec/" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
00045 <!-- Top level PDU -->
00046 <start>
00047 <element name="msg">
00048 <attribute name="version">
00049 <data type="positiveInteger">
00050 <param name="maxInclusive">1</param>
00051 </data>
00052 </attribute>
00053 <choice>
00054 <group>
00055 <attribute name="type">
00056 <value>query</value>
00057 </attribute>
00058 <zeroOrMore>
00059 <ref name="query_elt"/>
00060 </zeroOrMore>
00061 </group>
00062 <group>
00063 <attribute name="type">
00064 <value>reply</value>
00065 </attribute>
00066 <zeroOrMore>
00067 <ref name="reply_elt"/>
00068 </zeroOrMore>
00069 </group>
00070 </choice>
00071 </element>
00072 </start>
00073 <!-- PDUs allowed in a query -->
00074 <define name="query_elt" combine="choice">
00075 <ref name="self_query"/>
00076 </define>
00077 <define name="query_elt" combine="choice">
00078 <ref name="bsc_query"/>
00079 </define>
00080 <define name="query_elt" combine="choice">
00081 <ref name="parent_query"/>
00082 </define>
00083 <define name="query_elt" combine="choice">
00084 <ref name="child_query"/>
00085 </define>
00086 <define name="query_elt" combine="choice">
00087 <ref name="repository_query"/>
00088 </define>
00089 <define name="query_elt" combine="choice">
00090 <ref name="list_roa_requests_query"/>
00091 </define>
00092 <define name="query_elt" combine="choice">
00093 <ref name="list_resources_query"/>
00094 </define>
00095 <define name="query_elt" combine="choice">
00096 <ref name="list_published_objects_query"/>
00097 </define>
00098 <define name="query_elt" combine="choice">
00099 <ref name="list_received_resources_query"/>
00100 </define>
00101 <!-- PDUs allowed in a reply -->
00102 <define name="reply_elt" combine="choice">
00103 <ref name="self_reply"/>
00104 </define>
00105 <define name="reply_elt" combine="choice">
00106 <ref name="bsc_reply"/>
00107 </define>
00108 <define name="reply_elt" combine="choice">
00109 <ref name="parent_reply"/>
00110 </define>
00111 <define name="reply_elt" combine="choice">
00112 <ref name="child_reply"/>
00113 </define>
00114 <define name="reply_elt" combine="choice">
00115 <ref name="repository_reply"/>
00116 </define>
00117 <define name="reply_elt" combine="choice">
00118 <ref name="list_resources_reply"/>
00119 </define>
00120 <define name="reply_elt" combine="choice">
00121 <ref name="list_roa_requests_reply"/>
00122 </define>
00123 <define name="reply_elt" combine="choice">
00124 <ref name="list_published_objects_reply"/>
00125 </define>
00126 <define name="reply_elt" combine="choice">
00127 <ref name="list_received_resources_reply"/>
00128 </define>
00129 <define name="reply_elt" combine="choice">
00130 <ref name="report_error_reply"/>
00131 </define>
00132 <!-- Tag attributes for bulk operations -->
00133 <define name="tag">
00134 <optional>
00135 <attribute name="tag">
00136 <data type="token">
00137 <param name="maxLength">1024</param>
00138 </data>
00139 </attribute>
00140 </optional>
00141 </define>
00142 <!--
00143 Combinations of action and type attributes used in later definitions.
00144 The same patterns repeat in most of the elements in this protocol.
00145 -->
00146 <define name="ctl_create">
00147 <attribute name="action">
00148 <value>create</value>
00149 </attribute>
00150 <ref name="tag"/>
00151 </define>
00152 <define name="ctl_set">
00153 <attribute name="action">
00154 <value>set</value>
00155 </attribute>
00156 <ref name="tag"/>
00157 </define>
00158 <define name="ctl_get">
00159 <attribute name="action">
00160 <value>get</value>
00161 </attribute>
00162 <ref name="tag"/>
00163 </define>
00164 <define name="ctl_list">
00165 <attribute name="action">
00166 <value>list</value>
00167 </attribute>
00168 <ref name="tag"/>
00169 </define>
00170 <define name="ctl_destroy">
00171 <attribute name="action">
00172 <value>destroy</value>
00173 </attribute>
00174 <ref name="tag"/>
00175 </define>
00176 <!-- Base64 encoded DER stuff -->
00177 <define name="base64">
00178 <data type="base64Binary">
00179 <param name="maxLength">512000</param>
00180 </data>
00181 </define>
00182 <!--
00183 Base definition for all fields that are really just SQL primary indices
00184 sql_id = xsd:nonNegativeInteger
00185 -->
00186 <!--
00187 ...except that fields containing SQL primary indicies don't belong
00188 in this protocol, so they're turninging into handles.
00189 Length restriction is a MySQL implementation issue.
00190 Handles are case-insensitive (because SQL is, among other reasons).
00191 -->
00192 <define name="object_handle">
00193 <data type="string">
00194 <param name="maxLength">255</param>
00195 <param name="pattern">[\-_A-Za-z0-9]*</param>
00196 </data>
00197 </define>
00198 <!-- URIs -->
00199 <define name="uri">
00200 <data type="anyURI">
00201 <param name="maxLength">4096</param>
00202 </data>
00203 </define>
00204 <!-- Name fields imported from up-down protocol -->
00205 <define name="up_down_name">
00206 <data type="token">
00207 <param name="maxLength">1024</param>
00208 </data>
00209 </define>
00210 <!-- Resource lists -->
00211 <define name="asn_list">
00212 <data type="string">
00213 <param name="maxLength">512000</param>
00214 <param name="pattern">[\-,0-9]*</param>
00215 </data>
00216 </define>
00217 <define name="ipv4_list">
00218 <data type="string">
00219 <param name="maxLength">512000</param>
00220 <param name="pattern">[\-,0-9/.]*</param>
00221 </data>
00222 </define>
00223 <define name="ipv6_list">
00224 <data type="string">
00225 <param name="maxLength">512000</param>
00226 <param name="pattern">[\-,0-9/:a-fA-F]*</param>
00227 </data>
00228 </define>
00229 <!-- <self/> element -->
00230 <define name="self_bool">
00231 <optional>
00232 <attribute name="rekey">
00233 <value>yes</value>
00234 </attribute>
00235 </optional>
00236 <optional>
00237 <attribute name="reissue">
00238 <value>yes</value>
00239 </attribute>
00240 </optional>
00241 <optional>
00242 <attribute name="revoke">
00243 <value>yes</value>
00244 </attribute>
00245 </optional>
00246 <optional>
00247 <attribute name="run_now">
00248 <value>yes</value>
00249 </attribute>
00250 </optional>
00251 <optional>
00252 <attribute name="publish_world_now">
00253 <value>yes</value>
00254 </attribute>
00255 </optional>
00256 <optional>
00257 <attribute name="revoke_forgotten">
00258 <value>yes</value>
00259 </attribute>
00260 </optional>
00261 </define>
00262 <define name="self_payload">
00263 <optional>
00264 <attribute name="use_hsm">
00265 <choice>
00266 <value>yes</value>
00267 <value>no</value>
00268 </choice>
00269 </attribute>
00270 </optional>
00271 <optional>
00272 <attribute name="crl_interval">
00273 <data type="positiveInteger"/>
00274 </attribute>
00275 </optional>
00276 <optional>
00277 <attribute name="regen_margin">
00278 <data type="positiveInteger"/>
00279 </attribute>
00280 </optional>
00281 <optional>
00282 <element name="bpki_cert">
00283 <ref name="base64"/>
00284 </element>
00285 </optional>
00286 <optional>
00287 <element name="bpki_glue">
00288 <ref name="base64"/>
00289 </element>
00290 </optional>
00291 </define>
00292 <define name="self_handle">
00293 <attribute name="self_handle">
00294 <ref name="object_handle"/>
00295 </attribute>
00296 </define>
00297 <define name="self_query" combine="choice">
00298 <element name="self">
00299 <ref name="ctl_create"/>
00300 <ref name="self_handle"/>
00301 <ref name="self_bool"/>
00302 <ref name="self_payload"/>
00303 </element>
00304 </define>
00305 <define name="self_reply" combine="choice">
00306 <element name="self">
00307 <ref name="ctl_create"/>
00308 <ref name="self_handle"/>
00309 </element>
00310 </define>
00311 <define name="self_query" combine="choice">
00312 <element name="self">
00313 <ref name="ctl_set"/>
00314 <ref name="self_handle"/>
00315 <ref name="self_bool"/>
00316 <ref name="self_payload"/>
00317 </element>
00318 </define>
00319 <define name="self_reply" combine="choice">
00320 <element name="self">
00321 <ref name="ctl_set"/>
00322 <ref name="self_handle"/>
00323 </element>
00324 </define>
00325 <define name="self_query" combine="choice">
00326 <element name="self">
00327 <ref name="ctl_get"/>
00328 <ref name="self_handle"/>
00329 </element>
00330 </define>
00331 <define name="self_reply" combine="choice">
00332 <element name="self">
00333 <ref name="ctl_get"/>
00334 <ref name="self_handle"/>
00335 <ref name="self_payload"/>
00336 </element>
00337 </define>
00338 <define name="self_query" combine="choice">
00339 <element name="self">
00340 <ref name="ctl_list"/>
00341 </element>
00342 </define>
00343 <define name="self_reply" combine="choice">
00344 <element name="self">
00345 <ref name="ctl_list"/>
00346 <ref name="self_handle"/>
00347 <ref name="self_payload"/>
00348 </element>
00349 </define>
00350 <define name="self_query" combine="choice">
00351 <element name="self">
00352 <ref name="ctl_destroy"/>
00353 <ref name="self_handle"/>
00354 </element>
00355 </define>
00356 <define name="self_reply" combine="choice">
00357 <element name="self">
00358 <ref name="ctl_destroy"/>
00359 <ref name="self_handle"/>
00360 </element>
00361 </define>
00362 <!-- <bsc/> element. Key parameters hardwired for now. -->
00363 <define name="bsc_bool">
00364 <optional>
00365 <attribute name="generate_keypair">
00366 <value>yes</value>
00367 </attribute>
00368 <optional>
00369 <attribute name="key_type">
00370 <value>rsa</value>
00371 </attribute>
00372 </optional>
00373 <optional>
00374 <attribute name="hash_alg">
00375 <value>sha256</value>
00376 </attribute>
00377 </optional>
00378 <optional>
00379 <attribute name="key_length">
00380 <value>2048</value>
00381 </attribute>
00382 </optional>
00383 </optional>
00384 </define>
00385 <define name="bsc_handle">
00386 <attribute name="bsc_handle">
00387 <ref name="object_handle"/>
00388 </attribute>
00389 </define>
00390 <define name="bsc_payload">
00391 <optional>
00392 <element name="signing_cert">
00393 <ref name="base64"/>
00394 </element>
00395 </optional>
00396 <optional>
00397 <element name="signing_cert_crl">
00398 <ref name="base64"/>
00399 </element>
00400 </optional>
00401 </define>
00402 <define name="bsc_pkcs10">
00403 <optional>
00404 <element name="pkcs10_request">
00405 <ref name="base64"/>
00406 </element>
00407 </optional>
00408 </define>
00409 <define name="bsc_query" combine="choice">
00410 <element name="bsc">
00411 <ref name="ctl_create"/>
00412 <ref name="self_handle"/>
00413 <ref name="bsc_handle"/>
00414 <ref name="bsc_bool"/>
00415 <ref name="bsc_payload"/>
00416 </element>
00417 </define>
00418 <define name="bsc_reply" combine="choice">
00419 <element name="bsc">
00420 <ref name="ctl_create"/>
00421 <ref name="self_handle"/>
00422 <ref name="bsc_handle"/>
00423 <ref name="bsc_pkcs10"/>
00424 </element>
00425 </define>
00426 <define name="bsc_query" combine="choice">
00427 <element name="bsc">
00428 <ref name="ctl_set"/>
00429 <ref name="self_handle"/>
00430 <ref name="bsc_handle"/>
00431 <ref name="bsc_bool"/>
00432 <ref name="bsc_payload"/>
00433 </element>
00434 </define>
00435 <define name="bsc_reply" combine="choice">
00436 <element name="bsc">
00437 <ref name="ctl_set"/>
00438 <ref name="self_handle"/>
00439 <ref name="bsc_handle"/>
00440 <ref name="bsc_pkcs10"/>
00441 </element>
00442 </define>
00443 <define name="bsc_query" combine="choice">
00444 <element name="bsc">
00445 <ref name="ctl_get"/>
00446 <ref name="self_handle"/>
00447 <ref name="bsc_handle"/>
00448 </element>
00449 </define>
00450 <define name="bsc_reply" combine="choice">
00451 <element name="bsc">
00452 <ref name="ctl_get"/>
00453 <ref name="self_handle"/>
00454 <ref name="bsc_handle"/>
00455 <ref name="bsc_payload"/>
00456 <ref name="bsc_pkcs10"/>
00457 </element>
00458 </define>
00459 <define name="bsc_query" combine="choice">
00460 <element name="bsc">
00461 <ref name="ctl_list"/>
00462 <ref name="self_handle"/>
00463 </element>
00464 </define>
00465 <define name="bsc_reply" combine="choice">
00466 <element name="bsc">
00467 <ref name="ctl_list"/>
00468 <ref name="self_handle"/>
00469 <ref name="bsc_handle"/>
00470 <ref name="bsc_payload"/>
00471 <ref name="bsc_pkcs10"/>
00472 </element>
00473 </define>
00474 <define name="bsc_query" combine="choice">
00475 <element name="bsc">
00476 <ref name="ctl_destroy"/>
00477 <ref name="self_handle"/>
00478 <ref name="bsc_handle"/>
00479 </element>
00480 </define>
00481 <define name="bsc_reply" combine="choice">
00482 <element name="bsc">
00483 <ref name="ctl_destroy"/>
00484 <ref name="self_handle"/>
00485 <ref name="bsc_handle"/>
00486 </element>
00487 </define>
00488 <!-- <parent/> element -->
00489 <define name="parent_handle">
00490 <attribute name="parent_handle">
00491 <ref name="object_handle"/>
00492 </attribute>
00493 </define>
00494 <define name="parent_bool">
00495 <optional>
00496 <attribute name="rekey">
00497 <value>yes</value>
00498 </attribute>
00499 </optional>
00500 <optional>
00501 <attribute name="reissue">
00502 <value>yes</value>
00503 </attribute>
00504 </optional>
00505 <optional>
00506 <attribute name="revoke">
00507 <value>yes</value>
00508 </attribute>
00509 </optional>
00510 <optional>
00511 <attribute name="revoke_forgotten">
00512 <value>yes</value>
00513 </attribute>
00514 </optional>
00515 </define>
00516 <define name="parent_payload">
00517 <optional>
00518 <attribute name="peer_contact_uri">
00519 <ref name="uri"/>
00520 </attribute>
00521 </optional>
00522 <optional>
00523 <attribute name="sia_base">
00524 <ref name="uri"/>
00525 </attribute>
00526 </optional>
00527 <optional>
00528 <ref name="bsc_handle"/>
00529 </optional>
00530 <optional>
00531 <ref name="repository_handle"/>
00532 </optional>
00533 <optional>
00534 <attribute name="sender_name">
00535 <ref name="up_down_name"/>
00536 </attribute>
00537 </optional>
00538 <optional>
00539 <attribute name="recipient_name">
00540 <ref name="up_down_name"/>
00541 </attribute>
00542 </optional>
00543 <optional>
00544 <element name="bpki_cms_cert">
00545 <ref name="base64"/>
00546 </element>
00547 </optional>
00548 <optional>
00549 <element name="bpki_cms_glue">
00550 <ref name="base64"/>
00551 </element>
00552 </optional>
00553 <optional>
00554 <element name="bpki_https_cert">
00555 <ref name="base64"/>
00556 </element>
00557 </optional>
00558 <optional>
00559 <element name="bpki_https_glue">
00560 <ref name="base64"/>
00561 </element>
00562 </optional>
00563 </define>
00564 <define name="parent_query" combine="choice">
00565 <element name="parent">
00566 <ref name="ctl_create"/>
00567 <ref name="self_handle"/>
00568 <ref name="parent_handle"/>
00569 <ref name="parent_bool"/>
00570 <ref name="parent_payload"/>
00571 </element>
00572 </define>
00573 <define name="parent_reply" combine="choice">
00574 <element name="parent">
00575 <ref name="ctl_create"/>
00576 <ref name="self_handle"/>
00577 <ref name="parent_handle"/>
00578 </element>
00579 </define>
00580 <define name="parent_query" combine="choice">
00581 <element name="parent">
00582 <ref name="ctl_set"/>
00583 <ref name="self_handle"/>
00584 <ref name="parent_handle"/>
00585 <ref name="parent_bool"/>
00586 <ref name="parent_payload"/>
00587 </element>
00588 </define>
00589 <define name="parent_reply" combine="choice">
00590 <element name="parent">
00591 <ref name="ctl_set"/>
00592 <ref name="self_handle"/>
00593 <ref name="parent_handle"/>
00594 </element>
00595 </define>
00596 <define name="parent_query" combine="choice">
00597 <element name="parent">
00598 <ref name="ctl_get"/>
00599 <ref name="self_handle"/>
00600 <ref name="parent_handle"/>
00601 </element>
00602 </define>
00603 <define name="parent_reply" combine="choice">
00604 <element name="parent">
00605 <ref name="ctl_get"/>
00606 <ref name="self_handle"/>
00607 <ref name="parent_handle"/>
00608 <ref name="parent_payload"/>
00609 </element>
00610 </define>
00611 <define name="parent_query" combine="choice">
00612 <element name="parent">
00613 <ref name="ctl_list"/>
00614 <ref name="self_handle"/>
00615 </element>
00616 </define>
00617 <define name="parent_reply" combine="choice">
00618 <element name="parent">
00619 <ref name="ctl_list"/>
00620 <ref name="self_handle"/>
00621 <ref name="parent_handle"/>
00622 <ref name="parent_payload"/>
00623 </element>
00624 </define>
00625 <define name="parent_query" combine="choice">
00626 <element name="parent">
00627 <ref name="ctl_destroy"/>
00628 <ref name="self_handle"/>
00629 <ref name="parent_handle"/>
00630 </element>
00631 </define>
00632 <define name="parent_reply" combine="choice">
00633 <element name="parent">
00634 <ref name="ctl_destroy"/>
00635 <ref name="self_handle"/>
00636 <ref name="parent_handle"/>
00637 </element>
00638 </define>
00639 <!-- <child/> element -->
00640 <define name="child_handle">
00641 <attribute name="child_handle">
00642 <ref name="object_handle"/>
00643 </attribute>
00644 </define>
00645 <define name="child_bool">
00646 <optional>
00647 <attribute name="reissue">
00648 <value>yes</value>
00649 </attribute>
00650 </optional>
00651 </define>
00652 <define name="child_payload">
00653 <optional>
00654 <ref name="bsc_handle"/>
00655 </optional>
00656 <optional>
00657 <element name="bpki_cert">
00658 <ref name="base64"/>
00659 </element>
00660 </optional>
00661 <optional>
00662 <element name="bpki_glue">
00663 <ref name="base64"/>
00664 </element>
00665 </optional>
00666 </define>
00667 <define name="child_query" combine="choice">
00668 <element name="child">
00669 <ref name="ctl_create"/>
00670 <ref name="self_handle"/>
00671 <ref name="child_handle"/>
00672 <ref name="child_bool"/>
00673 <ref name="child_payload"/>
00674 </element>
00675 </define>
00676 <define name="child_reply" combine="choice">
00677 <element name="child">
00678 <ref name="ctl_create"/>
00679 <ref name="self_handle"/>
00680 <ref name="child_handle"/>
00681 </element>
00682 </define>
00683 <define name="child_query" combine="choice">
00684 <element name="child">
00685 <ref name="ctl_set"/>
00686 <ref name="self_handle"/>
00687 <ref name="child_handle"/>
00688 <ref name="child_bool"/>
00689 <ref name="child_payload"/>
00690 </element>
00691 </define>
00692 <define name="child_reply" combine="choice">
00693 <element name="child">
00694 <ref name="ctl_set"/>
00695 <ref name="self_handle"/>
00696 <ref name="child_handle"/>
00697 </element>
00698 </define>
00699 <define name="child_query" combine="choice">
00700 <element name="child">
00701 <ref name="ctl_get"/>
00702 <ref name="self_handle"/>
00703 <ref name="child_handle"/>
00704 </element>
00705 </define>
00706 <define name="child_reply" combine="choice">
00707 <element name="child">
00708 <ref name="ctl_get"/>
00709 <ref name="self_handle"/>
00710 <ref name="child_handle"/>
00711 <ref name="child_payload"/>
00712 </element>
00713 </define>
00714 <define name="child_query" combine="choice">
00715 <element name="child">
00716 <ref name="ctl_list"/>
00717 <ref name="self_handle"/>
00718 </element>
00719 </define>
00720 <define name="child_reply" combine="choice">
00721 <element name="child">
00722 <ref name="ctl_list"/>
00723 <ref name="self_handle"/>
00724 <ref name="child_handle"/>
00725 <ref name="child_payload"/>
00726 </element>
00727 </define>
00728 <define name="child_query" combine="choice">
00729 <element name="child">
00730 <ref name="ctl_destroy"/>
00731 <ref name="self_handle"/>
00732 <ref name="child_handle"/>
00733 </element>
00734 </define>
00735 <define name="child_reply" combine="choice">
00736 <element name="child">
00737 <ref name="ctl_destroy"/>
00738 <ref name="self_handle"/>
00739 <ref name="child_handle"/>
00740 </element>
00741 </define>
00742 <!-- <repository/> element -->
00743 <define name="repository_handle">
00744 <attribute name="repository_handle">
00745 <ref name="object_handle"/>
00746 </attribute>
00747 </define>
00748 <define name="repository_payload">
00749 <optional>
00750 <attribute name="peer_contact_uri">
00751 <ref name="uri"/>
00752 </attribute>
00753 </optional>
00754 <optional>
00755 <ref name="bsc_handle"/>
00756 </optional>
00757 <optional>
00758 <element name="bpki_cert">
00759 <ref name="base64"/>
00760 </element>
00761 </optional>
00762 <optional>
00763 <element name="bpki_glue">
00764 <ref name="base64"/>
00765 </element>
00766 </optional>
00767 </define>
00768 <define name="repository_query" combine="choice">
00769 <element name="repository">
00770 <ref name="ctl_create"/>
00771 <ref name="self_handle"/>
00772 <ref name="repository_handle"/>
00773 <ref name="repository_payload"/>
00774 </element>
00775 </define>
00776 <define name="repository_reply" combine="choice">
00777 <element name="repository">
00778 <ref name="ctl_create"/>
00779 <ref name="self_handle"/>
00780 <ref name="repository_handle"/>
00781 </element>
00782 </define>
00783 <define name="repository_query" combine="choice">
00784 <element name="repository">
00785 <ref name="ctl_set"/>
00786 <ref name="self_handle"/>
00787 <ref name="repository_handle"/>
00788 <ref name="repository_payload"/>
00789 </element>
00790 </define>
00791 <define name="repository_reply" combine="choice">
00792 <element name="repository">
00793 <ref name="ctl_set"/>
00794 <ref name="self_handle"/>
00795 <ref name="repository_handle"/>
00796 </element>
00797 </define>
00798 <define name="repository_query" combine="choice">
00799 <element name="repository">
00800 <ref name="ctl_get"/>
00801 <ref name="self_handle"/>
00802 <ref name="repository_handle"/>
00803 </element>
00804 </define>
00805 <define name="repository_reply" combine="choice">
00806 <element name="repository">
00807 <ref name="ctl_get"/>
00808 <ref name="self_handle"/>
00809 <ref name="repository_handle"/>
00810 <ref name="repository_payload"/>
00811 </element>
00812 </define>
00813 <define name="repository_query" combine="choice">
00814 <element name="repository">
00815 <ref name="ctl_list"/>
00816 <ref name="self_handle"/>
00817 </element>
00818 </define>
00819 <define name="repository_reply" combine="choice">
00820 <element name="repository">
00821 <ref name="ctl_list"/>
00822 <ref name="self_handle"/>
00823 <ref name="repository_handle"/>
00824 <ref name="repository_payload"/>
00825 </element>
00826 </define>
00827 <define name="repository_query" combine="choice">
00828 <element name="repository">
00829 <ref name="ctl_destroy"/>
00830 <ref name="self_handle"/>
00831 <ref name="repository_handle"/>
00832 </element>
00833 </define>
00834 <define name="repository_reply" combine="choice">
00835 <element name="repository">
00836 <ref name="ctl_destroy"/>
00837 <ref name="self_handle"/>
00838 <ref name="repository_handle"/>
00839 </element>
00840 </define>
00841 <!-- <list_resources/> element -->
00842 <define name="list_resources_query">
00843 <element name="list_resources">
00844 <ref name="tag"/>
00845 <ref name="self_handle"/>
00846 <ref name="child_handle"/>
00847 </element>
00848 </define>
00849 <define name="list_resources_reply">
00850 <element name="list_resources">
00851 <ref name="tag"/>
00852 <ref name="self_handle"/>
00853 <ref name="child_handle"/>
00854 <attribute name="valid_until">
00855 <data type="dateTime">
00856 <param name="pattern">.*Z</param>
00857 </data>
00858 </attribute>
00859 <optional>
00860 <attribute name="asn">
00861 <ref name="asn_list"/>
00862 </attribute>
00863 </optional>
00864 <optional>
00865 <attribute name="ipv4">
00866 <ref name="ipv4_list"/>
00867 </attribute>
00868 </optional>
00869 <optional>
00870 <attribute name="ipv6">
00871 <ref name="ipv6_list"/>
00872 </attribute>
00873 </optional>
00874 </element>
00875 </define>
00876 <!-- <list_roa_requests/> element -->
00877 <define name="list_roa_requests_query">
00878 <element name="list_roa_requests">
00879 <ref name="tag"/>
00880 <ref name="self_handle"/>
00881 </element>
00882 </define>
00883 <define name="list_roa_requests_reply">
00884 <element name="list_roa_requests">
00885 <ref name="tag"/>
00886 <ref name="self_handle"/>
00887 <attribute name="asn">
00888 <data type="positiveInteger"/>
00889 </attribute>
00890 <optional>
00891 <attribute name="ipv4">
00892 <ref name="ipv4_list"/>
00893 </attribute>
00894 </optional>
00895 <optional>
00896 <attribute name="ipv6">
00897 <ref name="ipv6_list"/>
00898 </attribute>
00899 </optional>
00900 </element>
00901 </define>
00902 <!-- <list_published_objects/> element -->
00903 <define name="list_published_objects_query">
00904 <element name="list_published_objects">
00905 <ref name="tag"/>
00906 <ref name="self_handle"/>
00907 </element>
00908 </define>
00909 <define name="list_published_objects_reply">
00910 <element name="list_published_objects">
00911 <ref name="tag"/>
00912 <ref name="self_handle"/>
00913 <attribute name="uri">
00914 <ref name="uri"/>
00915 </attribute>
00916 <ref name="base64"/>
00917 </element>
00918 </define>
00919 <!-- <list_received_resources/> element -->
00920 <define name="list_received_resources_query">
00921 <element name="list_received_resources">
00922 <ref name="tag"/>
00923 <ref name="self_handle"/>
00924 </element>
00925 </define>
00926 <define name="list_received_resources_reply">
00927 <element name="list_received_resources">
00928 <ref name="tag"/>
00929 <ref name="self_handle"/>
00930 <attribute name="notBefore">
00931 <data type="dateTime">
00932 <param name="pattern">.*Z</param>
00933 </data>
00934 </attribute>
00935 <attribute name="notAfter">
00936 <data type="dateTime">
00937 <param name="pattern">.*Z</param>
00938 </data>
00939 </attribute>
00940 <attribute name="uri">
00941 <ref name="uri"/>
00942 </attribute>
00943 <attribute name="sia_uri">
00944 <ref name="uri"/>
00945 </attribute>
00946 <attribute name="aia_uri">
00947 <ref name="uri"/>
00948 </attribute>
00949 <optional>
00950 <attribute name="asn">
00951 <ref name="asn_list"/>
00952 </attribute>
00953 </optional>
00954 <optional>
00955 <attribute name="ipv4">
00956 <ref name="ipv4_list"/>
00957 </attribute>
00958 </optional>
00959 <optional>
00960 <attribute name="ipv6">
00961 <ref name="ipv6_list"/>
00962 </attribute>
00963 </optional>
00964 </element>
00965 </define>
00966 <!-- <report_error/> element -->
00967 <define name="error">
00968 <data type="token">
00969 <param name="maxLength">1024</param>
00970 </data>
00971 </define>
00972 <define name="report_error_reply">
00973 <element name="report_error">
00974 <ref name="tag"/>
00975 <optional>
00976 <ref name="self_handle"/>
00977 </optional>
00978 <attribute name="error_code">
00979 <ref name="error"/>
00980 </attribute>
00981 <optional>
00982 <data type="string">
00983 <param name="maxLength">512000</param>
00984 </data>
00985 </optional>
00986 </element>
00987 </define>
00988 </grammar>
00989 <!--
00990 Local Variables:
00991 indent-tabs-mode: nil
00992 End:
00993 -->
00994 '''))
00995
00996
00997
00998 up_down = lxml.etree.RelaxNG(lxml.etree.fromstring('''<?xml version="1.0" encoding="UTF-8"?>
00999 <!--
01000 $Id: up-down-schema.rnc 2839 2009-10-27 18:53:00Z sra $
01001
01002 RelaxNG Scheme for up-down protocol, extracted from APNIC Wiki.
01003
01004 libxml2 (including xmllint) only groks the XML syntax of RelaxNG, so
01005 run the compact syntax through trang to get XML syntax.
01006 -->
01007 <grammar ns="http://www.apnic.net/specs/rescerts/up-down/" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
01008 <start>
01009 <element name="message">
01010 <attribute name="version">
01011 <data type="positiveInteger">
01012 <param name="maxInclusive">1</param>
01013 </data>
01014 </attribute>
01015 <attribute name="sender">
01016 <data type="token">
01017 <param name="maxLength">1024</param>
01018 </data>
01019 </attribute>
01020 <attribute name="recipient">
01021 <data type="token">
01022 <param name="maxLength">1024</param>
01023 </data>
01024 </attribute>
01025 <ref name="payload"/>
01026 </element>
01027 </start>
01028 <define name="payload" combine="choice">
01029 <attribute name="type">
01030 <value>list</value>
01031 </attribute>
01032 <ref name="list_request"/>
01033 </define>
01034 <define name="payload" combine="choice">
01035 <attribute name="type">
01036 <value>list_response</value>
01037 </attribute>
01038 <ref name="list_response"/>
01039 </define>
01040 <define name="payload" combine="choice">
01041 <attribute name="type">
01042 <value>issue</value>
01043 </attribute>
01044 <ref name="issue_request"/>
01045 </define>
01046 <define name="payload" combine="choice">
01047 <attribute name="type">
01048 <value>issue_response</value>
01049 </attribute>
01050 <ref name="issue_response"/>
01051 </define>
01052 <define name="payload" combine="choice">
01053 <attribute name="type">
01054 <value>revoke</value>
01055 </attribute>
01056 <ref name="revoke_request"/>
01057 </define>
01058 <define name="payload" combine="choice">
01059 <attribute name="type">
01060 <value>revoke_response</value>
01061 </attribute>
01062 <ref name="revoke_response"/>
01063 </define>
01064 <define name="payload" combine="choice">
01065 <attribute name="type">
01066 <value>error_response</value>
01067 </attribute>
01068 <ref name="error_response"/>
01069 </define>
01070 <define name="list_request">
01071 <empty/>
01072 </define>
01073 <define name="list_response">
01074 <zeroOrMore>
01075 <ref name="class"/>
01076 </zeroOrMore>
01077 </define>
01078 <define name="class">
01079 <element name="class">
01080 <attribute name="class_name">
01081 <data type="token">
01082 <param name="maxLength">1024</param>
01083 </data>
01084 </attribute>
01085 <attribute name="cert_url">
01086 <data type="string">
01087 <param name="maxLength">4096</param>
01088 </data>
01089 </attribute>
01090 <attribute name="resource_set_as">
01091 <data type="string">
01092 <param name="maxLength">512000</param>
01093 <param name="pattern">[\-,0-9]*</param>
01094 </data>
01095 </attribute>
01096 <attribute name="resource_set_ipv4">
01097 <data type="string">
01098 <param name="maxLength">512000</param>
01099 <param name="pattern">[\-,/.0-9]*</param>
01100 </data>
01101 </attribute>
01102 <attribute name="resource_set_ipv6">
01103 <data type="string">
01104 <param name="maxLength">512000</param>
01105 <param name="pattern">[\-,/:0-9a-fA-F]*</param>
01106 </data>
01107 </attribute>
01108 <optional>
01109 <attribute name="resource_set_notafter">
01110 <data type="dateTime">
01111 <param name="pattern">.*Z</param>
01112 </data>
01113 </attribute>
01114 </optional>
01115 <optional>
01116 <attribute name="suggested_sia_head">
01117 <data type="anyURI">
01118 <param name="maxLength">1024</param>
01119 <param name="pattern">rsync://.+</param>
01120 </data>
01121 </attribute>
01122 </optional>
01123 <zeroOrMore>
01124 <element name="certificate">
01125 <attribute name="cert_url">
01126 <data type="string">
01127 <param name="maxLength">4096</param>
01128 </data>
01129 </attribute>
01130 <optional>
01131 <attribute name="req_resource_set_as">
01132 <data type="string">
01133 <param name="maxLength">512000</param>
01134 <param name="pattern">[\-,0-9]*</param>
01135 </data>
01136 </attribute>
01137 </optional>
01138 <optional>
01139 <attribute name="req_resource_set_ipv4">
01140 <data type="string">
01141 <param name="maxLength">512000</param>
01142 <param name="pattern">[\-,/.0-9]*</param>
01143 </data>
01144 </attribute>
01145 </optional>
01146 <optional>
01147 <attribute name="req_resource_set_ipv6">
01148 <data type="string">
01149 <param name="maxLength">512000</param>
01150 <param name="pattern">[\-,/:0-9a-fA-F]*</param>
01151 </data>
01152 </attribute>
01153 </optional>
01154 <data type="base64Binary">
01155 <param name="maxLength">512000</param>
01156 </data>
01157 </element>
01158 </zeroOrMore>
01159 <element name="issuer">
01160 <data type="base64Binary">
01161 <param name="maxLength">512000</param>
01162 </data>
01163 </element>
01164 </element>
01165 </define>
01166 <define name="issue_request">
01167 <element name="request">
01168 <attribute name="class_name">
01169 <data type="token">
01170 <param name="maxLength">1024</param>
01171 </data>
01172 </attribute>
01173 <optional>
01174 <attribute name="req_resource_set_as">
01175 <data type="string">
01176 <param name="maxLength">512000</param>
01177 <param name="pattern">[\-,0-9]*</param>
01178 </data>
01179 </attribute>
01180 </optional>
01181 <optional>
01182 <attribute name="req_resource_set_ipv4">
01183 <data type="string">
01184 <param name="maxLength">512000</param>
01185 <param name="pattern">[\-,/.0-9]*</param>
01186 </data>
01187 </attribute>
01188 </optional>
01189 <optional>
01190 <attribute name="req_resource_set_ipv6">
01191 <data type="string">
01192 <param name="maxLength">512000</param>
01193 <param name="pattern">[\-,/:0-9a-fA-F]*</param>
01194 </data>
01195 </attribute>
01196 </optional>
01197 <data type="base64Binary">
01198 <param name="maxLength">512000</param>
01199 </data>
01200 </element>
01201 </define>
01202 <define name="issue_response">
01203 <ref name="class"/>
01204 </define>
01205 <define name="revoke_request">
01206 <ref name="revocation"/>
01207 </define>
01208 <define name="revoke_response">
01209 <ref name="revocation"/>
01210 </define>
01211 <define name="revocation">
01212 <element name="key">
01213 <attribute name="class_name">
01214 <data type="token">
01215 <param name="maxLength">1024</param>
01216 </data>
01217 </attribute>
01218 <attribute name="ski">
01219 <data type="token">
01220 <param name="maxLength">1024</param>
01221 </data>
01222 </attribute>
01223 </element>
01224 </define>
01225 <define name="error_response">
01226 <element name="status">
01227 <data type="positiveInteger">
01228 <param name="maxInclusive">999999999999999</param>
01229 </data>
01230 </element>
01231 <optional>
01232 <element name="description">
01233 <attribute name="xml:lang">
01234 <data type="language"/>
01235 </attribute>
01236 <data type="string">
01237 <param name="maxLength">1024</param>
01238 </data>
01239 </element>
01240 </optional>
01241 </define>
01242 </grammar>
01243 <!--
01244 Local Variables:
01245 indent-tabs-mode: nil
01246 End:
01247 -->
01248 '''))
01249
01250
01251
01252 publication = lxml.etree.RelaxNG(lxml.etree.fromstring('''<?xml version="1.0" encoding="UTF-8"?>
01253 <!--
01254 $Id: publication-schema.rnc 3109 2010-03-16 23:55:07Z sra $
01255
01256 RelaxNG Schema for RPKI publication protocol.
01257
01258 libxml2 (including xmllint) only groks the XML syntax of RelaxNG, so
01259 run the compact syntax through trang to get XML syntax.
01260
01261 Copyright (C) 2009-2010 Internet Systems Consortium ("ISC")
01262
01263 Permission to use, copy, modify, and distribute this software for any
01264 purpose with or without fee is hereby granted, provided that the above
01265 copyright notice and this permission notice appear in all copies.
01266
01267 THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
01268 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
01269 AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
01270 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
01271 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
01272 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
01273 PERFORMANCE OF THIS SOFTWARE.
01274
01275 Portions copyright (C) 2007-2008 American Registry for Internet Numbers ("ARIN")
01276
01277 Permission to use, copy, modify, and distribute this software for any
01278 purpose with or without fee is hereby granted, provided that the above
01279 copyright notice and this permission notice appear in all copies.
01280
01281 THE SOFTWARE IS PROVIDED "AS IS" AND ARIN DISCLAIMS ALL WARRANTIES WITH
01282 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
01283 AND FITNESS. IN NO EVENT SHALL ARIN BE LIABLE FOR ANY SPECIAL, DIRECT,
01284 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
01285 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
01286 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
01287 PERFORMANCE OF THIS SOFTWARE.
01288 -->
01289 <grammar ns="http://www.hactrn.net/uris/rpki/publication-spec/" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
01290 <!-- Top level PDU -->
01291 <start>
01292 <element name="msg">
01293 <attribute name="version">
01294 <data type="positiveInteger">
01295 <param name="maxInclusive">1</param>
01296 </data>
01297 </attribute>
01298 <choice>
01299 <group>
01300 <attribute name="type">
01301 <value>query</value>
01302 </attribute>
01303 <zeroOrMore>
01304 <ref name="query_elt"/>
01305 </zeroOrMore>
01306 </group>
01307 <group>
01308 <attribute name="type">
01309 <value>reply</value>
01310 </attribute>
01311 <zeroOrMore>
01312 <ref name="reply_elt"/>
01313 </zeroOrMore>
01314 </group>
01315 </choice>
01316 </element>
01317 </start>
01318 <!-- PDUs allowed in a query -->
01319 <define name="query_elt">
01320 <choice>
01321 <ref name="config_query"/>
01322 <ref name="client_query"/>
01323 <ref name="certificate_query"/>
01324 <ref name="crl_query"/>
01325 <ref name="manifest_query"/>
01326 <ref name="roa_query"/>
01327 </choice>
01328 </define>
01329 <!-- PDUs allowed in a reply -->
01330 <define name="reply_elt">
01331 <choice>
01332 <ref name="config_reply"/>
01333 <ref name="client_reply"/>
01334 <ref name="certificate_reply"/>
01335 <ref name="crl_reply"/>
01336 <ref name="manifest_reply"/>
01337 <ref name="roa_reply"/>
01338 <ref name="report_error_reply"/>
01339 </choice>
01340 </define>
01341 <!-- Tag attributes for bulk operations -->
01342 <define name="tag">
01343 <attribute name="tag">
01344 <data type="token">
01345 <param name="maxLength">1024</param>
01346 </data>
01347 </attribute>
01348 </define>
01349 <!-- Base64 encoded DER stuff -->
01350 <define name="base64">
01351 <data type="base64Binary">
01352 <param name="maxLength">512000</param>
01353 </data>
01354 </define>
01355 <!-- Publication URLs -->
01356 <define name="uri_t">
01357 <data type="anyURI">
01358 <param name="maxLength">4096</param>
01359 </data>
01360 </define>
01361 <define name="uri">
01362 <attribute name="uri">
01363 <ref name="uri_t"/>
01364 </attribute>
01365 </define>
01366 <!--
01367 Handles on remote objects (replaces passing raw SQL IDs). NB:
01368 Unlike the up-down protocol, handles in this protocol allow "/" as a
01369 hierarchy delimiter.
01370 -->
01371 <define name="object_handle">
01372 <data type="string">
01373 <param name="maxLength">255</param>
01374 <param name="pattern">[\-_A-Za-z0-9/]*</param>
01375 </data>
01376 </define>
01377 <!--
01378 <config/> element (use restricted to repository operator)
01379 config_handle attribute, create, list, and destroy commands omitted deliberately, see code for details
01380 -->
01381 <define name="config_payload">
01382 <optional>
01383 <element name="bpki_crl">
01384 <ref name="base64"/>
01385 </element>
01386 </optional>
01387 </define>
01388 <define name="config_query" combine="choice">
01389 <element name="config">
01390 <attribute name="action">
01391 <value>set</value>
01392 </attribute>
01393 <optional>
01394 <ref name="tag"/>
01395 </optional>
01396 <ref name="config_payload"/>
01397 </element>
01398 </define>
01399 <define name="config_reply" combine="choice">
01400 <element name="config">
01401 <attribute name="action">
01402 <value>set</value>
01403 </attribute>
01404 <optional>
01405 <ref name="tag"/>
01406 </optional>
01407 </element>
01408 </define>
01409 <define name="config_query" combine="choice">
01410 <element name="config">
01411 <attribute name="action">
01412 <value>get</value>
01413 </attribute>
01414 <optional>
01415 <ref name="tag"/>
01416 </optional>
01417 </element>
01418 </define>
01419 <define name="config_reply" combine="choice">
01420 <element name="config">
01421 <attribute name="action">
01422 <value>get</value>
01423 </attribute>
01424 <optional>
01425 <ref name="tag"/>
01426 </optional>
01427 <ref name="config_payload"/>
01428 </element>
01429 </define>
01430 <!-- <client/> element (use restricted to repository operator) -->
01431 <define name="client_handle">
01432 <attribute name="client_handle">
01433 <ref name="object_handle"/>
01434 </attribute>
01435 </define>
01436 <define name="client_payload">
01437 <optional>
01438 <attribute name="base_uri">
01439 <ref name="uri_t"/>
01440 </attribute>
01441 </optional>
01442 <optional>
01443 <element name="bpki_cert">
01444 <ref name="base64"/>
01445 </element>
01446 </optional>
01447 <optional>
01448 <element name="bpki_glue">
01449 <ref name="base64"/>
01450 </element>
01451 </optional>
01452 </define>
01453 <define name="client_query" combine="choice">
01454 <element name="client">
01455 <attribute name="action">
01456 <value>create</value>
01457 </attribute>
01458 <optional>
01459 <ref name="tag"/>
01460 </optional>
01461 <ref name="client_handle"/>
01462 <ref name="client_payload"/>
01463 </element>
01464 </define>
01465 <define name="client_reply" combine="choice">
01466 <element name="client">
01467 <attribute name="action">
01468 <value>create</value>
01469 </attribute>
01470 <optional>
01471 <ref name="tag"/>
01472 </optional>
01473 <ref name="client_handle"/>
01474 </element>
01475 </define>
01476 <define name="client_query" combine="choice">
01477 <element name="client">
01478 <attribute name="action">
01479 <value>set</value>
01480 </attribute>
01481 <optional>
01482 <ref name="tag"/>
01483 </optional>
01484 <ref name="client_handle"/>
01485 <ref name="client_payload"/>
01486 </element>
01487 </define>
01488 <define name="client_reply" combine="choice">
01489 <element name="client">
01490 <attribute name="action">
01491 <value>set</value>
01492 </attribute>
01493 <optional>
01494 <ref name="tag"/>
01495 </optional>
01496 <ref name="client_handle"/>
01497 </element>
01498 </define>
01499 <define name="client_query" combine="choice">
01500 <element name="client">
01501 <attribute name="action">
01502 <value>get</value>
01503 </attribute>
01504 <optional>
01505 <ref name="tag"/>
01506 </optional>
01507 <ref name="client_handle"/>
01508 </element>
01509 </define>
01510 <define name="client_reply" combine="choice">
01511 <element name="client">
01512 <attribute name="action">
01513 <value>get</value>
01514 </attribute>
01515 <optional>
01516 <ref name="tag"/>
01517 </optional>
01518 <ref name="client_handle"/>
01519 <ref name="client_payload"/>
01520 </element>
01521 </define>
01522 <define name="client_query" combine="choice">
01523 <element name="client">
01524 <attribute name="action">
01525 <value>list</value>
01526 </attribute>
01527 <optional>
01528 <ref name="tag"/>
01529 </optional>
01530 </element>
01531 </define>
01532 <define name="client_reply" combine="choice">
01533 <element name="client">
01534 <attribute name="action">
01535 <value>list</value>
01536 </attribute>
01537 <optional>
01538 <ref name="tag"/>
01539 </optional>
01540 <ref name="client_handle"/>
01541 <ref name="client_payload"/>
01542 </element>
01543 </define>
01544 <define name="client_query" combine="choice">
01545 <element name="client">
01546 <attribute name="action">
01547 <value>destroy</value>
01548 </attribute>
01549 <optional>
01550 <ref name="tag"/>
01551 </optional>
01552 <ref name="client_handle"/>
01553 </element>
01554 </define>
01555 <define name="client_reply" combine="choice">
01556 <element name="client">
01557 <attribute name="action">
01558 <value>destroy</value>
01559 </attribute>
01560 <optional>
01561 <ref name="tag"/>
01562 </optional>
01563 <ref name="client_handle"/>
01564 </element>
01565 </define>
01566 <!-- <certificate/> element -->
01567 <define name="certificate_query" combine="choice">
01568 <element name="certificate">
01569 <attribute name="action">
01570 <value>publish</value>
01571 </attribute>
01572 <optional>
01573 <ref name="tag"/>
01574 </optional>
01575 <ref name="uri"/>
01576 <ref name="base64"/>
01577 </element>
01578 </define>
01579 <define name="certificate_reply" combine="choice">
01580 <element name="certificate">
01581 <attribute name="action">
01582 <value>publish</value>
01583 </attribute>
01584 <optional>
01585 <ref name="tag"/>
01586 </optional>
01587 <ref name="uri"/>
01588 </element>
01589 </define>
01590 <define name="certificate_query" combine="choice">
01591 <element name="certificate">
01592 <attribute name="action">
01593 <value>withdraw</value>
01594 </attribute>
01595 <optional>
01596 <ref name="tag"/>
01597 </optional>
01598 <ref name="uri"/>
01599 </element>
01600 </define>
01601 <define name="certificate_reply" combine="choice">
01602 <element name="certificate">
01603 <attribute name="action">
01604 <value>withdraw</value>
01605 </attribute>
01606 <optional>
01607 <ref name="tag"/>
01608 </optional>
01609 <ref name="uri"/>
01610 </element>
01611 </define>
01612 <!-- <crl/> element -->
01613 <define name="crl_query" combine="choice">
01614 <element name="crl">
01615 <attribute name="action">
01616 <value>publish</value>
01617 </attribute>
01618 <optional>
01619 <ref name="tag"/>
01620 </optional>
01621 <ref name="uri"/>
01622 <ref name="base64"/>
01623 </element>
01624 </define>
01625 <define name="crl_reply" combine="choice">
01626 <element name="crl">
01627 <attribute name="action">
01628 <value>publish</value>
01629 </attribute>
01630 <optional>
01631 <ref name="tag"/>
01632 </optional>
01633 <ref name="uri"/>
01634 </element>
01635 </define>
01636 <define name="crl_query" combine="choice">
01637 <element name="crl">
01638 <attribute name="action">
01639 <value>withdraw</value>
01640 </attribute>
01641 <optional>
01642 <ref name="tag"/>
01643 </optional>
01644 <ref name="uri"/>
01645 </element>
01646 </define>
01647 <define name="crl_reply" combine="choice">
01648 <element name="crl">
01649 <attribute name="action">
01650 <value>withdraw</value>
01651 </attribute>
01652 <optional>
01653 <ref name="tag"/>
01654 </optional>
01655 <ref name="uri"/>
01656 </element>
01657 </define>
01658 <!-- <manifest/> element -->
01659 <define name="manifest_query" combine="choice">
01660 <element name="manifest">
01661 <attribute name="action">
01662 <value>publish</value>
01663 </attribute>
01664 <optional>
01665 <ref name="tag"/>
01666 </optional>
01667 <ref name="uri"/>
01668 <ref name="base64"/>
01669 </element>
01670 </define>
01671 <define name="manifest_reply" combine="choice">
01672 <element name="manifest">
01673 <attribute name="action">
01674 <value>publish</value>
01675 </attribute>
01676 <optional>
01677 <ref name="tag"/>
01678 </optional>
01679 <ref name="uri"/>
01680 </element>
01681 </define>
01682 <define name="manifest_query" combine="choice">
01683 <element name="manifest">
01684 <attribute name="action">
01685 <value>withdraw</value>
01686 </attribute>
01687 <optional>
01688 <ref name="tag"/>
01689 </optional>
01690 <ref name="uri"/>
01691 </element>
01692 </define>
01693 <define name="manifest_reply" combine="choice">
01694 <element name="manifest">
01695 <attribute name="action">
01696 <value>withdraw</value>
01697 </attribute>
01698 <optional>
01699 <ref name="tag"/>
01700 </optional>
01701 <ref name="uri"/>
01702 </element>
01703 </define>
01704 <!-- <roa/> element -->
01705 <define name="roa_query" combine="choice">
01706 <element name="roa">
01707 <attribute name="action">
01708 <value>publish</value>
01709 </attribute>
01710 <optional>
01711 <ref name="tag"/>
01712 </optional>
01713 <ref name="uri"/>
01714 <ref name="base64"/>
01715 </element>
01716 </define>
01717 <define name="roa_reply" combine="choice">
01718 <element name="roa">
01719 <attribute name="action">
01720 <value>publish</value>
01721 </attribute>
01722 <optional>
01723 <ref name="tag"/>
01724 </optional>
01725 <ref name="uri"/>
01726 </element>
01727 </define>
01728 <define name="roa_query" combine="choice">
01729 <element name="roa">
01730 <attribute name="action">
01731 <value>withdraw</value>
01732 </attribute>
01733 <optional>
01734 <ref name="tag"/>
01735 </optional>
01736 <ref name="uri"/>
01737 </element>
01738 </define>
01739 <define name="roa_reply" combine="choice">
01740 <element name="roa">
01741 <attribute name="action">
01742 <value>withdraw</value>
01743 </attribute>
01744 <optional>
01745 <ref name="tag"/>
01746 </optional>
01747 <ref name="uri"/>
01748 </element>
01749 </define>
01750 <!-- <report_error/> element -->
01751 <define name="error">
01752 <data type="token">
01753 <param name="maxLength">1024</param>
01754 </data>
01755 </define>
01756 <define name="report_error_reply">
01757 <element name="report_error">
01758 <optional>
01759 <ref name="tag"/>
01760 </optional>
01761 <attribute name="error_code">
01762 <ref name="error"/>
01763 </attribute>
01764 <optional>
01765 <data type="string">
01766 <param name="maxLength">512000</param>
01767 </data>
01768 </optional>
01769 </element>
01770 </define>
01771 </grammar>
01772 <!--
01773 Local Variables:
01774 indent-tabs-mode: nil
01775 End:
01776 -->
01777 '''))
01778