idnits 2.17.1 draft-bryan-metalink-22.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** You're using the IETF Trust Provisions' Section 6.b License Notice from 12 Sep 2009 rather than the newer Notice from 28 Dec 2009. (See https://trustee.ietf.org/license-info/) Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document seems to contain a disclaimer for pre-RFC5378 work, and may have content which was first submitted before 10 November 2008. The disclaimer is necessary when there are original authors that you have been unable to contact, or if some do not wish to grant the BCP78 rights to the IETF Trust. If you are able to get all authors (current and original) to grant those rights, you can and should remove the disclaimer; otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (November 7, 2009) is 5284 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Possible downref: Non-RFC (?) normative reference: ref. 'BITTORRENT' -- Possible downref: Non-RFC (?) normative reference: ref. 'ISO3166-1' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xml' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xml-infoset' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xml-names' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xmlbase' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xmldsig-core' ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 3023 (Obsoleted by RFC 7303) ** Downref: Normative reference to an Informational RFC: RFC 3174 ** Obsolete normative reference: RFC 4288 (Obsoleted by RFC 6838) Summary: 5 errors (**), 0 flaws (~~), 1 warning (==), 10 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group A. Bryan 3 Internet-Draft T. Tsujikawa 4 Intended status: Standards Track N. McNab 5 Expires: May 11, 2010 6 P. Poeml 7 Novell, Inc. 8 November 7, 2009 10 The Metalink Download Description Format 11 draft-bryan-metalink-22 13 Abstract 15 This document specifies Metalink, an XML-based download description 16 format. Metalink describes multiple download locations (mirrors), 17 checksums, and other information. Clients can transparently use this 18 information to reliably transfer files. 20 Status of this Memo 22 This Internet-Draft is submitted to IETF in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF), its areas, and its working groups. Note that 27 other groups may also distribute working documents as Internet- 28 Drafts. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 The list of current Internet-Drafts can be accessed at 36 http://www.ietf.org/ietf/1id-abstracts.txt. 38 The list of Internet-Draft Shadow Directories can be accessed at 39 http://www.ietf.org/shadow.html. 41 This Internet-Draft will expire on May 11, 2010. 43 Copyright Notice 45 Copyright (c) 2009 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (http://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the BSD License. 58 This document may contain material from IETF Documents or IETF 59 Contributions published or made publicly available before November 60 10, 2008. The person(s) controlling the copyright in some of this 61 material may not have granted the IETF Trust the right to allow 62 modifications of such material outside the IETF Standards Process. 63 Without obtaining an adequate license from the person(s) controlling 64 the copyright in such materials, this document may not be modified 65 outside the IETF Standards Process, and derivative works of it may 66 not be created outside the IETF Standards Process, except to format 67 it for publication as an RFC or to translate it into languages other 68 than English. 70 Table of Contents 72 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 73 1.1. Examples . . . . . . . . . . . . . . . . . . . . . . . . . 5 74 1.2. Namespace and Version . . . . . . . . . . . . . . . . . . 5 75 1.3. Notational Conventions . . . . . . . . . . . . . . . . . . 6 76 2. Metalink Documents . . . . . . . . . . . . . . . . . . . . . . 6 77 3. Common Metalink Constructs . . . . . . . . . . . . . . . . . . 7 78 3.1. Text Constructs . . . . . . . . . . . . . . . . . . . . . 8 79 3.1.1. Text . . . . . . . . . . . . . . . . . . . . . . . . . 8 80 3.2. Date Constructs . . . . . . . . . . . . . . . . . . . . . 8 81 4. Metalink Element Definitions . . . . . . . . . . . . . . . . . 9 82 4.1. Container Elements . . . . . . . . . . . . . . . . . . . . 9 83 4.1.1. The "metalink:metalink" Element . . . . . . . . . . . 9 84 4.1.2. The "metalink:file" Element . . . . . . . . . . . . . 10 85 4.1.3. The "metalink:pieces" Element . . . . . . . . . . . . 12 86 4.2. Metadata Elements . . . . . . . . . . . . . . . . . . . . 12 87 4.2.1. The "metalink:copyright" Element . . . . . . . . . . . 12 88 4.2.2. The "metalink:description" Element . . . . . . . . . . 13 89 4.2.3. The "metalink:dynamic" Element . . . . . . . . . . . . 13 90 4.2.4. The "metalink:generator" Element . . . . . . . . . . . 13 91 4.2.5. The "metalink:hash" Element . . . . . . . . . . . . . 14 92 4.2.6. The "metalink:identity" Element . . . . . . . . . . . 15 93 4.2.7. The "metalink:language" Element . . . . . . . . . . . 15 94 4.2.8. The "metalink:license" Element . . . . . . . . . . . . 15 95 4.2.9. The "metalink:logo" Element . . . . . . . . . . . . . 16 96 4.2.10. The "metalink:metaurl" Element . . . . . . . . . . . . 16 97 4.2.11. The "metalink:origin" Element . . . . . . . . . . . . 17 98 4.2.12. The "metalink:os" Element . . . . . . . . . . . . . . 18 99 4.2.13. The "metalink:published" Element . . . . . . . . . . . 18 100 4.2.14. The "metalink:publisher" Element . . . . . . . . . . . 18 101 4.2.15. The "metalink:signature" Element . . . . . . . . . . . 19 102 4.2.16. The "metalink:size" Element . . . . . . . . . . . . . 19 103 4.2.17. The "metalink:updated" Element . . . . . . . . . . . . 19 104 4.2.18. The "metalink:url" Element . . . . . . . . . . . . . . 20 105 4.2.19. The "metalink:version" Element . . . . . . . . . . . . 20 106 5. Securing Metalink Documents . . . . . . . . . . . . . . . . . 20 107 6. Extending Metalink . . . . . . . . . . . . . . . . . . . . . . 21 108 6.1. Extensions from Non-Metalink Vocabularies . . . . . . . . 21 109 6.2. Extensions to the Metalink Vocabulary . . . . . . . . . . 21 110 6.3. Processing Foreign Markup . . . . . . . . . . . . . . . . 21 111 6.4. Extension Elements . . . . . . . . . . . . . . . . . . . . 22 112 6.4.1. Simple Extension Elements . . . . . . . . . . . . . . 22 113 6.4.2. Structured Extension Elements . . . . . . . . . . . . 22 114 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 115 7.1. XML Namespace Registration . . . . . . . . . . . . . . . . 23 116 7.2. application/metalink4+xml MIME type . . . . . . . . . . . 23 117 8. Security Considerations . . . . . . . . . . . . . . . . . . . 24 118 8.1. URIs and IRIs . . . . . . . . . . . . . . . . . . . . . . 24 119 8.2. Spoofing . . . . . . . . . . . . . . . . . . . . . . . . . 24 120 8.3. Cryptographic Hashes . . . . . . . . . . . . . . . . . . . 24 121 8.4. Signing . . . . . . . . . . . . . . . . . . . . . . . . . 25 122 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 25 123 9.1. Normative References . . . . . . . . . . . . . . . . . . . 25 124 9.2. Informative References . . . . . . . . . . . . . . . . . . 26 125 Appendix A. Acknowledgements and Contributors . . . . . . . . . . 27 126 Appendix B. RELAX NG Compact Schema . . . . . . . . . . . . . . . 28 127 Appendix C. Document History (to be removed by RFC Editor 128 before publication) . . . . . . . . . . . . . . . . . 33 129 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 130 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 38 132 1. Introduction 134 Metalink is an XML-based document format that describes a file or 135 list of files to be added to a download queue. Metalinks can list a 136 number of files, each with an extensible set of attached metadata. 137 For example, each file can have a description, checksum, and list of 138 URIs that it is available from. 140 Identical copies of a file are frequently accessible in multiple 141 locations on the Internet over a variety of protocols (FTP, HTTP, and 142 Peer-to-Peer). In some cases, Users are shown a list of these 143 multiple download locations (mirrors) and must manually select a 144 single one on the basis of geographical location, priority, or 145 bandwidth. This distributes the load across multiple servers. At 146 times, individual servers can be slow, outdated, or unreachable, but 147 this can not be determined until the download has been initiated. 148 This can lead to the user canceling the download and needing to 149 restart it. During downloads, errors in transmission can corrupt the 150 file. There are no easy ways to repair these files. For large 151 downloads this can be extremely troublesome. Any of the number of 152 problems that can occur during a download lead to frustration on the 153 part of users. 155 All the information about a download, including mirrors, checksums, 156 digital signatures, and more can be stored in a machine-readable 157 Metalink file. This Metalink file transfers the knowledge of the 158 download server (and mirror database) to the client. Clients can 159 fall back to alternate mirrors if the current one has an issue. With 160 this knowledge, the client is enabled to work its way to a successful 161 download even under adverse circumstances. All this is done 162 transparently to the user and the download is much more reliable and 163 efficient. In contrast, a traditional HTTP redirect to a mirror 164 conveys only extremely minimal information - one link to one server, 165 and there is no provision in the HTTP protocol to handle failures. 166 Other features that some clients provide include multi-source 167 downloads, where chunks of a file are downloaded from multiple 168 mirrors (and optionally, Peer-to-Peer) simultaneously, which 169 frequently results in a faster download. Metalinks also provide 170 structured information about downloads that can be indexed by search 171 engines. 173 [[ Discussion of this draft should take place on 174 discuss@apps.ietf.org or the Metalink discussion mailing list located 175 at metalink-discussion@googlegroups.com. To join the list, visit 176 http://groups.google.com/group/metalink-discussion . ]] 178 1.1. Examples 180 A brief, single file Metalink Document: 182 183 184 185 14471447 186 ftp://ftp.example.com/example.ext 187 http://example.com/example.ext 188 189 http://example.com/example.ext.torrent 190 191 192 194 A more extensive, single file Metalink Document: 196 197 198 2009-05-15T12:23:23Z 199 200 14471447 201 Example 202 1.0 203 en 204 A description of the example file for 205 download. 206 207 80bc95fd391772fa61c91ed68567f0980bb45fd9 208 209 ftp://ftp.example.com/example.ext 210 211 http://example.com/example.ext 212 213 http://example.com/example.ext.torrent 214 215 216 218 1.2. Namespace and Version 220 The XML Namespaces URI [REC-xml-names] for the XML data format 221 described in this specification is: 223 urn:ietf:params:xml:ns:metalink 225 For convenience, this data format may be referred to as "Metalink", 226 which this specification uses internally. 228 1.3. Notational Conventions 230 This specification describes conformance of Metalink Documents. 231 Additionally, it places some requirements on Metalink Processors. 233 This specification uses the namespace prefix "metalink:" for the 234 Namespace URI identified in Section 1.2, above. Note that the choice 235 of namespace prefix is arbitrary and not semantically significant. 237 Metalink is specified using terms from the XML Infoset 238 [REC-xml-infoset]. However, this specification uses a shorthand for 239 two common terms: the phrase "Information Item" is omitted when 240 naming Element Information Items and Attribute Information Items. 241 Therefore, when this specification uses the term "element," it is 242 referring to an Element Information Item in Infoset terms. Likewise, 243 when it uses the term "attribute," it is referring to an Attribute 244 Information Item. 246 Some sections of this specification are illustrated with fragments of 247 a non-normative RELAX NG Compact schema [RELAX-NG]. However, the 248 text of this specification provides the definition of conformance. A 249 complete schema appears in Appendix B. 251 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 252 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 253 document are to be interpreted as described in BCP 14, [RFC2119], as 254 scoped to those conformance targets. 256 2. Metalink Documents 258 This specification describes Metalink Documents. 260 A Metalink Document describes a file or group of files, how to access 261 them, and metadata that identifies them. Its root is the metalink: 262 metalink element. 264 namespace metalink = "urn:ietf:params:xml:ns:metalink" 265 start = metalinkMetalink 267 Metalink Documents are specified in terms of the XML Information Set, 268 serialized as XML 1.0 [REC-xml] and identified with the "application/ 269 metalink4+xml" media type. 271 Metalink Documents MUST be well-formed XML. This specification does 272 not define a DTD for Metalink Documents, and hence does not require 273 them to be valid (in the sense used by XML). 275 Metalink allows the use of IRIs, encoded according to [RFC3987]. 276 Every URI [RFC3986] is also an IRI, so a URI may be used wherever 277 below an IRI is named. There is one special consideration: when an 278 IRI that is not also a URI is given for dereferencing, it MUST be 279 mapped to a URI using the steps in Section 3.1 of [RFC3987]. 281 Any element defined by this specification MAY have an xml:base 282 attribute [REC-xmlbase]. When xml:base is used in an Metalink 283 Document, it serves the function described in Section 5.1.1 of 284 [RFC3986], establishing the base URI (or IRI) for resolving any 285 relative references found within the effective scope of the xml:base 286 attribute. 288 Any element defined by this specification MAY have an xml:lang 289 attribute, whose content indicates the natural language for the 290 element and its descendents. The language context is only 291 significant for elements and attributes declared to be "Language- 292 Sensitive" by this specification. Requirements regarding the content 293 and interpretation of xml:lang are specified in XML 1.0 [REC-xml], 294 Section 2.12. 296 metalinkCommonAttributes = 297 attribute xml:base { metalinkUri }?, 298 attribute xml:lang { metalinkLanguageTag }?, 299 undefinedAttribute* 301 Metalink Documents that do not follow this specification are invalid, 302 and partially or wholly unusable to Metalink Processors. 304 Metalink is an extensible format. See Section 6 of this document for 305 a full description of how Metalink Documents can be extended. 307 3. Common Metalink Constructs 309 Many of Metalink's elements share a few common structures. This 310 section defines those structures and their requirements for 311 convenient reference by the appropriate element definitions. 313 When an element is identified as being a particular kind of 314 construct, it inherits the corresponding requirements from that 315 construct's definition in this section. 317 Note that there MUST NOT be any white space in a Date construct or in 318 any IRI. Some XML-emitting implementations erroneously insert white 319 space around values by default, and such implementations will emit 320 invalid Metalink Documents. 322 3.1. Text Constructs 324 A Text construct contains human-readable text, usually in small 325 quantities. The content of Text constructs is Language-Sensitive. 327 metalinkTextConstruct = 328 metalinkCommonAttributes, 329 text 331 3.1.1. Text 333 Example metalink:description with text content: 335 ... 336 337 A description of the example file for download. 338 339 ... 341 The content of the Text construct MUST NOT contain child elements. 342 Such text is intended to be presented to humans in a readable 343 fashion. Thus, white space could be collapsed (including line 344 breaks) and text could be displayed using typographic techniques such 345 as justification and proportional fonts. 347 3.2. Date Constructs 349 A Date construct is an element whose content MUST conform to the 350 "date-time" production in [RFC3339]. In addition, an uppercase "T" 351 character MUST be used to separate date and time, and an uppercase 352 "Z" character MUST be present in the absence of a numeric time zone 353 offset. 355 metalinkDateConstruct = 356 metalinkCommonAttributes, 357 xsd:dateTime 359 Such date values happen to be compatible with the following 360 specifications: [ISO.8601.1988], [W3C.NOTE-datetime-19980827], and 361 [W3C.REC-xmlschema-2-20041028]. 363 Example Date constructs: 365 2009-05-15T18:30:02Z 366 2009-05-15T18:30:02.25Z 367 2009-05-15T18:30:02+01:00 368 2009-05-15T18:30:02.25+01:00 370 Date values SHOULD be as accurate as possible. For example, it would 371 be generally inappropriate for a publishing system to apply the same 372 timestamp to several Metalink Documents that were published during 373 the course of a single day. 375 4. Metalink Element Definitions 377 4.1. Container Elements 379 4.1.1. The "metalink:metalink" Element 381 The "metalink:metalink" element is the document (i.e., top-level) 382 element of a Metalink Document, acting as a container for metadata 383 and data associated with the listed files. It contains one or more 384 metalink:file child elements which consist of metadata elements. 386 metalinkMetalink = 387 element metalink:metalink { 388 metalinkCommonAttributes, 389 (metalinkDynamic? 390 & metalinkFile+ 391 & metalinkGenerator? 392 & metalinkOrigin? 393 & metalinkPublished? 394 & metalinkUpdated? 395 & extensionElement*) 396 } 398 The following child elements are defined by this specification (note 399 that the presence of some of these elements is required): 401 o metalink:metalink elements MAY contain exactly one metalink: 402 dynamic element. 403 o metalink:metalink elements MUST contain one or more metalink:file 404 elements. 405 o metalink:metalink elements MAY contain exactly one metalink: 406 generator element. 407 o metalink:metalink elements SHOULD contain exactly one metalink: 408 origin element. 409 o metalink:metalink elements MAY contain exactly one metalink: 410 published element. 412 4.1.1.1. Providing Textual Content 414 Experience teaches that downloads providing textual content are in 415 general more useful than those that do not. Some applications (one 416 example is full-text indexers) require a minimum amount of text to 417 function reliably and predictably. Metalink publishers should be 418 aware of these issues. It is advisable that each metalink:file 419 element contain a non-empty metalink:description element, a non-empty 420 metalink:identity element when that element is present, and a non- 421 empty metalink:version element, and a non-empty metalink:publisher 422 element. However, the absence of metalink:description is not an 423 error, and Metalink Processors MUST NOT fail to function correctly as 424 a consequence of such an absence. 426 4.1.2. The "metalink:file" Element 428 The "metalink:file" element represents an individual file, acting as 429 a container for metadata and data associated with the file. 431 All metalink:url elements SHOULD lead to identical files. That is, 432 each metalink:url element should be an alternative location for the 433 same file and each metalink:metaurl element should provide metadata 434 to retrieve the same file in another way, such as a peer to peer 435 network. 437 metalinkFile = 438 element metalink:file { 439 metalinkCommonAttributes, 440 attribute name { text }, 441 (metalinkCopyright? 442 & metalinkDescription? 443 & metalinkHash* 444 & metalinkIdentity? 445 & metalinkLanguage? 446 & metalinkLicense? 447 & metalinkLogo? 448 & metalinkMetaURL* 449 & metalinkURL* 450 & metalinkOS* 451 & metalinkPieces* 452 & metalinkPublisher? 453 & metalinkSignature? 454 & metalinkSize? 455 & metalinkVersion? 456 & extensionElement*) 457 } 459 This specification assigns no significance to the order of metalink: 461 file elements or to the order of metalink:url or metalink:metaurl 462 elements. Significance is determined by the value of the "priority" 463 attribute of the metalink:url or metalink:metaurl elements. 465 The following child elements are defined by this specification (note 466 that it requires the presence of some of these elements): 468 o metalink:file elements MAY contain exactly one metalink:copyright 469 element. 470 o metalink:file elements MAY contain exactly one metalink: 471 description element. 472 o metalink:file elements MAY contain exactly one metalink:identity 473 element. 474 o metalink:file elements MAY contain one or more metalink:hash 475 elements. 476 o metalink:file elements MAY contain exactly one metalink:language 477 element. 478 o metalink:file elements MAY contain exactly one metalink:license 479 element. 480 o metalink:file elements MAY contain exactly one metalink:logo 481 element. 482 o metalink:file elements MAY contain one or more metalink:os 483 element. 484 o metalink:file elements MUST contain at least one metalink:url 485 element or at least one metalink:metaurl element. Typically, 486 metalink:file elements contain more than one metalink:url element 487 to provide multiple download sources. 488 o metalink:file elements MAY contain one or more metalink:pieces 489 elements. 490 o metalink:file elements MAY contain exactly one metalink:publisher 491 element. 492 o metalink:file elements MAY contain one or more metalink:signature 493 elements. 494 o metalink:file elements SHOULD contain exactly one metalink:size 495 element. 496 o metalink:file elements MAY contain exactly one metalink:version 497 element. 499 4.1.2.1. The "name" Attribute 501 metalink:file elements MUST have a "name" attribute, which contains 502 the filename of the file to be downloaded. 504 Directory information can also be contained in a "path/file" format 505 only, as in: 507 508 In this example, a subdirectory "debian-amd64/sarge/" will be created 509 and a file named "Contents-amd64.gz" will be created inside it. The 510 path MUST NOT contain any directory traversal directives or 511 information. The path MUST be relative. The path MUST NOT begin 512 with a "/", "./" or "../", contain "/../", or end with "/..". 514 4.1.3. The "metalink:pieces" Element 516 The "metalink:pieces" element acts as a container for a list of 517 checksums of non-overlapping pieces of the file. The checksums MUST 518 be listed in the same order as the corresponding pieces appear in the 519 file, starting at the beginning of the file. 521 metalinkPieces = 522 element metalink:pieces { 523 attribute length { xsd:integer }, 524 attribute type { text }, 525 metalinkHash+ 526 } 528 4.1.3.1. The "type" Attribute 530 metalink:pieces elements MUST have a "type" attribute. 532 The IANA registry named "Hash Function Textual Names" defines values 533 for hash types. If a Metalink Document contains hashes, it SHOULD 534 include "sha-1" which is SHA-1 as specified in [RFC3174], or a 535 stronger hash. It MAY also include other hashes. 537 4.1.3.2. The "length" Attribute 539 metalink:pieces elements MUST have a "length" attribute, which is an 540 integer that describes the length of the pieces of the file in 541 octets. The whole file is divided into non-overlapping pieces of 542 this length, starting from the beginning of the file. That is, every 543 piece should be the same size, apart from the last piece which is the 544 remainder. The last piece extends to the end of the file, and can 545 therefore be shorter than the other pieces. 547 4.2. Metadata Elements 549 4.2.1. The "metalink:copyright" Element 551 The "metalink:copyright" element is a Text construct that conveys a 552 human-readable copyright for a file. 554 metalinkCopyright = 555 element metalink:copyright { 556 metalinkTextConstruct 557 } 559 4.2.2. The "metalink:description" Element 561 The "metalink:description" element is a Text construct that conveys a 562 human-readable description for a file. 564 metalinkDescription = 565 element metalink:description { 566 metalinkTextConstruct 567 } 569 4.2.3. The "metalink:dynamic" Element 571 The "metalink:dynamic" element is a Text construct that describes 572 whether the IRI from "metalink:origin" in a Metalink will contain 573 dynamic updated information or if it is static and not likely to be 574 updated. 576 metalinkDynamic = 577 element metalink:dynamic { 578 "true" | "false" 579 } 581 4.2.4. The "metalink:generator" Element 583 The "metalink:generator" element's content identifies the generating 584 agent name and version, separated by a "/", used to generate a 585 Metalink Document, for debugging and other purposes. 587 metalinkGenerator = 588 element metalink:generator { 589 metalinkTextConstruct 590 } 592 The content of this element, when present, MUST be a string that is a 593 human-readable name and version, separated by a "/", for the 594 generating agent. For example, "MirrorBrain/2.9.2", where 595 "MirrorBrain" is the name and "2.9.2" is the version. Entities such 596 as "&" and "<" represent their corresponding characters ("&" 597 and "<" respectively), not markup. 599 4.2.5. The "metalink:hash" Element 601 The "metalink:hash" element is a Text construct that conveys a hash 602 for a file. All hashes are encoded in lowercase hexadecimal format. 603 Hashes are used to verify the integrity of a complete file or portion 604 of a file to determine if the file has been transferred without any 605 errors. 607 metalinkHash = 608 element metalink:hash { 609 attribute type { text }?, 610 text 611 } 613 metalink:hash elements with a "type" attribute MUST contain a hash of 614 the complete file. Metalink Documents can contain one or multiples 615 hashes of a complete file. In this example, both SHA-1 and SHA-256 616 hashes are included. 618 ... 619 a97fcf6ba9358f8a6f62beee4421863d3e52b080 620 fc87941af7fd7f03e53b34af393f4c14923d74 621 825f51116ff591336af4880227 622 ... 624 Metalink Documents can also contain hashes for individual pieces of a 625 file. metalink:hash elements that are inside a metalink:pieces 626 container element have a hash for that specific piece or chunk of the 627 file, and are of the same hash type as the metalink:pieces element 628 they are contained in. metalink:hash elements without a "type" 629 attribute MUST contain a hash for that specific piece or chunk of the 630 file and MUST be listed in the same order as the corresponding pieces 631 appear in the file, starting at the beginning of the file. The size 632 of the piece is equal to the value of the "length" attribute of the 633 metalink:pieces element. The whole file is divided into non- 634 overlapping pieces of this length, starting from the beginning of the 635 file. That is, every piece should be the same size, apart from the 636 last piece which is the remainder. The last piece extends to the end 637 of the file, and can therefore be shorter than the other pieces. 639 ... 640 a97fcf6ba9358f8a6f62beee4421863d3e52b080 641 fc87941af7fd7f03e53b34af393f4c14923d74 642 825f51116ff591336af4880227 643 644 d96b9a4b92a899c2099b7b31bddb5ca423bb9b30 645 10d68f4b1119014c123da2a0a6baf5c8a6d5ba1e 646 3e84219096435c34e092b17b70a011771c52d87a 647 67183e4c3ab892d3ebe8326b7d79eb62d077f487 648 649 ... 651 4.2.5.1. The "type" Attribute 653 metalink:hash elements MUST have a "type" attribute, if and only if 654 it contains a hash of the complete file. The IANA registry named 655 "Hash Function Textual Names" defines values for hash types. If a 656 Metalink Document contains hashes, it SHOULD include "sha-1" which is 657 SHA-1 as specified in [RFC3174], or a stronger hash. It MAY also 658 include additional hash types. 660 4.2.6. The "metalink:identity" Element 662 The "metalink:identity" element is a Text construct that conveys a 663 human-readable identity for a file. For example, the identity of 664 Firefox 3.5 would be "Firefox". 666 metalinkIdentity = 667 element metalink:identity { 668 metalinkTextConstruct 669 } 671 4.2.7. The "metalink:language" Element 673 The "metalink:language" element is a Text construct that conveys a 674 code for the language of a file, per [RFC5646]. 676 metalinkLanguage = 677 element metalink:language { 678 metalinkTextConstruct 679 } 681 4.2.8. The "metalink:license" Element 683 The "metalink:license" element is a Text construct that conveys a 684 human-readable license name for a file. 686 metalinkLicense = 687 element metalink:license { 688 metalinkCommonAttributes, 689 attribute url { metalinkUri }?, 690 attribute name { text }? 691 } 693 The metalink:license element MAY have a "url" attribute whose value 694 MUST be an IRI reference [RFC3987]. When dereferenced, the resulting 695 URI (mapped from an IRI, if necessary) SHOULD produce a 696 representation that is relevant to that agent. 698 The metalink:license element MAY have a "name" attribute that 699 indicates the name of the license. 701 4.2.9. The "metalink:logo" Element 703 The "metalink:logo" element's content is an IRI reference [RFC3987] 704 that identifies an image that provides visual identification for a 705 file. 707 metalinkLogo = 708 element metalink:logo { 709 metalinkCommonAttributes, 710 (metalinkUri) 711 } 713 The image SHOULD have an aspect ratio of one (horizontal) to one 714 (vertical) and SHOULD be suitable for presentation at a small size. 716 4.2.10. The "metalink:metaurl" Element 718 The "metalink:metaurl" element contains the IRI of metadata about a 719 resource to download. For example, this could be the IRI of a 720 BitTorrent .torrent file or a Metalink Document. Note that the 721 information in the metalink:hash element does not apply to these 722 files, but to the files that are described by them. 724 metalinkMetaURL = 725 element metalink:metaurl { 726 metalinkCommonAttributes, 727 attribute priority { xsd:integer }?, 728 attribute type { text }, 729 attribute name { text }?, 730 metalinkUri 731 } 733 4.2.10.1. The "priority" Attribute 735 metalink:metaurl elements MAY have a priority attribute. Lower 736 values indicate a higher priority. Multiple metalink:metaurl 737 elements can have the same priority, i.e. three BitTorrent .torrent 738 files could have priority="1". See also the "priority" attribute of 739 the metalink:url element. 741 4.2.10.2. The "type" Attribute 743 metalink:metaurl elements MUST have a "type" attribute that indicates 744 the MIME media type [RFC4288] of the metadata available at the IRI. 745 In the case of BitTorrent as specified in [BITTORRENT], the value 746 "torrent" is required. Types without "/" are reserved. Currently, 747 "torrent" is the only reserved value. 749 4.2.10.3. The "name" Attribute 751 metalink:metaurl elements MAY have a "name" attribute that indicates 752 a specific file in a BitTorrent .torrent file or a Metalink Document 753 that describes multiple files. 755 Directory information can also be contained in a "path/file" format 756 only, as in: 758 760 In this example, a file named "Contents-amd64.gz" is indicated, in a 761 "debian-amd64/sarge/" subdirectory. The path MUST NOT contain any 762 directory traversal directives or information. The path MUST be 763 relative. The path MUST NOT begin with a "/", "./" or "../", contain 764 "/../", or end with "/..". 766 4.2.11. The "metalink:origin" Element 768 The "metalink:origin" element is an IRI where the Metalink Document 769 was originally published. If metalink:dynamic is "true", then 770 updated versions of the Metalink can be found at this IRI. 772 metalinkOrigin = 773 element metalink:origin { 774 metalinkCommonAttributes, 775 (metalinkUri) 776 } 778 4.2.12. The "metalink:os" Element 780 The "metalink:os" element is a Text construct that conveys a human- 781 readable Operating System for a file. The IANA registry named 782 "Operating System Names" defines values for OS types. 784 metalinkOS = 785 element metalink:os { 786 metalinkTextConstruct 787 } 789 4.2.13. The "metalink:published" Element 791 The "metalink:published" element is a Date construct indicating an 792 instant in time associated with an event early in the life cycle of 793 the entry. 795 metalinkPublished = 796 element metalink:published { 797 metalinkDateConstruct 798 } 800 Typically, metalink:published will be associated with the initial 801 creation or first availability of the resource. 803 4.2.14. The "metalink:publisher" Element 805 The "metalink:publisher" element indicates a group or other entity 806 which has published the file described in the Metalink Document. 808 metalinkPublisher = 809 element metalink:publisher { 810 metalinkCommonAttributes, 811 attribute url { metalinkUri }?, 812 attribute name { text }? 813 } 815 The metalink:publisher element MAY have a "url" attribute whose value 816 MUST be an IRI reference [RFC3987]. When dereferenced, the resulting 817 URI (mapped from an IRI, if necessary) SHOULD produce a 818 representation that is relevant to that agent. 820 The metalink:publisher element MAY have a "name" attribute that 821 indicates the name of the publisher. 823 4.2.15. The "metalink:signature" Element 825 The "metalink:signature" element is a Text construct that conveys a 826 digital signature for a file described in a Metalink Document. 827 Digital signatures verify that a file is from the entity that has 828 signed it. 830 metalinkSignature = 831 element metalink:signature { 832 attribute type { "pgp" }, 833 metalinkTextConstruct 834 } 836 4.2.15.1. The "type" Attribute 838 metalink:signature elements MUST have a "type" attribute. The 839 initial value of "type" is the string that is non-empty and matches 840 "pgp". It may be useful to extend Metalink documents with new types 841 of digital signatures, so unknown types are allowed. 843 4.2.16. The "metalink:size" Element 845 The "metalink:size" element indicates the length of the linked 846 content in octets; it is a hint about the content length of the 847 representation returned when the IRI is mapped to a URI and 848 dereferenced. 850 metalinkSize = 851 element metalink:size { 852 metalinkTextConstruct 853 } 855 4.2.17. The "metalink:updated" Element 857 The "metalink:updated" element is a Date construct indicating the 858 most recent instant in time when a Metalink was modified in a way the 859 publisher considers significant. Therefore, not all modifications 860 necessarily result in a changed metalink:updated value. 862 metalinkUpdated = 863 element metalink:updated { 864 metalinkDateConstruct 865 } 867 Publishers MAY change the value of this element over time. 869 4.2.18. The "metalink:url" Element 871 The "metalink:url" element contains the IRI of a file. Most Metalink 872 Documents will contain multiple metalink:url elements, and each one 873 SHOULD be a valid alternative to download the same file. 875 metalinkURL = 876 element metalink:url { 877 metalinkCommonAttributes, 878 attribute location { xsd:string { 879 minLength = "2" maxLength="2"} 880 }?, 881 attribute priority { xsd:integer }?, 882 metalinkUri 883 } 885 4.2.18.1. The "priority" Attribute 887 metalink:url elements MAY have a priority attribute. Lower values 888 indicate a higher priority. Multiple metalink:url elements can have 889 the same priority, i.e. ten mirrors could have priority="1". 891 4.2.18.2. The "location" Attribute 893 metalink:url elements MAY have a "location" attribute, which is a 894 [ISO3166-1] alpha-2 two letter country code for the geographical 895 location of the physical server an IRI is used to access. 897 4.2.19. The "metalink:version" Element 899 The "metalink:version" element is a Text construct that conveys a 900 human-readable version for a file. The version of Firefox 3.5 would 901 be "3.5". 903 metalinkVersion = 904 element metalink:version { 905 metalinkTextConstruct 906 } 908 5. Securing Metalink Documents 910 Because Metalink is an XML-based format, existing XML security 911 mechanisms can be used to secure its content. 913 Producers of Metalink Documents may have sound reasons for signing 914 otherwise-unprotected content. For example, a merchant might 915 digitally sign a Metalink that lists a file download to verify its 916 origin. Other merchants may wish to sign and encrypt Metalink 917 Documents that list digital songs that have been purchased. Of 918 course, many other examples are conceivable as well. 920 The algorithm requirements in this section pertain to the Metalink 921 Processor. They require that a recipient, at a minimum, be able to 922 handle messages that use the specified cryptographic algorithms. 923 These requirements do not limit the algorithms that the sender can 924 choose. 926 Metalink Processors that verify signed Metalink Documents MUST at 927 least support XML-Signature and Syntax Processing [REC-xmldsig-core]. 929 6. Extending Metalink 931 6.1. Extensions from Non-Metalink Vocabularies 933 This specification describes Metalink's XML markup vocabulary. 934 Markup from other vocabularies ("foreign markup") can be used in an 935 Metalink Document. 937 6.2. Extensions to the Metalink Vocabulary 939 The Metalink namespace is reserved for future forward-compatible 940 revisions of Metalink. Future versions of this specification could 941 add new elements and attributes to the Metalink markup vocabulary. 942 Software written to conform to this version of the specification will 943 not be able to process such markup correctly and, in fact, will not 944 be able to distinguish it from markup error. For the purposes of 945 this discussion, unrecognized markup from the Metalink vocabulary 946 will be considered "foreign markup". 948 6.3. Processing Foreign Markup 950 Metalink Processors that encounter foreign markup in a location that 951 is legal according to this specification MUST NOT stop processing or 952 signal an error. It might be the case that the Metalink Processor is 953 able to process the foreign markup correctly and does so. Otherwise, 954 such markup is termed "unknown foreign markup". 956 When unknown foreign markup is encountered as a child of metalink: 957 file, metalink:metalink, Metalink Processors MAY bypass the markup 958 and any textual content and MUST NOT change their behavior as a 959 result of the markup's presence. 961 When unknown foreign markup is encountered in a Text Construct, 962 software SHOULD ignore the markup and process any text content of 963 foreign elements as though the surrounding markup were not present. 965 6.4. Extension Elements 967 Metalink allows foreign markup anywhere in an Metalink document, 968 except where it is explicitly forbidden. Child elements of metalink: 969 file and metalink:metalink are considered Metadata elements and are 970 described below. Child elements of Person constructs are considered 971 to apply to the construct. The role of other foreign markup is 972 undefined by this specification. 974 6.4.1. Simple Extension Elements 976 A Simple Extension element MUST NOT have any attributes or child 977 elements. The element MAY contain character data or be empty. 978 Simple Extension elements are not Language-Sensitive. 980 simpleExtensionElement = 981 element * - metalink:* { 982 text 983 } 985 The element can be interpreted as a simple property (or name/value 986 pair) of the parent element that encloses it. The pair consisting of 987 the namespace-URI of the element and the local name of the element 988 can be interpreted as the name of the property. The character data 989 content of the element can be interpreted as the value of the 990 property. If the element is empty, then the property value can be 991 interpreted as an empty string. 993 6.4.2. Structured Extension Elements 995 The root element of a Structured Extension element MUST have at least 996 one attribute or child element. It MAY have attributes, it MAY 997 contain well-formed XML content (including character data), or it MAY 998 be empty. Structured Extension elements are Language-Sensitive. 1000 structuredExtensionElement = 1001 element * - metalink:* { 1002 (attribute * { text }+, 1003 (text|anyElement)*) 1004 | (attribute * { text }*, 1005 (text?, anyElement+, (text|anyElement)*)) 1006 } 1008 The structure of a Structured Extension element, including the order 1009 of its child elements, could be significant. 1011 This specification does not provide an interpretation of a Structured 1012 Extension element. The syntax of the XML contained in the element 1013 (and an interpretation of how the element relates to its containing 1014 element) is defined by the specification of the Metalink extension. 1016 7. IANA Considerations 1018 7.1. XML Namespace Registration 1020 This document makes use of the XML registry specified in [RFC3688]. 1021 Accordingly, IANA has made the following registration: 1023 Registration request for the Metalink namespace: 1025 URI: urn:ietf:params:xml:ns:metalink 1027 Registrant Contact: See the "Author's Address" section of this 1028 document. 1030 XML: None. Namespace URIs do not represent an XML specification. 1032 7.2. application/metalink4+xml MIME type 1034 A Metalink Document, when serialized as XML 1.0, can be identified 1035 with the following media type: 1037 MIME media type name: application 1038 MIME subtype name: metalink4+xml 1039 Mandatory parameters: None. 1040 Optional parameters: 1041 "charset": This parameter has semantics identical to the charset 1042 parameter of the "application/xml" media type as specified in 1043 [RFC3023]. 1044 Encoding considerations: Identical to those of "application/xml" as 1045 described in [RFC3023], Section 3.2. 1046 Security considerations: As defined in this specification. 1047 In addition, as this media type uses the "+xml" convention, it 1048 shares the same security considerations as described in [RFC3023], 1049 Section 10. 1050 Interoperability considerations: There are no known interoperability 1051 issues. 1052 Published specification: This specification. 1053 Applications that use this media type: No known applications 1054 currently use this media type. 1056 Additional information: 1058 Magic number(s): As specified for "application/xml" in [RFC3023], 1059 Section 3.2. 1060 File extension: .meta4 1061 Fragment identifiers: As specified for "application/xml" in 1062 [RFC3023], Section 5. 1063 Base URI: As specified in [RFC3023], Section 6. 1064 Macintosh File Type code: TEXT 1065 Person and email address to contact for further information: Anthony 1066 Bryan 1067 Intended usage: COMMON 1068 Author/Change controller: IESG 1070 8. Security Considerations 1072 Publishers are encouraged to offer Metalink documents via 1073 authenticated HTTP under TLS as specified in [RFC2818]. Publishers 1074 are also encouraged to include digital signatures of the files within 1075 the Metalink Documents if they are available. 1077 8.1. URIs and IRIs 1079 Metalink Processors handle URIs and IRIs. See Section 7 of [RFC3986] 1080 and Section 8 of [RFC3987] for security considerations related to 1081 their handling and use. 1083 8.2. Spoofing 1085 There is potential for spoofing attacks where the attacker publishes 1086 Metalink Documents with false information. Malicious publishers 1087 might create Metalink Documents containing inaccurate information 1088 anywhere in the document. Unaware downloaders could be deceived into 1089 downloading a malicious or worthless file. Malicious publishers 1090 could attempt a distributed denial of service attack by inserting 1091 unrelated IRIs into Metalink Documents. 1093 8.3. Cryptographic Hashes 1095 Currently, some of the hash types defined in the IANA registry named 1096 "Hash Function Textual Names" are considered insecure. These include 1097 the whole Message Digest family of algorithms which are not suitable 1098 for cryptographically strong verification. Malicious people could 1099 provide files that appear to be identical to another file because of 1100 a collision, i.e. the weak cryptographic hashes of the intended file 1101 and a substituted malicious file could match. 1103 If a Metalink Document contains hashes, it SHOULD include "sha-1" 1104 which is SHA-1, as specified in [RFC3174], or stronger. It MAY also 1105 include other hashes from the IANA registry named "Hash Function 1106 Textual Names". 1108 8.4. Signing 1110 Metalink Documents SHOULD be signed using [REC-xmldsig-core] and are 1111 subject to the security considerations implied by its use. This 1112 addresses the issue of spoofing. 1114 Digital signatures provide authentication, message integrity, and 1115 non-repudiation with proof of origin. 1117 9. References 1119 9.1. Normative References 1121 [BITTORRENT] 1122 Cohen, B., "The BitTorrent Protocol Specification", 1123 BITTORRENT 11031, February 2008, 1124 . 1126 [ISO3166-1] 1127 International Organization for Standardization, "ISO 3166- 1128 1:2006. Codes for the representation of names of 1129 countries and their subdivisions -- Part 1: Country 1130 codes", November 2006. 1132 [REC-xml] Yergeau, F., Paoli, J., Bray, T., Sperberg-McQueen, C., 1133 and E. Maler, "Extensible Markup Language (XML) 1.0 1134 (Fourth Edition)", World Wide Web Consortium 1135 Recommendation REC-xml-20060816, August 2006, 1136 . 1138 [REC-xml-infoset] 1139 Cowan, J. and R. Tobin, "XML Information Set (Second 1140 Edition)", World Wide Web Consortium Recommendation REC- 1141 xml-infoset-20040204, February 2004, 1142 . 1144 [REC-xml-names] 1145 Hollander, D., Bray, T., Tobin, R., and A. Layman, 1146 "Namespaces in XML 1.0 (Second Edition)", World Wide Web 1147 Consortium Recommendation REC-xml-names-20060816, 1148 August 2006, 1149 . 1151 [REC-xmlbase] 1152 Marsh, J., "XML Base", W3C REC W3C.REC-xmlbase-20010627, 1153 June 2001, 1154 . 1156 [REC-xmldsig-core] 1157 Solo, D., Reagle, J., and D. Eastlake, "XML-Signature 1158 Syntax and Processing (Second Edition)", World Wide Web 1159 Consortium Recommendation REC-xmldsig-core-20080610, 1160 June 2008, 1161 . 1163 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1164 Requirement Levels", BCP 14, RFC 2119, March 1997. 1166 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 1168 [RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media 1169 Types", RFC 3023, January 2001. 1171 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 1172 (SHA1)", RFC 3174, September 2001. 1174 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 1175 Timestamps", RFC 3339, July 2002. 1177 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1178 January 2004. 1180 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1181 Resource Identifier (URI): Generic Syntax", STD 66, 1182 RFC 3986, January 2005. 1184 [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource 1185 Identifiers (IRIs)", RFC 3987, January 2005. 1187 [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and 1188 Registration Procedures", BCP 13, RFC 4288, December 2005. 1190 [RFC5646] Phillips, A. and M. Davis, "Tags for Identifying 1191 Languages", BCP 47, RFC 5646, September 2009. 1193 9.2. Informative References 1195 [ISO.8601.1988] 1196 International Organization for Standardization, "Data 1197 elements and interchange formats - Information interchange 1198 - Representation of dates and times", ISO Standard 8601, 1199 June 1988. 1201 [RELAX-NG] 1202 Clark, J., "RELAX NG Compact Syntax", December 2001, . 1206 [RFC4287] Nottingham, M. and R. Sayre, "The Atom Syndication 1207 Format", RFC 4287, December 2005. 1209 [W3C.NOTE-datetime-19980827] 1210 Wolf, M. and C. Wicksteed, "Date and Time Formats", W3C 1211 NOTE NOTE-datetime-19980827, August 1998, 1212 . 1214 [W3C.REC-xmlschema-2-20041028] 1215 Malhotra, A. and P. Biron, "XML Schema Part 2: Datatypes 1216 Second Edition", W3C REC REC-xmlschema-2-20041028, 1217 October 2004, 1218 . 1220 Appendix A. Acknowledgements and Contributors 1222 The layout and content of this document relies heavily on work 1223 pioneered in the Atom Syndication Format as specified in [RFC4287]. 1225 The content and concepts within are a product of the Metalink 1226 community. 1228 The Metalink community has dozens of contributors who proposed ideas 1229 and wording for this document, or contributed to the evolution of 1230 Metalink, including: 1232 Paul Burkhead, Kristian Weston, Darius Liktorius, Michael Burford, 1233 Giorgio Maone, Manuel Subredu, A. Bram Neijt, Max Velasques, Manolo 1234 Valdes, Urs Wolfer, Frederick Cheung, Nils Maier, Hampus Wessman, 1235 Hayden Legendre, Danny Ayers, Nick Dominguez, Rene Leonhardt, Per 1236 Oyvind Karlsen, Gary Zellerbach, James Clark, Daniel Stenberg, Matt 1237 Domsch, Yazsoft, KGet developers, FDM Team, Orbit Team, Arne 1238 Babenhauserheide, Mathias Berchtold, Xienzhenyu and TheWorld Browser 1239 Team, Xi Software, Nicolas Alvarez, Patrick Ruckstuhl, Sebastien 1240 Willemijns, Micah Cowan, Bridget and Ethan Fletcher, Ruben Kerkhof, 1241 Agostino Russo, Salvatore Musumeci, Steve Eshelman, Lucas Hewett, 1242 Ryan Cronin, Dave Winquist, Bob Denison, Wes Shelton, Kees Cook, Josh 1243 Colbert, Steve Kleisath, Chad Neptune, Nick Carrabba, Chris Carrabba, 1244 Erin Solari, Derick Cordoba, Ryan Alexander, John & Sandra Sowder, 1245 Tom Mainville, Janie Wargo, Jason Hansen, Tim Bray, Dan Brickley, 1246 Markus Hofmann, Dan Connolly, Tim Berners-Lee, Louis Suarez-Potts, 1247 Ross Smith, Jeff Covey, Ed Lee, Shawn Wilsher, Mike Connor, Johan 1248 Svedberg, Dedric Carter, James Antill, Debi Goulding, Chris Newman, 1249 Lisa Dusseault, Ian Macfarlane, Dave Cridland, Julian Reschke, Barry 1250 Leiba, Uri Blumenthal, Paul Hoffman, Felix Sasaki, Matthias Fuchs, 1251 Mark Baker, Eran Hammer-Lahav, and Mark Nottingham. We also thank 1252 the Anthony Family, the Bryan Family, Juanita Anthony and Zimmy 1253 Bryan. 1255 Appendix B. RELAX NG Compact Schema 1257 This appendix is informative. 1259 The Relax NG schema explicitly excludes elements in the Metalink 1260 namespace that are not defined in this revision of the specification. 1261 Requirements for Metalink Processors encountering such markup are 1262 given in Sections 6.2 and 6.3. 1264 # -*- rnc -*- 1265 # RELAX NG Compact Syntax Grammar for the 1266 # Metalink Format Specification Version 4 1268 namespace local = "" 1269 namespace metalink = "urn:ietf:params:xml:ns:metalink" 1270 namespace xsd = "http://www.w3.org/2001/XMLSchema" 1272 # Common attributes 1274 metalinkCommonAttributes = 1275 attribute xml:base { metalinkUri }?, 1276 attribute xml:lang { metalinkLanguageTag }?, 1277 undefinedAttribute* 1279 # Text Constructs 1281 metalinkTextConstruct = 1282 metalinkCommonAttributes, 1283 text 1285 # Date Construct 1287 metalinkDateConstruct = 1288 metalinkCommonAttributes, 1289 xsd:dateTime 1291 start = metalinkMetalink 1293 metalinkMetalink = 1294 element metalink:metalink { 1295 metalinkCommonAttributes, 1296 (metalinkDynamic? 1297 & metalinkFile+ 1298 & metalinkGenerator? 1299 & metalinkOrigin? 1300 & metalinkPublished? 1301 & metalinkUpdated? 1302 & extensionElement*) 1303 } 1305 metalinkFile = 1306 element metalink:file { 1307 metalinkCommonAttributes, 1308 attribute name { text }, 1309 (metalinkCopyright? 1310 & metalinkDescription? 1311 & metalinkIdentity? 1312 & metalinkHash* 1313 & metalinkLanguage? 1314 & metalinkLicense? 1315 & metalinkLogo? 1316 & metalinkMetaURL* 1317 & metalinkURL* 1318 & metalinkOS* 1319 & metalinkPieces* 1320 & metalinkPublisher? 1321 & metalinkSignature? 1322 & metalinkSize? 1323 & metalinkVersion? 1324 & extensionElement*) 1325 } 1327 metalinkPieces = 1328 element metalink:pieces { 1329 attribute length { xsd:integer }, 1330 attribute type { text }, 1331 metalinkHash+ 1332 } 1334 metalinkCopyright = 1335 element metalink:copyright { 1336 metalinkTextConstruct 1337 } 1339 metalinkDescription = 1340 element metalink:description { 1341 metalinkTextConstruct 1342 } 1344 metalinkDynamic = 1345 element metalink:dynamic { 1346 "true" | "false" 1347 } 1349 metalinkGenerator = 1350 element metalink:generator { 1351 metalinkTextConstruct 1352 } 1354 metalinkHash = 1355 element metalink:hash { 1356 attribute type { text }?, 1357 text 1358 } 1360 metalinkIdentity = 1361 element metalink:identity { 1362 metalinkTextConstruct 1363 } 1365 metalinkLanguage = 1366 element metalink:language { 1367 metalinkTextConstruct 1368 } 1370 metalinkLicense = 1371 element metalink:license { 1372 metalinkCommonAttributes, 1373 attribute url { metalinkUri }?, 1374 attribute name { text }? 1375 } 1377 metalinkLogo = 1378 element metalink:logo { 1379 metalinkCommonAttributes, 1380 (metalinkUri) 1381 } 1383 metalinkMetaURL = 1384 element metalink:metaurl { 1385 metalinkCommonAttributes, 1386 attribute priority { xsd:integer }?, 1387 attribute type { text }, 1388 attribute name { text }?, 1389 metalinkUri 1390 } 1392 metalinkOrigin = 1393 element metalink:origin { 1394 metalinkCommonAttributes, 1395 (metalinkUri) 1396 } 1398 metalinkOS = 1399 element metalink:os { 1400 metalinkTextConstruct 1401 } 1403 metalinkPublished = 1404 element metalink:published { 1405 metalinkDateConstruct 1406 } 1408 metalinkPublisher = 1409 element metalink:publisher { 1410 metalinkCommonAttributes, 1411 attribute url { metalinkUri }?, 1412 attribute name { text }? 1413 } 1415 metalinkSignature = 1416 element metalink:signature { 1417 attribute type { "pgp" }, 1418 metalinkTextConstruct 1419 } 1421 metalinkSize = 1422 element metalink:size { 1423 metalinkTextConstruct 1424 } 1426 metalinkUpdated = 1427 element metalink:updated { 1428 metalinkDateConstruct 1429 } 1431 metalinkURL = 1432 element metalink:url { 1433 metalinkCommonAttributes, 1434 attribute location { xsd:string { 1435 minLength = "2" maxLength="2"} 1436 }?, 1437 attribute priority { xsd:integer }?, 1438 metalinkUri 1439 } 1441 metalinkVersion = 1442 element metalink:version { 1443 metalinkTextConstruct 1444 } 1446 # As defined in RFC 3066 and compatible with RFC 5646 1447 metalinkLanguageTag = xsd:string { 1448 pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*" 1449 } 1451 # Unconstrained; it's not entirely clear how IRI fit into 1452 # xsd:anyURI so let's not try to constrain it here 1453 metalinkUri = text 1455 # Simple Extension 1457 simpleExtensionElement = 1458 element * - metalink:* { 1459 text 1460 } 1462 # Structured Extension 1464 structuredExtensionElement = 1465 element * - metalink:* { 1466 (attribute * { text }+, 1467 (text|anyElement)*) 1468 | (attribute * { text }*, 1469 (text?, anyElement+, (text|anyElement)*)) 1470 } 1472 # Other Extensibility 1474 extensionElement = 1475 simpleExtensionElement | structuredExtensionElement 1477 undefinedAttribute = 1478 attribute * - (xml:base | xml:lang | local:*) { text } 1480 undefinedContent = (text|anyForeignElement)* 1482 anyElement = 1483 element * { 1484 (attribute * { text } 1485 | text 1486 | anyElement)* 1487 } 1489 anyForeignElement = 1490 element * - metalink:* { 1491 (attribute * { text } 1492 | text 1493 | anyElement)* 1494 } 1496 # EOF 1498 Appendix C. Document History (to be removed by RFC Editor before 1499 publication) 1501 [[ to be removed by the RFC editor before publication as an RFC. ]] 1503 Updated versions can be found at 1504 http://tools.ietf.org/html/draft-bryan-metalink with frequent updates 1505 in Subversion at 1506 http://metalinks.svn.sourceforge.net/viewvc/metalinks/internetdraft/ 1508 Known issues concerning this draft: 1509 o None. 1511 -22 : October 30, 2009. 1512 o Clarifications. 1514 -21 : October 13, 2009. 1515 o Update author details. 1517 -20 : October 12, 2009. 1518 o RFC 5646 updates RFC 4646. 1520 -19 : October 5, 2009. 1521 o Remove organization for independent authors. 1523 -18 : October 4, 2009. 1524 o File extension: .meta4 1525 o Hashes clarification, modified to allow multiple metalink:os 1526 elements, add size element to example. 1528 -17 : September 28, 2009. 1529 o Typo correction. 1531 -16 : August 31, 2009. 1532 o Clarifications. 1534 -15 : August 26, 2009. 1536 o Rename "preference" attribute of metaurl and url elements to 1537 "priority", where lower values indicate higher priority. 1539 -14 : August 24, 2009. 1540 o Update abstract and introduction. 1542 -13 : August 21, 2009. 1543 o Remove files, resources, verification container elements. 1544 o MIME type: application/metalink4+xml 1546 -12 : August 18, 2009. 1547 o Remove "piece" attribute from hash elements in pieces container 1548 elements. 1549 o Rename "uri" attribute of license and publisher elements to "url". 1551 -11 : August 08, 2009. 1552 o Renamed type element (static or dynamic values) to dynamic element 1553 (true or false values). 1554 o Removed metadata inheritance and most other elements from files 1555 element. 1557 -10 : July 28, 2009. 1558 o Schema fixes. 1559 o Rename metadata element to metaurl, add name attribute to it 1560 similar to file element's name attribute. 1561 o Update REC-xmldsig-core reference to second edition. 1563 -09 : July 11, 2009. 1564 o Replace ISO639-2 references with RFC 4646. 1565 o Add ISO3166-1. 1567 -08 : July 04, 2009. 1568 o Clarifications. 1569 o Remove "uri" and "version" attributes from generator element. 1571 -07 : June 18, 2009. 1572 o This ID describes the Metalink document format/schema. 1573 o Remove "Client Implementation Considerations" section. 1574 o Expand "Known issues" section of Document History. 1576 -06 : March 3, 2009. 1577 o Add authors and this Document History section. 1579 -05 : January 13, 2009. 1580 o Clarifications. 1582 -04 : December 31, 2008. 1584 o New IPR notice as required by IETF. 1585 o Correct "metalink:pieces" Element text. 1586 o Add hash examples. 1587 o Slim down "Securing Metalink Documents" section. 1588 o Recommend at least SHA-1. 1590 -03 : September 19, 2008. 1591 o New namespace - urn:ietf:params:xml:ns:metalink 1592 o Use the IANA registry named "Operating System Names" to define 1593 values for OS types. 1594 o Add "Client Implementation Considerations" section, which includes 1595 Content Negotiation. 1597 -02 : September 4, 2008. 1598 o Use the IANA registry named "Hash Function Textual Names" for hash 1599 types. 1600 o metadata Element for listing .torrent, .metalink, etc. 1601 o Remove type attribute for url Element. 1603 -01 : August 28, 2008. 1604 o Clarify directory info in name attribute, hash types, add text for 1605 preference attribute. 1607 -00 : August 23, 2008. 1608 o Initial draft; Text largely based on RFC 4287, ideas from Metalink 1609 3.0 specification. 1611 Index 1613 A 1614 application/metalink4+xml Media Type 24 1616 C 1617 copyright XML element 13 1619 D 1620 description XML element 14 1622 F 1623 file XML element 11 1625 G 1626 generator XML element 14 1627 Grammar 1628 metalinkCommonAttributes 8 1629 metalinkCopyright 14 1630 metalinkDateConstruct 9 1631 metalinkDescription 14 1632 metalinkFile 11 1633 metalinkGenerator 14 1634 metalinkHash 15 1635 metalinkIdentity 16 1636 metalinkLanguage 16 1637 metalinkLicense 17 1638 metalinkLogo 17 1639 metalinkMetalink 10 1640 metalinkOrigin 18 1641 metalinkOS 19 1642 metalinkPieces 13 1643 metalinkPublished 19 1644 metalinkPublisher 19 1645 metalinkSignature 20 1646 metalinkSize 20 1647 metalinkTextConstruct 9 1648 metalinkType 14 1649 metalinkUpdated 20 1650 metalinkURL 17, 21 1651 metalinkVersion 21 1652 simpleExtensionElement 23 1653 structuredExtensionElement 23 1655 H 1656 hash XML element 15 1658 I 1659 identity XML element 16 1661 L 1662 language XML element 16 1663 license XML element 16 1664 logo XML element 17 1666 M 1667 Media Type 1668 application/metalink4+xml 24 1669 metadata XML element 17 1670 metalink XML element 10 1671 metalinkCommonAttributes grammar production 8 1672 metalinkCopyright grammar production 14 1673 metalinkDateConstruct grammar production 9 1674 metalinkDescription grammar production 14 1675 metalinkFile grammar production 11 1676 metalinkGenerator grammar production 14 1677 metalinkHash grammar production 15 1678 metalinkIdentity grammar production 16 1679 metalinkLanguage grammar production 16 1680 metalinkLicense grammar production 17 1681 metalinkLogo grammar production 17 1682 metalinkMetalink grammar production 10 1683 metalinkOrigin grammar production 18 1684 metalinkOS grammar production 19 1685 metalinkPieces grammar production 13 1686 metalinkPublished grammar production 19 1687 metalinkPublisher grammar production 19 1688 metalinkSignature grammar production 20 1689 metalinkSize grammar production 20 1690 metalinkTextConstruct grammar production 9 1691 metalinkType grammar production 14 1692 metalinkUpdated grammar production 20 1693 metalinkURL grammar production 17, 21 1694 metalinkVersion grammar production 21 1696 O 1697 origin XML element 18 1698 os XML element 19 1700 P 1701 pieces XML element 13 1702 published XML element 19 1703 publisher XML element 19 1705 S 1706 signature XML element 20 1707 simpleExtensionElement grammar production 23 1708 size XML element 20 1709 structuredExtensionElement grammar production 23 1711 T 1712 type XML element 14 1714 U 1715 updated XML element 20 1716 url XML element 21 1718 V 1719 version XML element 21 1721 X 1722 XML Elements 1723 copyright 13 1724 description 14 1725 entry 11 1726 generator 14 1727 hash 15 1728 identity 16 1729 language 16 1730 license 16 1731 logo 17 1732 metadata 17 1733 metalink 10 1734 origin 18 1735 os 19 1736 pieces 13 1737 published 19 1738 publisher 19 1739 signature 20 1740 size 20 1741 type 14 1742 updated 20 1743 url 21 1744 version 21 1746 Authors' Addresses 1748 Anthony Bryan 1749 Pompano Beach, FL 1750 USA 1752 Email: anthonybryan@gmail.com 1753 URI: http://www.metalinker.org 1755 Tatsuhiro Tsujikawa 1757 Email: tatsuhiro.t@gmail.com 1758 URI: http://aria2.sourceforge.net 1760 Neil McNab 1762 Email: neil@nabber.org 1763 URI: http://www.nabber.org 1765 Peter Poeml 1766 Novell, Inc. 1768 Email: poeml@mirrorbrain.org 1769 URI: http://www.mirrorbrain.org/