idnits 2.17.00 (12 Aug 2021) /tmp/idnits9624/draft-ietf-urn-ietf-05.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 (2022-05-20) 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) 2022 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 23 longer pages, the longest (page 2) being 60 lines == It seems as if not all pages are separated by form feeds - found 0 form feeds but 24 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 30 instances of too long lines in the document, the longest one being 19 characters in excess of 72. ** 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 181: '...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 (May 1998) is 8771 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 344, but not defined -- Looks like a reference, but probably isn't: '0-9' on line 344 ** Obsolete normative reference: RFC 2141 (ref. '1') (Obsoleted by RFC 8141) ** Obsolete normative reference: RFC 2234 (ref. '2') (Obsoleted by RFC 4234) Summary: 13 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-05.txt AT&T 4 Expires in six months May 1998 6 A URN Namespace for IETF Documents 7 Filename: draft-ietf-urn-ietf-05.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 view the entire list of current Internet-Drafts, please check 23 the "1id-abstracts.txt" listing contained in the Internet-Drafts 24 Shadow Directories on ftp.is.co.za (Africa), ftp.nordu.net 25 (Northern Europe), ftp.nis.garr.it (Southern Europe), munnari.oz.au 26 (Pacific Rim), ftp.ietf.org (US East Coast), or ftp.isi.edu 27 (US West Coast). 29 Abstract 31 A system for Uniform Resource Names (URNs) must be capable of 32 supporting new naming systems. As an example of proposing a new 33 namespace, this document proposes the "ietf" namespace. This 34 namespace consists of the RFC family of documents (RFCs, STDs, FYIs, 35 and BCPs) developed by the IETF and published by the RFC editor and 36 the minutes of working groups (WG) and birds of a feather (BOF) 37 meetings that occur during IETF conferences. Both the current URN 38 framework and 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 1. Introduction 60 This document proposes the "ietf" namespace, which consists of the 61 RFC family of documents (RFCs, STDs, FYIs, and BCPs) developed by the 62 IETF and published by the RFC editor and the minutes of working 63 groups (WG) and birds of a feather (BOF) meetings that occur during 64 IETF conferences. 66 The namespace specification is for a formal namespace. 68 2. Specification Template 70 Namespace ID: 72 "ietf" requested. 74 Declared registrant of the namespace: 76 Ryan Moats 77 jayhawk@att.com 79 Declaration of structure: 81 The identifier has the following ABNF [2] specification: 83 NSS = (family ":" number) / ("mtg-" number "-" wgbofname) 84 family = "rfc" / "std" / "fyi" / "bcp" 85 number = 1*DIGIT 86 wgbofname = 1*LETDIGIT 87 LETDIGIT = DIGIT / %x41-%x5a / %x61-%x7a 88 DIGIT = %x30-%x39 90 If the IESG (or it successor) adds a new document 91 series, this ABNF specification will need to be 92 updated. Further, if a working group or BOF is 93 created that used characters outside the range of this 94 ABNF specification, this specification will need to be 95 updated. Any system intended to resolve names for 96 this namespace should be written with the awareness 97 that this could occur at any time. 99 Identifier uniqueness considerations: 101 Because the rfc-editor assigns the RFC number uniquely 102 these URNs are unique. Since the mapping between RFCs 103 and other rfc-editor document series (STDs, FYIs or 104 BCPs) is not necessarily one-to-one, uniqueness of 105 STDs, FYIs and BCPs are defined based on the document 106 mappings maintained by the RFC Editor (the index files 107 "rfc-index.txt", "fyi-index.txt", "bcp-index.txt" and 108 "std-index.txt") are defined to be the definitive 109 statement of the assignment of RFC Family URNs in this 110 namespace. The meeting minutes portion of the 111 namespace is guaranteed unique because the URN 112 includes the sequence number of the IETF conference. 114 Identifier persistence considerations: 116 Persistence of the URNs of this namespace is 117 independent of the mutability of the underlying 118 documents. A URN once assigned will never be 119 reassigned to a different resource; the assignment is 120 persistent and immutable. Distinct from this, the 121 resources identified as RFCs are immutable, whereas 122 the other sorts of documents, STDs, FYIs, and BCPs are 123 not. They may be composites of one or more RFCs and 124 the set of RFCs that comprise them may change with 125 time. It is important to note that this mutability of 126 some resources is independent of the immutability of 127 URN assignment to a resource. 129 Process of identifier assignment: 131 Assignment of URNs from this namespace occurs in two 132 ways. The first is when a new RFC, FYI, STD or BCP is 133 passed by the IESG and published by the RFC 134 Editor. This new document will have a new series 135 number and will therefore define a new URN. The 136 document mappings maintained by the RFC Editor (the 137 index files "rfc-index.txt", "fyi-index.txt", 138 "bcp-index.txt" and "std-index.txt") are defined to be 139 the definitive statement of the assignment of RFC 140 Family URNs in this namespace. 142 The second way a URN is assigned is when a working 143 group or birds of a feather files meeting minutes as 144 part of an IETF conference. The list of minutes 145 maintained by the IETF for each working group and 146 conference in the subtree pointed at by the URL 147 ftp://ietf.org/ietf/ is considered the definitive 148 assignment of URNs for working group or birds of a 149 feather minutes. 151 Process of identifier resolution: 153 A mirrored copy of the underlying documentation is 154 required to resolve these URNs. Resolution via 155 HTTP is accomplished by a set of simple Perl cgi-bin 156 scripts presented in Appendix A. 158 Rules for Lexical Equivalence: 160 The entire URN is case-insensitive. 162 Conformance with URN Syntax: 164 There are no additional characters reserved. 166 Validation mechanism: 168 None specified. 170 Scope: 172 Global. 174 3. Security Considerations 176 Because this namespace defines no additional reserved characters, it 177 does not add any security considerations beyond those inherent from 178 the existence of the reserved characters from [1]. Further, none of 179 the reserved characters from [1] are used in the definition of the 180 NSS. This means that resolvers for this namespace may be considered 181 "secure" in the sense that any escaping of characters in the NSS MUST 182 result in the resolver indicating that the URN has incorrect syntax. 184 4. Acknowledgments 186 Thanks to various members of the URN working group for comments on 187 earlier drafts of this document. The work described in this document 188 is partially supported by the National Science Foundation, 189 Cooperative Agreement NCR-9218179. 191 4. References 193 Request For Comments (RFC) and Internet Draft documents are available 194 from and numerous mirror sites. 196 [1] R. Moats, "URN Syntax," RFC 2141, May 5, 1997. 198 [2] D. Crocker, P. Overell, "Augmented BNF for Syntax Specifica- 199 tions: ABNF," RFC 2234, November 1997. 201 5. Author's Address 203 Ryan Moats 204 AT&T 205 15621 Drexel Circle 206 Omaha, NE 68135-2358 207 USA 209 Phone: +1 402 894-9456 210 EMail: jayhawk@att.com 212 Appendix A. Example Resolution Scripts 214 The following scripts are examples that can be used for resolving 215 URNs in this namespace. 217 A.1 I2C 219 #!/usr/local/bin/perl 221 use strict; 223 # 224 # this is a URN 2 URC resolver for the ietf namespace 225 # 227 my(%cite) = ( 228 rfc => "/ftp/rfc/rfc-index.txt", 229 fyi => "/ftp/fyi/fyi-index.txt", 230 std => "/ftp/std/std-index.txt", 231 bcp => "/ftp/rfc/bcp-index.txt" 232 ); 233 my(%number2date) = ( 234 41 => "98apr", 235 40 => "97dec", 39 => "97aug", 38 => "97apr", 236 37 => "96dec", 36 => "96jun", 35 => "96mar", 237 34 => "95dec", 33 => "95jul", 32 => "95apr", 238 31 => "94dec", 30 => "94jul", 29 => "94mar", 239 28 => "93nov", 27 => "93jul", 26 => "93mar", 240 25 => "92nov", 24 => "92jul", 23 => "92mar", 241 22 => "91nov", 21 => "91jul", 20 => "91mar", 242 19 => "90dec" ); 244 my($wgpath) = "/ftp/ietf"; 245 my($urn) = $ENV{'QUERY_STRING'}; 246 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 247 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 249 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); 250 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); 251 &urn_error("400 Bad Request\n"); 253 sub resolve2 { 254 my($ietfnum, $sesnam) = @_; 255 &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); 256 my($date)=$number2date{$ietfnum}; 257 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 258 if (-f $link) { 259 print "Status: 200 OK\r\n"; 260 print "Content-type: text/html\r\n\r\n"; 261 print "\nCitation for $urn\n"; 262 print "\n"; 263 print "

