On Thu, 10 Mar 2005, David Nolan wrote:
$from isn't a simple string, you need to do something like:
yes, so i plucked code from mon to make this separate test program which receives traps and decodes what recv returns, and it does just as i expect:
#!/usr/bin/perl
use Socket;
$bindaddr = INADDR_ANY;
$udpproto = getprotobyname ('udp');
socket (TRAPSERVER, PF_INET, SOCK_DGRAM, $udpproto);
bind (TRAPSERVER, sockaddr_in (2583, $bindaddr));
$a = recv (TRAPSERVER, $buf, 65536, 0);
($port, $addr) = sockaddr_in ($a);
$addr = inet_ntoa ($addr); print "port=$port\n"; print "addr=[$addr]\n";
send a trap to that, and you'll see it report something like this:
$ ./tst port=33002 addr=[127.0.0.1]
dunno, i'll have to look at it harder.
_______________________________________________ mon mailing list mon@linux.kernel.org http://linux.kernel.org/mailman/listinfo/mon