idnits 2.17.1 draft-ietf-urn-ietf-04.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-19) 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 21 longer pages, the longest (page 2) being 66 lines == It seems as if not all pages are separated by form feeds - found 0 form feeds but 21 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 171: '...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 (April 1998) is 9501 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 335, but not defined -- Looks like a reference, but probably isn't: '0-9' on line 335 ** 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-04.txt AT&T 4 Expires in six months April 1998 5 pl 10.0i 7 A URN Namespace for IETF Documents 8 Filename: draft-ietf-urn-ietf-04.txt 10 Status of This Memo 12 This document is an Internet-Draft. Internet-Drafts are working 13 documents of the Internet Engineering Task Force (IETF), its 14 areas, and its working groups. Note that other groups may also 15 distribute working documents as Internet-Drafts. 17 Internet-Drafts are draft documents valid for a maximum of six 18 months and may be updated, replaced, or obsoleted by other 19 documents at any time. It is inappropriate to use Internet- 20 Drafts as reference material or to cite them other than as ``work 21 in progress.'' 23 To view the entire list of current Internet-Drafts, please check 24 the "1id-abstracts.txt" listing contained in the Internet-Drafts 25 Shadow Directories on ftp.is.co.za (Africa), ftp.nordu.net 26 (Northern Europe), ftp.nis.garr.it (Southern Europe), munnari.oz.au 27 (Pacific Rim), ftp.ietf.org (US East Coast), or ftp.isi.edu 28 (US West Coast). 30 Abstract 32 A system for Uniform Resource Names (URNs) must be capable of 33 supporting new naming systems. As an example of proposing a new 34 namespace, this document proposes the "ietf" namespace. This 35 namespace consists of the RFC family of documents (RFCs, STDs, FYIs, 36 and BCPs) developed by the IETF and published by the RFC editor and 37 the minutes of working groups (WG) and birds of a feather (BOF) 38 meetings that occur during IETF conferences. Both the current URN 39 framework and URN syntax support this namespace. 41 0.1 Changes from -02 43 This document has been restructured to use the template proposed in 44 draft-ietf-urn-nid-req-03.txt. Example Perl scripts for resolving 45 this namespace have been supplied in an Appendix. 47 0.2 Changes from -03 49 Text was added to the template clarifying persistence and uniqueness. 50 Support for the BCP document series added to the examples and the 51 ABNF. 53 1. Introduction 55 This document proposes the "ietf" namespace, which consists of the 56 RFC family of documents (RFCs, STDs, FYIs, and BCPs) developed by the 57 IETF and published by the RFC editor and the minutes of working 58 groups (WG) and birds of a feather (BOF) meetings that occur during 59 IETF conferences. 61 The namespace specification is for a formal namespace. 63 2. Specification Template 65 Namespace ID: 67 "ietf" requested. 69 Declared registrant of the namespace: 71 Ryan Moats 72 jayhawk@att.com 74 Declaration of structure: 76 The identifier has the following ABNF [2] specification: 78 NSS = (family ":" number) / ("mtg-" number "-" wgbofname) 79 family = "rfc" / "std" / "fyi" / "bcp" 80 number = 1*DIGIT 81 wgbofname = 1*LETDIGIT 82 LETDIGIT = DIGIT / %x41..%x5a / %x61..%x7a 83 DIGIT = %x30..%x39 85 If the IESG (or it successor) adds a new document 86 series, this ABNF specification will need to be 87 updated. Further, If a working group or BOF is 88 created that used characters outside the range of this 89 ABNF specification, this specification will need to be 90 updated. Any system intended to resolve names for 91 this namespace should be written with the awareness 92 that this could occur at any time. 94 Identifier uniqueness considerations: 96 Because the rfc-editor assigns the RFC number uniquely 97 these URNs are unique. Since the mapping between RFCs 98 and other rfc-editor docuent series (STDs, FYIs or 99 BCPs) is not necessarily one-to-one, uniqueness of 100 STDs, FYIs and BCPs are defined based on the document 101 mappings maintained by the RFC Editor (the index files 102 "rfc-index.txt", "fyi-index.txt", "bcp-index.txt" and 103 "std-index.txt") are defined to be the definitive 104 statement of the assignment of RFC Family URNs in this 105 namespace. The meeting minutes portion of the 106 namespace is guaranteed unique because the URN 107 includes the sequence number of the IETF conference. 109 Identifier persistence considerations: 111 Persistence of the URNs of this namespace is dependent 112 on the persistence of the underlying documents. The 113 fundamental difference between RFCs on one hand and 114 STDs, FYIs, or BCPs on the other is that only RFCs are 115 real, even persistent, documents while the others are 116 just names for sets of one or more RFCs which may 117 change over time. 119 Process of identifier assignment: 121 Assignment of URNs from this namespace occur in two 122 ways. The first is when a new RFC, FYI, STD or BCP is 123 passed by the IESG and published by the RFC 124 Editor. This new document will have a new series 125 number and will therefore define a new URN. The 126 document mappings maintained by the RFC Editor (the 127 index files "rfc-index.txt", "fyi-index.txt", 128 "bcp-index.txt" and "std-index.txt") are defined to be 129 the definitive statement of the assignment of RFC 130 Family URNs in this namespace. 132 The second way a URN is assigned is when a working 133 group or birds of a feather files meeting minutes as 134 part of an IETF conference. The list of minutes 135 maintained by the IETF for each working group and 136 conference in the subtree pointed at by the URL 137 ftp://ietf.org/ietf/ is considered the definitive 138 assignment of URNs for working group or birds of a 139 feather minutes. 141 Process of identifier resolution: 143 A mirrored copy of the underlying documentation is 144 required to resolve these URNs. Resolution via 145 HTTP is accomplished by a set of simple Perl cgi-bin 146 scripts presented in Appendix A. 148 Rules for Lexical Equivalence: 150 The entire URN is case-insensitive. 152 Conformance with URN Syntax: 154 There are no additional characters reserved. 156 Validation mechanism: 158 None specified. 160 Scope: 162 Global. 164 3. Security Considerations 166 Because this namespace defines no additional reserved characters, it 167 does not add any security considerations beyond those inherent from 168 the existence of the reserved characters from [1]. Further, none of 169 the reserved characters from [1] are used in the definition of the 170 NSS. This means that resolvers for this namespace may be considered 171 "secure" in the sense that any escaping of characters in the NSS MUST 172 result in the resolver indicating that the URN has incorrect syntax. 174 4. Acknowledgments 176 Thanks to various members of the URN working group for comments on 177 earlier drafts of this document. The work described in this document 178 is partially supported by the National Science Foundation, 179 Cooperative Agreement NCR-9218179. 181 4. References 183 Request For Comments (RFC) and Internet Draft documents are available 184 from and numerous mirror sites. 186 [1] R. Moats, "URN Syntax," RFC 2141, May 5, 1997. 188 [2] D. Crocker, P. Overell, "Augmented BNF for Syntax Specifica- 189 tions: ABNF," Internet Draft (work in progress), January 190 1997. 192 5. Author's Address 194 Ryan Moats 195 AT&T 196 15621 Drexel Circle 197 Omaha, NE 68135-2358 198 USA 200 Phone: +1 402 894-9456 201 EMail: jayhawk@att.com 203 Appendix A. Example Resolution Scripts 205 The following scripts are examples that can be used for resolving 206 URNs in this namespace. 208 A.1 I2C 210 #!/usr/local/bin/perl 212 use strict; 213 # 214 # this is a URN 2 URC resolver for the ietf namespace 215 # 217 my(%cite) = ( 218 rfc => "/ftp/rfc/rfc-index.txt", 219 fyi => "/ftp/fyi/fyi-index.txt", 220 std => "/ftp/std/std-index.txt", 221 bcp => "/ftp/rfc/bcp-index.txt" 222 ); 223 my(%number2date) = ( 224 41 => "98apr", 225 40 => "97dec", 39 => "97aug", 38 => "97apr", 226 37 => "96dec", 36 => "96jun", 35 => "96mar", 227 34 => "95dec", 33 => "95jul", 32 => "95apr", 228 31 => "94dec", 30 => "94jul", 29 => "94mar", 229 28 => "93nov", 27 => "93jul", 26 => "93mar", 230 25 => "92nov", 24 => "92jul", 23 => "92mar", 231 22 => "91nov", 21 => "91jul", 20 => "91mar", 232 19 => "90dec" ); 234 my($wgpath) = "/ftp/ietf"; 235 my($urn) = $ENV{'QUERY_STRING'}; 236 my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs 237 my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header 239 (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); 240 (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); 241 &urn_error("400 Bad Request\n"); 243 sub resolve2 { 244 my($ietfnum, $sesnam) = @_; 245 &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); 246 my($date)=$number2date{$ietfnum}; 247 my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; 248 if (-f $link) { 249 print "HTTP/1.0 200 OK\r\n"; 250 print "Content-type: text/html\r\n\r\n"; 251 print "\nCitation for $urn\n"; 252 print "\n"; 253 print "

