idnits 2.17.1 draft-ietf-urn-ietf-03.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-25) 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 22 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 23 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 29 instances of too long lines in the document, the longest one being 26 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 151: '...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 (September 1997) is 9719 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 314, but not defined -- Looks like a reference, but probably isn't: '0-9' on line 314 ** Obsolete normative reference: RFC 2141 (ref. '1') (Obsoleted by RFC 8141) -- Possible downref: Non-RFC (?) normative reference: ref. '2' Summary: 12 errors (**), 0 flaws (~~), 4 warnings (==), 5 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-03.txt AT&T 4 Expires in six months September 1997 6 A URN Namespace for IETF Documents 7 Filename: draft-ietf-urn-ietf-03.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), ds.internic.net (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, and 34 FYIs) developed by the IETF and published by the RFC editor and the 35 minutes of working groups (WG) and birds of a feather (BOF) meetings 36 that occur during IETF conferences. Both the current URN framework 37 and URN syntax support this namespace. 39 0. Changes from -02 41 This document has been restructured to use the template proposed in 42 draft-ietf-urn-nid-req-03.txt. Example Perl scripts for resolving 43 this namespace have been supplied in an Appendix. 45 1. Introduction 47 This document proposes the "ietf" namespace, which consists of the 48 RFC family of documents (RFCs, STDs, and FYIs) developed by the IETF 49 and published by the RFC editor and the minutes of working groups 50 (WG) and birds of a feather (BOF) meetings that occur during IETF 51 conferences. 53 The namespace specification is for a formal namespace. 55 2. Specification Template 57 Namespace ID: 59 "ietf" requested. 61 Declared registrant of the namespace: 63 Ryan Moats 64 jayhawk@att.com 66 Declaration of structure: 68 The identifier has the following ABNF [2] specification: 70 NSS = (family ":" number) / ("mtg-" number "-" wgbofname) 71 family = "rfc" / "std" / "fyi" 72 number = 1*DIGIT 73 wgbofname = 1*LETDIGIT 74 LETDIGIT = DIGIT / %x41..%x5a / %x61..%x7a 75 DIGIT = %x30..%x39 77 If the IESG (or it successor) adds a new document 78 series, this ABNF specification will need to be 79 updated. Further, If a working group or BOF is 80 created that used characters outside the range of this 81 ABNF specification, this specification will need to be 82 updated. Any system intended to resolve names for 83 this namespace should be written with the awareness 84 that this could occur at any time. 86 Identifier uniqueness considerations: 88 Because the rfc-editor assigns the RFC, FYI and STD 89 number uniquely these URNs are unique. The meeting 90 minutes portion of the namespace is guaranteed unique 91 because the URN includes the sequence number of the 92 IETF conference 94 Identifier persistence considerations: 96 Persistence of the URNs of this namespace is dependent 97 on the persistence of the underlying documents. 99 Process of identifier assignment: 101 Assignment of URNs from this namespace occur in two 102 ways. The first is when a new RFC, FYI or STD is 103 passed by the IESG and published by the RFC 104 Editor. This new document will have a new series 105 number and will therefore define a new URN. The 106 document mappings maintained by the RFC Editor (the 107 index files "rfc-index.txt", "fyi-index.txt", 108 "std-index.txt") are defined to be the definitive 109 statement of the assignment of RFC Family URNs in this 110 namespace. 112 The second way a URN is assigned is when a working 113 group or birds of a feather files meeting minutes as 114 part of an IETF conference. The list of minutes 115 maintained by the IETF for each working group and 116 conference in the subtree pointed at by the URL 117 ftp://ietf.org/ietf/ is considered the definitive 118 assignment of URNs for working group or birds of a 119 feather minutes. 121 Process of identifier resolution: 123 A mirrored copy of the underlying documentation is 124 required to resolve these URNs. Resolution via 125 HTTP is accomplished by a set of simple Perl cgi-bin 126 scripts presented in Appendix A. 128 Rules for Lexical Equivalence: 130 The entire URN is case-insensitive. 132 Conformance with URN Syntax: 134 There are no additional characters reserved. 136 Validation mechanism: 138 None specified. 140 Scope: 142 Global. 144 3. Security Considerations 146 Because this namespace defines no additional reserved characters, it 147 does not add any security considerations beyond those inherent from 148 the existence of the reserved characters from [1]. Further, none of 149 the reserved characters from [1] are used in the definition of the 150 NSS. This means that resolvers for this namespace may be considered 151 "secure" in the sense that any escaping of characters in the NSS MUST 152 result in the resolver indicating that the URN has incorrect syntax. 154 4. Acknowledgments 156 Thanks to various members of the URN working group for comments on 157 earlier drafts of this document. The work described in this document 158 is partially supported by the National Science Foundation, 159 Cooperative Agreement NCR-9218179. 161 4. References 163 Request For Comments (RFC) and Internet Draft documents are available 164 from and numerous mirror sites. 166 [1] R. Moats, "URN Syntax," RFC 2141, May 5, 1997. 168 [2] D. Crocker, P. Overell, "Augmented BNF for Syntax Specifica- 169 tions: ABNF," Internet Draft (work in progress), January 170 1997. 172 5. Author's Address 174 Ryan Moats 175 AT&T 176 15621 Drexel Circle 177 Omaha, NE 68135-2358 178 USA 180 Phone: +1 402 894-9456 181 EMail: jayhawk@att.com 183 Appendix A. Example Resolution Scripts 185 The following scripts are examples that can be used for resolving 186 URNs in this namespace. 188 A.1 I2C 189 #!/usr/local/bin/perl 191 use strict; 193 # 194 # this is a URN 2 URC resolver for the ietf namespace 195 # 197 my(%cite) = ( 198 rfc => "/ftp/rfc/rfc-index.txt", 199 fyi => "/ftp/fyi/fyi-index.txt", 200 std => "/ftp/std/std-index.txt" 201 ); 202 my(%number2date) = ( 203 41 => "98apr", 204 40 => "97dec", 39 => "97aug", 38 => "97apr", 205 37 => "96dec", 36 => "96jun", 35 => "96mar", 206 34 => "95dec", 33 => "95jul", 32 => "95apr", 207 31 => "94dec", 30 => "94jul", 29 => "94mar", 208 28 => "93nov", 27 => "93jul", 26 => "93mar", 209 25 => "92nov", 24 => "92jul", 23 => "92mar", 210 22 => "91nov", 21 => "91jul", 20 => "91mar", 211 19 => "90dec" ); 213 my($wgpath) = "/ftp/ietf"; 214 my($urn) = $ENV{'QUERY_STRING'}; 215 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 216 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 218 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); 219 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); 220 &urn_error("400 Bad Request\n"); 222 sub resolve2 { 223 my($ietfnum, $sesnam) = @_; 224 &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); 225 my($date)=$number2date{$ietfnum}; 226 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 227 if (-f $link) { 228 print "HTTP/1.0 200 OK\r\n"; 229 print "Content-type: text/html\r\n\r\n"; 230 print "\nCitation for $urn\n"; 231 print "\n"; 232 print "