$urn:

\n"; 264 print "Minutes of the $sesnam working group from the " . &end($ietfnum) . " IETF"; 265 print "\n\n"; 266 return; 267 } 268 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 269 if (-f $link) { 270 print "Status: 200 OK\r\n"; 271 print "Content-type: text/html\r\n\r\n"; 272 print "\nCitation for $urn\n"; 273 print "\n"; 274 print "

$urn:

\n"; 275 print "Minutes of the $sesnam working group from the " . &end($ietfnum) . " IETF"; 276 print "\n\n"; 277 return; 278 } 279 &urn_error("404 Not Found\n"); 280 } 282 sub end { 283 my($inarg)=@_; 284 return $inarg . "st" if ($inarg =~ /1$/); 285 return $inarg . "nd" if ($inarg =~ /2$/); 286 return $inarg . "rd" if ($inarg =~ /3$/); 287 return $inarg . "th"; 288 } 290 sub resolve1 { 291 my($flag,@bib,$i,$k,$j,$done,@ref); 292 my($l,$link); 293 my($scheme, $value) = @_; 294 $scheme =~ tr/A-Z/a-z/; 295 if (!defined $cite{$scheme}) { 296 &urn_error("404 Not Found\n"); 297 } 299 $flag = 0; 300 open(INPUT, "$cite{$scheme}"); 301 while () { 302 $flag = 1 if (/^0*$value /); 303 if ($flag == 1) { 304 last if (/^$/); 305 chop; 306 push @bib,$_; 307 } 308 } 310 if ($scheme ne "rfc") { 311 print "Status: 200 OK\r\n"; 312 print "Content-type: text/html\r\n\r\n"; 313 $bib[0] =~ s/^[0-9]*\s*//; 314 for ($i=0; $i<=$#bib; $i+=1) { 315 last if ($bib[$i] =~ s/\./.<\/B>/); 316 } 317 for ($i=0;$i<=$#bib;$i+=1) { 318 $k=$bib[$i]; 319 while ($k =~ /(fyi|std|rfc|bcp)([0-9]+)(.*)/i) { 320 push @ref,"$1$2"; 321 $k=$3; 322 } 323 $done=""; 324 foreach $j (@ref) { 325 next if ($done =~ $j); 326 $done .= "$j "; 327 $l = $j; 328 $l =~ tr/A-Z/a-z/; 329 $link=&make_link("$l"); 330 $bib[$i] =~ s/$j/$j<\/A>/g; 331 } 332 } 333 print "\nCitation for $urn\n"; 334 print "\n"; 335 $link=&make_link("$scheme$value"); 336 print "

