bset
[email protected] (walter valenti) Fri, 05 Oct 2001 11:40:13 +0200
| Newsgroups | perl.libnet |
|---|---|
| Message-ID | <[email protected]> |
Hi, i'm new of list.
I'm trying the Net:.RawIP module.
I've got a problem with the "bset" fuction: this my code of test, a
little sniffer for see the "SYN packets"
#!/usr/bin/perl
$|=1;
use Net::RawIP qw(:pcap);
$a=new Net::RawIP;
$b=new Net::RawIP;
$filtro='ip proto \\tcp';
$size=150;
$tout=60;
$pcap=$a->pcapinit('eth0',$filtro,$size,$tout);
$offset=linkoffset($pcap);
do {
$ipc=&next($pcap,$temp);
$tmc=timem();
if ($ipc) {
print "catturato: $tmc\n";
$b->bset(substr($ipc,$offset));
#@syn=$b->get({tcp=>['syn']});
#if($syn[0]==0){
# print "SYN\n";
#}
}
}while(1);
After some cicle i've: "Out of memory".
If i comment the bset function i have'nt the problem.
I use Debian GNU/Linux 2.2.19, and Net::RawIP 0.09 from Debian
distribution.
Thanks
Walter
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com