idnits 2.17.1 draft-ietf-urn-ietf-07.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Cannot find the required boilerplate sections (Copyright, IPR, etc.) in this document. Expected boilerplate is as follows today (2024-04-18) according to https://trustee.ietf.org/license-info : IETF Trust Legal Provisions of 28-dec-2009, Section 6.a: This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 2: Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://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. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity -- however, there's a paragraph with a matching beginning. Boilerplate error? ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. ** The document is more than 15 pages and seems to lack a Table of Contents. == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 28 longer pages, the longest (page 7) being 62 lines == It seems as if not all pages are separated by form feeds - found 0 form feeds but 29 pages Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There are 4 instances of too long lines in the document, the longest one being 3 characters in excess of 72. ** There are 16 instances of lines with control characters in the document. ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 221: '...escaping of characters in the NSS MUST...' Miscellaneous warnings: ---------------------------------------------------------------------------- -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (October 1998) is 9317 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: '0' is mentioned on line 388, but not defined -- Looks like a reference, but probably isn't: '0-9' on line 388 ** Obsolete normative reference: RFC 2141 (ref. '1') (Obsoleted by RFC 8141) ** Obsolete normative reference: RFC 2234 (ref. '2') (Obsoleted by RFC 4234) Summary: 14 errors (**), 0 flaws (~~), 4 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet-Draft Ryan Moats 3 draft-ietf-urn-ietf-07.txt AT&T 4 Expires in six months October 1998 6 A URN Namespace for IETF Documents 7 Filename: draft-ietf-urn-ietf-07.txt 9 Status of This Memo 11 This document is an Internet-Draft. Internet-Drafts are working 12 documents of the Internet Engineering Task Force (IETF), its 13 areas, and its working groups. Note that other groups may also 14 distribute working documents as Internet-Drafts. 16 Internet-Drafts are draft documents valid for a maximum of six 17 months and may be updated, replaced, or obsoleted by other 18 documents at any time. It is inappropriate to use Internet- 19 Drafts as reference material or to cite them other than as ``work 20 in progress.'' 22 To learn the current status of any Internet-Draft, please check 23 the ``1id-abstracts.txt'' listing contained in the Internet- 24 Drafts Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net 25 (Europe), munnari.oz.au (Pacific Rim), ftp.ietf.org (US East 26 Coast), or ftp.isi.edu (US West Coast). 28 Abstract 30 A system for Uniform Resource Names (URNs) must be capable of 31 supporting new naming systems. As an example of proposing a new 32 namespace, this document proposes the 'ietf' namespace. This 33 namespace consists of the RFC family of documents (RFCs, STDs, FYIs, 34 and BCPs) developed by the IETF and published by the RFC Editor, the 35 minutes of working groups (WG) and birds of a feather (BOF) meetings 36 that occur during IETF conferences, and the Internet Drafts published 37 by the Internet Drafts Editor. Both the current URN framework and 38 URN syntax support this namespace. 40 0.1 Changes from -02 42 This document has been restructured to use the template proposed in 43 draft-ietf-urn-nid-req-03.txt. Example Perl scripts for resolving 44 this namespace have been supplied in an Appendix. 46 0.2 Changes from -03 48 Text was added to the template clarifying persistence and uniqueness. 49 Support for the BCP document series added to the examples and the 50 ABNF. 52 0.3 Changes from -04 54 More clarifications for the persistence section. In addition, 55 cleaned up some typos and ensured that the Appendix examples are 56 functional 58 0.4 Changes from -05 60 Based on a number of requests, i-ds have been added to the structure 61 and resolvers. In addition, some examples have been added. 63 0.4 Changes from -06 65 Some changes of the template to conform with draft-ietf-urn-nid-req- 66 06.txt. Minor editing of some of the sections for more clarity. 68 1. Introduction 70 This document proposes the "ietf" namespace, which consists of the 71 RFC family of documents (RFCs, STDs, FYIs, and BCPs) developed by the 72 IETF and published by the RFC editor and the minutes of working 73 groups (WG) and birds of a feather (BOF) meetings that occur during 74 IETF conferences. 76 The namespace specification is for a formal namespace. 78 2. Specification Template 80 Namespace ID: 82 "ietf" requested. 84 Registration Information: 86 Registration version number: 1 87 Registration date: 1998-10-09 89 Declared registrant of the namespace: 91 Ryan Moats 92 jayhawk@att.com 94 Declaration of structure: 96 The identifier has the following ABNF [2] specification: 98 NSS = (family ":" number) / ("mtg-" number "-" wgbofname) 99 ( "id:" name) 100 family = "rfc" / "std" / "fyi" / "bcp" 101 number = 1*DIGIT 102 wgbofname = 1*LETDIGIT 103 name = id draft name beginning with "draft-" and trailing 104 type removed (e.g. ietf-urn-ietf-06) 105 LETDIGIT = DIGIT / %x41-%x5a / %x61-%x7a 106 DIGIT = %x30-%x39 108 If the IESG (or it successor) adds a new document 109 series, this ABNF specification will need to be 110 updated. Further, if a working group or BOF is 111 created that used characters outside the range of this 112 ABNF specification, this specification will need to be 113 updated. Any system intended to resolve names for 114 this namespace should be written with the awareness 115 that this could occur at any time. 117 Identifier uniqueness considerations: 119 Because the rfc-editor assigns the RFC number uniquely 120 these URNs are unique. Since the mapping between RFCs 121 and other rfc-editor document series (STDs, FYIs or 122 BCPs) is not necessarily one-to-one, uniqueness of 123 STDs, FYIs and BCPs are defined based on the document 124 mappings maintained by the RFC Editor (the index files 125 "rfc-index.txt", "fyi-index.txt", "bcp-index.txt", 126 "std-index.txt") are defined to be the definitive 127 statement of the assignment of RFC Family URNs in this 128 namespace. The meeting minutes portion of the 129 namespace is guaranteed unique because the URN 130 includes the sequence number of the IETF conference. 131 The document mapping maintained by the Internet Drafts 132 editor ("1id-abstracts.txt") is defined as the 133 definitive statement of the assignment of URNs for 134 the internet draft portion of this namespace. 136 Identifier persistence considerations: 138 Persistence of the URNs of this namespace is 139 independent of the mutability of the underlying 140 documents. A URN once assigned will never be 141 reassigned to a different resource; the assignment is 142 persistent and immutable. Distinct from this, the 143 resources identified as RFCs are immutable, whereas 144 the other sorts of documents, STDs, FYIs, and BCPs are 145 not. They may be composites of one or more RFCs and 146 the set of RFCs that includes them may change with 147 time. It is important to note that this mutability of 148 some resources is independent of the immutability of 149 URN assignment to a resource. 151 Process of identifier assignment: 153 Assignment of URNs from this namespace occurs in three 154 ways. The first is through publication of a new RFC, 155 FYI, STD or BCP is by the RFC Editor. This new document 156 will have a new series number and will therefore define 157 a new URN. The document mappings maintained by the 158 RFC Editor (the index files "rfc-index.txt", 159 "fyi-index.txt", "bcp-index.txt" and "std-index.txt") 160 are defined to be the definitive statement of the 161 assignment of RFC Family URNs in this namespace. 163 The second way a URN is assigned is through the filing 164 of meeting minutes by a working group or birds of a 165 feather as part of an IETF conference. The list of 166 minutes maintained by the IETF for each working group 167 and conference in the subtree pointed at by the URL 168 ftp://ietf.org/ietf/ is considered the definitive 169 assignment of URNs for working group or birds of a 170 feather minutes. 172 The third way a URN is assigned is through the 173 publication of a new internet-draft by the Internet 174 Draft Editor. This draft will have a distinct name 175 (and version number) and therefore defined a new URN. 176 The document mapping maintained by the Internet Drafts 177 editor ("1id-abstracts.txt") is defined as the 178 definitive statement of the assignment of URNs for 179 this portion of the namespace. 181 Process of identifier resolution: 183 A mirrored copy of the underlying documentation is 184 required to resolve these URNs. Resolution via 185 HTTP is done by a set of simple Perl cgi-bin 186 scripts presented in Appendix A. 188 Rules for Lexical Equivalence: 190 The entire URN is case-insensitive. 192 Conformance with URN Syntax: 194 There are no additional characters reserved. 196 Validation mechanism: 198 None specified. 200 Scope: 202 Global. 204 3. Examples 206 The following are examples of URNs that a resolver for this namespace 207 can resolve: 209 urn:ietf:rfc:2141 210 urn:ietf:std:50 211 urn:ietf:id:ietf-urn-ietf-06.txt 212 urn:ietf:mtg-41-urn 214 4. Security Considerations 216 Because this namespace defines no additional reserved characters, it 217 does not add any security considerations beyond those inherent from 218 the existence of the reserved characters from [1]. Further, none of 219 the reserved characters from [1] are used in the definition of the 220 NSS. This means that resolvers for this namespace may be considered 221 "secure" in the sense that any escaping of characters in the NSS MUST 222 result in the resolver indicating that the URN has incorrect syntax. 224 5. Acknowledgments 226 Thanks to various members of the URN working group for comments on 227 earlier drafts of this document. The work described in this document 228 is partially supported by the National Science Foundation, 229 Cooperative Agreement NCR-9218179. 231 6. References 233 Request For Comments (RFC) and Internet Draft documents are available 234 from and numerous mirror sites. 236 [1] R. Moats, "URN Syntax," RFC 2141, May 5, 1997. 238 [2] D. Crocker, P. Overell, "Augmented BNF for Syntax 239 Specifications: ABNF," RFC 2234, November 1997. 241 7. Author's Address 243 Ryan Moats 244 AT&T 245 15621 Drexel Circle 246 Omaha, NE 68135-2358 247 USA 249 Phone: +1 402 894-9456 250 EMail: jayhawk@att.com 252 Appendix A. Example Resolution Scripts 254 The following scripts are examples that can be used for resolving 255 URNs in this namespace. 257 A.1 I2C 259 #!/usr/local/bin/perl 261 use strict; 263 # 264 # this is a URN 2 URC resolver for the ietf namespace 265 # 267 my(%cite) = ( 268 bcp => "/ftp/rfc/bcp-index.txt", 269 fyi => "/ftp/fyi/fyi-index.txt", 270 id => "/ftp/internet-drafts/1id-abstracts.txt", 271 rfc => "/ftp/rfc/rfc-index.txt", 272 std => "/ftp/std/std-index.txt" 273 ); 274 my(%number2date) = ( 275 41 => "98apr", 276 40 => "97dec", 39 => "97aug", 38 => "97apr", 277 37 => "96dec", 36 => "96jun", 35 => "96mar", 278 34 => "95dec", 33 => "95jul", 32 => "95apr", 279 31 => "94dec", 30 => "94jul", 29 => "94mar", 280 28 => "93nov", 27 => "93jul", 26 => "93mar", 281 25 => "92nov", 24 => "92jul", 23 => "92mar", 282 22 => "91nov", 21 => "91jul", 20 => "91mar", 283 19 => "90dec" ); 285 my($wgpath) = "/ftp/ietf"; 286 my($urn) = $ENV{'QUERY_STRING'}; 287 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 288 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 290 (&resolveid($1), exit) if ($urn =~ /urn:ietf:id:(i); 291 (&resolverfc($1, $2), exit) if ($urn =~ /urn:ietf:(72)/i); 292 (&resolvemtg($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(9*)-( 293 120&urn_error("400 Bad Request0); 295 sub resolvemtg { 296 my($ietfnum, $sesnam) = @_; 297 &urn_error("404 Not Found0) if (!defined $number2date{$ietfnum}); 298 my($date)=$number2date{$ietfnum}; 299 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 300 if (-f $link) { 301 print "Status: 200 OK70; 302 print "Content-type: text/html70; 303 print "0TITLE>Citation for $urn0; 304 print "0; 305 print "

