#!/usr/bin/env perl # # Read in the references, and put into an associative array # open FILE, ") { chop; split; $refs{$_[1]} = $_[0]; } close FILE; # # now loop over the input RFC's. # foreach $file (@ARGV) { open FILE, "<$file" || die "Error opening $file: $!\n"; $attribute = "zzzzz"; # get the current reference $ref = $file; $ref =~ s/\..*//g; open OUTPUT, ">$ref.html" || die "Error creating $ref.html: $!\n"; # # Print out the HTML header # print OUTPUT < $ref.html

EOF

    #  loop over the input file
    while () {
	# html-ize it
	s/&/&/g;
	s//>/g;
	
	if (/\[Page/) {
	    print OUTPUT;
	    next;
	}
	
	if (/^RFC \d+/) {
	    print OUTPUT;
	    next;
	}
	
	chop;
	
	#
	#  Attribute name header.
	#
	if (/^\d+\./ && !/\d$/) {
	    split;

	    if ($refs{$_[1]} ne "") {
		$attribute = $_[1];
		
		print OUTPUT "

$_

\n"; } else { print OUTPUT "

$_

\n"; $attribute = "zzzz"; } next; } # # Mark these up special. # if ((/^ Description/) || (/^ Type/) || (/^ Length/) || (/^ Value/)) { print OUTPUT "$_\n"; next; } # Make the current attribute name bold s/$attribute/$attribute<\/B>/g; split; # # Re-write the output with links to where-ever # foreach $word (@_) { $word =~ s/[^-a-zA-Z]//g; if ($refs{$word} ne "") { if ($refs{$word} eq $ref) { s/$word/$word<\/A>/g; } else { s/$word/$word<\/A>/g; } } } print OUTPUT $_, "\n"; } print OUTPUT "
\n"; print OUTPUT "\n"; close OUTPUT; close FILE; } # # And finally, create the index. # open OUTPUT, ">attributes.html" || die "Error creating attributes.html: $!\n"; # # Print out the HTML header # print OUTPUT < $ref.html

RADIUS Attribute List

EOF $letter = "@"; foreach $key (sort keys %refs) { if (substr($key,0,1) ne $letter) { print OUTPUT "\n" if ($letter ne "@"); $letter = substr($key,0,1); print OUTPUT "\n

$letter

\n\n"; print OUTPUT "
\n"; print OUTPUT "\n"; close OUTPUT;