$scheme$value:

\n"; 337 foreach $i (@bib) { 338 print "$i\n"; 339 } 340 print "\n\n"; 341 } else { 342 print "Status: 200 OK\r\n"; 343 print "Content-type: text/html\r\n\r\n"; 344 $bib[0] =~ s/^[0-9]*\s*//; 345 $j=0; 346 for ($i=0; $i<=$#bib; $i+=1) { 347 $j += ($bib[$i] =~ s/, "/, "/); 348 $j += ($bib[$i] =~ s/",/"<\/B>,/); 349 } 350 for ($i=0;$i<=$#bib;$i+=1) { 351 $k=$bib[$i]; 352 while ($k =~ /(fyi\s|std\s|rfc|bcp)([0-9]+)(.*)/i) { 353 push @ref,"$1$2"; 354 $k=$3; 355 } 356 $done=""; 357 foreach $j (@ref) { 358 next if ($done =~ $j); 359 $done .= "$j "; 360 $l = $j; 361 $l =~ s/\s//g; 362 $l =~ tr/A-Z/a-z/; 363 $link=&make_link("$l"); 364 $bib[$i] =~ s/$j/$j<\/A>/g; 365 } 366 } 367 print "\nCitation for $urn\n"; 368 print "\n"; 369 $link=&make_link("$scheme$value"); 370 print "

$scheme$value:

\n"; 371 foreach $i (@bib) { 372 print "$i\n"; 373 } 374 print "\n\n"; 375 } 376 } 378 sub make_link { 379 my($sc); 380 my($inarg)=@_; 381 ($sc=$1) if ($inarg =~ /([a-z]*)/); 382 return "/$sc/$inarg.ps" if (-e "/ftp/$sc/$inarg.ps"); 383 return "/$sc/$inarg.html" if (-e "/ftp/$sc/$inarg.html"); 384 return "/$sc/$inarg.txt"; 385 } 387 sub urn_error { 388 my($code) = @_; #store failure code here... 390 print "Status: $code"; 391 print "Content-type: text/html\n\n\n"; 392 print "URN Resolution: I2C $code\n"; 393 print "\n"; 394 print "

URN to URC resolution failed for the URN:

\n"; 395 print "

$urn

