Subject: | next_ex woes |
Date: | Fri, 29 Dec 2006 18:09:57 +0000 |
To: | bug-Net-Pcap [...] rt.cpan.org |
From: | Alexander Clouter <alex-cpan [...] digriz.org.uk> |
Hi,
I am running into a problem using Net::Pcap::next_ex() not returning the
actual packet payload. I have stared at the sourcecode with no success to
see if I can fix it myself but not knowing a thing about Perl XS I
unsurprisingly did not get too far :)
I have attached an example script, which might show if I am doing something
wrong, and implemented what the manpage tells me to do. %header is correctly
populated and if I extend the header by adding:
hv_store(hv, "data", strlen("data"), newSVpv(data, header->caplen), 0);
I get the correct payload accessible perfectly. Its bizarre to me why
pkt_data seem to be undefined when using the 'traditional' route.
Throwing in a couple of printf's/SvPV_nolen()'s after its been set tell me
pkt_data is empty. :-/
I am using libpcap0.8(-dev) {Debian 'unstable' package version 0.9.5-1}[1]
and have tried Net::Pcap version 0.14 and 0.15_01. I have also tried both:
* gcc version 3.4.6 (Debian 3.4.6-4)
* gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
In addition I cannot get next_ex() to timeout (with a $ret==0) after no
packet activity, but that's another bug I'll report later. :)
Any ideas?
Cheers
Alex
[1] as libpcap0.7 does not support next_ex, or so it tells me in the pcap
manpage
--
Show quoted text
________________________________________
/ May you have warm words on a cold \
| evening, a full mooon on a dark night, |
| and a smooth road all the way to your |
\ door. /
----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
Message body is not shown because sender requested not to inline it.