$urn:

\n"; 233 print "Minutes of the $sesnam working group from the " . &end($ietfnum) . " IETF"; 234 print "\n\n"; 235 return; 236 } 237 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 238 if (-f $link) { 239 print "HTTP/1.0 200 OK\r\n"; 240 print "Content-type: text/html\r\n\r\n"; 241 print "\nCitation for $urn\n"; 242 print "\n"; 243 print "

$urn:

\n"; 244 print "Minutes of the $sesnam working group from the " . &end($ietfnum) . " IETF"; 245 print "\n\n"; 246 return; 247 } 248 &urn_error("404 Not Found\n"); 249 } 251 sub end { 252 my($inarg)=@_; 253 return $inarg . "st" if ($inarg =~ /1$/); 254 return $inarg . "nd" if ($inarg =~ /2$/); 255 return $inarg . "rd" if ($inarg =~ /3$/); 256 return $inarg . "th"; 257 } 259 sub resolve1 { 260 my($flag,@bib,$i,$k,$j,$done,@ref); 261 my($l,$link); 262 my($scheme, $value) = @_; 263 $scheme =~ tr/A-Z/a-z/; 264 if (!defined $cite{$scheme}) { 265 &urn_error("404 Not Found\n"); 266 } 268 $flag = 0; 269 open(INPUT, "$cite{$scheme}"); 270 while () { 271 $flag = 1 if (/^0*$value /); 272 if ($flag == 1) { 273 last if (/^$/); 274 chop; 275 push @bib,$_; 276 } 277 } 279 if ($scheme ne "rfc") { 280 print "HTTP/1.0 200 OK\r\n"; 281 print "Content-type: text/html\r\n\r\n"; 282 $bib[0] =~ s/^[0-9]*\s*//; 283 for ($i=0; $i<=$#bib; $i+=1) { 284 last if ($bib[$i] =~ s/\./.<\/B>/); 286 } 287 for ($i=0;$i<=$#bib;$i+=1) { 288 $k=$bib[$i]; 289 while ($k =~ /(fyi|std|rfc)([0-9]+)(.*)/i) { 290 push @ref,"$1$2"; 291 $k=$3; 292 } 293 $done=""; 294 foreach $j (@ref) { 295 next if ($done =~ $j); 296 $done .= "$j "; 297 $l = $j; 298 $l =~ tr/A-Z/a-z/; 299 $link=&make_link("$l"); 300 $bib[$i] =~ s/$j/$j<\/A>/g; 301 } 302 } 303 print "\nCitation for $urn\n"; 304 print "\n"; 305 $link=&make_link("$scheme$value"); 306 print "