\n"; 396 print "\n"; 397 print "\n"; 398 exit; 399 }; 401 A.2 I2L 403 #!/usr/local/bin/perl 405 use strict; 407 # 408 # this is a URN 2 URL resolver for the ietf namespace 409 # 411 my(%pathbase) = ( 412 rfc => "rfc/rfc", 413 fyi => "fyi/fyi", 414 std => "std/std", 415 bcp => "bcp/bcp", 416 ); 418 my(%number2date) = ( 419 41 => "98apr", 420 40 => "97dec", 39 => "97aug", 38 => "97apr", 421 37 => "96dec", 36 => "96jun", 35 => "96mar", 422 34 => "95dec", 33 => "95jul", 32 => "95apr", 423 31 => "94dec", 30 => "94jul", 29 => "94mar", 424 28 => "93nov", 27 => "93jul", 26 => "93mar", 425 25 => "92nov", 24 => "92jul", 23 => "92mar", 426 22 => "91nov", 21 => "91jul", 20 => "91mar", 427 19 => "90dec" ); 429 my($wgpath) = "/ftp/ietf"; 430 my($urn) = $ENV{'QUERY_STRING'}; 431 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 432 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 434 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); 435 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); 436 &urn_error("400 Bad Request\n"); 438 sub resolve2 { 439 my($ietfnum, $sesnam) = @_; 440 &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); 441 my($date)=$number2date{$ietfnum}; 442 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 443 if (-f $link) { 444 print "Status: 302 Moved temporarily\n"; 445 print "Location: $link\n"; 446 return; 447 } 448 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 449 if (-f $link) { 450 print "Status: 302 Moved temporarily\n"; 451 print "Location: $link\n"; 452 return; 453 } 454 &urn_error("404 Not Found\n"); 455 } 457 sub end { 458 my($inarg)=@_; 459 return $inarg . "st" if ($inarg =~ /1$/); 460 return $inarg . "nd" if ($inarg =~ /2$/); 461 return $inarg . "rd" if ($inarg =~ /3$/); 462 return $inarg . "th"; 463 } 465 sub resolve1 { 466 my($flag,@bib,$i,$k,$j,$done,@ref); 467 my($l,$link); 468 my($scheme, $value) = @_; 469 $scheme =~ tr/A-Z/a-z/; 470 &urn_error("404 Not Found\n")if (!defined $pathbase{$scheme}); 471 my($txttry)="/ftp/$pathbase{$scheme}$value.txt"; 472 my($pstry)="/ftp/$pathbase{$scheme}$value.ps"; 473 my($htmltry)="/ftp/$pathbase{$scheme}$value.html"; 474 MIME_SWITCH: { 475 if ($accept =~ /application\/postscript/ && -f $pstry) { 476 print "Status: 302 Moved temporarily\n"; 477 print "Location: http://$host/$pathbase{$scheme}$value.ps\n\n"; 478 last MIME_SWITCH; 479 } 480 if ($accept =~ /text\/html/ && -f $htmltry) { 481 print "Status: 302 Moved temporarily\n"; 482 print "Location: http://$host/$pathbase{$scheme}$value.html\n\n"; 483 last MIME_SWITCH; 484 } 485 if ($accept =~ /\*\/\*|text\/plain/ && -f $txttry) { 486 print "Status: 302 Moved temporarily\n"; 487 print "Location: http://$host/$pathbase{$scheme}$value.txt\n\n"; 488 last MIME_SWITCH; 489 } 490 &urn_error("404 Not Found\n"); 491 } 492 } 494 sub urn_error { 495 my($code) = @_; #store failure code here... 497 print "Status: $code"; 498 print "Content-type: text/html\n\n\n"; 499 print "URN Resolution: I2L $code\n"; 500 print "\n"; 501 print "

URN to URL resolution failed for the URN:

\n"; 502 print "

$urn

\n"; 503 print "\n"; 504 print "\n"; 505 exit; 506 } 508 A.3 I2Ls 510 #!/usr/local/bin/perl 512 use strict; 514 # 515 # this is a URN 2 URLs resolver for the ietf namespace 516 # 518 my(@urls); 520 my(%pathbase) = ( 521 rfc => "rfc/rfc", 522 fyi => "fyi/fyi", 523 std => "std/std", 524 bcp => "bcp/bcp" 525 ); 526 my(%number2date) = ( 527 41 => "98apr", 528 40 => "97dec", 39 => "97aug", 38 => "97apr", 529 37 => "96dec", 36 => "96jun", 35 => "96mar", 530 34 => "95dec", 33 => "95jul", 32 => "95apr", 531 31 => "94dec", 30 => "94jul", 29 => "94mar", 532 28 => "93nov", 27 => "93jul", 26 => "93mar", 533 25 => "92nov", 24 => "92jul", 23 => "92mar", 534 22 => "91nov", 21 => "91jul", 20 => "91mar", 535 19 => "90dec" ); 537 my($wgpath) = "/ftp/ietf"; 538 my($urn) = $ENV{'QUERY_STRING'}; 539 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 540 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 542 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); 543 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); 544 &urn_error("400 Bad Request\n"); 546 sub resolve2 { 547 my($ietfnum, $sesnam) = @_; 548 &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); 549 my($date)=$number2date{$ietfnum}; 550 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 551 if (-f $link) { 552 $link=~s/^\/ftp\///; 553 my($ftplink)="ftp://$host/$link"; 554 my($httplink)="http://$host/$link"; 555 my($glink)="gopher://$host:70/0/$link"; 556 if ($accept =~ /text\/uri-list/) { #look for text/uri-list, otherwise text/html 557 print "Status: 200 OK\n"; 558 print "Content-type: text/uri-list\n\n\n"; 559 print "#$urn\n"; 560 print "$ftplink\n"; 561 print "$httplink\n"; 562 print "$glink\n"; 563 } 564 if ($accept =~ /\*\/\*|text\/html/) { 565 print "Status: 200 OK\n"; 566 print "Content-type: text/html\n\n\n"; 567 print "URN Resolution: I2Ls\n"; 568 print "\n"; 569 print "

