#!/usr/bin/perl -w
use strict;
use CGI;
use CGI::Carp qw( fatalsToBrowser ); # not leaving in production!
# this is hackish and ugly using n_ for keys, but sort() likes it
my %swip_data = (
"02_org_name" => "",
"03_org_addr1" => "",
"03_org_addr2" => "",
"04_org_city" => "",
"05_org_st" => "",
"06_org_zip" => "",
"07_org_cc" => "",
"09_poc_type" => "",
"10_poc_role" => "",
"12_poc_cname" => "",
"13_poc_addr1" => "",
"13_poc_addr2" => "",
"14_poc_city" => "",
"15_poc_st" => "",
"16_poc_zip" => "",
"17_poc_cc" => "",
"18_poc_phone" => "",
"19_poc_email" => "",
"20_ip_addr" => "",
"21_netname" => "",
);
my $cgi = new CGI;
print $cgi->header;
print $cgi->start_html(-title => "ARIN SWIP Generator");
print "Welcome to the ARIN Shared WHOIS Project Template Filler!
";
print "In development...pretty straightforward although your mileage may
vary.
Please check results for sanity!";
print "
";
my @sorted = sort keys %swip_data;
# loop through our ordered keys and match fields to template values
print $cgi->start_form();
foreach (@sorted) {
print "$_ :" . $cgi->textfield(-name => "$_") . "
";
}
foreach (@sorted) {
if (defined $cgi->param("$_")) {
$swip_data{$_} = $cgi->param("$_");
}
else {
print "You must define a $_." . "
";
}
}
print $cgi->submit(-value => 'Black Magic');
print $cgi->end_form();
my $arin_tmpl = <
** As of September 2006
** Detailed instructions are located below the template
.
01. Downstream Org ID:
02. Org Name: $swip_data{'02_org_name'}
03. Org Address: $swip_data{'03_org_addr1'}
03. Org Address: $swip_data{'03_org_addr2'}
04. Org City: $swip_data{'04_org_city'}
05. Org State/Province: $swip_data{'05_org_st'}
06. Org Postal Code: $swip_data{'06_org_zip'}
07. Org Country Code: $swip_data{'07_org_cc'}
08. Org POC Handle:
09. Org POC Contact Type (P or R): $swip_data{'09_poc_type'}
10. Org POC Last Name or Role Account: $swip_data{'10_poc_role'}
11. Org POC First Name:
12. Org POC Company Name: $swip_data{'12_poc_cname'}
13. Org POC Address: $swip_data{'13_poc_addr1'}
13. Org POC Address: $swip_data{'13_poc_addr2'}
14. Org POC City: $swip_data{'14_poc_city'}
15. Org POC State/Province: $swip_data{'15_poc_st'}
16. Org POC Postal Code: $swip_data{'16_poc_zip'}
17. Org POC Country Code: $swip_data{'17_poc_cc'}
18. Org POC Office Phone Number: $swip_data{'18_poc_phone'}
19. Org POC E-mail Address: $swip_data{'19_poc_email'}
** NETWORK SECTION
20. IP Address and Prefix or Range: $swip_data{'20_ip_addr'}
21. Network Name: $swip_data{'21_netname'}
END_TMPL
;
print $arin_tmpl;
print $cgi->end_html();