$scheme$value:

\n"; 307 foreach $i (@bib) { 308 print "$i\n"; 309 } 310 print "\n\n"; 311 } else { 312 print "HTTP/1.0 200 OK\r\n"; 313 print "Content-type: text/html\r\n\r\n"; 314 $bib[0] =~ s/^[0-9]*\s*//; 315 $j=0; 316 for ($i=0; $i<=$#bib; $i+=1) { 317 $j += ($bib[$i] =~ s/, "/, "/); 318 $j += ($bib[$i] =~ s/",/"<\/B>,/); 319 } 320 for ($i=0;$i<=$#bib;$i+=1) { 321 $k=$bib[$i]; 322 while ($k =~ /(fyi\s|std\s|rfc)([0-9]+)(.*)/i) { 323 push @ref,"$1$2"; 324 $k=$3; 325 } 326 $done=""; 327 foreach $j (@ref) { 328 next if ($done =~ $j); 329 $done .= "$j "; 330 $l = $j; 331 $l =~ s/\s//g; 332 $l =~ tr/A-Z/a-z/; 333 $link=&make_link("$l"); 334 $bib[$i] =~ s/$j/$j<\/A>/g; 335 } 336 } 337 print "\nCitation for $urn\n"; 338 print "\n"; 339 $link=&make_link("$scheme$value"); 340 print "

$scheme$value:

\n"; 341 foreach $i (@bib) { 342 print "$i\n"; 343 } 344 print "\n\n"; 345 } 346 } 348 sub make_link { 349 my($sc); 350 my($inarg)=@_; 351 ($sc=$1) if ($inarg =~ /([a-z]*)/); 352 return "/$sc/$inarg.ps" if (-e "/ftp/$sc/$inarg.ps"); 353 return "/$sc/$inarg.html" if (-e "/ftp/$sc/$inarg.html"); 354 return "/$sc/$inarg.txt"; 355 } 357 sub urn_error { 358 my($code) = @_; #store failure code here... 360 print "HTTP/1.0 $code"; 361 print "Content-type: text/html\n\n\n"; 362 print "URN Resolution: I2C $code\n"; 363 print "\n"; 364 print "

URN to URC resolution failed for the URN:

\n"; 365 print "

$urn

