metalink4-ruby 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ # coding: utf-8
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'metalink4-ruby'
5
+ s.version = '1.0.0'
6
+ s.summary = "Class to format Metalink 4 / rfc5854 / .meta4 XML"
7
+ s.authors = ["Sudrien"]
8
+ s.email = '_+github@sudrien.net'
9
+ s.files = ['lib/metalink4.rb', 'metalink4-ruby.gemfile','README.md','rfc5854.txt','LICENSE']
10
+ s.require_paths = ["lib"]
11
+ s.homepage = 'https://github.com/Sudrien/metalink4-ruby'
12
+ s.license = 'MIT'
13
+
14
+ s.required_ruby_version = Gem::Requirement.new(">= 1.9.3")
15
+
16
+ s.add_runtime_dependency "builder"
17
+ s.add_runtime_dependency "mime-types"
18
+ s.add_runtime_dependency "nokogiri"
19
+ end
data/rfc5854.txt ADDED
@@ -0,0 +1,2187 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+ Internet Engineering Task Force (IETF) A. Bryan
8
+ Request for Comments: 5854 T. Tsujikawa
9
+ Category: Standards Track N. McNab
10
+ ISSN: 2070-1721
11
+ P. Poeml
12
+ MirrorBrain
13
+ June 2010
14
+
15
+
16
+ The Metalink Download Description Format
17
+
18
+ Abstract
19
+
20
+ This document specifies Metalink, an XML-based download description
21
+ format. Metalink describes download locations (mirrors),
22
+ cryptographic hashes, and other information. Clients can
23
+ transparently use this information to reliably transfer files.
24
+
25
+ Status of This Memo
26
+
27
+ This is an Internet Standards Track document.
28
+
29
+ This document is a product of the Internet Engineering Task Force
30
+ (IETF). It represents the consensus of the IETF community. It has
31
+ received public review and has been approved for publication by the
32
+ Internet Engineering Steering Group (IESG). Further information on
33
+ Internet Standards is available in Section 2 of RFC 5741.
34
+
35
+ Information about the current status of this document, any errata,
36
+ and how to provide feedback on it may be obtained at
37
+ http://www.rfc-editor.org/info/rfc5854.
38
+
39
+ Copyright Notice
40
+
41
+ Copyright (c) 2010 IETF Trust and the persons identified as the
42
+ document authors. All rights reserved.
43
+
44
+ This document is subject to BCP 78 and the IETF Trust's Legal
45
+ Provisions Relating to IETF Documents
46
+ (http://trustee.ietf.org/license-info) in effect on the date of
47
+ publication of this document. Please review these documents
48
+ carefully, as they describe your rights and restrictions with respect
49
+ to this document. Code Components extracted from this document must
50
+ include Simplified BSD License text as described in Section 4.e of
51
+ the Trust Legal Provisions and are provided without warranty as
52
+ described in the Simplified BSD License.
53
+
54
+
55
+
56
+
57
+
58
+ Bryan, et al. Standards Track [Page 1]
59
+
60
+ RFC 5854 Metalink Download Description Format June 2010
61
+
62
+
63
+ Table of Contents
64
+
65
+ 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
66
+ 1.1. Examples . . . . . . . . . . . . . . . . . . . . . . . . . 4
67
+ 1.2. Namespace and Version . . . . . . . . . . . . . . . . . . 5
68
+ 1.3. Notational Conventions . . . . . . . . . . . . . . . . . . 5
69
+ 2. Metalink Documents . . . . . . . . . . . . . . . . . . . . . . 6
70
+ 3. Common Metalink Constructs . . . . . . . . . . . . . . . . . . 7
71
+ 3.1. Text Constructs . . . . . . . . . . . . . . . . . . . . . 7
72
+ 3.2. Date Constructs . . . . . . . . . . . . . . . . . . . . . 8
73
+ 4. Metalink Element Definitions . . . . . . . . . . . . . . . . . 8
74
+ 4.1. Container Elements . . . . . . . . . . . . . . . . . . . . 8
75
+ 4.1.1. The "metalink:metalink" Element . . . . . . . . . . . 8
76
+ 4.1.2. The "metalink:file" Element . . . . . . . . . . . . . 9
77
+ 4.1.3. The "metalink:pieces" Element . . . . . . . . . . . . 12
78
+ 4.2. Metadata Elements . . . . . . . . . . . . . . . . . . . . 12
79
+ 4.2.1. The "metalink:copyright" Element . . . . . . . . . . . 12
80
+ 4.2.2. The "metalink:description" Element . . . . . . . . . . 13
81
+ 4.2.3. The "metalink:generator" Element . . . . . . . . . . . 13
82
+ 4.2.4. The "metalink:hash" Element . . . . . . . . . . . . . 14
83
+ 4.2.5. The "metalink:identity" Element . . . . . . . . . . . 15
84
+ 4.2.6. The "metalink:language" Element . . . . . . . . . . . 15
85
+ 4.2.7. The "metalink:logo" Element . . . . . . . . . . . . . 16
86
+ 4.2.8. The "metalink:metaurl" Element . . . . . . . . . . . . 16
87
+ 4.2.9. The "metalink:origin" Element . . . . . . . . . . . . 18
88
+ 4.2.10. The "metalink:os" Element . . . . . . . . . . . . . . 18
89
+ 4.2.11. The "metalink:published" Element . . . . . . . . . . . 18
90
+ 4.2.12. The "metalink:publisher" Element . . . . . . . . . . . 18
91
+ 4.2.13. The "metalink:signature" Element . . . . . . . . . . . 19
92
+ 4.2.14. The "metalink:size" Element . . . . . . . . . . . . . 20
93
+ 4.2.15. The "metalink:updated" Element . . . . . . . . . . . . 20
94
+ 4.2.16. The "metalink:url" Element . . . . . . . . . . . . . . 20
95
+ 4.2.17. The "metalink:version" Element . . . . . . . . . . . . 21
96
+ 5. Extending Metalink . . . . . . . . . . . . . . . . . . . . . . 21
97
+ 5.1. Extensions from Non-Metalink Vocabularies . . . . . . . . 21
98
+ 5.2. Extensions to the Metalink Vocabulary . . . . . . . . . . 21
99
+ 5.3. Processing Foreign Markup . . . . . . . . . . . . . . . . 22
100
+ 5.4. Extension Elements . . . . . . . . . . . . . . . . . . . . 22
101
+ 5.4.1. Simple Extension Elements . . . . . . . . . . . . . . 22
102
+ 5.4.2. Structured Extension Elements . . . . . . . . . . . . 23
103
+ 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23
104
+ 6.1. XML Namespace Registration . . . . . . . . . . . . . . . . 23
105
+ 6.2. application/metalink4+xml MIME type . . . . . . . . . . . 23
106
+ 7. Security Considerations . . . . . . . . . . . . . . . . . . . 24
107
+ 7.1. Digital Signatures . . . . . . . . . . . . . . . . . . . . 25
108
+ 7.2. URIs and IRIs . . . . . . . . . . . . . . . . . . . . . . 26
109
+ 7.3. Spoofing . . . . . . . . . . . . . . . . . . . . . . . . . 26
110
+ 7.4. Cryptographic Hashes . . . . . . . . . . . . . . . . . . . 26
111
+
112
+
113
+
114
+ Bryan, et al. Standards Track [Page 2]
115
+
116
+ RFC 5854 Metalink Download Description Format June 2010
117
+
118
+
119
+ 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 27
120
+ 8.1. Normative References . . . . . . . . . . . . . . . . . . . 27
121
+ 8.2. Informative References . . . . . . . . . . . . . . . . . . 28
122
+ Appendix A. Acknowledgements and Contributors . . . . . . . . . . 30
123
+ Appendix B. RELAX NG Compact Schema . . . . . . . . . . . . . . . 31
124
+ Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
125
+
126
+ 1. Introduction
127
+
128
+ Metalink is a document format based on Extensible Markup Language
129
+ (XML) that describes a file or list of files to be downloaded from a
130
+ server. Metalinks can list a number of files, each with an
131
+ extensible set of attached metadata. Each listed file can have a
132
+ description, multiple cryptographic hashes, and a list of Uniform
133
+ Resource Identifiers (URIs) from which it is available.
134
+
135
+ Often, identical copies of a file are accessible in multiple
136
+ locations on the Internet over a variety of protocols, such as File
137
+ Transfer Protocol (FTP), Hypertext Transfer Protocol (HTTP), and
138
+ Peer-to-Peer (P2P). In some cases, users are shown a list of these
139
+ multiple download locations (mirror servers) and must manually select
140
+ one based on geographical location, priority, or bandwidth. This is
141
+ done to distribute the load across multiple servers, and to give
142
+ human users the opportunity to choose a download location that they
143
+ expect to work best for them.
144
+
145
+ At times, individual servers can be slow, outdated, or unreachable,
146
+ but this cannot be determined until the download has been initiated.
147
+ This can lead to the user canceling the download and needing to
148
+ restart it. During downloads, errors in transmission can corrupt the
149
+ file. There are no easy ways to repair these files. For large
150
+ downloads, this can be especially troublesome. Any of the number of
151
+ problems that can occur during a download lead to frustration on the
152
+ part of users, and bandwidth wasted with retransmission.
153
+
154
+ Knowledge about availability of a download on mirror servers can be
155
+ acquired and maintained by the operators of the origin server or by a
156
+ third party. This knowledge, together with cryptographic hashes,
157
+ digital signatures, and more, can be stored in a machine-readable
158
+ Metalink file. The Metalink file can transfer this knowledge to the
159
+ user agent, which can peruse it in automatic ways or present the
160
+ information to a human user. User agents can fall back to alternate
161
+ mirrors if the current one has an issue. Thereby, clients are
162
+ enabled to work their way to a successful download under adverse
163
+ circumstances. All this can be done transparently to the human user
164
+ and the download is much more reliable and efficient. In contrast, a
165
+
166
+
167
+
168
+
169
+
170
+ Bryan, et al. Standards Track [Page 3]
171
+
172
+ RFC 5854 Metalink Download Description Format June 2010
173
+
174
+
175
+ traditional HTTP redirect to one mirror conveys only comparatively
176
+ minimal information -- a referral to a single server, and there is no
177
+ provision in the HTTP protocol to handle failures.
178
+
179
+ Other features that some clients provide include multi-source
180
+ downloads, where chunks of a file are downloaded from multiple
181
+ mirrors (and optionally, Peer-to-Peer) simultaneously, which
182
+ frequently results in a faster download. Metalinks can leverage
183
+ HTTP, FTP, and Peer-to-Peer protocols together, because regardless of
184
+ the protocol over which the Metalink was obtained, it can make a
185
+ resource accessible through other protocols. If the Metalink was
186
+ obtained from a trusted source, included verification metadata can
187
+ solve trust issues when downloading files from replica servers
188
+ operated by third parties. Metalinks also provide structured
189
+ information about downloads that can be indexed by search engines.
190
+
191
+ 1.1. Examples
192
+
193
+ A brief, Metalink Document that describes a single file:
194
+
195
+ <?xml version="1.0" encoding="UTF-8"?>
196
+ <metalink xmlns="urn:ietf:params:xml:ns:metalink">
197
+ <file name="example.ext">
198
+ <size>14471447</size>
199
+ <url>ftp://ftp.example.com/example.ext</url>
200
+ <url>http://example.com/example.ext</url>
201
+ <metaurl mediatype="torrent">
202
+ http://example.com/example.ext.torrent</metaurl>
203
+ </file>
204
+ </metalink>
205
+
206
+ A more extensive Metalink Document that describes two files:
207
+
208
+ <?xml version="1.0" encoding="UTF-8"?>
209
+ <metalink xmlns="urn:ietf:params:xml:ns:metalink">
210
+ <published>2009-05-15T12:23:23Z</published>
211
+ <file name="example.ext">
212
+ <size>14471447</size>
213
+ <identity>Example</identity>
214
+ <version>1.0</version>
215
+ <language>en</language>
216
+ <description>
217
+ A description of the example file for download.
218
+ </description>
219
+ <hash type="sha-256">f0ad929cd259957e160ea442eb80986b5f01...</hash>
220
+ <url location="de"
221
+ priority="1">ftp://ftp.example.com/example.ext</url>
222
+
223
+
224
+
225
+
226
+ Bryan, et al. Standards Track [Page 4]
227
+
228
+ RFC 5854 Metalink Download Description Format June 2010
229
+
230
+
231
+ <url location="fr"
232
+ priority="1">http://example.com/example.ext</url>
233
+ <metaurl mediatype="torrent"
234
+ priority="2">http://example.com/example.ext.torrent</metaurl>
235
+ </file>
236
+ <file name="example2.ext">
237
+ <size>14471447</size>
238
+ <identity>Example2</identity>
239
+ <version>1.0</version>
240
+ <language>en</language>
241
+ <description>
242
+ Another description for a second file.
243
+ </description>
244
+ <hash type="sha-256">2f548ce50c459a0270e85a7d63b2383c5523...</hash>
245
+ <url location="de"
246
+ priority="1">ftp://ftp.example.com/example2.ext</url>
247
+ <url location="fr"
248
+ priority="1">http://example.com/example2.ext</url>
249
+ <metaurl mediatype="torrent"
250
+ priority="2">http://example.com/example2.ext.torrent</metaurl>
251
+ </file>
252
+ </metalink>
253
+
254
+ 1.2. Namespace and Version
255
+
256
+ The XML Namespaces URI [REC-xml-names] for the XML data format
257
+ described in this specification is:
258
+
259
+ urn:ietf:params:xml:ns:metalink
260
+
261
+ For convenience, this data format may be referred to as "Metalink",
262
+ which this specification uses internally.
263
+
264
+ 1.3. Notational Conventions
265
+
266
+ This specification describes conformance of Metalink Documents.
267
+ Additionally, it places some requirements on Metalink Processors.
268
+
269
+ This specification uses the namespace prefix "metalink:" for the
270
+ Namespace URI identified in Section 1.2, above. Note that the choice
271
+ of namespace prefix is arbitrary and not semantically significant.
272
+
273
+ Metalink is specified using terms from the XML Infoset
274
+ [REC-xml-infoset]. However, this specification uses a shorthand for
275
+ two common terms: the phrase "Information Item" is omitted when
276
+ naming Element Information Items and Attribute Information Items.
277
+ Therefore, when this specification uses the term "element," it is
278
+ referring to an Element Information Item in Infoset terms. Likewise,
279
+
280
+
281
+
282
+ Bryan, et al. Standards Track [Page 5]
283
+
284
+ RFC 5854 Metalink Download Description Format June 2010
285
+
286
+
287
+ when it uses the term "attribute," it is referring to an Attribute
288
+ Information Item.
289
+
290
+ Some sections of this specification are illustrated with fragments of
291
+ a non-normative RELAX NG Compact schema [RELAX-NG]. However, the
292
+ text of this specification provides the definition of conformance. A
293
+ complete schema appears in Appendix B.
294
+
295
+ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
296
+ "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
297
+ document are to be interpreted as described in BCP 14, [RFC2119], as
298
+ scoped to those conformance targets.
299
+
300
+ 2. Metalink Documents
301
+
302
+ This specification describes Metalink Documents.
303
+
304
+ A Metalink Document describes a file or group of files, how to access
305
+ them, and metadata that identifies them. Its root is the metalink:
306
+ metalink element.
307
+
308
+ namespace metalink = "urn:ietf:params:xml:ns:metalink"
309
+ start = metalinkMetalink
310
+
311
+ Metalink Documents are specified in terms of the XML Information Set,
312
+ serialized as XML 1.0 [REC-xml] and identified with the "application/
313
+ metalink4+xml" media type.
314
+
315
+ Metalink Documents MUST be well-formed XML. This specification does
316
+ not define a Document Type Definition (DTD) for Metalink Documents,
317
+ and hence it does not require them to be valid (in the sense used by
318
+ XML).
319
+
320
+ Metalink allows the use of Internationalized Resource Identifiers
321
+ (IRIs), encoded according to [RFC3987]. Every URI [RFC3986] is also
322
+ an IRI, so a URI may be used wherever an IRI is named below. There
323
+ is one special consideration: when an IRI that is not also a URI is
324
+ given for dereferencing, it MUST be mapped to a URI using the steps
325
+ in Section 3.1 of [RFC3987].
326
+
327
+ Any element defined by this specification MAY have an xml:lang
328
+ attribute, whose content indicates the natural language for the
329
+ element and its descendents. The language context is only
330
+ significant for elements and attributes declared to be "Language-
331
+ Sensitive" by this specification. Requirements regarding the content
332
+ and interpretation of xml:lang are specified in XML 1.0 [REC-xml],
333
+ Section 2.12.
334
+
335
+
336
+
337
+
338
+ Bryan, et al. Standards Track [Page 6]
339
+
340
+ RFC 5854 Metalink Download Description Format June 2010
341
+
342
+
343
+ metalinkCommonAttributes =
344
+ attribute xml:lang { metalinkLanguageTag }?,
345
+ undefinedAttribute*
346
+
347
+ All leading and trailing whitespace is part of the element content
348
+ and MUST NOT be ignored. Consequently, it is disallowed for elements
349
+ where the defined type does not allow whitespace, such as dates,
350
+ integers, or IRIs. Some XML-generating implementations erroneously
351
+ insert whitespace around values by default, and such implementations
352
+ will generate invalid Metalink Documents.
353
+
354
+ Metalink Documents that do not follow this specification are invalid
355
+ and SHOULD NOT be used by Metalink Processors.
356
+
357
+ Metalink is an extensible format. See Section 5 of this document for
358
+ a full description of how Metalink Documents can be extended.
359
+
360
+ 3. Common Metalink Constructs
361
+
362
+ Many Metalink elements share common structures. This section defines
363
+ those structures and their requirements for convenient reference by
364
+ the appropriate element definitions.
365
+
366
+ When an element is identified as being a particular kind of
367
+ construct, it inherits the corresponding requirements from that
368
+ construct's definition in this section.
369
+
370
+ 3.1. Text Constructs
371
+
372
+ A Text construct contains human-readable text, usually short in
373
+ length.
374
+
375
+ metalinkTextConstruct =
376
+ metalinkCommonAttributes,
377
+ text
378
+
379
+ For example, a metalink:description with text content:
380
+
381
+ ...
382
+ <description>
383
+ A description of the example file for download.
384
+ </description>
385
+ ...
386
+
387
+ The content of the Text construct MUST NOT contain child elements.
388
+ Such text is intended to be presented to humans in a readable
389
+ fashion. Thus, whitespace could be collapsed (including line
390
+
391
+
392
+
393
+
394
+ Bryan, et al. Standards Track [Page 7]
395
+
396
+ RFC 5854 Metalink Download Description Format June 2010
397
+
398
+
399
+ breaks), and text could be displayed using typographic techniques
400
+ such as justification and proportional fonts.
401
+
402
+ 3.2. Date Constructs
403
+
404
+ A Date construct is an element whose content MUST conform to the
405
+ "date-time" production in [RFC3339]. In addition, an uppercase "T"
406
+ character MUST be used to separate date and time, and an uppercase
407
+ "Z" character MUST be present in the absence of a numeric time zone
408
+ offset.
409
+
410
+ metalinkDateConstruct =
411
+ metalinkCommonAttributes,
412
+ xsd:dateTime
413
+
414
+ Such date values happen to be compatible with the following
415
+ specifications: [ISO.8601.1988], [NOTE-datetime-19980827], and
416
+ [REC-xmlschema-2-20041028].
417
+
418
+ Example Date constructs:
419
+
420
+ ...
421
+ <updated>2010-05-01T12:15:02Z</updated>
422
+ ...
423
+ <updated>2010-05-01T12:15:02.25Z</updated>
424
+ ...
425
+ <updated>2010-05-01T12:15:02+01:00</updated>
426
+ ...
427
+ <updated>2010-05-01T12:15:02.25+01:00</updated>
428
+ ...
429
+
430
+ 4. Metalink Element Definitions
431
+
432
+ 4.1. Container Elements
433
+
434
+ 4.1.1. The "metalink:metalink" Element
435
+
436
+ The "metalink:metalink" element is the document (i.e., top-level)
437
+ element of a Metalink Document, acting as a container for metadata
438
+ and data associated with the listed files. It contains one or more
439
+ metalink:file child elements that consist of Metadata elements.
440
+
441
+ metalinkMetalink =
442
+ element metalink:metalink {
443
+ metalinkCommonAttributes,
444
+ (metalinkFile+
445
+ & metalinkGenerator?
446
+ & metalinkOrigin?
447
+
448
+
449
+
450
+ Bryan, et al. Standards Track [Page 8]
451
+
452
+ RFC 5854 Metalink Download Description Format June 2010
453
+
454
+
455
+ & metalinkPublished?
456
+ & metalinkUpdated?
457
+ & extensionElement*)
458
+ }
459
+
460
+ The following child elements are defined by this specification (note
461
+ that the presence of some of these elements is required):
462
+
463
+ o metalink:metalink elements MUST contain one or more metalink:file
464
+ elements.
465
+
466
+ o metalink:metalink elements MAY contain exactly one metalink:
467
+ generator element and MUST NOT contain more than one such element.
468
+
469
+ o metalink:metalink elements SHOULD contain exactly one metalink:
470
+ origin element and MUST NOT contain more than one such element.
471
+
472
+ o metalink:metalink elements MAY contain exactly one metalink:
473
+ published element and MUST NOT contain more than one such element.
474
+
475
+ o metalink:metalink elements MAY contain exactly one metalink:
476
+ updated element and MUST NOT contain more than one such element.
477
+
478
+ 4.1.1.1. Providing Textual Content
479
+
480
+ Experience teaches that downloads providing textual content are, in
481
+ general, more useful than those that do not. Some applications (one
482
+ example is full-text indexers) require a minimum amount of text to
483
+ function reliably and predictably. Metalink publishers should be
484
+ aware of this. It is RECOMMENDED that each metalink:file element
485
+ contain a non-empty metalink:description element, a non-empty
486
+ metalink:identity element, a non-empty metalink:version element, and
487
+ a non-empty metalink:publisher element when these elements are
488
+ present. However, the absence of metalink:description, metalink:
489
+ identity, metalink:version, and metalink:publisher is not an error,
490
+ and Metalink Processors MUST NOT fail to function correctly as a
491
+ consequence of such an absence.
492
+
493
+ 4.1.2. The "metalink:file" Element
494
+
495
+ The "metalink:file" element represents an individual file, acting as
496
+ a container for metadata and data associated with the file. Each
497
+ unique file described in a Metalink Document MUST have its own
498
+ metalink:file element.
499
+
500
+ All metalink:url elements contained in each metalink:file element
501
+ SHOULD lead to identical files. That is, each metalink:url element
502
+ should be an alternative location for the same file and each
503
+
504
+
505
+
506
+ Bryan, et al. Standards Track [Page 9]
507
+
508
+ RFC 5854 Metalink Download Description Format June 2010
509
+
510
+
511
+ metalink:metaurl element should provide metadata to retrieve the same
512
+ file in another way, such as a Peer-to-Peer network. Refer to
513
+ Sections 4.2.8 and 4.2.16 for more information.
514
+
515
+ metalinkFile =
516
+ element metalink:file {
517
+ metalinkCommonAttributes,
518
+ attribute name { text },
519
+ (metalinkCopyright?
520
+ & metalinkDescription?
521
+ & metalinkHash*
522
+ & metalinkIdentity?
523
+ & metalinkLanguage*
524
+ & metalinkLogo?
525
+ & metalinkMetaURL*
526
+ & metalinkOS*
527
+ & metalinkPieces*
528
+ & metalinkPublisher?
529
+ & metalinkSignature?
530
+ & metalinkSize?
531
+ & metalinkURL*
532
+ & metalinkVersion?
533
+ & extensionElement*)
534
+ }
535
+
536
+ This specification assigns no significance to the order of metalink:
537
+ file elements or to the order of metalink:url or metalink:metaurl
538
+ elements. Significance is determined by the value of the "priority"
539
+ attribute of the metalink:url or metalink:metaurl elements.
540
+
541
+ The following child elements are defined by this specification (the
542
+ presence of some of them is required):
543
+
544
+ o metalink:file elements MAY contain exactly one metalink:copyright
545
+ element and MUST NOT contain more than one such element.
546
+
547
+ o metalink:file elements MAY contain exactly one metalink:
548
+ description element and MUST NOT contain more than one such
549
+ element.
550
+
551
+ o metalink:file elements MAY contain exactly one metalink:identity
552
+ element and MUST NOT contain more than one such element.
553
+
554
+ o metalink:file elements MAY contain one or more metalink:hash
555
+ elements.
556
+
557
+ o metalink:file elements MAY contain one or more metalink:language
558
+ elements.
559
+
560
+
561
+
562
+ Bryan, et al. Standards Track [Page 10]
563
+
564
+ RFC 5854 Metalink Download Description Format June 2010
565
+
566
+
567
+ o metalink:file elements MAY contain exactly one metalink:logo
568
+ element and MUST NOT contain more than one such element.
569
+
570
+ o metalink:file elements MAY contain one or more metalink:os
571
+ element.
572
+
573
+ o metalink:file elements MUST contain at least one metalink:url
574
+ element or at least one metalink:metaurl element. Typically,
575
+ metalink:file elements contain more than one metalink:url element
576
+ to provide multiple download sources.
577
+
578
+ o metalink:file elements MAY contain one or more metalink:pieces
579
+ elements.
580
+
581
+ o metalink:file elements MAY contain exactly one metalink:publisher
582
+ element and MUST NOT contain more than one such element.
583
+
584
+ o metalink:file elements MAY contain one or more metalink:signature
585
+ elements.
586
+
587
+ o metalink:file elements SHOULD contain exactly one metalink:size
588
+ element and MUST NOT contain more than one such element.
589
+
590
+ o metalink:file elements MAY contain exactly one metalink:version
591
+ element and MUST NOT contain more than one such element.
592
+
593
+ 4.1.2.1. The "name" Attribute
594
+
595
+ metalink:file elements MUST have a "name" attribute, which contains
596
+ the local file name to which the downloaded file will be written.
597
+ Hence, if a Metalink Document contains multiple metalink:file
598
+ elements, the value of the "name" attribute MUST be unique for each.
599
+
600
+ Directory information can also be contained in a "path/file" format
601
+ only, as in:
602
+
603
+ <file name="debian-amd64/sarge/Contents-amd64.gz">
604
+
605
+ In this example, a subdirectory "debian-amd64/sarge/" will be created
606
+ and a file named "Contents-amd64.gz" will be created inside it.
607
+
608
+ Security Note: The path MUST NOT contain any directory traversal
609
+ directives or information. The path MUST be relative. The path
610
+ MUST NOT begin with a "/", "./", or "../"; contain "/../"; or end
611
+ with "/..".
612
+
613
+
614
+
615
+
616
+
617
+
618
+ Bryan, et al. Standards Track [Page 11]
619
+
620
+ RFC 5854 Metalink Download Description Format June 2010
621
+
622
+
623
+ 4.1.3. The "metalink:pieces" Element
624
+
625
+ The "metalink:pieces" element acts as a container for a list of
626
+ cryptographic hashes of contiguous, non-overlapping pieces of the
627
+ file. The cryptographic hashes MUST be listed in the same order as
628
+ the corresponding pieces appear in the file, starting at the
629
+ beginning of the file. Metalink Documents MAY contain one or
630
+ multiple metalink:pieces container elements, if each "type" attribute
631
+ of metalink:pieces has a unique value.
632
+
633
+ metalinkPieces =
634
+ element metalink:pieces {
635
+ attribute length { xsd:positiveInteger },
636
+ attribute type { text },
637
+ metalinkHash+
638
+ }
639
+
640
+ 4.1.3.1. The "type" Attribute
641
+
642
+ metalink:pieces elements MUST have a "type" attribute.
643
+
644
+ The Internet Assigned Numbers Authority (IANA) registry named "Hash
645
+ Function Textual Names" defines values for hash types. See
646
+ Section 7.4 for security implications.
647
+
648
+ 4.1.3.2. The "length" Attribute
649
+
650
+ metalink:pieces elements MUST have a "length" attribute, which is a
651
+ positive integer that describes the length of the pieces of the file
652
+ in octets. The whole file is divided into non-overlapping pieces of
653
+ this length, starting from the beginning of the file. That is, every
654
+ piece MUST be the same size, apart from the last piece, which is the
655
+ remainder. The last piece extends to the end of the file, and it
656
+ therefore MAY be shorter than the other pieces.
657
+
658
+ 4.2. Metadata Elements
659
+
660
+ 4.2.1. The "metalink:copyright" Element
661
+
662
+ The "metalink:copyright" element is a Text construct that conveys a
663
+ human-readable copyright for a file. It is Language-Sensitive.
664
+
665
+ metalinkCopyright =
666
+ element metalink:copyright {
667
+ metalinkTextConstruct
668
+ }
669
+
670
+
671
+
672
+
673
+
674
+ Bryan, et al. Standards Track [Page 12]
675
+
676
+ RFC 5854 Metalink Download Description Format June 2010
677
+
678
+
679
+ 4.2.2. The "metalink:description" Element
680
+
681
+ The "metalink:description" element is a Text construct that conveys a
682
+ human-readable file description. It is Language-Sensitive.
683
+
684
+ metalinkDescription =
685
+ element metalink:description {
686
+ metalinkTextConstruct
687
+ }
688
+
689
+ 4.2.3. The "metalink:generator" Element
690
+
691
+ The "metalink:generator" element's content identifies the generating
692
+ agent name and version used to generate a Metalink Document, for
693
+ debugging and other purposes.
694
+
695
+ metalinkGenerator =
696
+ element metalink:generator {
697
+ metalinkTextConstruct
698
+ }
699
+
700
+ The metalink:generator element's content is defined below in ABNF
701
+ notation [RFC5234].
702
+
703
+ token = 1*<any CHAR except CTLs or separators>
704
+ separators = "(" / ")" / "<" / ">" / "@"
705
+ / "," / ";" / ":" / "\" / DQUOTE
706
+ / "/" / "[" / "]" / "?" / "="
707
+ / "{" / "}" / SP / HTAB
708
+ agent = token ["/" agent-version]
709
+ agent-version = token
710
+
711
+ Examples:
712
+
713
+ ...
714
+ <generator>MirrorBrain/2.11</generator>
715
+ ...
716
+ <generator>MirrorManager/1.2.11</generator>
717
+ ...
718
+ <generator>metalinktools/0.3.6</generator>
719
+ ...
720
+ <generator>MetalinkEditor/1.2.0</generator>
721
+ ...
722
+
723
+ Although any token character MAY appear in an agent-version, this
724
+ token SHOULD only be used for a version identifier (i.e., successive
725
+ versions of the same agent SHOULD only differ in the agent-version
726
+ portion of the agent value).
727
+
728
+
729
+
730
+ Bryan, et al. Standards Track [Page 13]
731
+
732
+ RFC 5854 Metalink Download Description Format June 2010
733
+
734
+
735
+ 4.2.4. The "metalink:hash" Element
736
+
737
+ The "metalink:hash" element is a Text construct that conveys a
738
+ cryptographic hash for a file. All hashes are encoded in lowercase
739
+ hexadecimal format. Hashes are used to verify the integrity of a
740
+ complete file or portion of a file to determine if the file has been
741
+ transferred without any errors.
742
+
743
+ metalinkHash =
744
+ element metalink:hash {
745
+ attribute type { text }?,
746
+ text
747
+ }
748
+
749
+ Metalink Documents MAY contain one or multiples hashes of a complete
750
+ file. metalink:hash elements with a "type" attribute MUST contain a
751
+ hash of the complete file. In this example, both SHA-1 and SHA-256
752
+ hashes of the complete file are included.
753
+
754
+ ...
755
+ <hash type="sha-1">a97fcf6ba9358f8a6f62beee4421863d3e52b080</hash>
756
+ <hash type="sha-256">fc87941af7fd7f03e53b34af393f4c14923d74...</hash>
757
+ ...
758
+
759
+ Metalink Documents MAY also contain hashes for individual pieces of a
760
+ file. metalink:hash elements that are inside a metalink:pieces
761
+ container element have a hash for that specific piece or chunk of the
762
+ file, and are of the same hash type as the metalink:pieces element in
763
+ which they are contained. Metalink Documents MAY contain one or
764
+ multiple metalink:pieces container elements, if each "type" attribute
765
+ of metalink:pieces has a unique value.
766
+
767
+ metalink:hash elements without a "type" attribute MUST contain a hash
768
+ for that specific piece or chunk of the file and MUST be listed in
769
+ the same order as the corresponding pieces appear in the file,
770
+ starting at the beginning of the file. The size of the piece is
771
+ equal to the value of the "length" attribute of the metalink:pieces
772
+ element, apart from the last piece, which is the remainder. See
773
+ Section 4.1.3.2 for more information on the size of pieces.
774
+
775
+
776
+
777
+
778
+
779
+
780
+
781
+
782
+
783
+
784
+
785
+
786
+ Bryan, et al. Standards Track [Page 14]
787
+
788
+ RFC 5854 Metalink Download Description Format June 2010
789
+
790
+
791
+ In this example, SHA-1 and SHA-256 hashes of the complete file are
792
+ included, along with four SHA-1 piece hashes.
793
+
794
+ ...
795
+ <hash type="sha-1">a97fcf6ba9358f8a6f62beee4421863d3e52b080</hash>
796
+ <hash type="sha-256">fc87941af7fd7f03e53b34af393f4c14923d74...</hash>
797
+ <pieces length="1048576" type="sha-1">
798
+ <hash>d96b9a4b92a899c2099b7b31bddb5ca423bb9b30</hash>
799
+ <hash>10d68f4b1119014c123da2a0a6baf5c8a6d5ba1e</hash>
800
+ <hash>3e84219096435c34e092b17b70a011771c52d87a</hash>
801
+ <hash>67183e4c3ab892d3ebe8326b7d79eb62d077f487</hash>
802
+ </pieces>
803
+ ...
804
+
805
+ 4.2.4.1. The "type" Attribute
806
+
807
+ metalink:hash elements MUST have a "type" attribute, if and only if
808
+ it contains a hash of the complete file. The IANA registry named
809
+ "Hash Function Textual Names" defines values for hash types.
810
+ metalink:hash elements MUST NOT have a "type" attribute, if they are
811
+ inside a metalink:pieces container element. See Section 7.4 for
812
+ security implications.
813
+
814
+ 4.2.5. The "metalink:identity" Element
815
+
816
+ The "metalink:identity" element is a Text construct that conveys a
817
+ human-readable identity for a file. For example, the identity of
818
+ Firefox 3.5 would be "Firefox".
819
+
820
+ metalinkIdentity =
821
+ element metalink:identity {
822
+ metalinkTextConstruct
823
+ }
824
+
825
+ 4.2.6. The "metalink:language" Element
826
+
827
+ The "metalink:language" element is a Text construct that conveys a
828
+ code for the language of a file, per [RFC5646].
829
+
830
+ Multiple metalink:language elements are allowed, for instance, to
831
+ describe a file such as an binary installation program that provides
832
+ multiple language options, a movie with multiple language tracks, or
833
+ a document in multiple languages.
834
+
835
+ metalinkLanguage =
836
+ element metalink:language {
837
+ metalinkTextConstruct
838
+ }
839
+
840
+
841
+
842
+ Bryan, et al. Standards Track [Page 15]
843
+
844
+ RFC 5854 Metalink Download Description Format June 2010
845
+
846
+
847
+ 4.2.7. The "metalink:logo" Element
848
+
849
+ The "metalink:logo" element's content is an IRI reference [RFC3987]
850
+ that identifies an image that provides visual identification for a
851
+ file.
852
+
853
+ metalinkLogo =
854
+ element metalink:logo {
855
+ metalinkCommonAttributes,
856
+ (metalinkUri)
857
+ }
858
+
859
+ The image SHOULD have an aspect ratio of one (horizontal) to one
860
+ (vertical) and SHOULD be suitable for presentation at a small size.
861
+
862
+ 4.2.8. The "metalink:metaurl" Element
863
+
864
+ The "metalink:metaurl" element contains the IRI of a metadata file,
865
+ also known as a metainfo file, about a resource to download. For
866
+ example, this could be the IRI of a BitTorrent .torrent file, a
867
+ Metalink Document, or other type of metadata file. Note that the
868
+ information in the metalink:hash element does not apply to these
869
+ metadata files but to the files that are described by them.
870
+
871
+ metalinkMetaURL =
872
+ element metalink:metaurl {
873
+ metalinkCommonAttributes,
874
+ attribute priority { xsd:positiveInteger {
875
+ maxInclusive = "999999"}}?,
876
+ attribute mediatype { text },
877
+ attribute name { text }?,
878
+ (metalinkUri)
879
+ }
880
+
881
+ 4.2.8.1. The "priority" Attribute
882
+
883
+ metalink:metaurl elements MAY have a priority attribute. Values MUST
884
+ be positive integers between 1 and 999999. Lower values indicate a
885
+ higher priority. metalink:metaurl elements without a priority
886
+ attribute are considered to have the lowest priority, i.e., 999999.
887
+ The priority values of metalink:metaurl and metalink:url elements are
888
+ compared and those with the lowest values, starting with 1, are used
889
+ first. Multiple metalink:metaurl and metalink:url elements MAY have
890
+ the same priority, i.e., one BitTorrent .torrent file and three FTP
891
+ URIs could have priority="1". See also the "priority" attribute of
892
+ the metalink:url element.
893
+
894
+
895
+
896
+
897
+
898
+ Bryan, et al. Standards Track [Page 16]
899
+
900
+ RFC 5854 Metalink Download Description Format June 2010
901
+
902
+
903
+ 4.2.8.2. The "mediatype" Attribute
904
+
905
+ metalink:metaurl elements MUST have a "mediatype" attribute that
906
+ indicates the Multipurpose Internet Mail Extensions (MIME) media type
907
+ [RFC4288] of the metadata file available at the IRI. In the case of
908
+ BitTorrent as specified in [BITTORRENT], the value "torrent" is
909
+ REQUIRED. Types without "/" are reserved. Currently, "torrent" is
910
+ the only reserved value.
911
+
912
+ Values for this attribute are defined below in ABNF notation
913
+ [RFC5234].
914
+
915
+ media-type = (type-name "/" subtype-name) / media-reserved
916
+ media-reserved = "torrent"
917
+ type-name = <Defined in Section 4.2 of RFC 4288>
918
+ subtype-name = <Defined in Section 4.2 of RFC 4288>
919
+
920
+ 4.2.8.3. The "name" Attribute
921
+
922
+ metalink:metaurl elements MAY have a "name" attribute that indicates
923
+ a specific file in a BitTorrent .torrent file or a Metalink Document
924
+ that describes multiple files.
925
+
926
+ Directory information can also be contained in a "path/file" format
927
+ only, as in:
928
+
929
+ <metaurl
930
+ mediatype="torrent" name="debian-amd64/sarge/Contents-amd64.gz">
931
+
932
+ In this example, a file named "Contents-amd64.gz" is indicated, in a
933
+ "debian-amd64/sarge/" subdirectory. The path MUST NOT contain any
934
+ directory traversal directives or information. The path MUST be
935
+ relative. The path MUST NOT begin with a "/", "./", or "../";
936
+ contain "/../"; or end with "/..".
937
+
938
+ 4.2.9. The "metalink:origin" Element
939
+
940
+ The "metalink:origin" element is an IRI where the Metalink Document
941
+ was originally published. If the dynamic attribute of metalink:
942
+ origin is "true", then updated versions of the Metalink can be found
943
+ at this IRI.
944
+
945
+ metalinkOrigin =
946
+ element metalink:origin {
947
+ metalinkCommonAttributes,
948
+ attribute dynamic { xsd:boolean }?,
949
+ (metalinkUri)
950
+ }
951
+
952
+
953
+
954
+ Bryan, et al. Standards Track [Page 17]
955
+
956
+ RFC 5854 Metalink Download Description Format June 2010
957
+
958
+
959
+ 4.2.9.1. The "dynamic" Attribute
960
+
961
+ The metalink:origin element MAY have a "dynamic" attribute, set to
962
+ "true" or "false", which tells if a Metalink at the origin IRI will
963
+ contain dynamic updated information or if it is static and not likely
964
+ to be updated.
965
+
966
+ 4.2.10. The "metalink:os" Element
967
+
968
+ The "metalink:os" element is a Text construct that conveys an
969
+ Operating System that a file is suitable for. The IANA registry
970
+ named "Operating System Names" defines values for OS types.
971
+
972
+ metalinkOS =
973
+ element metalink:os {
974
+ metalinkTextConstruct
975
+ }
976
+
977
+ 4.2.11. The "metalink:published" Element
978
+
979
+ The "metalink:published" element is a Date construct indicating an
980
+ instant in time associated with an event early in the life cycle of
981
+ the entry.
982
+
983
+ metalinkPublished =
984
+ element metalink:published {
985
+ metalinkDateConstruct
986
+ }
987
+
988
+ Typically, metalink:published will be associated with the initial
989
+ creation or first availability of the resource. The metalink:updated
990
+ element is used when a Metalink Document has been updated after
991
+ initial publication.
992
+
993
+ 4.2.12. The "metalink:publisher" Element
994
+
995
+ The "metalink:publisher" element contains a human-readable group or
996
+ other entity that has published the file described in the Metalink
997
+ Document and an IRI for more information.
998
+
999
+ metalinkPublisher =
1000
+ element metalink:publisher {
1001
+ metalinkCommonAttributes,
1002
+ attribute name { text },
1003
+ attribute url { metalinkUri }?
1004
+ }
1005
+
1006
+
1007
+
1008
+
1009
+
1010
+ Bryan, et al. Standards Track [Page 18]
1011
+
1012
+ RFC 5854 Metalink Download Description Format June 2010
1013
+
1014
+
1015
+ 4.2.12.1. The "name" Attribute
1016
+
1017
+ The metalink:publisher element MUST have a "name" attribute that
1018
+ indicates the human-readable name of the publisher.
1019
+
1020
+ 4.2.12.2. The "url" Attribute
1021
+
1022
+ The metalink:publisher element MAY have a "url" attribute whose value
1023
+ MUST be an IRI reference [RFC3987].
1024
+
1025
+ 4.2.13. The "metalink:signature" Element
1026
+
1027
+ The "metalink:signature" element is a Text construct that conveys a
1028
+ digital signature for a file described in a Metalink Document.
1029
+ Digital signatures verify that a file is from the entity that has
1030
+ signed it.
1031
+
1032
+ Support in Metalink Processors for digital signatures included in
1033
+ this element is OPTIONAL. Note that the signing of Metalink
1034
+ Documents, as opposed to a digital signature of a file described in a
1035
+ Metalink Document, is covered in Section 7.1.
1036
+
1037
+ metalinkSignature =
1038
+ element metalink:signature {
1039
+ attribute mediatype { text },
1040
+ metalinkTextConstruct
1041
+ }
1042
+
1043
+ Example with an OpenPGP signature [RFC4880]:
1044
+
1045
+ <signature mediatype="application/pgp-signature">
1046
+ -----BEGIN PGP SIGNATURE-----
1047
+ Version: GnuPG v1.4.10 (GNU/Linux)
1048
+
1049
+ iEYEABECAAYFAkrxdXQACgkQeOEcayedXJHqFwCfd1p/HhRf/iDvYhvFbTrQPz+p
1050
+ p3oAoO9lKHoOqOE0EMB3zmMcLoYUrNkg
1051
+ =ggAf
1052
+ -----END PGP SIGNATURE-----
1053
+ </signature>
1054
+
1055
+ 4.2.13.1. The "mediatype" Attribute
1056
+
1057
+ metalink:signature elements MUST have a "mediatype" attribute that
1058
+ indicates the MIME media type [RFC4288] of the included digital
1059
+ signature.
1060
+
1061
+ Values for this attribute are defined below in ABNF notation
1062
+ [RFC5234].
1063
+
1064
+
1065
+
1066
+ Bryan, et al. Standards Track [Page 19]
1067
+
1068
+ RFC 5854 Metalink Download Description Format June 2010
1069
+
1070
+
1071
+ media-type = type-name "/" subtype-name
1072
+ type-name = <Defined in Section 4.2 of RFC 4288>
1073
+ subtype-name = <Defined in Section 4.2 of RFC 4288>
1074
+
1075
+ 4.2.14. The "metalink:size" Element
1076
+
1077
+ The "metalink:size" element indicates the length of the linked
1078
+ content in octets. This is the content length of the representation
1079
+ returned when the IRI is mapped to a URI and dereferenced. Note that
1080
+ the "metalink:size" element MUST override the actual content length
1081
+ of the representation as reported by the underlying protocol, and
1082
+ those that do not match MUST be discarded by Metalink Processors.
1083
+ This value MUST be a non-negative integer.
1084
+
1085
+ metalinkSize =
1086
+ element metalink:size {
1087
+ xsd:nonNegativeInteger
1088
+ }
1089
+
1090
+ 4.2.15. The "metalink:updated" Element
1091
+
1092
+ The "metalink:updated" element is a Date construct indicating the
1093
+ most recent instant in time when a Metalink was modified in a way the
1094
+ publisher considers significant. Therefore, not all modifications
1095
+ necessarily result in a changed metalink:updated value.
1096
+
1097
+ metalinkUpdated =
1098
+ element metalink:updated {
1099
+ metalinkDateConstruct
1100
+ }
1101
+
1102
+ Publishers MAY change the value of this element over time.
1103
+
1104
+ 4.2.16. The "metalink:url" Element
1105
+
1106
+ The "metalink:url" element contains a file IRI. Most metalink:file
1107
+ container elements will contain multiple metalink:url elements, and
1108
+ each one SHOULD be a valid alternative to download the same file.
1109
+
1110
+ The metalink:url elements SHOULD be resolvable and, if resolvable,
1111
+ SHOULD lead to identical files.
1112
+
1113
+ Metalink Processors MUST filter out invalid files obtained from
1114
+ "metalink:url" elements by using information in the metalink:size
1115
+ element and metalink:hash elements.
1116
+
1117
+
1118
+
1119
+
1120
+
1121
+
1122
+ Bryan, et al. Standards Track [Page 20]
1123
+
1124
+ RFC 5854 Metalink Download Description Format June 2010
1125
+
1126
+
1127
+ metalinkURL =
1128
+ element metalink:url {
1129
+ metalinkCommonAttributes,
1130
+ attribute location { xsd:string {
1131
+ minLength = "2" maxLength="2"}
1132
+ }?,
1133
+ attribute priority { xsd:positiveInteger {
1134
+ maxInclusive = "999999"}}?,
1135
+ (metalinkUri)
1136
+ }
1137
+
1138
+ 4.2.16.1. The "priority" Attribute
1139
+
1140
+ metalink:url elements MAY have a priority attribute. Values MUST be
1141
+ positive integers between 1 and 999999. Lower values indicate a
1142
+ higher priority. metalink:url elements without a priority attribute
1143
+ are considered to have the lowest priority, i.e., 999999. Multiple
1144
+ metalink:url elements can have the same priority, i.e., ten different
1145
+ mirrors could have priority="1".
1146
+
1147
+ 4.2.16.2. The "location" Attribute
1148
+
1149
+ metalink:url elements MAY have a "location" attribute, which is a
1150
+ [ISO3166-1] alpha-2 two letter country code for the geographical
1151
+ location of the physical server an IRI is used to access.
1152
+
1153
+ 4.2.17. The "metalink:version" Element
1154
+
1155
+ The "metalink:version" element is a Text construct that conveys a
1156
+ human-readable version for a file. The version of Firefox 3.5 would
1157
+ be "3.5".
1158
+
1159
+ metalinkVersion =
1160
+ element metalink:version {
1161
+ metalinkTextConstruct
1162
+ }
1163
+
1164
+ 5. Extending Metalink
1165
+
1166
+ 5.1. Extensions from Non-Metalink Vocabularies
1167
+
1168
+ This specification describes Metalink's XML vocabulary.
1169
+
1170
+ 5.2. Extensions to the Metalink Vocabulary
1171
+
1172
+ The Metalink namespace is reserved for future forward-compatible
1173
+ revisions of Metalink. Future versions of this specification could
1174
+ add new elements and attributes to the Metalink markup vocabulary.
1175
+
1176
+
1177
+
1178
+ Bryan, et al. Standards Track [Page 21]
1179
+
1180
+ RFC 5854 Metalink Download Description Format June 2010
1181
+
1182
+
1183
+ Software written to conform to this version of the specification will
1184
+ not be able to process such markup correctly and, in fact, will not
1185
+ be able to distinguish it from markup error. For the purposes of
1186
+ this discussion, unrecognized markup from the Metalink vocabulary
1187
+ will be considered "foreign markup".
1188
+
1189
+ 5.3. Processing Foreign Markup
1190
+
1191
+ Metalink Processors that encounter foreign markup in a location that
1192
+ is legal according to this specification MUST ignore such foreign
1193
+ markup, in particular they MUST NOT stop processing or signal an
1194
+ error. It might be the case that the Metalink Processor is able to
1195
+ process the foreign markup correctly and does so. Otherwise, such
1196
+ markup is termed "unknown foreign markup".
1197
+
1198
+ When unknown foreign markup is encountered as a child of metalink:
1199
+ file, metalink:metalink, Metalink Processors MAY bypass the markup
1200
+ and any textual content and MUST NOT change their behavior as a
1201
+ result of the markup's presence.
1202
+
1203
+ 5.4. Extension Elements
1204
+
1205
+ Metalink allows foreign markup anywhere in a Metalink document,
1206
+ except where it is explicitly forbidden. Child elements of metalink:
1207
+ file and metalink:metalink are considered Metadata elements and are
1208
+ described below. The role of other foreign markup is undefined by
1209
+ this specification.
1210
+
1211
+ 5.4.1. Simple Extension Elements
1212
+
1213
+ A Simple Extension element MUST NOT have any attributes or child
1214
+ elements. The element MAY contain character data or be empty.
1215
+ Simple Extension elements are not Language-Sensitive.
1216
+
1217
+ simpleExtensionElement =
1218
+ element * - metalink:* {
1219
+ text
1220
+ }
1221
+
1222
+ The element can be interpreted as a simple property (or name/value
1223
+ pair) of the parent element that encloses it. The pair consisting of
1224
+ the namespace URI of the element and the local name of the element
1225
+ can be interpreted as the name of the property. The character data
1226
+ content of the element can be interpreted as the value of the
1227
+ property. If the element is empty, then the property value can be
1228
+ interpreted as an empty string.
1229
+
1230
+
1231
+
1232
+
1233
+
1234
+ Bryan, et al. Standards Track [Page 22]
1235
+
1236
+ RFC 5854 Metalink Download Description Format June 2010
1237
+
1238
+
1239
+ 5.4.2. Structured Extension Elements
1240
+
1241
+ The root element of a Structured Extension element MUST have at least
1242
+ one attribute or child element. It MAY have attributes, it MAY
1243
+ contain well-formed XML content (including character data), or it MAY
1244
+ be empty. Structured Extension elements are Language-Sensitive.
1245
+
1246
+ structuredExtensionElement =
1247
+ element * - metalink:* {
1248
+ (attribute * { text }+,
1249
+ (text|anyElement)*)
1250
+ | (attribute * { text }*,
1251
+ (text?, anyElement+, (text|anyElement)*))
1252
+ }
1253
+
1254
+ The structure of a Structured Extension element, including the order
1255
+ of its child elements, could be significant.
1256
+
1257
+ This specification does not provide an interpretation of a Structured
1258
+ Extension element. The syntax of the XML contained in the element
1259
+ (and an interpretation of how the element relates to its containing
1260
+ element) is defined by the specification of the Metalink extension.
1261
+
1262
+ 6. IANA Considerations
1263
+
1264
+ 6.1. XML Namespace Registration
1265
+
1266
+ This document makes use of the XML registry specified in [RFC3688].
1267
+ Accordingly, IANA has made the following registration:
1268
+
1269
+ Registration request for the Metalink namespace:
1270
+
1271
+ URI: urn:ietf:params:xml:ns:metalink
1272
+
1273
+ Registrant Contact: See the "Authors' Addresses" section of this
1274
+ document.
1275
+
1276
+ XML: None. Namespace URIs do not represent an XML specification.
1277
+
1278
+ 6.2. application/metalink4+xml MIME type
1279
+
1280
+ A Metalink Document, when serialized as XML 1.0, can be identified
1281
+ with the following media type:
1282
+
1283
+ Type name: application
1284
+
1285
+ Subtype name: metalink4+xml
1286
+
1287
+
1288
+
1289
+
1290
+ Bryan, et al. Standards Track [Page 23]
1291
+
1292
+ RFC 5854 Metalink Download Description Format June 2010
1293
+
1294
+
1295
+ Required parameters: None.
1296
+
1297
+ Optional parameters:
1298
+
1299
+ "charset": This parameter has semantics identical to the charset
1300
+ parameter of the "application/xml" media type as specified in
1301
+ [RFC3023].
1302
+
1303
+ Encoding considerations: Identical to those of "application/xml" as
1304
+ described in [RFC3023], Section 3.2.
1305
+
1306
+ Security considerations: As defined in this specification.
1307
+
1308
+ In addition, as this media type uses the "+xml" convention, it
1309
+ shares the same security considerations as described in [RFC3023],
1310
+ Section 10.
1311
+
1312
+ Interoperability considerations: There are no known interoperability
1313
+ issues.
1314
+
1315
+ Published specification: This specification.
1316
+
1317
+ Applications that use this media type: File transfer applications.
1318
+
1319
+ Additional information:
1320
+
1321
+ Magic number(s): None.
1322
+
1323
+ File extension: .meta4
1324
+
1325
+ Macintosh File Type code: TEXT
1326
+
1327
+ Person and email address to contact for further information:
1328
+ Anthony Bryan <anthonybryan@gmail.com>
1329
+
1330
+ Intended usage: COMMON
1331
+
1332
+ Restrictions on usage: None.
1333
+
1334
+ Author: Anthony Bryan <anthonybryan@gmail.com>
1335
+
1336
+ Change controller: IESG
1337
+
1338
+ 7. Security Considerations
1339
+
1340
+ Because Metalink is an XML-based format, existing XML security
1341
+ mechanisms can be used to secure its content.
1342
+
1343
+
1344
+
1345
+
1346
+ Bryan, et al. Standards Track [Page 24]
1347
+
1348
+ RFC 5854 Metalink Download Description Format June 2010
1349
+
1350
+
1351
+ Publishers of Metalink Documents may have sound reasons for signing
1352
+ otherwise-unprotected content. For example, a merchant might
1353
+ digitally sign a Metalink that lists a file download to verify its
1354
+ origin. Other merchants may wish to sign and encrypt Metalink
1355
+ Documents that list digital songs that have been purchased. Many
1356
+ other examples are conceivable.
1357
+
1358
+ Publishers are encouraged to offer Metalink documents via
1359
+ authenticated HTTP under Transport Layer Security (TLS) as specified
1360
+ in [RFC2818]. The choice of a secure content layer rests entirely
1361
+ with the content providers.
1362
+
1363
+ Publishers are also encouraged to include digital signatures of the
1364
+ files within the Metalink Documents, if they are available, as
1365
+ described in Section 4.2.13.
1366
+
1367
+ Normally, a publisher is in the best position to know how strong the
1368
+ protective signing ought to be on their content. Thus, a publisher
1369
+ can choose weak or strong cryptography, and a Metalink Processor
1370
+ SHOULD normally accept that. There are potential applications where
1371
+ the Metalink Processor chooses to reject weak cryptography, but that
1372
+ is not envisioned as the common use case.
1373
+
1374
+ 7.1. Digital Signatures
1375
+
1376
+ The root of a Metalink Document (i.e., metalink:metalink) or any
1377
+ metalink:file element MAY have an Enveloped Signature, as described
1378
+ by XML-Signature and Syntax Processing [REC-xmldsig-core].
1379
+
1380
+ Although signing and verifying signatures are both OPTIONAL, an
1381
+ implementation that supports either feature SHOULD implement RSA with
1382
+ a minimum key size of 2048 with SHA-256.
1383
+
1384
+ Metalink Processors that support verifying signatures MUST reject
1385
+ Metalink Documents with invalid signatures.
1386
+
1387
+ Metalink Processors MUST NOT reject a Metalink Document containing
1388
+ such a signature because they are not capable of verifying it; they
1389
+ MUST continue processing and MAY inform the user of their failure to
1390
+ validate the signature.
1391
+
1392
+ In other words, the presence of an element with the namespace URI
1393
+ "http://www.w3.org/2000/09/xmldsig#" and a local name of "Signature"
1394
+ as a child of the document element MUST NOT cause a Metalink
1395
+ Processor to fail merely because of its presence.
1396
+
1397
+ Other elements in a Metalink Document MUST NOT be signed unless their
1398
+ definitions explicitly specify such a capability.
1399
+
1400
+
1401
+
1402
+ Bryan, et al. Standards Track [Page 25]
1403
+
1404
+ RFC 5854 Metalink Download Description Format June 2010
1405
+
1406
+
1407
+ Section 6.5.1 of [REC-xmldsig-core] requires support for Canonical
1408
+ XML [REC-xml-c14n]. However, many - implementers do not use it
1409
+ because signed XML documents - enclosed in other XML documents have
1410
+ their signatures - broken. Thus, Metalink Processors that verify
1411
+ signed Metalink Documents MUST be able to canonicalize with the
1412
+ exclusive XML canonicalization method identified by the URI
1413
+ "http://www.w3.org/2001/10/xml-exc-c14n#", as specified in Exclusive
1414
+ XML Canonicalization [REC-xml-exc-c14n].
1415
+
1416
+ Section 4.4.2 of [REC-xmldsig-core] requires support for Digital
1417
+ Signature Algorithm (DSA) signatures and recommends support for RSA
1418
+ signatures. However, because of the much greater popularity in the
1419
+ market of RSA versus DSA, Metalink Processors that verify signed
1420
+ Metalink Documents MUST be able to verify RSA signatures, but do not
1421
+ need be able to verify DSA signatures. Due to security issues that
1422
+ can arise if the keying material for message authentication code
1423
+ (MAC) authentication is not handled properly, Metalink Documents
1424
+ SHOULD NOT use MACs for signatures.
1425
+
1426
+ 7.2. URIs and IRIs
1427
+
1428
+ Metalink Processors handle URIs and IRIs. See Section 7 of [RFC3986]
1429
+ and Section 8 of [RFC3987] for security considerations related to
1430
+ their handling and use.
1431
+
1432
+ 7.3. Spoofing
1433
+
1434
+ There is potential for spoofing attacks where the attacker publishes
1435
+ Metalink Documents with false information. Malicious publishers
1436
+ might create Metalink Documents containing inaccurate information
1437
+ anywhere in the document. Unaware downloaders could be deceived into
1438
+ downloading malicious or worthless content. Malicious publishers
1439
+ could attempt a distributed denial-of-service attack by inserting
1440
+ unrelated IRIs into Metalink Documents.
1441
+
1442
+ Digital signatures address the issue of spoofing.
1443
+
1444
+ 7.4. Cryptographic Hashes
1445
+
1446
+ Currently, some of the hash types defined in the IANA registry named
1447
+ "Hash Function Textual Names" are considered insecure. These include
1448
+ the whole Message Digest family of algorithms that are not suitable
1449
+ for cryptographically strong verification. Malicious parties could
1450
+ provide files that appear to be identical to another file because of
1451
+ a collision, i.e., the weak cryptographic hashes of the intended file
1452
+ and a substituted malicious file could match.
1453
+
1454
+
1455
+
1456
+
1457
+
1458
+ Bryan, et al. Standards Track [Page 26]
1459
+
1460
+ RFC 5854 Metalink Download Description Format June 2010
1461
+
1462
+
1463
+ Metalink Generators and Processors MUST support "sha-256", which is
1464
+ SHA-256, as specified in [FIPS-180-3], and MAY support stronger
1465
+ hashes.
1466
+
1467
+ If a Metalink Document contains hashes, it SHOULD include "sha-256",
1468
+ which is SHA-256, or stronger. It MAY also include other hashes from
1469
+ the IANA registry named "Hash Function Textual Names".
1470
+
1471
+ 8. References
1472
+
1473
+ 8.1. Normative References
1474
+
1475
+ [BITTORRENT] Cohen, B., "The BitTorrent Protocol Specification",
1476
+ BITTORRENT 11031, February 2008,
1477
+ <http://www.bittorrent.org/beps/bep_0003.html>.
1478
+
1479
+ [FIPS-180-3] National Institute of Standards and Technology (NIST),
1480
+ "Secure Hash Standard (SHS)", FIPS PUB 180-3,
1481
+ October 2008.
1482
+
1483
+ [ISO3166-1] International Organization for Standardization, "ISO
1484
+ 3166- 1:2006. Codes for the representation of names of
1485
+ countries and their subdivisions -- Part 1: Country
1486
+ codes", November 2006.
1487
+
1488
+ [REC-xml] Yergeau, F., Paoli, J., Bray, T., Sperberg-McQueen, C.,
1489
+ and E. Maler, "Extensible Markup Language (XML) 1.0
1490
+ (Fifth Edition)", W3C REC-xml-20081126, November 2008,
1491
+ <http://www.w3.org/TR/2008/REC-xml-20081126/>.
1492
+
1493
+ [REC-xml-c14n]
1494
+ Boyer, J., "Canonical XML Version 1.0", W3C REC REC-xml-
1495
+ c14n-20010315, March 2001,
1496
+ <http://www.w3.org/TR/2001/REC-xml-c14n-20010315>.
1497
+
1498
+ [REC-xml-exc-c14n]
1499
+ Eastlake, D., Boyer, J., and J. Reagle, "Exclusive XML
1500
+ Canonicalization Version 1.0", W3C REC REC-xml-exc-c14n-
1501
+ 20020718, July 2002,
1502
+ <http://www.w3.org/TR/2002/REC-xml-exc-c14n-20020718/>.
1503
+
1504
+ [REC-xml-infoset]
1505
+ Cowan, J. and R. Tobin, "XML Information Set (Second
1506
+ Edition)", W3C REC-xml-infoset-20040204, February 2004,
1507
+ <http://www.w3.org/TR/2004/REC-xml-infoset-20040204/>.
1508
+
1509
+
1510
+
1511
+
1512
+
1513
+
1514
+ Bryan, et al. Standards Track [Page 27]
1515
+
1516
+ RFC 5854 Metalink Download Description Format June 2010
1517
+
1518
+
1519
+ [REC-xml-names]
1520
+ Hollander, D., Bray, T., Tobin, R., and A. Layman,
1521
+ "Namespaces in XML 1.0 (Third Edition)", W3C REC-xml-
1522
+ names-20091208, December 2009,
1523
+ <http://www.w3.org/TR/2009/REC-xml-names-20091208/>.
1524
+
1525
+ [REC-xmldsig-core]
1526
+ Solo, D., Reagle, J., and D. Eastlake, "XML-Signature
1527
+ Syntax and Processing (Second Edition)",
1528
+ W3C REC-xmldsig- core-20080610, June 2008,
1529
+ <http://www.w3.org/TR/2008/REC-xmldsig-core-20080610/>.
1530
+
1531
+ [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
1532
+ Requirement Levels", BCP 14, RFC 2119, March 1997.
1533
+
1534
+ [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000.
1535
+
1536
+ [RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media
1537
+ Types", RFC 3023, January 2001.
1538
+
1539
+ [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet:
1540
+ Timestamps", RFC 3339, July 2002.
1541
+
1542
+ [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
1543
+ Resource Identifier (URI): Generic Syntax", STD 66,
1544
+ RFC 3986, January 2005.
1545
+
1546
+ [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource
1547
+ Identifiers (IRIs)", RFC 3987, January 2005.
1548
+
1549
+ [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and
1550
+ Registration Procedures", BCP 13, RFC 4288,
1551
+ December 2005.
1552
+
1553
+ [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for
1554
+ Syntax Specifications: ABNF", STD 68, January 2008.
1555
+
1556
+ [RFC5646] Phillips, A. and M. Davis, "Tags for Identifying
1557
+ Languages", BCP 47, RFC 5646, September 2009.
1558
+
1559
+ 8.2. Informative References
1560
+
1561
+ [ISO.8601.1988]
1562
+ International Organization for Standardization, "Data
1563
+ elements and interchange formats - Information
1564
+ interchange - Representation of dates and times",
1565
+ ISO Standard 8601, June 1988.
1566
+
1567
+
1568
+
1569
+
1570
+ Bryan, et al. Standards Track [Page 28]
1571
+
1572
+ RFC 5854 Metalink Download Description Format June 2010
1573
+
1574
+
1575
+ [NOTE-datetime-19980827]
1576
+ Wolf, M. and C. Wicksteed, "Date and Time Formats",
1577
+ W3C NOTE-datetime-19980827, August 1998,
1578
+ <http://www.w3.org/TR/1998/NOTE-datetime-19980827>.
1579
+
1580
+ [REC-xmlschema-2-20041028]
1581
+ Malhotra, A. and P. Biron, "XML Schema Part 2: Datatypes
1582
+ Second Edition", W3C REC-xmlschema-2-20041028,
1583
+ October 2004,
1584
+ <http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/>.
1585
+
1586
+ [RELAX-NG] Clark, J., "RELAX NG Compact Syntax", December 2001,
1587
+ <http ://www.oasis-open.org/committees/relax-ng/
1588
+ compact-20021121.html>.
1589
+
1590
+ [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
1591
+ January 2004.
1592
+
1593
+ [RFC4287] Nottingham, M. and R. Sayre, "The Atom Syndication
1594
+ Format", RFC 4287, December 2005.
1595
+
1596
+ [RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and
1597
+ R. Thayer, "OpenPGP Message Format", RFC 4880,
1598
+ November 2007.
1599
+
1600
+
1601
+
1602
+
1603
+
1604
+
1605
+
1606
+
1607
+
1608
+
1609
+
1610
+
1611
+
1612
+
1613
+
1614
+
1615
+
1616
+
1617
+
1618
+
1619
+
1620
+
1621
+
1622
+
1623
+
1624
+
1625
+
1626
+ Bryan, et al. Standards Track [Page 29]
1627
+
1628
+ RFC 5854 Metalink Download Description Format June 2010
1629
+
1630
+
1631
+ Appendix A. Acknowledgements and Contributors
1632
+
1633
+ The layout and shape of this document relies heavily on work
1634
+ pioneered in the Atom Syndication Format as specified in [RFC4287].
1635
+
1636
+ The content and concepts within are a product of the Metalink
1637
+ community. Key contributors provided early implementations: A. Bram
1638
+ Neijt, Hampus Wessman, Darius Liktorius, Manuel Subredu, Michael
1639
+ Burford, Giorgio Maone, Nils Maier, Max Velasques, Manolo Valdes,
1640
+ Hayden Legendre, Frederick Cheung, Rene Leonhardt, Per Oyvind
1641
+ Karlsen, Matt Domsch, Yazsoft, KGet developers, Free Download Manager
1642
+ developers, Orbit developers, Arne Babenhauserheide, Mathias
1643
+ Berchtold, Xienzhenyu and TheWorld Browser developers, Xi Software,
1644
+ Agostino Russo, and James Antill.
1645
+
1646
+ The Metalink community has dozens of contributors who contributed to
1647
+ the evolution of Metalink or proposed ideas and wording for this
1648
+ document, including:
1649
+
1650
+ Paul Burkhead, Kristian Weston, Nicolas Alvarez, Urs Wolfer, Bridget
1651
+ and Ethan Fletcher, Patrick Ruckstuhl, Sebastien Willemijns, Micah
1652
+ Cowan, Ruben Kerkhof, Danny Ayers, Nick Dominguez, Gary Zellerbach,
1653
+ James Clark, Daniel Stenberg, John and Sandra Sowder, Salvatore
1654
+ Musumeci, Steve Eshelman, Lucas Hewett, Ryan Cronin, Dave Winquist,
1655
+ Bob Denison, Wes Shelton, Josh Colbert, Steve Kleisath, Chad Neptune,
1656
+ Derick Cordoba, Nick Carrabba, Chris Carrabba, Erin Solari, Ryan
1657
+ Alexander, Tom Mainville, Janie Wargo, Jason Hansen, Tim Bray, Dan
1658
+ Brickley, Markus Hofmann, Dan Connolly, Tim Berners-Lee, Louis
1659
+ Suarez-Potts, Ross Smith, Jeff Covey, Ed Lee, Shawn Wilsher, Mike
1660
+ Connor, Johan Svedberg, Kees Cook, Dedric Carter, and Debi Goulding.
1661
+ We also thank the Anthony Family, the Bryan Family, Juanita Anthony,
1662
+ and Zimmy Bryan.
1663
+
1664
+ Special thanks to Eran Hammer-Lahav, document shepherd, and Lisa
1665
+ Dusseault, Area Director. We also thank the following contributors
1666
+ for assistance and review: Mark Nottingham, Peter Saint-Andre, Julian
1667
+ Reschke, Chris Newman, Ian Macfarlane, Dave Cridland, Barry Leiba,
1668
+ Uri Blumenthal, Paul Hoffman, Felix Sasaki, Matthias Fuchs, Mark
1669
+ Baker, Scott Cantor, Brian Carpenter, Alexey Melnikov, Lars Eggert,
1670
+ Pasi Eronen, Tim Polk, Dan Romascanu, and Bjoern Hoehrmann.
1671
+
1672
+ Peter Poeml wishes to acknowledge the support of SUSE Linux Products
1673
+ GmbH / Novell Inc., where he was employed during much of the work on
1674
+ this document.
1675
+
1676
+ This document is dedicated to Sonora Bryan.
1677
+
1678
+
1679
+
1680
+
1681
+
1682
+ Bryan, et al. Standards Track [Page 30]
1683
+
1684
+ RFC 5854 Metalink Download Description Format June 2010
1685
+
1686
+
1687
+ Appendix B. RELAX NG Compact Schema
1688
+
1689
+ This appendix is informative.
1690
+
1691
+ The Relax NG schema explicitly excludes elements in the Metalink
1692
+ namespace that are not defined in this revision of the specification.
1693
+ Requirements for Metalink Processors encountering such markup are
1694
+ given in Sections 5.2 and 5.3.
1695
+
1696
+ # -*- rnc -*-
1697
+ # RELAX NG Compact Syntax Grammar for the
1698
+ # Metalink Format Specification Version 4
1699
+ # Based on RFC 4287 schema
1700
+
1701
+ namespace local = ""
1702
+ namespace metalink = "urn:ietf:params:xml:ns:metalink"
1703
+ namespace xsd = "http://www.w3.org/2001/XMLSchema"
1704
+
1705
+ # Common attributes
1706
+
1707
+ metalinkCommonAttributes =
1708
+ attribute xml:lang { metalinkLanguageTag }?,
1709
+ undefinedAttribute*
1710
+
1711
+ # Text Constructs
1712
+
1713
+ metalinkTextConstruct =
1714
+ metalinkCommonAttributes,
1715
+ text
1716
+
1717
+ # Date Construct
1718
+
1719
+ metalinkDateConstruct =
1720
+ metalinkCommonAttributes,
1721
+ xsd:dateTime
1722
+
1723
+ start = metalinkMetalink
1724
+
1725
+ metalinkMetalink =
1726
+ element metalink:metalink {
1727
+ metalinkCommonAttributes,
1728
+ (metalinkFile+
1729
+ & metalinkGenerator?
1730
+ & metalinkOrigin?
1731
+ & metalinkPublished?
1732
+ & metalinkUpdated?
1733
+ & extensionElement*)
1734
+ }
1735
+
1736
+
1737
+
1738
+ Bryan, et al. Standards Track [Page 31]
1739
+
1740
+ RFC 5854 Metalink Download Description Format June 2010
1741
+
1742
+
1743
+ metalinkFile =
1744
+ element metalink:file {
1745
+ metalinkCommonAttributes,
1746
+ attribute name { text },
1747
+ (metalinkCopyright?
1748
+ & metalinkDescription?
1749
+ & metalinkHash*
1750
+ & metalinkIdentity?
1751
+ & metalinkLanguage*
1752
+ & metalinkLogo?
1753
+ & metalinkMetaURL*
1754
+ & metalinkOS*
1755
+ & metalinkPieces*
1756
+ & metalinkPublisher?
1757
+ & metalinkSignature?
1758
+ & metalinkSize?
1759
+ & metalinkURL*
1760
+ & metalinkVersion?
1761
+ & extensionElement*)
1762
+ }
1763
+
1764
+ metalinkPieces =
1765
+ element metalink:pieces {
1766
+ attribute length { xsd:positiveInteger },
1767
+ attribute type { text },
1768
+ metalinkHash+
1769
+ }
1770
+
1771
+ metalinkCopyright =
1772
+ element metalink:copyright {
1773
+ metalinkTextConstruct
1774
+ }
1775
+
1776
+ metalinkDescription =
1777
+ element metalink:description {
1778
+ metalinkTextConstruct
1779
+ }
1780
+
1781
+ metalinkGenerator =
1782
+ element metalink:generator {
1783
+ metalinkTextConstruct
1784
+ }
1785
+
1786
+ metalinkHash =
1787
+ element metalink:hash {
1788
+ attribute type { text }?,
1789
+ text
1790
+ }
1791
+
1792
+
1793
+
1794
+ Bryan, et al. Standards Track [Page 32]
1795
+
1796
+ RFC 5854 Metalink Download Description Format June 2010
1797
+
1798
+
1799
+ metalinkIdentity =
1800
+ element metalink:identity {
1801
+ metalinkTextConstruct
1802
+ }
1803
+
1804
+ metalinkLanguage =
1805
+ element metalink:language {
1806
+ metalinkTextConstruct
1807
+ }
1808
+
1809
+ metalinkLogo =
1810
+ element metalink:logo {
1811
+ metalinkCommonAttributes,
1812
+ (metalinkUri)
1813
+ }
1814
+
1815
+ metalinkMetaURL =
1816
+ element metalink:metaurl {
1817
+ metalinkCommonAttributes,
1818
+ attribute priority { xsd:positiveInteger {
1819
+ maxInclusive = "999999"}}?,
1820
+ attribute mediatype { text },
1821
+ attribute name { text }?,
1822
+ (metalinkUri)
1823
+ }
1824
+
1825
+ metalinkOrigin =
1826
+ element metalink:origin {
1827
+ metalinkCommonAttributes,
1828
+ attribute dynamic { xsd:boolean }?,
1829
+ (metalinkUri)
1830
+ }
1831
+
1832
+ metalinkOS =
1833
+ element metalink:os {
1834
+ metalinkTextConstruct
1835
+ }
1836
+
1837
+ metalinkPublished =
1838
+ element metalink:published {
1839
+ metalinkDateConstruct
1840
+ }
1841
+
1842
+ metalinkPublisher =
1843
+ element metalink:publisher {
1844
+ metalinkCommonAttributes,
1845
+ attribute name { text },
1846
+ attribute url { metalinkUri }?
1847
+
1848
+
1849
+
1850
+ Bryan, et al. Standards Track [Page 33]
1851
+
1852
+ RFC 5854 Metalink Download Description Format June 2010
1853
+
1854
+
1855
+ }
1856
+
1857
+ metalinkSignature =
1858
+ element metalink:signature {
1859
+ attribute mediatype { text },
1860
+ metalinkTextConstruct
1861
+ }
1862
+
1863
+ metalinkSize =
1864
+ element metalink:size {
1865
+ xsd:nonNegativeInteger
1866
+ }
1867
+
1868
+ metalinkUpdated =
1869
+ element metalink:updated {
1870
+ metalinkDateConstruct
1871
+ }
1872
+
1873
+ metalinkURL =
1874
+ element metalink:url {
1875
+ metalinkCommonAttributes,
1876
+ attribute location { xsd:string {
1877
+ minLength = "2" maxLength="2"}
1878
+ }?,
1879
+ attribute priority { xsd:positiveInteger {
1880
+ maxInclusive = "999999"}}?,
1881
+ (metalinkUri)
1882
+ }
1883
+
1884
+ metalinkVersion =
1885
+ element metalink:version {
1886
+ metalinkTextConstruct
1887
+ }
1888
+
1889
+ # As defined in RFC 3066 and compatible with RFC 5646
1890
+ metalinkLanguageTag = xsd:string {
1891
+ pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*"
1892
+ }
1893
+
1894
+ # Unconstrained; it's not entirely clear how IRI fit into
1895
+ # xsd:anyURI so let's not try to constrain it here
1896
+ metalinkUri = text
1897
+
1898
+ # Simple Extension
1899
+
1900
+ simpleExtensionElement =
1901
+ element * - metalink:* {
1902
+ text
1903
+
1904
+
1905
+
1906
+ Bryan, et al. Standards Track [Page 34]
1907
+
1908
+ RFC 5854 Metalink Download Description Format June 2010
1909
+
1910
+
1911
+ }
1912
+
1913
+ # Structured Extension
1914
+
1915
+ structuredExtensionElement =
1916
+ element * - metalink:* {
1917
+ (attribute * { text }+,
1918
+ (text|anyElement)*)
1919
+ | (attribute * { text }*,
1920
+ (text?, anyElement+, (text|anyElement)*))
1921
+ }
1922
+
1923
+ # Other Extensibility
1924
+
1925
+ extensionElement =
1926
+ simpleExtensionElement | structuredExtensionElement
1927
+
1928
+ undefinedAttribute =
1929
+ attribute * - (xml:lang | local:*) { text }
1930
+
1931
+ undefinedContent = (text|anyForeignElement)*
1932
+
1933
+ anyElement =
1934
+ element * {
1935
+ (attribute * { text }
1936
+ | text
1937
+ | anyElement)*
1938
+ }
1939
+
1940
+ anyForeignElement =
1941
+ element * - metalink:* {
1942
+ (attribute * { text }
1943
+ | text
1944
+ | anyElement)*
1945
+ }
1946
+
1947
+ # EOF
1948
+
1949
+
1950
+
1951
+
1952
+
1953
+
1954
+
1955
+
1956
+
1957
+
1958
+
1959
+
1960
+
1961
+
1962
+ Bryan, et al. Standards Track [Page 35]
1963
+
1964
+ RFC 5854 Metalink Download Description Format June 2010
1965
+
1966
+
1967
+ Index
1968
+
1969
+ A
1970
+ ABNF
1971
+ metalinkGenerator 13
1972
+ metaurl mediatype 17
1973
+ signature mediatype 19
1974
+ application/metalink4+xml Media Type 23
1975
+
1976
+ C
1977
+ copyright XML element 12
1978
+
1979
+ D
1980
+ description XML element 13
1981
+
1982
+ F
1983
+ file XML element 10
1984
+
1985
+ G
1986
+ generator XML element 13
1987
+ Grammar
1988
+ metalinkCommonAttributes 7
1989
+ metalinkCopyright 13
1990
+ metalinkDateConstruct 8
1991
+ metalinkDescription 13
1992
+ metalinkFile 10
1993
+ metalinkGenerator 13
1994
+ metalinkHash 14
1995
+ metalinkIdentity 15
1996
+ metalinkLanguage 15
1997
+ metalinkLogo 16
1998
+ metalinkMetalink 8
1999
+ metalinkMetaURL 16
2000
+ metalinkOrigin 17
2001
+ metalinkOS 18
2002
+ metalinkPieces 12
2003
+ metalinkPublished 18
2004
+ metalinkPublisher 18
2005
+ metalinkSignature 19
2006
+ metalinkSize 20
2007
+ metalinkTextConstruct 7
2008
+ metalinkUpdated 20
2009
+ metalinkURL 21
2010
+ metalinkVersion 21
2011
+ simpleExtensionElement 22
2012
+ structuredExtensionElement 23
2013
+
2014
+
2015
+
2016
+
2017
+
2018
+ Bryan, et al. Standards Track [Page 36]
2019
+
2020
+ RFC 5854 Metalink Download Description Format June 2010
2021
+
2022
+
2023
+ H
2024
+ hash XML element 14
2025
+
2026
+ I
2027
+ identity XML element 15
2028
+
2029
+ L
2030
+ language XML element 15
2031
+ logo XML element 16
2032
+
2033
+ M
2034
+ Media Type
2035
+ application/metalink4+xml 23
2036
+ metalink XML element 8
2037
+ metalinkCommonAttributes grammar production 7
2038
+ metalinkCopyright grammar production 12
2039
+ metalinkDateConstruct grammar production 8
2040
+ metalinkDescription grammar production 13
2041
+ metalinkFile grammar production 10
2042
+ metalinkGenerator ABNF 13
2043
+ metalinkGenerator grammar production 13
2044
+ metalinkHash grammar production 14
2045
+ metalinkIdentity grammar production 15
2046
+ metalinkLanguage grammar production 15
2047
+ metalinkLogo grammar production 16
2048
+ metalinkMetalink grammar production 8
2049
+ metalinkMetaURL grammar production 16
2050
+ metalinkOrigin grammar production 17
2051
+ metalinkOS grammar production 18
2052
+ metalinkPieces grammar production 12
2053
+ metalinkPublished grammar production 18
2054
+ metalinkPublisher grammar production 18
2055
+ metalinkSignature grammar production 19
2056
+ metalinkSize grammar production 20
2057
+ metalinkTextConstruct grammar production 7
2058
+ metalinkUpdated grammar production 20
2059
+ metalinkURL grammar production 21
2060
+ metalinkVersion grammar production 21
2061
+ metaurl mediatype ABNF 16
2062
+ metaurl XML element 16
2063
+
2064
+ O
2065
+ origin XML element 17
2066
+ os XML element 18
2067
+
2068
+
2069
+
2070
+
2071
+
2072
+
2073
+
2074
+ Bryan, et al. Standards Track [Page 37]
2075
+
2076
+ RFC 5854 Metalink Download Description Format June 2010
2077
+
2078
+
2079
+ P
2080
+ pieces XML element 12
2081
+ published XML element 18
2082
+ publisher XML element 18
2083
+
2084
+ S
2085
+ signature mediatype ABNF 19
2086
+ signature XML element 19
2087
+ simpleExtensionElement grammar production 22
2088
+ size XML element 20
2089
+ structuredExtensionElement grammar production 23
2090
+
2091
+ U
2092
+ updated XML element 20
2093
+ url XML element 20
2094
+
2095
+ V
2096
+ version XML element 21
2097
+
2098
+ X
2099
+ XML Elements
2100
+ copyright 12
2101
+ description 13
2102
+ file 9
2103
+ generator 13
2104
+ hash 14
2105
+ identity 15
2106
+ language 15
2107
+ logo 16
2108
+ metalink 8
2109
+ metaurl 16
2110
+ origin 17
2111
+ os 18
2112
+ pieces 12
2113
+ published 18
2114
+ publisher 18
2115
+ signature 19
2116
+ size 20
2117
+ updated 20
2118
+ url 20
2119
+ version 21
2120
+
2121
+
2122
+
2123
+
2124
+
2125
+
2126
+
2127
+
2128
+
2129
+
2130
+ Bryan, et al. Standards Track [Page 38]
2131
+
2132
+ RFC 5854 Metalink Download Description Format June 2010
2133
+
2134
+
2135
+ Authors' Addresses
2136
+
2137
+ Anthony Bryan
2138
+ Pompano Beach, FL
2139
+ USA
2140
+
2141
+ EMail: anthonybryan@gmail.com
2142
+ URI: http://www.metalinker.org
2143
+
2144
+
2145
+ Tatsuhiro Tsujikawa
2146
+ Shiga
2147
+ Japan
2148
+
2149
+ EMail: tatsuhiro.t@gmail.com
2150
+ URI: http://aria2.sourceforge.net
2151
+
2152
+
2153
+ Neil McNab
2154
+ San Diego, CA
2155
+ USA
2156
+
2157
+ EMail: neil@nabber.org
2158
+ URI: http://www.nabber.org
2159
+
2160
+
2161
+ Dr. med. Peter Poeml
2162
+ MirrorBrain
2163
+ Venloer Str. 317
2164
+ Koeln 50823
2165
+ DE
2166
+
2167
+ Phone: +49 221 6778 333 8
2168
+ EMail: peter@poeml.de
2169
+ URI: http://mirrorbrain.org/~poeml/
2170
+
2171
+
2172
+
2173
+
2174
+
2175
+
2176
+
2177
+
2178
+
2179
+
2180
+
2181
+
2182
+
2183
+
2184
+
2185
+
2186
+ Bryan, et al. Standards Track [Page 39]
2187
+