URN $urn resolves to the following URLs:

\n"; 570 print "
\n\n\n"; 575 } 576 return; 577 } 578 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 579 if (-f $link) { 580 $link=~s/^\/ftp\///; 581 my($ftplink)="ftp://$host/$link"; 582 my($httplink)="http://$host/$link"; 583 my($glink)="gopher://$host:70/0/$link"; 584 if ($accept =~ /text\/uri-list/) { #look for text/uri-list, otherwise text/html 585 print "Status: 200 OK\n"; 586 print "Content-type: text/uri-list\n\n\n"; 587 print "#$urn\n"; 588 print "$ftplink\n"; 589 print "$httplink\n"; 590 print "$glink\n"; 591 } 592 if ($accept =~ /\*\/\*|text\/html/) { 593 print "Status: 200 OK\n"; 594 print "Content-type: text/html\n\n\n"; 595 print "URN Resolution: I2Ls\n"; 596 print "\n"; 597 print "

URN $urn resolves to the following URLs:

\n"; 598 print "
\n\n\n"; 603 } 604 return; 605 } 606 &urn_error("404 Not Found\n"); 607 } 609 sub resolve1 { 610 my($flag,@bib,$i,$k,$j,$done,@ref); 611 my($l,$link); 612 my($scheme, $value) = @_; 613 $scheme =~ tr/A-Z/a-z/; 614 &urn_error("404 Not Found\n")if (!defined $pathbase{$scheme}); 615 my($try)="/ftp/$pathbase{$scheme}$value.txt"; 616 if (-f $try) { 617 push(@urls, "http://$host/$pathbase{$scheme}$value.txt"); 618 push(@urls, "ftp://$host/$pathbase{$scheme}$value.txt"); 619 push(@urls, "gopher://$host:70/0/$pathbase{$scheme}$value.txt"); 620 } 621 $try="/ftp/$pathbase{$scheme}$value.ps"; 622 if (-f $try) { 623 push(@urls, "http://$host/$pathbase{$scheme}$value.ps"); 624 push(@urls, "ftp://$host/$pathbase{$scheme}$value.ps"); 625 push(@urls, "gopher://$host:70/0/$pathbase{$scheme}$value.ps"); 626 } 627 $try="/ftp/$pathbase{$scheme}$value.html"; 628 if (-f $try) { 629 push(@urls, "http://$host/$pathbase{$scheme}$value.html"); 630 push(@urls, "ftp://$host/$pathbase{$scheme}$value.html"); 631 } 633 &urn_error("404 Not Found\n") if ($#urls == -1); 635 MIME_SWITCH: { 636 if ($accept =~ /text\/uri-list/) { #look for text/uri-list, otherwise text/html 637 print "Status: 200 OK\n"; 638 print "Content-type: text/uri-list\n\n\n"; 639 print "#$urn\n"; 640 foreach $i (@urls) { 641 print "$i\n"; 642 } 643 last MIME_SWITCH; 644 } 645 if ($accept =~ /\*\/\*|text\/html/) { 646 print "Status: 200 OK\n"; 647 print "Content-type: text/html\n\n\n"; 648 print "URN Resolution: I2Ls\n"; 649 print "\n"; 650 print "

URN $urn resolves to the following URLs:

\n"; 651 print "
    \n"; 652 foreach $i (@urls) { 653 print "
  • $i\n"; 654 } 655 print "
\n\n\n"; 656 last MIME_SWITCH; 657 } 658 } 659 } 661 sub urn_error { 662 my($code) = @_; #store failure code here... 664 print "Status: $code"; 665 print "Content-type: text/html\n\n\n"; 666 print "URN Resolution: I2Ls $code\n"; 667 print "\n"; 668 print "

URN to URL resolution failed for the URN:

\n"; 669 print "

$urn