\n"; 366 print "\n"; 367 print "\n"; 368 exit; 369 }; 371 A.2 I2L 373 #!/usr/local/bin/perl 375 use strict; 377 # 378 # this is a URN 2 URL resolver for the ietf namespace 379 # 381 my(%pathbase) = ( 382 rfc => "rfc/rfc", 383 fyi => "fyi/fyi", 384 std => "std/std" 385 ); 387 my(%number2date) = ( 388 38 => "97apr", 389 37 => "96dec", 36 => "96jun", 35 => "96mar", 390 34 => "95dec", 33 => "95jul", 32 => "95apr", 391 31 => "94dec", 30 => "94jul", 29 => "94mar", 392 28 => "93nov", 27 => "93jul", 26 => "93mar", 393 25 => "92nov", 24 => "92jul", 23 => "92mar", 394 22 => "91nov", 21 => "91jul", 20 => "91mar", 395 19 => "90dec" ); 397 my($wgpath) = "/ftp/ietf"; 398 my($urn) = $ENV{'QUERY_STRING'}; 399 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 400 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 402 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); 403 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); 404 &urn_error("400 Bad Request\n"); 406 sub resolve2 { 407 my($ietfnum, $sesnam) = @_; 408 &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); 409 my($date)=$number2date{$ietfnum}; 410 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 411 if (-f $link) { 412 print "HTTP/1.0 302 Moved temporarily\n"; 413 print "Location: $link\n"; 414 return; 415 } 416 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 417 if (-f $link) { 418 print "HTTP/1.0 302 Moved temporarily\n"; 419 print "Location: $link\n"; 420 return; 421 } 422 &urn_error("404 Not Found\n"); 423 } 425 sub end { 426 my($inarg)=@_; 427 return $inarg . "st" if ($inarg =~ /1$/); 428 return $inarg . "nd" if ($inarg =~ /2$/); 429 return $inarg . "rd" if ($inarg =~ /3$/); 430 return $inarg . "th"; 431 } 433 sub resolve1 { 434 my($flag,@bib,$i,$k,$j,$done,@ref); 435 my($l,$link); 436 my($scheme, $value) = @_; 437 $scheme =~ tr/A-Z/a-z/; 438 &urn_error("404 Not Found\n")if (!defined $pathbase{$scheme}); 439 my($txttry)="/ftp/$pathbase{$scheme}$value.txt"; 440 my($pstry)="/ftp/$pathbase{$scheme}$value.ps"; 441 my($htmltry)="/ftp/$pathbase{$scheme}$value.html"; 442 MIME_SWITCH: { 443 if ($accept =~ /application\/postscript/ && -f $pstry) { 444 print "HTTP/1.0 302 Moved temporarily\n"; 445 print "Location: http://$host/$pathbase{$scheme}$value.ps\n\n"; 446 last MIME_SWITCH; 447 } 448 if ($accept =~ /text\/html/ && -f $htmltry) { 449 print "HTTP/1.0 302 Moved temporarily\n"; 450 print "Location: http://$host/$pathbase{$scheme}$value.html\n\n"; 451 last MIME_SWITCH; 452 } 453 if ($accept =~ /\*\/\*|text\/plain/ && -f $txttry) { 454 print "HTTP/1.0 302 Moved temporarily\n"; 455 print "Location: http://$host/$pathbase{$scheme}$value.txt\n\n"; 456 last MIME_SWITCH; 457 } 458 &urn_error("404 Not Found\n"); 459 } 460 } 462 sub urn_error { 463 my($code) = @_; #store failure code here... 465 print "HTTP/1.0 $code"; 466 print "Content-type: text/html\n\n\n"; 467 print "URN Resolution: I2L $code\n"; 468 print "\n"; 469 print "

URN to URL resolution failed for the URN:

\n"; 470 print "

$urn

\n"; 471 print "\n"; 472 print "\n"; 473 exit; 474 } 476 A.3 I2Ls 477 #!/usr/local/bin/perl 479 use strict; 481 # 482 # this is a URN 2 URLs resolver for the ietf namespace 483 # 485 my(@urls); 487 my(%pathbase) = ( 488 rfc => "rfc/rfc", 489 fyi => "fyi/fyi", 490 std => "std/std" 491 ); 493 my(%number2date) = ( 494 38 => "97apr", 495 37 => "96dec", 36 => "96jun", 35 => "96mar", 496 34 => "95dec", 33 => "95jul", 32 => "95apr", 497 31 => "94dec", 30 => "94jul", 29 => "94mar", 498 28 => "93nov", 27 => "93jul", 26 => "93mar", 499 25 => "92nov", 24 => "92jul", 23 => "92mar", 500 22 => "91nov", 21 => "91jul", 20 => "91mar", 501 19 => "90dec" ); 503 my($wgpath) = "/ftp/ietf"; 504 my($urn) = $ENV{'QUERY_STRING'}; 505 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 506 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 508 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); 509 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); 510 &urn_error("400 Bad Request\n"); 512 sub resolve2 { 513 my($ietfnum, $sesnam) = @_; 514 &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); 515 my($date)=$number2date{$ietfnum}; 516 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 517 if (-f $link) { 518 $link=~s/^\/ftp\///; 519 my($ftplink)="ftp://$host/$link"; 520 my($httplink)="http://$host/$link"; 521 my($glink)="gopher://$host:70/0/$link"; 522 if ($accept =~ /text\/uri-list/) { #look for text/uri-list, otherwise text/html 523 print "HTTP/1.0 200 OK\n"; 524 print "Content-type: text/uri-list\n\n\n"; 525 print "#$urn\n"; 526 print "$ftplink\n"; 527 print "$httplink\n"; 528 print "$glink\n"; 529 } 530 if ($accept =~ /\*\/\*|text\/html/) { 531 print "HTTP/1.0 200 OK\n"; 532 print "Content-type: text/html\n\n\n"; 533 print "URN Resolution: I2Ls\n"; 534 print "\n"; 535 print "

URN $urn resolves to the following URLs:

\n"; 536 print "
\n\n\n"; 541 } 542 return; 543 } 544 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 545 if (-f $link) { 546 $link=~s/^\/ftp\///; 547 my($ftplink)="ftp://$host/$link"; 548 my($httplink)="http://$host/$link"; 549 my($glink)="gopher://$host:70/0/$link"; 550 if ($accept =~ /text\/uri-list/) { #look for text/uri-list, otherwise text/html 551 print "HTTP/1.0 200 OK\n"; 552 print "Content-type: text/uri-list\n\n\n"; 553 print "#$urn\n"; 554 print "$ftplink\n"; 555 print "$httplink\n"; 556 print "$glink\n"; 557 } 558 if ($accept =~ /\*\/\*|text\/html/) { 559 print "HTTP/1.0 200 OK\n"; 560 print "Content-type: text/html\n\n\n"; 561 print "URN Resolution: I2Ls\n"; 562 print "\n"; 563 print "

URN $urn resolves to the following URLs:

\n"; 564 print "
\n\n\n"; 569 } 570 return; 571 } 572 &urn_error("404 Not Found\n"); 574 } 576 sub resolve1 { 577 my($flag,@bib,$i,$k,$j,$done,@ref); 578 my($l,$link); 579 my($scheme, $value) = @_; 580 $scheme =~ tr/A-Z/a-z/; 581 &urn_error("404 Not Found\n")if (!defined $pathbase{$scheme}); 582 my($try)="/ftp/$pathbase{$scheme}$value.txt"; 583 if (-f $try) { 584 push(@urls, "http://$host/$pathbase{$scheme}$value.txt"); 585 push(@urls, "ftp://$host/$pathbase{$scheme}$value.txt"); 586 push(@urls, "gopher://$host:70/0/$pathbase{$scheme}$value.txt"); 587 } 588 $try="/ftp/$pathbase{$scheme}$value.ps"; 589 if (-f $try) { 590 push(@urls, "http://$host/$pathbase{$scheme}$value.ps"); 591 push(@urls, "ftp://$host/$pathbase{$scheme}$value.ps"); 592 push(@urls, "gopher://$host:70/0/$pathbase{$scheme}$value.ps"); 593 } 594 $try="/ftp/$pathbase{$scheme}$value.html"; 595 if (-f $try) { 596 push(@urls, "http://$host/$pathbase{$scheme}$value.html"); 597 push(@urls, "ftp://$host/$pathbase{$scheme}$value.html"); 598 } 600 &urn_error("404 Not Found\n") if ($#urls == -1); 602 MIME_SWITCH: { 603 if ($accept =~ /text\/uri-list/) { #look for text/uri-list, otherwise text/html 604 print "HTTP/1.0 200 OK\n"; 605 print "Content-type: text/uri-list\n\n\n"; 606 print "#$urn\n"; 607 foreach $i (@urls) { 608 print "$i\n"; 609 } 610 last MIME_SWITCH; 611 } 612 if ($accept =~ /\*\/\*|text\/html/) { 613 print "HTTP/1.0 200 OK\n"; 614 print "Content-type: text/html\n\n\n"; 615 print "URN Resolution: I2Ls\n"; 616 print "\n"; 617 print "

URN $urn resolves to the following URLs:

\n"; 618 print "
    \n"; 619 foreach $i (@urls) { 620 print "
  • $i\n"; 621 } 622 print "
\n\n\n"; 623 last MIME_SWITCH; 624 } 625 } 626 } 628 sub urn_error { 629 my($code) = @_; #store failure code here... 631 print "HTTP/1.0 $code"; 632 print "Content-type: text/html\n\n\n"; 633 print "URN Resolution: I2L $code\n"; 634 print "\n"; 635 print "

URN to URL resolution failed for the URN:

\n"; 636 print "

$urn

