package RDA::Extern::Net; # $Id: Net.pm,v 1.2 2009/04/30 07:10:36 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/RDA/Extern/Net.pm,v 1.2 2009/04/30 07:10:36 mschenke Exp $ # # Change History # 20090430 DEM Remore unused variable. =head1 NAME RDA::Extern::Net - Net Routines =head1 SYNOPSIS require RDA::Extern::Net; =head1 DESCRIPTION The following method is available: =cut use strict; BEGIN { use Exporter; use Socket; } =head2 S This method gets the reverse lookup information. =cut sub reverse_lookup { my ($agt, $hst) = @_; my ($alt, $nam, $ofh, @adr); if ($ofh = $agt->get_handle) { ($nam, $alt, undef, undef, @adr) = gethostbyname($hst); $ofh->write("|*Host Name*|".$nam." |\n"); if (ref($alt) eq 'ARRAY') { $ofh->write("|*Aliases*|".join('%BR%', @$alt)." |\n"); } else { $ofh->write("|*Aliases*|".$alt." |\n"); } foreach my $adr (@adr) { $ofh->write('|*Reverse Lookup of '.inet_ntoa($adr)."*|" .gethostbyaddr($adr, AF_INET)." |\n"); } } 1; } 1; =head1 COPYRIGHT NOTICE Copyright (c) 2002-2009, Oracle. All rights reserved. =head1 TRADEMARK NOTICE Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. =cut