\n"; 670 print "\n"; 671 print "\n"; 672 exit; 673 } 675 A.4 I2Ns 677 #!/usr/local/bin/perl 679 use strict; 681 # 682 # this is a URN 2 URNs resolver for the ietf namespace 683 # 685 my(%cite) = ( 686 rfc => "/ftp/rfc/rfc-index.txt", 687 fyi => "/ftp/fyi/fyi-index.txt", 688 std => "/ftp/std/std-index.txt", 689 bcp => "/ftp/rfc/bcp-index.txt" 690 ); 692 my(%number2date) = ( 693 41 => "98apr", 694 40 => "97dec", 39 => "97aug", 38 => "97apr", 695 37 => "96dec", 36 => "96jun", 35 => "96mar", 696 34 => "95dec", 33 => "95jul", 32 => "95apr", 697 31 => "94dec", 30 => "94jul", 29 => "94mar", 698 28 => "93nov", 27 => "93jul", 26 => "93mar", 699 25 => "92nov", 24 => "92jul", 23 => "92mar", 700 22 => "91nov", 21 => "91jul", 20 => "91mar", 701 19 => "90dec" ); 703 my($wgpath) = "/ftp/ietf"; 704 my($urn) = $ENV{'QUERY_STRING'}; 705 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 706 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 708 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); 709 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); 710 &urn_error("400 Bad Request\n"); 712 sub resolve2 { 713 my($ietfnum, $sesnam) = @_; 714 &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); 715 my($date)=$number2date{$ietfnum}; 716 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 717 if (-f $link) { 718 if ($accept =~ /text\/uri-list/) { 719 print "Status: 200 OK\n"; 720 print "Content-type: text/uri-list\n\n\n"; 721 print "#$urn\n"; 722 return; 723 } 724 if ($accept =~ /\*\/\*|text\/html/) { 725 print "Status: 200 OK\n"; 726 print "Content-type: text/html\n\n\n"; 727 print "URN Resolution: I2Ns\n"; 728 print "\n"; 729 print "

URN $urn resolves to the following URNs:

\n"; 730 print "
    \n"; 731 print "
\n\n\n"; 732 return; 733 } 734 } 735 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 736 if (-f $link) { 737 if ($accept =~ /text\/uri-list/) { 738 print "Status: 200 OK\n"; 739 print "Content-type: text/uri-list\n\n\n"; 740 print "#$urn\n"; 741 return; 742 } 743 if ($accept =~ /\*\/\*|text\/html/) { 744 print "Status: 200 OK\n"; 745 print "Content-type: text/html\n\n\n"; 746 print "URN Resolution: I2Ns\n"; 747 print "\n"; 748 print "

URN $urn resolves to the following URNs:

\n"; 749 print "
    \n"; 750 print "
\n\n\n"; 751 return; 752 } 753 } 754 &urn_error("404 Not Found\n"); 755 } 757 sub end { 758 my($inarg)=@_; 759 return $inarg . "st" if ($inarg =~ /1$/); 760 return $inarg . "nd" if ($inarg =~ /2$/); 761 return $inarg . "rd" if ($inarg =~ /3$/); 762 return $inarg . "th"; 763 } 764 sub resolve1 { 765 my($flag,@bib,$i,$k,$j,$done,@ref); 766 my($l,$link); 767 my($scheme, $value) = @_; 768 $scheme =~ tr/A-Z/a-z/; 769 if (!defined $cite{$scheme}) { 770 &urn_error("404 Not Found\n"); 771 } 773 $flag = 0; 774 open(INPUT, "$cite{$scheme}"); 775 while () { 776 $flag = 1 if (/^0*$value /); 777 if ($flag == 1) { 778 last if (/^$/); 779 chop; 780 push @bib,$_; 781 } 782 } 784 $k=join " ",@bib; 785 while ($k =~ /(\S*)\s*(fyi|std|rfc|bcp)\s*([0-9]+)(.*)/i) { 786 $k=$4; 787 $a=$2; $b=$3; 788 if (($a ne $scheme || $b ne $value) && ($1 !~ /obso/i)){ 789 $a =~ tr/A-Z/a-z/; 790 $b =~ s/^0*//; 791 push @ref,"urn:ietf:$a:$b"; 792 } 793 } 795 MIME_SWITCH: { 796 if ($accept =~ /text\/uri-list/) { 797 print "Status: 200 OK\n"; 798 print "Content-type: text/uri-list\n\n\n"; 799 print "#$urn\n"; 800 foreach $i (@ref) { 801 print "$i\n"; 802 } 803 last MIME_SWITCH; 804 } 805 if ($accept =~ /\*\/\*|text\/html/) { 806 print "Status: 200 OK\n"; 807 print "Content-type: text/html\n\n\n"; 808 print "URN Resolution: I2Ns\n"; 809 print "\n"; 810 print "

URN $urn resolves to the following URNs:

\n"; 811 print "
    \n"; 812 foreach $i (@ref) { 813 print "
  • $i: Click to resolve using\n"; 814 print "I2C,\n"; 815 print "I2L,\n"; 816 print "I2Ls,\n"; 817 print "I2R,\n"; 818 print "I2Rs\n"; 819 } 820 print "