\n"; 637 print "\n"; 638 print "\n"; 639 exit; 640 } 642 A.4 I2Ns 644 #!/usr/local/bin/perl 646 use strict; 648 # 649 # this is a URN 2 URNs resolver for the ietf namespace 650 # 652 my(%cite) = ( 653 rfc => "/ftp/rfc/rfc-index.txt", 654 fyi => "/ftp/fyi/fyi-index.txt", 655 std => "/ftp/std/std-index.txt" 656 ); 658 my(%number2date) = ( 659 38 => "97apr", 660 37 => "96dec", 36 => "96jun", 35 => "96mar", 661 34 => "95dec", 33 => "95jul", 32 => "95apr", 662 31 => "94dec", 30 => "94jul", 29 => "94mar", 663 28 => "93nov", 27 => "93jul", 26 => "93mar", 664 25 => "92nov", 24 => "92jul", 23 => "92mar", 665 22 => "91nov", 21 => "91jul", 20 => "91mar", 666 19 => "90dec" ); 668 my($wgpath) = "/ftp/ietf"; 669 my($urn) = $ENV{'QUERY_STRING'}; 670 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 671 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 673 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); 674 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); 675 &urn_error("400 Bad Request\n"); 677 sub resolve2 { 678 my($ietfnum, $sesnam) = @_; 679 &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); 680 my($date)=$number2date{$ietfnum}; 681 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 682 if (-f $link) { 683 if ($accept =~ /text\/uri-list/) { 684 print "HTTP/1.0 200 OK\n"; 685 print "Content-type: text/uri-list\n\n\n"; 686 print "#$urn\n"; 687 return; 688 } 689 if ($accept =~ /\*\/\*|text\/html/) { 690 print "HTTP/1.0 200 OK\n"; 691 print "Content-type: text/html\n\n\n"; 692 print "URN Resolution: I2Ns\n"; 693 print "\n"; 694 print "

URN $urn resolves to the following URNs:

\n"; 695 print "
    \n"; 696 print "
\n\n\n"; 697 return; 698 } 699 } 700 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 701 if (-f $link) { 702 if ($accept =~ /text\/uri-list/) { 703 print "HTTP/1.0 200 OK\n"; 704 print "Content-type: text/uri-list\n\n\n"; 705 print "#$urn\n"; 706 return; 707 } 708 if ($accept =~ /\*\/\*|text\/html/) { 709 print "HTTP/1.0 200 OK\n"; 710 print "Content-type: text/html\n\n\n"; 711 print "URN Resolution: I2Ns\n"; 712 print "\n"; 713 print "

URN $urn resolves to the following URNs:

\n"; 714 print "
    \n"; 715 print "
\n\n\n"; 716 return; 717 } 719 } 720 &urn_error("404 Not Found\n"); 721 } 723 sub end { 724 my($inarg)=@_; 725 return $inarg . "st" if ($inarg =~ /1$/); 726 return $inarg . "nd" if ($inarg =~ /2$/); 727 return $inarg . "rd" if ($inarg =~ /3$/); 728 return $inarg . "th"; 729 } 731 sub resolve1 { 732 my($flag,@bib,$i,$k,$j,$done,@ref); 733 my($l,$link); 734 my($scheme, $value) = @_; 735 $scheme =~ tr/A-Z/a-z/; 736 if (!defined $cite{$scheme}) { 737 &urn_error("404 Not Found\n"); 738 } 740 $flag = 0; 741 open(INPUT, "$cite{$scheme}"); 742 while () { 743 $flag = 1 if (/^0*$value /); 744 if ($flag == 1) { 745 last if (/^$/); 746 chop; 747 push @bib,$_; 748 } 749 } 751 $k=join " ",@bib; 752 while ($k =~ /(\S*)\s*(fyi|std|rfc)\s*([0-9]+)(.*)/i) { 753 $k=$4; 754 $a=$2; $b=$3; 755 if (($a ne $scheme || $b ne $value) && ($1 !~ /obso/i)){ 756 $a =~ tr/A-Z/a-z/; 757 push @ref,"urn:ietf:$a:$b"; 758 } 759 } 761 MIME_SWITCH: { 762 if ($accept =~ /text\/uri-list/) { 763 print "HTTP/1.0 200 OK\n"; 764 print "Content-type: text/uri-list\n\n\n"; 765 print "#$urn\n"; 766 foreach $i (@ref) { 767 print "$i\n"; 768 } 769 last MIME_SWITCH; 770 } 771 if ($accept =~ /\*\/\*|text\/html/) { 772 print "HTTP/1.0 200 OK\n"; 773 print "Content-type: text/html\n\n\n"; 774 print "URN Resolution: I2Ns\n"; 775 print "\n"; 776 print "

URN $urn resolves to the following URNs:

\n"; 777 print "
    \n"; 778 foreach $i (@ref) { 779 print "
  • $i: Click to resolve using\n"; 780 print "I2C,\n"; 781 print "I2L,\n"; 782 print "I2Ls,\n"; 783 print "I2R,\n"; 784 print "I2Rs\n"; 785 } 786 print "
