|
|
@@ -3,7 +3,7 @@
|
|
|
#
|
|
|
# whois wrapper to filter out private objects and attributes
|
|
|
#
|
|
|
-# By Arnd Vehling, NetHead - 11/03/2004
|
|
|
+# Arnd Vehling, NetHead - 11/03/2004
|
|
|
#
|
|
|
# For Cable & Wireless Munic
|
|
|
#
|
|
|
@@ -25,24 +25,23 @@
|
|
|
# Glob Vars
|
|
|
#
|
|
|
|
|
|
- # Whois Server Definition
|
|
|
- my %ldb = ('Host' => '@l_hostname@', 'Port' => '43001',
|
|
|
- 'Mode' => 0);
|
|
|
+ # Where to write the pidfile. Specify "none" for none.
|
|
|
+ my $pidfile = '@l_prefix@/var/ripe-dbase/whois_filt.pid';
|
|
|
|
|
|
- my @header = (
|
|
|
- "% This is the Cable & Wireless Whois server.\n",
|
|
|
- "% The objects are in RPSL format.\n",
|
|
|
- "%\n",
|
|
|
- "% Rights restricted by copyright.\n\n"
|
|
|
- );
|
|
|
+ my $header = "% This is the Cable & Wireless Whois server.\n% The objects are in RPSL format.\n%\n% Rights restricted by copyright.\n";
|
|
|
|
|
|
# Configuration file with private definitions
|
|
|
my $config="@l_prefix@/etc/ripe-dbase/whois_filt.config";
|
|
|
|
|
|
+
|
|
|
# All whois objects go into this
|
|
|
my @src_objects = ();
|
|
|
my @privates = ();
|
|
|
|
|
|
+ # Whois Server Definition
|
|
|
+ my %ldb = ('Host' => 'localhost', 'Port' => '43001',
|
|
|
+ 'Mode' => 0);
|
|
|
+
|
|
|
# Which source
|
|
|
my $local_source = "ARINCW";
|
|
|
|
|
|
@@ -106,8 +105,6 @@
|
|
|
print "Query error: $myerr\n";
|
|
|
exit 3;
|
|
|
}
|
|
|
-
|
|
|
- $source_whois->destroy();
|
|
|
}
|
|
|
|
|
|
##
|
|
|
@@ -158,8 +155,7 @@
|
|
|
&do_query( $query );
|
|
|
|
|
|
# Print header
|
|
|
- #map {($rc = printf $sock)} @header;
|
|
|
- $rc = printf $sock @header;
|
|
|
+ $rc = printf $sock $header;
|
|
|
|
|
|
if (!$rc) {
|
|
|
$self->Error("Client connection error %s",
|
|
|
@@ -193,7 +189,7 @@
|
|
|
}
|
|
|
$source =~ s/\n\n/\n/g;
|
|
|
|
|
|
- print("\n$source\n");
|
|
|
+ #print("\n$source\n");
|
|
|
$rc = printf $sock ("\n$source\n");
|
|
|
|
|
|
if (!$rc) {
|
|
|
@@ -225,7 +221,8 @@
|
|
|
package Main;
|
|
|
|
|
|
# Create Server
|
|
|
- my $server = cwho->new({'pidfile' => '@l_prefix@/var/ripe-dbase/whois_filt.pid', 'localport' => 43}, \@ARGV);
|
|
|
+ my $server = cwho->new({'pidfile' => $pidfile,
|
|
|
+ 'localport' => 43}, \@ARGV);
|
|
|
# Bind to address/port, run server
|
|
|
$server->Bind();
|
|
|
|