my $socket = IO::Socket::INET->new(
LocalPort => $LISTEN_PORT,
Type => SOCK_DGRAM,
Proto => 'udp') || die "ERROR: can't open socket\n";
while ($socket->recv(my $in, 1024) ) {
my $sock = IO::Socket::INET->new(
Proto => 'udp',
PeerAddr =>'127.0.0.1:50000');
print $sock $in;
####
$s_socket = IO::Socket::INET->new(
Proto=>"udp",
LocalAddr=>"$s_ip",
LocalPort=>"$s_port"
) or die ("\nCan't setup UDP socket on $ip$s_port: $!\n");
print "opened OK\n";
####
$s_socket->recv($s_output, 1024);
$s_peerhost = $s_socket->peerhost;
$s_peerport = $s_socket->peerport;
$s_addr = "$s_peerhost:$s_peerport";
####
# Get the server info, if we know the server, otherwise ignore the data
if (!$g_servers{$s_addr})
{
$g_servers{$s_addr} = &getServer($s_peerhost, $s_peerport);
if (!$g_servers{$s_addr}) {
&printEvent(997, "UNRECOGNISED SERVER: " . $s_output);
next;
}
}
####
Fri Mar 30 19:32:35 2001: 127.0.0.1:44018 - E997: UNRECOGNISED SERVER: ˙˙˙˙log L 03/30/2001 - 19:35:10: "eatitPUNK<269><346699>" killed "livestock<370><23593>" with "mp5navy"