\n\n\n"; 821 } 822 } 823 } 825 sub make_link { 826 my($sc); 827 my($inarg)=@_; 828 ($sc=$1) if ($inarg =~ /([a-z]*)/); 829 return "/$sc/$inarg.ps" if (-e "/ftp/$sc/$inarg.ps"); 830 return "/$sc/$inarg.html" if (-e "/ftp/$sc/$inarg.html"); 831 return "/$sc/$inarg.txt"; 832 } 834 sub urn_error { 835 my($code) = @_; #store failure code here... 837 print "Status: $code"; 838 print "Content-type: text/html\n\n\n"; 839 print "URN Resolution: I2Ns $code\n"; 840 print "\n"; 841 print "

URN to URC resolution failed for the URN:

\n"; 842 print "

$urn

\n"; 843 print "\n"; 844 print "\n"; 845 exit; 846 }; 848 A.5 I2R 850 #!/usr/local/bin/perl 852 use strict; 854 # 855 # this is a URN 2 resource resolver for the ietf namespace 856 # 858 my(%pathbase) = ( 859 rfc => "rfc/rfc", 860 fyi => "fyi/fyi", 861 std => "std/std", 862 bcp => "bcp/bcp" 863 ); 865 my(%number2date) = ( 866 41 => "98apr", 867 40 => "97dec", 39 => "97aug", 38 => "97apr", 868 37 => "96dec", 36 => "96jun", 35 => "96mar", 869 34 => "95dec", 33 => "95jul", 32 => "95apr", 870 31 => "94dec", 30 => "94jul", 29 => "94mar", 871 28 => "93nov", 27 => "93jul", 26 => "93mar", 872 25 => "92nov", 24 => "92jul", 23 => "92mar", 873 22 => "91nov", 21 => "91jul", 20 => "91mar", 874 19 => "90dec" ); 876 my($wgpath) = "/ftp/ietf"; 877 my($urn) = $ENV{'QUERY_STRING'}; 878 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 879 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 881 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); 882 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); 883 &urn_error("400 Bad Request\n"); 885 sub resolve2 { 886 my($ietfnum, $sesnam) = @_; 887 &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); 888 my($date)=$number2date{$ietfnum}; 889 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 890 if (-f $link) { 891 print "Status: 200 OK\n"; 892 print "Content-type: text/plain\n\n"; 893 open(FILE, "$link"); 894 while () { 895 print $_; 896 } 897 close FILE; 898 return; 899 } 900 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 901 if (-f $link) { 902 print "Status: 200 OK\n"; 903 print "Content-type: text/plain\n\n"; 904 open(FILE, "$link"); 905 while () { 906 print $_; 907 } 908 close FILE; 909 return; 910 } 911 &urn_error("404 Not Found\n"); 912 } 914 sub end { 915 my($inarg)=@_; 916 return $inarg . "st" if ($inarg =~ /1$/); 917 return $inarg . "nd" if ($inarg =~ /2$/); 918 return $inarg . "rd" if ($inarg =~ /3$/); 919 return $inarg . "th"; 920 } 922 sub resolve1 { 923 my($flag,@bib,$i,$k,$j,$done,@ref); 924 my($l,$link); 925 my($scheme, $value) = @_; 926 $scheme =~ tr/A-Z/a-z/; 927 &urn_error("404 Not Found\n")if (!defined $pathbase{$scheme}); 928 my($txttry)="/ftp/$pathbase{$scheme}$value.txt"; 929 my($pstry)="/ftp/$pathbase{$scheme}$value.ps"; 930 my($htmltry)="/ftp/$pathbase{$scheme}$value.html"; 931 MIME_SWITCH: { 932 if ($accept =~ /application\/postscript/ && -f $pstry) { 933 print "Status: 200 OK\n"; 934 print "Content-type: application/postscript\n\n"; 935 open(FILE, "$pstry"); 936 while () { 937 print $_; 938 } 939 close FILE; 940 last MIME_SWITCH; 941 } 942 if ($accept =~ /text\/html/ && -f $htmltry) { 943 print "Status: 200 OK\n"; 944 print "Content-type: text/html\n\n"; 945 open(FILE, "$htmltry"); 946 while () { 947 print $_; 948 } 949 close FILE; 950 last MIME_SWITCH; 951 } 952 if ($accept =~ /\*\/\*|text\/plain/ && -f $txttry) { 953 print "Status: 200 OK\n"; 954 print "Content-type: text/plain\n\n"; 955 open(FILE, "$txttry"); 956 while () { 957 print $_; 958 } 959 close FILE; 960 last MIME_SWITCH; 961 } 962 &urn_error("404 Not Found\n"); 963 } 964 } 966 sub urn_error { 967 my($code) = @_; #store failure code here... 969 print "Status: $code"; 970 print "Content-type: text/html\n\n\n"; 971 print "URN Resolution: I2R $code\n"; 972 print "\n"; 973 print "