0/HTML>0; 309 return; 310 } 311 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 312 if (-f $link) { 313 print "Status: 200 OK70; 314 print "Content-type: text/html70; 315 print "0TITLE>Citation for $urn0; 316 print "0; 317 print "

0/HTML>0; 321 return; 322 } 323 &urn_error("404 Not Found0); 324 } 326 sub end { 327 my($inarg)=@_; 328 return $inarg . "st" if ($inarg =~ /1$/); 329 return $inarg . "nd" if ($inarg =~ /2$/); 330 return $inarg . "rd" if ($inarg =~ /3$/); 331 return $inarg . "th"; 332 } 334 sub resolverfc { 335 my($flag,@bib,$i,$k,$j,$done,@ref); 336 my($l,$link); 337 my($scheme, $value) = @_; 338 $scheme =~ tr/A-Z/a-z/; 339 if (!defined $cite{$scheme}) { 340 &urn_error("404 Not Found0); 341 } 343 $flag = 0; 344 open(INPUT, "$cite{$scheme}"); 345 while () { 346 $flag = 1 if (/^0*$value /); 347 if ($flag == 1) { 348 last if (/^$/); 349 chop; 350 push @bib,$_; 351 } 352 } 354 if ($scheme ne "rfc") { 355 print "Status: 200 OK70; 356 print "Content-type: text/html70; 357 $bib[0] =~ s/^[0-9]*//; 358 for ($i=0; $i<=$#bib; $i+=1) { 359 last if ($bib[$i] =~ s/././); 360 } 361 for ($i=0;$i<=$#bib;$i+=1) { 362 $k=$bib[$i]; 363 while ($k =~ /(fyi|std|rfc|bcp)([0-9]+)(.*)/i) { 364 push @ref,"$1$2"; 365 $k=$3; 366 } 367 $done=""; 368 foreach $j (@ref) { 369 next if ($done =~ $j); 370 $done .= "$j "; 371 $l = $j; 372 $l =~ tr/A-Z/a-z/; 373 $link=&make_link("$l"); 374 $bib[$i] =~ s/$j/$j/g; 375 } 376 } 377 print "0TITLE>Citation for $urn0; 378 print "0; 379 $link=&make_link("$scheme$value"); 380 print "

0/HTML>0; 385 } else { 386 print "Status: 200 OK70; 387 print "Content-type: text/html70; 388 $bib[0] =~ s/^[0-9]*//; 389 $j=0; 390 for ($i=0; $i<=$#bib; $i+=1) { 391 $j += ($bib[$i] =~ s/, "/, "/); 392 $j += ($bib[$i] =~ s/",/",/); 393 } 394 for ($i=0;$i<=$#bib;$i+=1) { 395 $k=$bib[$i]; 396 while ($k =~ /(fyistdrfc|bcp)([0-9]+)(.*)/i) { 397 push @ref,"$1$2"; 398 $k=$3; 399 } 400 $done=""; 401 foreach $j (@ref) { 402 next if ($done =~ $j); 403 $done .= "$j "; 404 $l = $j; 405 $l =~ s//g; 406 $l =~ tr/A-Z/a-z/; 407 $link=&make_link("$l"); 408 $bib[$i] =~ s/$j/$j/g; 409 } 410 } 411 print "0TITLE>Citation for $urn0; 412 print "0; 413 $link=&make_link("$scheme$value"); 414 print "

0/HTML>0; 419 } 420 } 422 sub make_link { 423 my($sc); 424 my($inarg)=@_; 425 ($sc=$1) if ($inarg =~ /([a-z]*)/); 426 return "/$sc/$inarg.ps" if (-e "/ftp/$sc/$inarg.ps"); 427 return "/$sc/$inarg.html" if (-e "/ftp/$sc/$inarg.html"); 428 return "/$sc/$inarg.txt"; 429 } 431 sub urn_error { 432 my($code) = @_; #store failure code here... 434 print "Status: $code"; 435 print "Content-type: text/html0HTML>0; 436 print "URN Resolution: I2C $code0; 437 print "0; 438 print "

URN to URC resolution failed for the URN:

0; 439 print "

$urn

0; 440 print "0; 441 print "0; 442 exit; 443 }; 445 sub resolveid { 446 my($flag,@bib,$i,$k,$j,$count,@ref); 447 my($l,$link, $hdr, $done); 448 my($value) = @_; 449 my($scheme) = "id"; 451 open(INPUT, "$cite{$scheme}"); 452 while () { 453 # 454 # capture record 455 # 456 if ($flag == 1 || /^ 457 push @bib,$_; 458 ($hdr = -1, $count = 0, $flag = 1) if (/^ 459 $count++ if (/^/); 460 } 461 if ($count == 1) { 462 $hdr = $#bib if ($hdr == -1); 463 } 464 if ($count == 2) { 465 for ($i=0; $i<=$hdr; $i+=1) { 466 if ($bib[$i] =~ /<(.*)>/) { 467 $l = $1; 468 if ($l eq "draft-$value.txt" || $l eq "draft-$value.ps") { 469 print "Status: 200 OK70; 470 print "Content-type: text/html70; 471 print "0TITLE>Citation for $urn0; 472 print "0; 473 print "
0; 475 foreach $i (@bib) { 476 print "$i"; 477 } 478 print "0; 479 print "0/HTML>0; 480 exit; 481 } 482 } 483 } 484 $flag = 0; 485 @bib = (); 486 } 487 } 488 &urn_error("404 Not Found0); 489 } 491 A.2 I2L 493 #!/usr/local/bin/perl 495 use strict; 497 # 498 # this is a URN 2 URL resolver for the ietf namespace 499 # 501 my(%pathbase) = ( 502 rfc => "rfc/rfc", 503 fyi => "fyi/fyi", 504 std => "std/std", 505 bcp => "bcp/bcp", 506 id => "internet-drafts/draft-", 507 ); 509 my(%number2date) = ( 510 41 => "98apr", 511 40 => "97dec", 39 => "97aug", 38 => "97apr", 512 37 => "96dec", 36 => "96jun", 35 => "96mar", 513 34 => "95dec", 33 => "95jul", 32 => "95apr", 514 31 => "94dec", 30 => "94jul", 29 => "94mar", 515 28 => "93nov", 27 => "93jul", 26 => "93mar", 516 25 => "92nov", 24 => "92jul", 23 => "92mar", 517 22 => "91nov", 21 => "91jul", 20 => "91mar", 518 19 => "90dec" ); 520 my($wgpath) = "/ftp/ietf"; 521 my($urn) = $ENV{'QUERY_STRING'}; 522 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 523 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 525 (&resolveid($1), exit) if ($urn =~ /urn:ietf:id:(i); 526 (&resolverfc($1, $2), exit) if ($urn =~ /urn:ietf:(72)/i); 527 (&resolvemtg($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(9*)-( 528 120&urn_error("400 Bad Request0); 530 sub resolvemtg { 531 my($ietfnum, $sesnam) = @_; 532 &urn_error("404 Not Found0) if (!defined $number2date{$ietfnum}); 533 my($date)=$number2date{$ietfnum}; 534 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 535 if (-f $link) { 536 print "Status: 302 Moved temporarily0; 537 print "Location: $link0; 538 return; 539 } 540 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 541 if (-f $link) { 542 print "Status: 302 Moved temporarily0; 543 print "Location: $link0; 544 return; 545 } 546 &urn_error("404 Not Found0); 547 } 549 sub end { 550 my($inarg)=@_; 551 return $inarg . "st" if ($inarg =~ /1$/); 552 return $inarg . "nd" if ($inarg =~ /2$/); 553 return $inarg . "rd" if ($inarg =~ /3$/); 554 return $inarg . "th"; 555 } 557 sub resolverfc { 558 my($flag,@bib,$i,$k,$j,$done,@ref); 559 my($l,$link); 560 my($scheme, $value) = @_; 561 $scheme =~ tr/A-Z/a-z/; 562 &urn_error("404 Not Found0)if (!defined $pathbase{$scheme}); 563 my($txttry)="/ftp/$pathbase{$scheme}$value.txt"; 564 my($pstry)="/ftp/$pathbase{$scheme}$value.ps"; 565 my($htmltry)="/ftp/$pathbase{$scheme}$value.html"; 566 MIME_SWITCH: { 567 if ($accept =~ /application/postscript/ && -f $pstry) { 568 print "Status: 302 Moved temporarily0; 569 print "Location: http://$host/$pathbase{$scheme}$value.ps0; 570 last MIME_SWITCH; 571 } 572 if ($accept =~ /text/html/ && -f $htmltry) { 573 print "Status: 302 Moved temporarily0; 574 print "Location: http://$host/$pathbase{$scheme}$value.html0; 575 last MIME_SWITCH; 577 } 578 if ($accept =~ /text/plain/ && -f $txttry) { 579 print "Status: 302 Moved temporarily0; 580 print "Location: http://$host/$pathbase{$scheme}$value.txt0; 581 last MIME_SWITCH; 582 } 583 &urn_error("404 Not Found0); 584 } 585 } 587 sub urn_error { 588 my($code) = @_; #store failure code here... 590 print "Status: $code"; 591 print "Content-type: text/html0HTML>0; 592 print "URN Resolution: I2L $code0; 593 print "0; 594 print "

URN to URL resolution failed for the URN:

0; 595 print "

$urn

0; 596 print "0; 597 print "0; 598 exit; 599 } 601 sub resolveid { 602 my($flag,@bib,$i,$k,$j,$done,@ref); 603 my($l,$link); 604 my($scheme) = "id"; 605 my($value) = @_; 606 $scheme =~ tr/A-Z/a-z/; 607 &urn_error("404 Not Found0)if (!defined $pathbase{$scheme}); 608 my($txttry)="/ftp/$pathbase{$scheme}$value.txt"; 609 my($pstry)="/ftp/$pathbase{$scheme}$value.ps"; 610 my($htmltry)="/ftp/$pathbase{$scheme}$value.html"; 611 MIME_SWITCH: { 612 if ($accept =~ /application/postscript/ && -f $pstry) { 613 print "Status: 302 Moved temporarily0; 614 print "Location: http://$host/$pathbase{$scheme}$value.ps0; 615 last MIME_SWITCH; 616 } 617 if ($accept =~ /text/html/ && -f $htmltry) { 618 print "Status: 302 Moved temporarily0; 619 print "Location: http://$host/$pathbase{$scheme}$value.html0; 620 last MIME_SWITCH; 621 } 622 if ($accept =~ /text/plain/ && -f $txttry) { 623 print "Status: 302 Moved temporarily0; 624 print "Location: http://$host/$pathbase{$scheme}$value.txt0; 625 last MIME_SWITCH; 626 } 627 &urn_error("404 Not Found0); 628 } 629 } 631 A.3 I2Ls 633 #!/usr/local/bin/perl 635 use strict; 637 # 638 # this is a URN 2 URLs resolver for the ietf namespace 639 # 641 my(@urls); 643 my(%pathbase) = ( 644 rfc => "rfc/rfc", 645 fyi => "fyi/fyi", 646 std => "std/std", 647 bcp => "bcp/bcp", 648 id => "internet-drafts/draft-" 649 ); 651 my(%number2date) = ( 652 41 => "98apr", 653 40 => "97dec", 39 => "97aug", 38 => "97apr", 654 37 => "96dec", 36 => "96jun", 35 => "96mar", 655 34 => "95dec", 33 => "95jul", 32 => "95apr", 656 31 => "94dec", 30 => "94jul", 29 => "94mar", 657 28 => "93nov", 27 => "93jul", 26 => "93mar", 658 25 => "92nov", 24 => "92jul", 23 => "92mar", 659 22 => "91nov", 21 => "91jul", 20 => "91mar", 660 19 => "90dec" ); 662 my($wgpath) = "/ftp/ietf"; 663 my($urn) = $ENV{'QUERY_STRING'}; 664 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 665 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 667 (&resolveid($1), exit) if ($urn =~ /urn:ietf:id:(i); 668 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(72)/i); 669 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(9*)-( 670 120&urn_error("400 Bad Request0); 672 sub resolve2 { 673 my($ietfnum, $sesnam) = @_; 674 &urn_error("404 Not Found0) if (!defined $number2date{$ietfnum}); 675 my($date)=$number2date{$ietfnum}; 676 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 677 if (-f $link) { 678 $link=~s/^/ftp///; 679 my($ftplink)="ftp://$host/$link"; 680 my($httplink)="http://$host/$link"; 681 my($glink)="gopher://$host:70/0/$link"; 682 if ($accept =~ /text/uri-list/) { #look for text/uri-list, otherwise 683 text/html 684 print "Status: 200 OK0; 685 print "Content-type: text/uri-list0; 686 print "#$urn0; 687 print "$ftplink0; 688 print "$httplink0; 689 print "$glink0; 690 } 691 if ($accept =~ /text/html/) { 692 print "Status: 200 OK0; 693 print "Content-type: text/html0HTML>0; 694 print "URN Resolution: I2Ls0; 695 print "0; 696 print "

URN $urn resolves to the following URLs:

0; 697 print "