-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrfc5854.html
More file actions
2219 lines (2010 loc) · 136 KB
/
rfc5854.html
File metadata and controls
2219 lines (2010 loc) · 136 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en"><head><title>The Metalink Download Description Format</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="The Metalink Download Description Format">
<meta name="keywords" content="file transfer, mirrors, data integrity, hash, xml, http, hypertext transfer protocol, ftp, file transfer protocol, metadata, torrent">
<meta name="generator" content="xml2rfc v1.35 (http://xml.resource.org/)">
<style type='text/css'><!--
body {
font-family: verdana, charcoal, helvetica, arial, sans-serif;
font-size: small; color: #000; background-color: #FFF;
margin: 2em;
}
h1, h2, h3, h4, h5, h6 {
font-family: helvetica, monaco, "MS Sans Serif", arial, sans-serif;
font-weight: bold; font-style: normal;
}
h1 { color: #900; background-color: transparent; text-align: right; }
h3 { color: #333; background-color: transparent; }
td.RFCbug {
font-size: x-small; text-decoration: none;
width: 30px; height: 30px; padding-top: 2px;
text-align: justify; vertical-align: middle;
background-color: #000;
}
td.RFCbug span.RFC {
font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, verdana, sans-serif;
font-weight: bold; color: #666;
}
td.RFCbug span.hotText {
font-family: charcoal, monaco, geneva, "MS Sans Serif", helvetica, verdana, sans-serif;
font-weight: normal; text-align: center; color: #FFF;
}
table.TOCbug { width: 30px; height: 15px; }
td.TOCbug {
text-align: center; width: 30px; height: 15px;
color: #FFF; background-color: #900;
}
td.TOCbug a {
font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, sans-serif;
font-weight: bold; font-size: x-small; text-decoration: none;
color: #FFF; background-color: transparent;
}
td.header {
font-family: arial, helvetica, sans-serif; font-size: x-small;
vertical-align: top; width: 33%;
color: #FFF; background-color: #666;
}
td.author { font-weight: bold; font-size: x-small; margin-left: 4em; }
td.author-text { font-size: x-small; }
/* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */
a.info {
/* This is the key. */
position: relative;
z-index: 24;
text-decoration: none;
}
a.info:hover {
z-index: 25;
color: #FFF; background-color: #900;
}
a.info span { display: none; }
a.info:hover span.info {
/* The span will display just on :hover state. */
display: block;
position: absolute;
font-size: smaller;
top: 2em; left: -5em; width: 15em;
padding: 2px; border: 1px solid #333;
color: #900; background-color: #EEE;
text-align: left;
}
a { font-weight: bold; }
a:link { color: #900; background-color: transparent; }
a:visited { color: #633; background-color: transparent; }
a:active { color: #633; background-color: transparent; }
p { margin-left: 2em; margin-right: 2em; }
p.copyright { font-size: x-small; }
p.toc { font-size: small; font-weight: bold; margin-left: 3em; }
table.toc { margin: 0 0 0 3em; padding: 0; border: 0; vertical-align: text-top; }
td.toc { font-size: small; font-weight: bold; vertical-align: text-top; }
ol.text { margin-left: 2em; margin-right: 2em; }
ul.text { margin-left: 2em; margin-right: 2em; }
li { margin-left: 3em; }
/* RFC-2629 <spanx>s and <artwork>s. */
em { font-style: italic; }
strong { font-weight: bold; }
dfn { font-weight: bold; font-style: normal; }
cite { font-weight: normal; font-style: normal; }
tt { color: #036; }
tt, pre, pre dfn, pre em, pre cite, pre span {
font-family: "Courier New", Courier, monospace; font-size: small;
}
pre {
text-align: left; padding: 4px;
color: #000; background-color: #CCC;
}
pre dfn { color: #900; }
pre em { color: #66F; background-color: #FFC; font-weight: normal; }
pre .key { color: #33C; font-weight: bold; }
pre .id { color: #900; }
pre .str { color: #000; background-color: #CFF; }
pre .val { color: #066; }
pre .rep { color: #909; }
pre .oth { color: #000; background-color: #FCF; }
pre .err { background-color: #FCC; }
/* RFC-2629 <texttable>s. */
table.all, table.full, table.headers, table.none {
font-size: small; text-align: center; border-width: 2px;
vertical-align: top; border-collapse: collapse;
}
table.all, table.full { border-style: solid; border-color: black; }
table.headers, table.none { border-style: none; }
th {
font-weight: bold; border-color: black;
border-width: 2px 2px 3px 2px;
}
table.all th, table.full th { border-style: solid; }
table.headers th { border-style: none none solid none; }
table.none th { border-style: none; }
table.all td {
border-style: solid; border-color: #333;
border-width: 1px 2px;
}
table.full td, table.headers td, table.none td { border-style: none; }
hr { height: 1px; }
hr.insert {
width: 80%; border-style: none; border-width: 0;
color: #CCC; background-color: #CCC;
}
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="2" width="30" align="right">
<tr>
<td class="RFCbug">
<span class="RFC"> RFC </span><br /><span class="hotText"> 5854 </span>
</td>
</tr>
<tr><td class="TOCbug"><a href="#toc"> TOC </a><br /></td></tr>
</table>
<table summary="layout" width="66%" border="0" cellpadding="0" cellspacing="0"><tr><td><table summary="layout" width="100%" border="0" cellpadding="2" cellspacing="1">
<tr><td class="header">Network Working Group</td><td class="header">A. Bryan</td></tr>
<tr><td class="header">Request for Comments: 5854</td><td class="header">T. Tsujikawa</td></tr>
<tr><td class="header">Category: Standards Track</td><td class="header">N. McNab</td></tr>
<tr><td class="header"> </td><td class="header"> </td></tr>
<tr><td class="header"> </td><td class="header">P. Poeml</td></tr>
<tr><td class="header"> </td><td class="header">MirrorBrain</td></tr>
<tr><td class="header"> </td><td class="header">May 2010</td></tr>
</table></td></tr></table>
<h1><br />The Metalink Download Description Format</h1>
<h3>Abstract</h3>
<p>This document specifies Metalink, an XML-based download description
format. Metalink describes download locations
(mirrors), cryptographic hashes, and other information. Clients can
transparently use this information to reliably transfer
files.
</p>
<h3>Status of This Memo</h3>
<p>
This document specifies an Internet standards track protocol for the Internet
community, and requests discussion and suggestions for improvements.
Please refer to the current edition of the “Internet Official Protocol
Standards” (STD 1) for the standardization state and status of this
protocol.
Distribution of this memo is unlimited.</p>
<h3>Copyright Notice</h3>
<p>
Copyright (c) 2010 IETF Trust and the persons identified as the
document authors. All rights reserved.</p>
<p>
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.</p>
<a name="toc"></a><hr />
<table border="0" cellpadding="0" cellspacing="2" width="30" align="right">
<tr>
<td class="RFCbug">
<span class="RFC"> RFC </span><br /><span class="hotText"> 5854 </span>
</td>
</tr>
<tr><td class="TOCbug"><a href="#toc"> TOC </a><br /></td></tr>
</table>
<h3>Table of Contents</h3>
<p class="toc">
<a href="#anchor1">1.</a>
Introduction<br />
<a href="#anchor2">1.1.</a>
Examples<br />
<a href="#namespace.and.version">1.2.</a>
Namespace and Version<br />
<a href="#anchor3">1.3.</a>
Notational Conventions<br />
<a href="#metalink.documents">2.</a>
Metalink Documents<br />
<a href="#anchor4">3.</a>
Common Metalink Constructs<br />
<a href="#text.constructs">3.1.</a>
Text Constructs<br />
<a href="#date.constructs">3.2.</a>
Date Constructs<br />
<a href="#anchor5">4.</a>
Metalink Element Definitions<br />
<a href="#anchor6">4.1.</a>
Container Elements<br />
<a href="#element.metalink">4.1.1.</a>
The "metalink:metalink" Element<br />
<a href="#element.file">4.1.2.</a>
The "metalink:file" Element<br />
<a href="#element.pieces">4.1.3.</a>
The "metalink:pieces" Element<br />
<a href="#anchor10">4.2.</a>
Metadata Elements<br />
<a href="#element.copyright">4.2.1.</a>
The "metalink:copyright" Element<br />
<a href="#element.description">4.2.2.</a>
The "metalink:description" Element<br />
<a href="#element.generator">4.2.3.</a>
The "metalink:generator" Element<br />
<a href="#element.hash">4.2.4.</a>
The "metalink:hash" Element<br />
<a href="#element.identity">4.2.5.</a>
The "metalink:identity" Element<br />
<a href="#element.language">4.2.6.</a>
The "metalink:language" Element<br />
<a href="#element.logo">4.2.7.</a>
The "metalink:logo" Element<br />
<a href="#element.metaurl">4.2.8.</a>
The "metalink:metaurl" Element<br />
<a href="#element.origin">4.2.9.</a>
The "metalink:origin" Element<br />
<a href="#element.os">4.2.10.</a>
The "metalink:os" Element<br />
<a href="#element.published">4.2.11.</a>
The "metalink:published" Element<br />
<a href="#element.publisher">4.2.12.</a>
The "metalink:publisher" Element<br />
<a href="#element.signature">4.2.13.</a>
The "metalink:signature" Element<br />
<a href="#element.size">4.2.14.</a>
The "metalink:size" Element<br />
<a href="#element.updated">4.2.15.</a>
The "metalink:updated" Element<br />
<a href="#element.url">4.2.16.</a>
The "metalink:url" Element<br />
<a href="#element.version">4.2.17.</a>
The "metalink:version" Element<br />
<a href="#extending_metalink">5.</a>
Extending Metalink<br />
<a href="#anchor21">5.1.</a>
Extensions from Non-Metalink Vocabularies<br />
<a href="#extensions.to.the.metalink.vocabulary">5.2.</a>
Extensions to the Metalink Vocabulary<br />
<a href="#processing.foreign.markup">5.3.</a>
Processing Foreign Markup<br />
<a href="#extension">5.4.</a>
Extension Elements<br />
<a href="#simple.extension.elements">5.4.1.</a>
Simple Extension Elements<br />
<a href="#structured.extension.elements">5.4.2.</a>
Structured Extension Elements<br />
<a href="#IANA">6.</a>
IANA Considerations<br />
<a href="#anchor22">6.1.</a>
XML Namespace Registration<br />
<a href="#anchor23">6.2.</a>
application/metalink4+xml MIME type<br />
<a href="#anchor24">7.</a>
Security Considerations<br />
<a href="#security.signatures">7.1.</a>
Digital Signatures<br />
<a href="#anchor25">7.2.</a>
URIs and IRIs<br />
<a href="#anchor26">7.3.</a>
Spoofing<br />
<a href="#security.hash">7.4.</a>
Cryptographic Hashes<br />
<a href="#rfc.references1">8.</a>
References<br />
<a href="#rfc.references1">8.1.</a>
Normative References<br />
<a href="#rfc.references2">8.2.</a>
Informative References<br />
<a href="#anchor29">Appendix A.</a>
Acknowledgements and Contributors<br />
<a href="#schema">Appendix B.</a>
RELAX NG Compact Schema<br />
<a href="#rfc.index">§</a>
Index<br />
</p>
<br clear="all" />
<a name="anchor1"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.1"></a><h3>1.
Introduction</h3>
<p>Metalink is a document format based on Extensible Markup Language (XML) that describes a file or list
of files to be downloaded from a server. Metalinks can list a number of
files, each with an extensible set of attached metadata.
Each listed file can have a description, multiple cryptographic hashes, and a list of Uniform Resource Identifiers (URIs) from which it is
available.
</p>
<p>Often, identical copies of a file are accessible in multiple locations
on the Internet over a variety of protocols, such as File Transfer Protocol (FTP), Hypertext Transfer Protocol (HTTP), and
Peer-to-Peer (P2P). In some cases, users are shown a list of these multiple
download locations (mirror servers) and must manually select one based on
geographical location, priority, or bandwidth. This is done to distribute
the load across multiple servers, and to give human users the opportunity
to choose a download location that they expect to work best for them.
</p>
<p>At times, individual servers can be
slow, outdated, or unreachable, but this cannot be determined until the
download has been initiated. This can lead to the user canceling the
download and needing to restart it. During downloads, errors in
transmission can corrupt the file. There are no easy ways to repair
these files. For large downloads, this can be especially troublesome. Any
of the number of problems that can occur during a download lead to
frustration on the part of users, and bandwidth wasted with retransmission.
</p>
<p>Knowledge about availability of a download on mirror servers can be
acquired and maintained by the operators of the origin server or by a third
party. This knowledge, together with cryptographic hashes,
digital signatures, and more, can be stored in a machine-readable Metalink
file. The Metalink file can transfer this knowledge to the user agent,
which can peruse it in automatic ways or present the information to a human user.
User agents can fall back to alternate
mirrors if the current one has an issue. Thereby, clients
are enabled to work their way to a successful download under adverse
circumstances. All this can be done transparently to the human user and the
download is much more reliable and efficient. In contrast, a traditional
HTTP redirect to one mirror conveys only comparatively minimal information --
a referral to a single server, and there is no provision in the HTTP protocol to
handle failures.
</p>
<p>Other features that some clients provide include multi-source
downloads, where chunks of a file are downloaded from multiple mirrors
(and optionally, Peer-to-Peer) simultaneously, which frequently results
in a faster download. Metalinks can leverage HTTP, FTP, and Peer-to-Peer
protocols together, because regardless of the protocol over
which the Metalink
was obtained, it can make a resource accessible through other protocols.
If the Metalink was obtained from a trusted source, included verification
metadata can solve trust issues when downloading files from replica
servers operated by third parties. Metalinks also provide structured
information about downloads that can be indexed by search engines.
</p>
<a name="anchor2"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.1.1"></a><h3>1.1.
Examples</h3>
<p>
<p>A brief, Metalink Document that describes a single file:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<?xml version="1.0" encoding="UTF-8"?>
<metalink xmlns="urn:ietf:params:xml:ns:metalink">
<file name="example.ext">
<size>14471447</size>
<url>ftp://ftp.example.com/example.ext</url>
<url>http://example.com/example.ext</url>
<metaurl mediatype="torrent">
http://example.com/example.ext.torrent</metaurl>
</file>
</metalink>
</pre></div>
<p>
<p>A more extensive Metalink Document that describes two files:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<?xml version="1.0" encoding="UTF-8"?>
<metalink xmlns="urn:ietf:params:xml:ns:metalink">
<published>2009-05-15T12:23:23Z</published>
<file name="example.ext">
<size>14471447</size>
<identity>Example</identity>
<version>1.0</version>
<language>en</language>
<description>
A description of the example file for download.
</description>
<hash type="sha-256">f0ad929cd259957e160ea442eb80986b5f01...</hash>
<url location="de"
priority="1">ftp://ftp.example.com/example.ext</url>
<url location="fr"
priority="1">http://example.com/example.ext</url>
<metaurl mediatype="torrent"
priority="2">http://example.com/example.ext.torrent</metaurl>
</file>
<file name="example2.ext">
<size>14471447</size>
<identity>Example2</identity>
<version>1.0</version>
<language>en</language>
<description>
Another description for a second file.
</description>
<hash type="sha-256">2f548ce50c459a0270e85a7d63b2383c5523...</hash>
<url location="de"
priority="1">ftp://ftp.example.com/example2.ext</url>
<url location="fr"
priority="1">http://example.com/example2.ext</url>
<metaurl mediatype="torrent"
priority="2">http://example.com/example2.ext.torrent</metaurl>
</file>
</metalink></pre></div>
<a name="namespace.and.version"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.1.2"></a><h3>1.2.
Namespace and Version</h3>
<p>The XML Namespaces URI <a class='info' href='#REC-xml-names'>[REC‑xml‑names]<span> (</span><span class='info'>Hollander, D., Bray, T., Tobin, R., and A. Layman, “Namespaces in XML 1.0 (Third Edition),” December 2009.</span><span>)</span></a> for the XML data
format described in this specification is:
</p>
<p>urn:ietf:params:xml:ns:metalink
</p>
<p>For convenience, this data format may be referred to as
"Metalink", which this specification uses internally.
</p>
<a name="anchor3"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.1.3"></a><h3>1.3.
Notational Conventions</h3>
<p>This specification describes conformance of Metalink
Documents. Additionally, it places some requirements on Metalink
Processors.
</p>
<p>This specification uses the namespace prefix "metalink:" for
the Namespace URI identified in <a class='info' href='#namespace.and.version'>Section 1.2<span> (</span><span class='info'>Namespace and Version</span><span>)</span></a>, above. Note that
the choice of namespace prefix is arbitrary and not
semantically significant.
</p>
<p>Metalink is specified using terms from the XML Infoset <a class='info' href='#REC-xml-infoset'>[REC‑xml‑infoset]<span> (</span><span class='info'>Cowan, J. and R. Tobin, “XML Information Set (Second Edition),” February 2004.</span><span>)</span></a>. However, this
specification uses a shorthand for two common terms: the
phrase "Information Item" is omitted when naming Element
Information Items and Attribute Information Items. Therefore,
when this specification uses the term "element," it is
referring to an Element Information Item in Infoset
terms. Likewise, when it uses the term "attribute," it is
referring to an Attribute Information Item.
</p>
<p>Some sections of this specification are illustrated with fragments
of a non-normative RELAX NG Compact schema <a class='info' href='#RELAX-NG'>[RELAX‑NG]<span> (</span><span class='info'>Clark, J., “RELAX NG Compact Syntax,” December 2001.</span><span>)</span></a>. However, the text of this specification provides the definition of
conformance. A complete schema appears in <a class='info' href='#schema'>Appendix B<span> (</span><span class='info'>RELAX NG Compact Schema</span><span>)</span></a>.
</p>
<p>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in BCP 14, <a class='info' href='#RFC2119'>[RFC2119]<span> (</span><span class='info'>Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.</span><span>)</span></a>, as scoped to those conformance targets.
</p>
<a name="metalink.documents"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2"></a><h3>2.
Metalink Documents</h3>
<p>This specification describes Metalink Documents.
</p>
<p>A Metalink Document describes a file or group of files,
how to access them, and metadata that identifies them. Its root is the <a class='info' href='#element.metalink'>metalink:metalink<span> (</span><span class='info'>The "metalink:metalink" Element</span><span>)</span></a> element.
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
namespace metalink = "urn:ietf:params:xml:ns:metalink"
start = metalinkMetalink</pre></div>
<p>Metalink Documents are specified in terms of the
XML Information Set, serialized as XML 1.0 <a class='info' href='#REC-xml'>[REC‑xml]<span> (</span><span class='info'>Yergeau, F., Paoli, J., Bray, T., Sperberg-McQueen, C., and E. Maler, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a> and identified with the
"application/metalink4+xml" media type.
</p>
<p>Metalink Documents MUST be
well-formed XML. This specification does not define a Document Type Definition (DTD) for
Metalink Documents, and hence it does not require them to be valid (in
the sense used by XML).
</p>
<p>Metalink allows the use of Internationalized Resource Identifiers (IRIs), encoded according to <a class='info' href='#RFC3987'>[RFC3987]<span> (</span><span class='info'>Duerst, M. and M. Suignard, “Internationalized Resource Identifiers (IRIs),” January 2005.</span><span>)</span></a>. Every
URI <a class='info' href='#RFC3986'>[RFC3986]<span> (</span><span class='info'>Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax,” January 2005.</span><span>)</span></a> is also an IRI, so a URI may be used wherever an IRI is named below.
There is one special
consideration: when an IRI that is not also a URI is given for
dereferencing, it MUST be mapped to a URI using the steps in
Section 3.1 of <a class='info' href='#RFC3987'>[RFC3987]<span> (</span><span class='info'>Duerst, M. and M. Suignard, “Internationalized Resource Identifiers (IRIs),” January 2005.</span><span>)</span></a>.
</p>
<p>Any element defined by this specification MAY have an
xml:lang attribute, whose content indicates the natural language
for the element and its descendents. The language context is only
significant for elements and attributes declared to be
"Language-Sensitive" by this specification. Requirements
regarding the content and interpretation of xml:lang are
specified in <a class='info' href='#REC-xml'>XML 1.0<span> (</span><span class='info'>Yergeau, F., Paoli, J., Bray, T., Sperberg-McQueen, C., and E. Maler, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a> [REC‑xml],
Section 2.12.
<a name='anchor30'></a><a name='anchor31'></a></p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
metalinkCommonAttributes =
attribute xml:lang { metalinkLanguageTag }?,
undefinedAttribute*</pre></div><p>
</p>
<p>All leading and trailing whitespace is part of the element content and MUST NOT be ignored. Consequently, it is disallowed for elements where the defined type does not allow whitespace, such as dates, integers, or IRIs.
Some XML-generating implementations erroneously insert whitespace around values by default, and such implementations will generate invalid Metalink Documents.
</p>
<p>Metalink Documents that do not follow this specification are invalid and SHOULD NOT be used by Metalink Processors.
</p>
<p>Metalink is an extensible format. See <a class='info' href='#extending_metalink'>Section 5<span> (</span><span class='info'>Extending Metalink</span><span>)</span></a>
of this document for a full description of how Metalink Documents can
be extended.
</p>
<a name="anchor4"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.3"></a><h3>3.
Common Metalink Constructs</h3>
<p>Many Metalink elements share common structures. This section
defines those structures and their requirements for convenient
reference by the appropriate element definitions.
</p>
<p>When an element is identified as being a particular kind of
construct, it inherits the corresponding requirements from that
construct's definition in this section.
</p>
<a name="text.constructs"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.3.1"></a><h3>3.1.
Text Constructs</h3>
<p>A Text construct contains human-readable text, usually short
in length.
<a name='anchor32'></a><a name='anchor33'></a></p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
metalinkTextConstruct =
metalinkCommonAttributes,
text</pre></div><p>
</p>
<p>For example, a <a class='info' href='#element.description'>metalink:description<span> (</span><span class='info'>The "metalink:description" Element</span><span>)</span></a> with text content:
</p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
...
<description>
A description of the example file for download.
</description>
...</pre></div><p>
</p>
<p>The content of the Text
construct MUST NOT contain child elements. Such text is
intended to be presented to humans in a readable fashion.
Thus, whitespace could be collapsed (including
line breaks), and text could be displayed using typographic
techniques such as justification and proportional
fonts.
</p>
<a name="date.constructs"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.3.2"></a><h3>3.2.
Date Constructs</h3>
<p>A Date construct is an element whose content MUST conform
to the "date-time" production in <a class='info' href='#RFC3339'>[RFC3339]<span> (</span><span class='info'>Klyne, G. and C. Newman, “Date and Time on the Internet: Timestamps,” July 2002.</span><span>)</span></a>. In addition, an uppercase "T" character
MUST be used to separate date and time, and an uppercase "Z"
character MUST be present in the absence of a numeric time zone
offset.
<a name='anchor34'></a><a name='anchor35'></a></p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
metalinkDateConstruct =
metalinkCommonAttributes,
xsd:dateTime</pre></div><p>
</p>
<p>Such date values happen to be compatible with the following
specifications:
<a class='info' href='#ISO.8601.1988'>[ISO.8601.1988]<span> (</span><span class='info'>International Organization for Standardization, “Data elements and interchange formats - Information interchange - Representation of dates and times,” June 1988.</span><span>)</span></a>,
<a class='info' href='#NOTE-datetime-19980827'>[NOTE‑datetime‑19980827]<span> (</span><span class='info'>Wolf, M. and C. Wicksteed, “Date and Time Formats,” August 1998.</span><span>)</span></a>,
and <a class='info' href='#REC-xmlschema-2-20041028'>[REC‑xmlschema‑2‑20041028]<span> (</span><span class='info'>Malhotra, A. and P. Biron, “XML Schema Part 2: Datatypes Second Edition,” October 2004.</span><span>)</span></a>.
</p>
<p>Example Date constructs:
</p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
...
<updated>2010-05-01T12:15:02Z</updated>
...
<updated>2010-05-01T12:15:02.25Z</updated>
...
<updated>2010-05-01T12:15:02+01:00</updated>
...
<updated>2010-05-01T12:15:02.25+01:00</updated>
...
</pre></div><p>
</p>
<a name="anchor5"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4"></a><h3>4.
Metalink Element Definitions</h3>
<a name="anchor6"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1"></a><h3>4.1.
Container Elements</h3>
<a name="element.metalink"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.1"></a><h3>4.1.1.
The "metalink:metalink" Element</h3>
<a name='anchor36'></a><a name='anchor37'></a>
<p>The "metalink:metalink" element is the document (i.e., top-level) element
of a Metalink Document, acting as a container for metadata and
data associated with the listed files. It contains one or more <a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> child elements that consist of
Metadata elements.
<a name='anchor38'></a><a name='anchor39'></a></p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
metalinkMetalink =
element metalink:metalink {
metalinkCommonAttributes,
(metalinkFile+
& metalinkGenerator?
& metalinkOrigin?
& metalinkPublished?
& metalinkUpdated?
& extensionElement*)
}</pre></div><p>
</p>
<p>The following child elements are defined by this specification
(note that the presence of some of these elements is required):
</p>
<p>
</p>
<ul class="text">
<li><a class='info' href='#element.metalink'>metalink:metalink<span> (</span><span class='info'>The "metalink:metalink" Element</span><span>)</span></a> elements MUST contain one or more <a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements.
</li>
<li><a class='info' href='#element.metalink'>metalink:metalink<span> (</span><span class='info'>The "metalink:metalink" Element</span><span>)</span></a> elements MAY contain exactly one <a class='info' href='#element.generator'>metalink:generator<span> (</span><span class='info'>The "metalink:generator" Element</span><span>)</span></a> element and MUST NOT contain more than one such element.
</li>
<li><a class='info' href='#element.metalink'>metalink:metalink<span> (</span><span class='info'>The "metalink:metalink" Element</span><span>)</span></a> elements SHOULD contain exactly one <a class='info' href='#element.origin'>metalink:origin<span> (</span><span class='info'>The "metalink:origin" Element</span><span>)</span></a> element and MUST NOT contain more than one such element.
</li>
<li><a class='info' href='#element.metalink'>metalink:metalink<span> (</span><span class='info'>The "metalink:metalink" Element</span><span>)</span></a> elements MAY contain exactly one <a class='info' href='#element.published'>metalink:published<span> (</span><span class='info'>The "metalink:published" Element</span><span>)</span></a> element and MUST NOT contain more than one such element.
</li>
<li><a class='info' href='#element.metalink'>metalink:metalink<span> (</span><span class='info'>The "metalink:metalink" Element</span><span>)</span></a> elements MAY contain exactly one <a class='info' href='#element.updated'>metalink:updated<span> (</span><span class='info'>The "metalink:updated" Element</span><span>)</span></a> element and MUST NOT contain more than one such element.
</li>
</ul>
<a name="anchor7"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.1.1"></a><h3>4.1.1.1.
Providing Textual Content</h3>
<p>Experience teaches that downloads providing textual
content are, in general, more useful than those that do
not. Some applications (one example is full-text indexers)
require a minimum amount of text to function
reliably and predictably. Metalink publishers should be aware
of this. It is RECOMMENDED that each <a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a>
element contain a non-empty <a class='info' href='#element.description'>metalink:description<span> (</span><span class='info'>The "metalink:description" Element</span><span>)</span></a> element, a
non-empty <a class='info' href='#element.identity'>metalink:identity<span> (</span><span class='info'>The "metalink:identity" Element</span><span>)</span></a> element, a non-empty <a class='info' href='#element.version'>metalink:version<span> (</span><span class='info'>The "metalink:version" Element</span><span>)</span></a> element, and a non-empty
<a class='info' href='#element.publisher'>metalink:publisher<span> (</span><span class='info'>The "metalink:publisher" Element</span><span>)</span></a> element when these elements are present. However, the
absence of <a class='info' href='#element.description'>metalink:description<span> (</span><span class='info'>The "metalink:description" Element</span><span>)</span></a>, <a class='info' href='#element.identity'>metalink:identity<span> (</span><span class='info'>The "metalink:identity" Element</span><span>)</span></a>, <a class='info' href='#element.version'>metalink:version<span> (</span><span class='info'>The "metalink:version" Element</span><span>)</span></a>, and <a class='info' href='#element.publisher'>metalink:publisher<span> (</span><span class='info'>The "metalink:publisher" Element</span><span>)</span></a> is not an error, and Metalink
Processors MUST NOT fail to function correctly as a
consequence of such an absence.
</p>
<a name="element.file"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.2"></a><h3>4.1.2.
The "metalink:file" Element</h3>
<a name='anchor40'></a><a name='anchor41'></a>
<p>The "<a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a>" element represents an individual file,
acting as a container for metadata and data associated with
the file. Each unique file described in a Metalink Document MUST have its own <a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> element.
</p>
<p>All <a class='info' href='#element.url'>metalink:url<span> (</span><span class='info'>The "metalink:url" Element</span><span>)</span></a> elements contained in each <a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> element SHOULD lead to identical files. That is,
each <a class='info' href='#element.url'>metalink:url<span> (</span><span class='info'>The "metalink:url" Element</span><span>)</span></a> element should be an alternative location for the same file and each
<a class='info' href='#element.metaurl'>metalink:metaurl<span> (</span><span class='info'>The "metalink:metaurl" Element</span><span>)</span></a> element should provide metadata to retrieve the same file in another way, such as a Peer-to-Peer network. Refer to Sections <a class='info' href='#element.metaurl'>4.2.8<span> (</span><span class='info'>The "metalink:metaurl" Element</span><span>)</span></a> and <a class='info' href='#element.url'>4.2.16<span> (</span><span class='info'>The "metalink:url" Element</span><span>)</span></a> for more information.
<a name='anchor42'></a><a name='anchor43'></a></p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
metalinkFile =
element metalink:file {
metalinkCommonAttributes,
attribute name { text },
(metalinkCopyright?
& metalinkDescription?
& metalinkHash*
& metalinkIdentity?
& metalinkLanguage*
& metalinkLogo?
& metalinkMetaURL*
& metalinkOS*
& metalinkPieces*
& metalinkPublisher?
& metalinkSignature?
& metalinkSize?
& metalinkURL*
& metalinkVersion?
& extensionElement*)
}</pre></div><p>
</p>
<p>This specification assigns no significance to the order of
<a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements or to the order of
<a class='info' href='#element.url'>metalink:url<span> (</span><span class='info'>The "metalink:url" Element</span><span>)</span></a> or <a class='info' href='#element.metaurl'>metalink:metaurl<span> (</span><span class='info'>The "metalink:metaurl" Element</span><span>)</span></a> elements. Significance is determined by the value of the "priority" attribute of the <a class='info' href='#element.url'>metalink:url<span> (</span><span class='info'>The "metalink:url" Element</span><span>)</span></a> or <a class='info' href='#element.metaurl'>metalink:metaurl<span> (</span><span class='info'>The "metalink:metaurl" Element</span><span>)</span></a> elements.
</p>
<p>The following child elements are defined by this specification
(the presence of some of them is required):
</p>
<p>
</p>
<ul class="text">
<li><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements MAY contain exactly one <a class='info' href='#element.copyright'>metalink:copyright<span> (</span><span class='info'>The "metalink:copyright" Element</span><span>)</span></a>
element and MUST NOT contain more than one such element.
</li>
<li><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements MAY contain exactly one <a class='info' href='#element.description'>metalink:description<span> (</span><span class='info'>The "metalink:description" Element</span><span>)</span></a>
element and MUST NOT contain more than one such element.
</li>
<li><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements MAY contain exactly one <a class='info' href='#element.identity'>metalink:identity<span> (</span><span class='info'>The "metalink:identity" Element</span><span>)</span></a>
element and MUST NOT contain more than one such element.
</li>
<li><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements MAY contain one or more <a class='info' href='#element.hash'>metalink:hash<span> (</span><span class='info'>The "metalink:hash" Element</span><span>)</span></a> elements.
</li>
<li><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements MAY contain one or more <a class='info' href='#element.language'>metalink:language<span> (</span><span class='info'>The "metalink:language" Element</span><span>)</span></a>
elements.
</li>
<li><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements MAY contain exactly one <a class='info' href='#element.logo'>metalink:logo<span> (</span><span class='info'>The "metalink:logo" Element</span><span>)</span></a>
element and MUST NOT contain more than one such element.
</li>
<li><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements MAY contain one or more <a class='info' href='#element.os'>metalink:os<span> (</span><span class='info'>The "metalink:os" Element</span><span>)</span></a>
element.
</li>
<li><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements MUST contain at least one <a class='info' href='#element.url'>metalink:url<span> (</span><span class='info'>The "metalink:url" Element</span><span>)</span></a> element or at least one <a class='info' href='#element.metaurl'>metalink:metaurl<span> (</span><span class='info'>The "metalink:metaurl" Element</span><span>)</span></a> element. Typically, <a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements contain more than one <a class='info' href='#element.url'>metalink:url<span> (</span><span class='info'>The "metalink:url" Element</span><span>)</span></a> element to provide multiple download sources.
</li>
<li><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements MAY contain one or more <a class='info' href='#element.pieces'>metalink:pieces<span> (</span><span class='info'>The "metalink:pieces" Element</span><span>)</span></a> elements.
</li>
<li><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements MAY contain exactly one <a class='info' href='#element.publisher'>metalink:publisher<span> (</span><span class='info'>The "metalink:publisher" Element</span><span>)</span></a>
element and MUST NOT contain more than one such element.
</li>
<li><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements MAY contain one or more <a class='info' href='#element.signature'>metalink:signature<span> (</span><span class='info'>The "metalink:signature" Element</span><span>)</span></a> elements.
</li>
<li><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements SHOULD contain exactly one <a class='info' href='#element.size'>metalink:size<span> (</span><span class='info'>The "metalink:size" Element</span><span>)</span></a>
element and MUST NOT contain more than one such element.
</li>
<li><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements MAY contain exactly one <a class='info' href='#element.version'>metalink:version<span> (</span><span class='info'>The "metalink:version" Element</span><span>)</span></a>
element and MUST NOT contain more than one such element.
</li>
</ul><p>
</p>
<a name="anchor8"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.2.1"></a><h3>4.1.2.1.
The "name" Attribute</h3>
<p><a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements MUST have a "name" attribute, which contains the local file name to which the downloaded file will be written. Hence, if a Metalink Document contains multiple <a class='info' href='#element.file'>metalink:file<span> (</span><span class='info'>The "metalink:file" Element</span><span>)</span></a> elements, the value of the "name" attribute MUST be unique for each.
<p>Directory information can also be contained in a "path/file" format only, as in:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<file name="debian-amd64/sarge/Contents-amd64.gz">
</pre></div>
<p>In this example, a subdirectory "debian-amd64/sarge/" will be created
and a file named "Contents-amd64.gz" will be created inside it.
</p>
<p></p>
<blockquote class="text">
<p>Security Note:
The path MUST NOT contain any directory traversal directives or
information. The path MUST be relative. The path MUST NOT begin with a "/", "./", or
"../"; contain "/../"; or end with "/..".
</p>
</blockquote>
<a name="element.pieces"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.3"></a><h3>4.1.3.
The "metalink:pieces" Element</h3>
<a name='anchor44'></a><a name='anchor45'></a>
<p>The "<a class='info' href='#element.pieces'>metalink:pieces<span> (</span><span class='info'>The "metalink:pieces" Element</span><span>)</span></a>" element acts as a container for a list of cryptographic hashes of
contiguous, non-overlapping pieces of the file. The cryptographic hashes MUST be listed in the same order as the corresponding pieces appear in the file, starting at
the beginning of the file. Metalink Documents MAY contain one or multiple <a class='info' href='#element.pieces'>metalink:pieces<span> (</span><span class='info'>The "metalink:pieces" Element</span><span>)</span></a> container elements, if each "type" attribute of <a class='info' href='#element.pieces'>metalink:pieces<span> (</span><span class='info'>The "metalink:pieces" Element</span><span>)</span></a> has a unique value.
<a name='anchor46'></a><a name='anchor47'></a></p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
metalinkPieces =
element metalink:pieces {
attribute length { xsd:positiveInteger },
attribute type { text },
metalinkHash+
}</pre></div><p>
</p>
<a name="anchor9"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.3.1"></a><h3>4.1.3.1.
The "type" Attribute</h3>
<p><a class='info' href='#element.pieces'>metalink:pieces<span> (</span><span class='info'>The "metalink:pieces" Element</span><span>)</span></a> elements MUST have a "type" attribute.
</p>
<p>The Internet Assigned Numbers Authority (IANA) registry named "Hash Function Textual Names" defines values for hash types. See <a class='info' href='#security.hash'>Section 7.4<span> (</span><span class='info'>Cryptographic Hashes</span><span>)</span></a> for security implications.
</p>
<a name="piece.length"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.3.2"></a><h3>4.1.3.2.
The "length" Attribute</h3>
<p><a class='info' href='#element.pieces'>metalink:pieces<span> (</span><span class='info'>The "metalink:pieces" Element</span><span>)</span></a> elements MUST have a "length" attribute, which is a positive integer
that describes the length of the pieces of the file in octets. The whole file is divided into non-overlapping pieces of this length,
starting from the beginning of the file. That is, every piece MUST be the same size, apart from
the last piece, which is the remainder. The last piece extends to the end of the file, and it therefore MAY be shorter than the other pieces.
</p>
<a name="anchor10"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.2"></a><h3>4.2.
Metadata Elements</h3>
<a name="element.copyright"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.2.1"></a><h3>4.2.1.
The "metalink:copyright" Element</h3>
<a name='anchor48'></a><a name='anchor49'></a>
<p>The "<a class='info' href='#element.copyright'>metalink:copyright<span> (</span><span class='info'>The "metalink:copyright" Element</span><span>)</span></a>" element is a Text construct that conveys a
human-readable copyright for a file. It is Language-Sensitive.
<a name='anchor50'></a><a name='anchor51'></a></p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
metalinkCopyright =
element metalink:copyright {
metalinkTextConstruct
}</pre></div><p>
</p>
<a name="element.description"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.2.2"></a><h3>4.2.2.
The "metalink:description" Element</h3>
<a name='anchor52'></a><a name='anchor53'></a>
<p>The "<a class='info' href='#element.description'>metalink:description<span> (</span><span class='info'>The "metalink:description" Element</span><span>)</span></a>" element is a Text construct that conveys a
human-readable file description. It is Language-Sensitive.
<a name='anchor54'></a><a name='anchor55'></a></p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
metalinkDescription =
element metalink:description {
metalinkTextConstruct
}</pre></div><p>
</p>
<a name="element.generator"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.2.3"></a><h3>4.2.3.
The "metalink:generator" Element</h3>
<a name='anchor56'></a><a name='anchor57'></a>
<p>The "<a class='info' href='#element.generator'>metalink:generator<span> (</span><span class='info'>The "metalink:generator" Element</span><span>)</span></a>" element's content identifies the generating agent name and version used to generate a Metalink Document, for debugging and other purposes.
<a name='anchor58'></a><a name='anchor59'></a></p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
metalinkGenerator =
element metalink:generator {
metalinkTextConstruct
}</pre></div><p>
</p>
<p>The <a class='info' href='#element.generator'>metalink:generator<span> (</span><span class='info'>The "metalink:generator" Element</span><span>)</span></a> element's content is defined below in ABNF notation <a class='info' href='#RFC5234'>[RFC5234]<span> (</span><span class='info'>Crocker, D., Ed. and P. Overell, “Augmented BNF for Syntax Specifications: ABNF,” January 2008.</span><span>)</span></a>.
<a name='anchor60'></a><a name='anchor61'></a></p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
token = 1*<any CHAR except CTLs or separators>
separators = "(" / ")" / "<" / ">" / "@"
/ "," / ";" / ":" / "\" / DQUOTE
/ "/" / "[" / "]" / "?" / "="
/ "{" / "}" / SP / HTAB
agent = token ["/" agent-version]
agent-version = token
</pre></div><p>
</p>
<p>Examples:
</p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
...
<generator>MirrorBrain/2.11</generator>
...
<generator>MirrorManager/1.2.11</generator>
...
<generator>metalinktools/0.3.6</generator>
...
<generator>MetalinkEditor/1.2.0</generator>
...
</pre></div><p>
</p>
<p>Although any token character MAY appear in an agent-version, this token SHOULD only be used for a version identifier (i.e., successive versions of the same agent
SHOULD only differ in the agent-version portion of the agent value).
</p>
<a name="element.hash"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.2.4"></a><h3>4.2.4.
The "metalink:hash" Element</h3>
<a name='anchor62'></a><a name='anchor63'></a>
<p>The "<a class='info' href='#element.hash'>metalink:hash<span> (</span><span class='info'>The "metalink:hash" Element</span><span>)</span></a>" element is a Text construct that conveys a cryptographic
hash for a file. All hashes are encoded in lowercase hexadecimal format. Hashes are used to verify the integrity of a complete file or portion of a file to determine if the file has been transferred without any errors.
<a name='anchor64'></a><a name='anchor65'></a></p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
metalinkHash =
element metalink:hash {
attribute type { text }?,
text
}</pre></div><p>
</p>
<p>Metalink Documents MAY contain one or multiples hashes of a complete file. <a class='info' href='#element.hash'>metalink:hash<span> (</span><span class='info'>The "metalink:hash" Element</span><span>)</span></a> elements
with a "type" attribute MUST contain a hash of the complete file. In this example, both SHA-1 and SHA-256 hashes of the complete file are included.
</p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
...
<hash type="sha-1">a97fcf6ba9358f8a6f62beee4421863d3e52b080</hash>
<hash type="sha-256">fc87941af7fd7f03e53b34af393f4c14923d74...</hash>
...</pre></div><p>
</p>
<p>Metalink Documents MAY also contain hashes for individual pieces of a file. <a class='info' href='#element.hash'>metalink:hash<span> (</span><span class='info'>The "metalink:hash" Element</span><span>)</span></a> elements that are inside a <a class='info' href='#element.pieces'>metalink:pieces<span> (</span><span class='info'>The "metalink:pieces" Element</span><span>)</span></a> container element have a hash for that specific piece or chunk of the file, and are of the same hash type as the <a class='info' href='#element.pieces'>metalink:pieces<span> (</span><span class='info'>The "metalink:pieces" Element</span><span>)</span></a> element in which they are contained. Metalink Documents MAY contain one or multiple <a class='info' href='#element.pieces'>metalink:pieces<span> (</span><span class='info'>The "metalink:pieces" Element</span><span>)</span></a> container elements, if each "type" attribute of <a class='info' href='#element.pieces'>metalink:pieces<span> (</span><span class='info'>The "metalink:pieces" Element</span><span>)</span></a> has a unique value.
</p>
<p><a class='info' href='#element.hash'>metalink:hash<span> (</span><span class='info'>The "metalink:hash" Element</span><span>)</span></a> elements without a "type" attribute MUST contain a hash for that specific piece or chunk of the file and MUST be listed in the
same order as the corresponding pieces appear in the file, starting at the beginning of the file. The size of the piece is equal to the value of the "length" attribute of the <a class='info' href='#element.pieces'>metalink:pieces<span> (</span><span class='info'>The "metalink:pieces" Element</span><span>)</span></a> element, apart from the last piece, which is the remainder. See <a class='info' href='#piece.length'>Section 4.1.3.2<span> (</span><span class='info'>The "length" Attribute</span><span>)</span></a> for more information on the size of pieces.
</p>
<p>In this example, SHA-1 and SHA-256 hashes of the complete file are included, along with four SHA-1 piece hashes.
</p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
...
<hash type="sha-1">a97fcf6ba9358f8a6f62beee4421863d3e52b080</hash>
<hash type="sha-256">fc87941af7fd7f03e53b34af393f4c14923d74...</hash>
<pieces length="1048576" type="sha-1">
<hash>d96b9a4b92a899c2099b7b31bddb5ca423bb9b30</hash>
<hash>10d68f4b1119014c123da2a0a6baf5c8a6d5ba1e</hash>
<hash>3e84219096435c34e092b17b70a011771c52d87a</hash>
<hash>67183e4c3ab892d3ebe8326b7d79eb62d077f487</hash>
</pieces>
...</pre></div><p>
</p>
<a name="anchor11"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.2.4.1"></a><h3>4.2.4.1.
The "type" Attribute</h3>
<p><a class='info' href='#element.hash'>metalink:hash<span> (</span><span class='info'>The "metalink:hash" Element</span><span>)</span></a> elements MUST have a "type" attribute, if and only if
it contains a hash of the complete file. The IANA registry named "Hash Function Textual Names" defines values for hash types. <a class='info' href='#element.hash'>metalink:hash<span> (</span><span class='info'>The "metalink:hash" Element</span><span>)</span></a> elements MUST NOT have a "type" attribute, if they are inside a <a class='info' href='#element.pieces'>metalink:pieces<span> (</span><span class='info'>The "metalink:pieces" Element</span><span>)</span></a> container element. See <a class='info' href='#security.hash'>Section 7.4<span> (</span><span class='info'>Cryptographic Hashes</span><span>)</span></a> for security implications.
</p>
<a name="element.identity"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.2.5"></a><h3>4.2.5.
The "metalink:identity" Element</h3>
<a name='anchor66'></a><a name='anchor67'></a>
<p>The "<a class='info' href='#element.identity'>metalink:identity<span> (</span><span class='info'>The "metalink:identity" Element</span><span>)</span></a>" element is a Text construct that conveys a
human-readable identity for a file. For example, the identity of Firefox 3.5 would be "Firefox".
<a name='anchor68'></a><a name='anchor69'></a></p>
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
metalinkIdentity =
element metalink:identity {