URN to URL resolution failed for the URN:

\n"; 974 print "

$urn

\n"; 975 print "\n"; 976 print "\n"; 977 exit; 978 } 980 A.6 I2Rs 982 #!/usr/local/bin/perl 984 use strict; 986 # 987 # this is a URN 2 resources resolver for the ietf namespace 988 # 990 my(@urls); 992 my(%pathbase) = ( 993 rfc => "rfc/rfc", 994 fyi => "fyi/fyi", 995 std => "std/std", 996 bcp => "bcp/bcp" 997 ); 999 my(%number2date) = ( 1000 41 => "98apr", 1001 40 => "97dec", 39 => "97aug", 38 => "97apr", 1002 37 => "96dec", 36 => "96jun", 35 => "96mar", 1003 34 => "95dec", 33 => "95jul", 32 => "95apr", 1004 31 => "94dec", 30 => "94jul", 29 => "94mar", 1005 28 => "93nov", 27 => "93jul", 26 => "93mar", 1006 25 => "92nov", 24 => "92jul", 23 => "92mar", 1007 22 => "91nov", 21 => "91jul", 20 => "91mar", 1008 19 => "90dec" ); 1010 my($wgpath) = "/ftp/ietf"; 1011 my($urn) = $ENV{'QUERY_STRING'}; 1012 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 1013 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 1015 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); 1016 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); 1017 &urn_error("400 Bad Request\n"); 1019 sub resolve2 { 1020 my($ietfnum, $sesnam) = @_; 1021 my(@vers,$i); 1022 &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); 1023 my($date)=$number2date{$ietfnum}; 1024 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 1025 if (-f $link) { 1026 push(@vers,$link); 1027 } 1028 $link="$wgpath/$date/$sesnam-minutes-$date.txt"; 1029 if (-f $link) { 1030 push(@vers,$link); 1031 } 1032 &urn_error("404 Not Found\n") if ($#vers==-1); 1034 print "Status: 200 OK\n"; 1035 print "Content-type: multipart/alternative; boundary=endpart\n\n"; 1036 foreach $i (@vers) { 1037 print "--endpart\n"; 1038 if ($i =~ /html$/) { 1039 print "Content-Type: text/html\n\n"; 1040 } 1041 if ($i =~ /txt$/) { 1042 print "Content-Type: text/plain\n\n"; 1043 } 1044 if ($i =~ /ps$/) { 1045 print "Content-Type: application/postscript\n\n"; 1046 } 1047 open(FILE, "$i"); 1048 while () { 1049 print "$_"; 1050 } 1051 close FILE; 1053 } 1054 print "--endpart\n"; 1055 } 1057 sub resolve1 { 1058 my($flag,@bib,$i,$k,$j,$done,@ref); 1059 my($l,$link,@vers); 1060 my($scheme, $value) = @_; 1061 $scheme =~ tr/A-Z/a-z/; 1062 &urn_error("404 Not Found\n")if (!defined $pathbase{$scheme}); 1063 my($try)="/ftp/$pathbase{$scheme}$value.txt"; 1064 if (-f $try) { 1065 push(@vers, $try); 1066 } 1067 $try="/ftp/$pathbase{$scheme}$value.ps"; 1068 if (-f $try) { 1069 push(@vers, $try); 1070 } 1071 $try="/ftp/$pathbase{$scheme}$value.html"; 1072 if (-f $try) { 1073 push(@vers, $try); 1074 } 1075 print "Status: 200 OK\n"; 1076 print "Content-type: multipart/alternative; boundary=endpart\n\n"; 1077 foreach $i (@vers) { 1078 print "--endpart\n"; 1079 if ($i =~ /html$/) { 1080 print "Content-Type: text/html\n\n"; 1081 } 1082 if ($i =~ /txt$/) { 1083 print "Content-Type: text/plain\n\n"; 1084 } 1085 if ($i =~ /ps$/) { 1086 print "Content-Type: application/postscript\n\n"; 1087 } 1088 open(FILE, "$i"); 1089 while () { 1090 print "$_"; 1091 } 1092 close FILE; 1093 } 1094 print "--endpart\n"; 1095 } 1097 sub urn_error { 1098 my($code) = @_; #store failure code here... 1100 print "Status: $code"; 1101 print "Content-type: text/html\n\n\n"; 1102 print "URN Resolution: I2Rs $code\n"; 1103 print "\n"; 1104 print "

URN to URL resolution failed for the URN:

\n"; 1105 print "

$urn

\n"; 1106 print "\n"; 1107 print "\n"; 1108 exit; 1109 }