\n\n\n"; 787 } 788 } 789 } 791 sub make_link { 792 my($sc); 793 my($inarg)=@_; 794 ($sc=$1) if ($inarg =~ /([a-z]*)/); 795 return "/$sc/$inarg.ps" if (-e "/ftp/$sc/$inarg.ps"); 796 return "/$sc/$inarg.html" if (-e "/ftp/$sc/$inarg.html"); 797 return "/$sc/$inarg.txt"; 798 } 800 sub urn_error { 801 my($code) = @_; #store failure code here... 803 print "HTTP/1.0 $code"; 804 print "Content-type: text/html\n\n\n"; 805 print "URN Resolution: I2Ns $code\n"; 806 print "\n"; 807 print "

URN to URC resolution failed for the URN:

\n"; 808 print "

$urn

\n"; 809 print "\n"; 810 print "\n"; 811 exit; 812 }; 814 A.5 I2R 815 #!/usr/local/bin/perl 817 use strict; 819 # 820 # this is a URN 2 resource resolver for the ietf namespace 821 # 823 my(%pathbase) = ( 824 rfc => "rfc/rfc", 825 fyi => "fyi/fyi", 826 std => "std/std" 827 ); 829 my(%number2date) = ( 830 38 => "97apr", 831 37 => "96dec", 36 => "96jun", 35 => "96mar", 832 34 => "95dec", 33 => "95jul", 32 => "95apr", 833 31 => "94dec", 30 => "94jul", 29 => "94mar", 834 28 => "93nov", 27 => "93jul", 26 => "93mar", 835 25 => "92nov", 24 => "92jul", 23 => "92mar", 836 22 => "91nov", 21 => "91jul", 20 => "91mar", 837 19 => "90dec" ); 839 my($wgpath) = "/ftp/ietf"; 840 my($urn) = $ENV{'QUERY_STRING'}; 841 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 842 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 844 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); 845 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); 846 &urn_error("400 Bad Request\n"); 848 sub resolve2 { 849 my($ietfnum, $sesnam) = @_; 850 &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); 851 my($date)=$number2date{$ietfnum}; 852 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 853 if (-f $link) { 854 print "HTTP/1.0 200 OK\n"; 855 print "Content-type: text/plain\n\n"; 856 open(FILE, "$link"); 857 while () { 858 print $_; 859 } 860 close FILE; 861 return; 862 } 863 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 864 if (-f $link) { 865 print "HTTP/1.0 200 OK\n"; 866 print "Content-type: text/plain\n\n"; 867 open(FILE, "$link"); 868 while () { 869 print $_; 870 } 871 close FILE; 872 return; 873 } 874 &urn_error("404 Not Found\n"); 875 } 877 sub end { 878 my($inarg)=@_; 879 return $inarg . "st" if ($inarg =~ /1$/); 880 return $inarg . "nd" if ($inarg =~ /2$/); 881 return $inarg . "rd" if ($inarg =~ /3$/); 882 return $inarg . "th"; 883 } 885 sub resolve1 { 886 my($flag,@bib,$i,$k,$j,$done,@ref); 887 my($l,$link); 888 my($scheme, $value) = @_; 889 $scheme =~ tr/A-Z/a-z/; 890 &urn_error("404 Not Found\n")if (!defined $pathbase{$scheme}); 891 my($txttry)="/ftp/$pathbase{$scheme}$value.txt"; 892 my($pstry)="/ftp/$pathbase{$scheme}$value.ps"; 893 my($htmltry)="/ftp/$pathbase{$scheme}$value.html"; 894 MIME_SWITCH: { 895 if ($accept =~ /application\/postscript/ && -f $pstry) { 896 print "HTTP/1.0 200 OK\n"; 897 print "Content-type: application/postscript\n\n"; 898 open(FILE, "$pstry"); 899 while () { 900 print $_; 901 } 902 close FILE; 903 last MIME_SWITCH; 904 } 905 if ($accept =~ /text\/html/ && -f $htmltry) { 906 print "HTTP/1.0 200 OK\n"; 907 print "Content-type: text/html\n\n"; 908 open(FILE, "$htmltry"); 909 while () { 910 print $_; 912 } 913 close FILE; 914 last MIME_SWITCH; 915 } 916 if ($accept =~ /\*\/\*|text\/plain/ && -f $txttry) { 917 print "HTTP/1.0 200 OK\n"; 918 print "Content-type: text/plain\n\n"; 919 open(FILE, "$txttry"); 920 while () { 921 print $_; 922 } 923 close FILE; 924 last MIME_SWITCH; 925 } 926 &urn_error("404 Not Found\n"); 927 } 928 } 930 sub urn_error { 931 my($code) = @_; #store failure code here... 933 print "HTTP/1.0 $code"; 934 print "Content-type: text/html\n\n\n"; 935 print "URN Resolution: I2L $code\n"; 936 print "\n"; 937 print "

