Packet Decoding

How to get TCP payload from packet in PROMISCUOUS mode

Hi,

here is my problem...

I listen to traffic in PROMISCUOUS mode and see lots of packets. But packet.hasHeader(tcp) returns true only for packets which are from or to current host. As a result, tcp.getPayload() doesn't work, but when I'm doing ip.getPayload() I see tcp payload with some additional headers (I guess it is tcp header).

So my question is how do I get pure tcp payload from packet which I received in PROMISCUOUS mode and which doesn't involve current host as src or dst?

Thanks.

best regards,
geng

Again BufferUnderflowException

Hi,

I have the same error as reported in the closed (why?) thread
http://jnetpcap.com/node/840
with 1.3.0 (jdk 1.7, windows vista, 32bit).

I read several packets from a pcap file and put them into a queue as PcapPacket objects for later processing. After around 500 packets, org.jnetpcap.packet.JPacket.hasHeader fails with a BufferUnderflowException in org.jnetpcap.nio.JBuffer.check (see the thread above). I assume a problem with memory management in jnetpcap because it works fine if I read and process the packets one by one.

Are there any plans to fix the problem in an official release? The original thread mentions that version 1.3.1 (plus undoing some changes) could help but I don't have the time and resources to build it. I also tried 1.4 but it also fails in the same method (but with a IndexOutofBounds exception).

Btw, for an outsider like me, the project looks quite inactive (no new versions released, no answers in the forum since new year). Would be a pitty.