$urn:

\n"; 254 print "Minutes of the $sesnam working group from the " . &end($ietfnum) . " IETF"; 255 print "\n\n"; 256 return; 257 } 258 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 259 if (-f $link) { 260 print "HTTP/1.0 200 OK\r\n"; 261 print "Content-type: text/html\r\n\r\n"; 262 print "\nCitation for $urn\n"; 263 print "\n"; 264 print "

$urn:

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

$scheme$value:

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

$scheme$value:

\n"; 362 foreach $i (@bib) { 363 print "$i\n"; 364 } 365 print "\n\n"; 366 } 367 } 369 sub make_link { 370 my($sc); 371 my($inarg)=@_; 372 ($sc=$1) if ($inarg =~ /([a-z]*)/); 373 return "/$sc/$inarg.ps" if (-e "/ftp/$sc/$inarg.ps"); 374 return "/$sc/$inarg.html" if (-e "/ftp/$sc/$inarg.html"); 375 return "/$sc/$inarg.txt"; 377 } 379 sub urn_error { 380 my($code) = @_; #store failure code here... 382 print "HTTP/1.0 $code"; 383 print "Content-type: text/html\n\n\n"; 384 print "URN Resolution: I2C $code\n"; 385 print "\n"; 386 print "

URN to URC resolution failed for the URN:

\n"; 387 print "

$urn

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

URN to URL resolution failed for the URN:

\n"; 493 print "

$urn

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

URN $urn resolves to the following URLs:

\n"; 561 print "
\n\n\n"; 566 } 567 return; 568 } 569 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 570 if (-f $link) { 571 $link=~s/^\/ftp\///; 572 my($ftplink)="ftp://$host/$link"; 573 my($httplink)="http://$host/$link"; 574 my($glink)="gopher://$host:70/0/$link"; 575 if ($accept =~ /text\/uri-list/) { #look for text/uri-list, otherwise text/html 576 print "HTTP/1.0 200 OK\n"; 577 print "Content-type: text/uri-list\n\n\n"; 578 print "#$urn\n"; 579 print "$ftplink\n"; 580 print "$httplink\n"; 581 print "$glink\n"; 582 } 583 if ($accept =~ /\*\/\*|text\/html/) { 584 print "HTTP/1.0 200 OK\n"; 585 print "Content-type: text/html\n\n\n"; 586 print "URN Resolution: I2Ls\n"; 587 print "\n"; 588 print "

URN $urn resolves to the following URLs:

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

URN $urn resolves to the following URLs:

\n"; 642 print "
    \n"; 643 foreach $i (@urls) { 644 print "
  • $i\n"; 646 } 647 print "
\n\n\n"; 648 last MIME_SWITCH; 649 } 650 } 651 } 653 sub urn_error { 654 my($code) = @_; #store failure code here... 656 print "HTTP/1.0 $code"; 657 print "Content-type: text/html\n\n\n"; 658 print "URN Resolution: I2Ls $code\n"; 659 print "\n"; 660 print "

URN to URL resolution failed for the URN:

\n"; 661 print "

$urn

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

URN $urn resolves to the following URNs:

\n"; 721 print "
    \n"; 722 print "
\n\n\n"; 723 return; 724 } 725 } 726 my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; 727 if (-f $link) { 728 if ($accept =~ /text\/uri-list/) { 729 print "HTTP/1.0 200 OK\n"; 730 print "Content-type: text/uri-list\n\n\n"; 731 print "#$urn\n"; 732 return; 733 } 734 if ($accept =~ /\*\/\*|text\/html/) { 735 print "HTTP/1.0 200 OK\n"; 736 print "Content-type: text/html\n\n\n"; 737 print "URN Resolution: I2Ns\n"; 738 print "\n"; 739 print "

URN $urn resolves to the following URNs:

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

URN $urn resolves to the following URNs:

\n"; 803 print "
    \n"; 804 foreach $i (@ref) { 805 print "
  • $i: Click to resolve using\n"; 806 print "I2C,\n"; 807 print "I2L,\n"; 808 print "I2Ls,\n"; 809 print "I2R,\n"; 810 print "I2Rs\n"; 811 } 812 print "
\n\n\n"; 813 } 814 } 815 } 817 sub make_link { 818 my($sc); 819 my($inarg)=@_; 820 ($sc=$1) if ($inarg =~ /([a-z]*)/); 821 return "/$sc/$inarg.ps" if (-e "/ftp/$sc/$inarg.ps"); 822 return "/$sc/$inarg.html" if (-e "/ftp/$sc/$inarg.html"); 823 return "/$sc/$inarg.txt"; 824 } 826 sub urn_error { 827 my($code) = @_; #store failure code here... 829 print "HTTP/1.0 $code"; 830 print "Content-type: text/html\n\n\n"; 831 print "URN Resolution: I2Ns $code\n"; 832 print "\n"; 833 print "

URN to URC resolution failed for the URN:

\n"; 834 print "

$urn

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

URN to URL resolution failed for the URN:

\n"; 966 print "

$urn

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

URN to URL resolution failed for the URN:

\n"; 1097 print "

$urn

\n"; 1098 print "\n"; 1099 print "\n"; 1100 exit; 1101 }