URN to URL resolution failed for the URN:

\n"; 938 print "

$urn

\n"; 939 print "\n"; 940 print "\n"; 941 exit; 942 } 944 A.6 I2Rs 946 #!/usr/local/bin/perl 948 use strict; 950 # 951 # this is a URN 2 resources resolver for the ietf namespace 952 # 954 my(@urls); 956 my(%pathbase) = ( 957 rfc => "rfc/rfc", 958 fyi => "fyi/fyi", 959 std => "std/std" 961 ); 963 my(%number2date) = ( 964 38 => "97apr", 965 37 => "96dec", 36 => "96jun", 35 => "96mar", 966 34 => "95dec", 33 => "95jul", 32 => "95apr", 967 31 => "94dec", 30 => "94jul", 29 => "94mar", 968 28 => "93nov", 27 => "93jul", 26 => "93mar", 969 25 => "92nov", 24 => "92jul", 23 => "92mar", 970 22 => "91nov", 21 => "91jul", 20 => "91mar", 971 19 => "90dec" ); 973 my($wgpath) = "/ftp/ietf"; 974 my($urn) = $ENV{'QUERY_STRING'}; 975 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 976 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 978 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); 979 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); 980 &urn_error("400 Bad Request\n"); 982 sub resolve2 { 983 my($ietfnum, $sesnam) = @_; 984 my(@vers,$i); 985 &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); 986 my($date)=$number2date{$ietfnum}; 987 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 988 if (-f $link) { 989 push(@vers,$link); 990 } 991 $link="$wgpath/$date/$sesnam-minutes-$date.txt"; 992 if (-f $link) { 993 push(@vers,$link); 994 } 995 &urn_error("404 Not Found\n") if ($#vers==-1); 997 print "HTTP/1.0 200 OK\n"; 998 print "Content-type: multipart/alternative; boundary=endpart\n\n"; 999 foreach $i (@vers) { 1000 print "--endpart\n"; 1001 if ($i =~ /html$/) { 1002 print "Content-Type: text/html\n\n"; 1003 } 1004 if ($i =~ /txt$/) { 1005 print "Content-Type: text/plain\n\n"; 1006 } 1007 if ($i =~ /ps$/) { 1008 print "Content-Type: application/postscript\n\n"; 1010 } 1011 open(FILE, "$i"); 1012 while () { 1013 print "$_"; 1014 } 1015 close FILE; 1016 } 1017 print "--endpart\n"; 1018 } 1020 sub resolve1 { 1021 my($flag,@bib,$i,$k,$j,$done,@ref); 1022 my($l,$link,@vers); 1023 my($scheme, $value) = @_; 1024 $scheme =~ tr/A-Z/a-z/; 1025 &urn_error("404 Not Found\n")if (!defined $pathbase{$scheme}); 1026 my($try)="/ftp/$pathbase{$scheme}$value.txt"; 1027 if (-f $try) { 1028 push(@vers, $try); 1029 } 1030 $try="/ftp/$pathbase{$scheme}$value.ps"; 1031 if (-f $try) { 1032 push(@vers, $try); 1033 } 1034 $try="/ftp/$pathbase{$scheme}$value.html"; 1035 if (-f $try) { 1036 push(@vers, $try); 1037 } 1038 print "HTTP/1.0 200 OK\n"; 1039 print "Content-type: multipart/alternative; boundary=endpart\n\n"; 1040 foreach $i (@vers) { 1041 print "--endpart\n"; 1042 if ($i =~ /html$/) { 1043 print "Content-Type: text/html\n\n"; 1044 } 1045 if ($i =~ /txt$/) { 1046 print "Content-Type: text/plain\n\n"; 1047 } 1048 if ($i =~ /ps$/) { 1049 print "Content-Type: application/postscript\n\n"; 1050 } 1051 open(FILE, "$i"); 1052 while () { 1053 print "$_"; 1054 } 1055 close FILE; 1056 } 1057 print "--endpart\n"; 1059 } 1061 sub urn_error { 1062 my($code) = @_; #store failure code here... 1064 print "HTTP/1.0 $code"; 1065 print "Content-type: text/html\n\n\n"; 1066 print "URN Resolution: I2L $code\n"; 1067 print "\n"; 1068 print "

URN to URL resolution failed for the URN:

\n"; 1069 print "

$urn

\n"; 1070 print "\n"; 1071 print "\n"; 1072 exit; 1073 }