February 2010

Fedora 12 rpmbuild problem

This is what i get when i try to make an rpm package.

"ant clean test" was successful
"ant -Dos=fc12 clean package-rpm" produces the following error:

build-rpm:
[copy] Copying 1 file to /usr/local/src/jnetpcap/build/rpm/SPECS
[copy] Copying 1 file to /usr/local/src/jnetpcap/build/rpm/INSTALL/usr/lib
[copy] Copying 1 file to /usr/local/src/jnetpcap/build/rpm/INSTALL/usr/share/java
[copy] Copying 1 file to /usr/local/src/jnetpcap/build/rpm/BUILD
[copy] Copying 1 file to /usr/local/src/jnetpcap/build/rpm/BUILD
[copy] Copying 1 file to /usr/local/src/jnetpcap/build/rpm/BUILD
[rpm] Building the RPM based on the jnetpcap.spec file
[rpm] Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.aGS4A6
[rpm] + umask 022
[rpm] + cd /usr/local/src/jnetpcap/build/rpm/BUILD
[rpm] + LANG=C
[rpm] + export LANG
[rpm] + unset DISPLAY
[rpm] + exit 0
[rpm] Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.d8TwC4
[rpm] + umask 022
[rpm] + cd /usr/local/src/jnetpcap/build/rpm/BUILD
[rpm] + LANG=C
[rpm] + export LANG
[rpm] + unset DISPLAY
[rpm] + pwd
[rpm] /usr/local/src/jnetpcap/build/rpm/BUILD
[rpm] + exit 0
[rpm] Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.q5zyE2
[rpm] + umask 022
[rpm] + cd /usr/local/src/jnetpcap/build/rpm/BUILD
[rpm] + '[' /usr/local/src/jnetpcap/build/rpm/INSTALL '!=' / ']'
[rpm] + rm -rf /usr/local/src/jnetpcap/build/rpm/INSTALL
[rpm] ++ dirname /usr/local/src/jnetpcap/build/rpm/INSTALL
[rpm] + mkdir -p /usr/local/src/jnetpcap/build/rpm
[rpm] + mkdir /usr/local/src/jnetpcap/build/rpm/INSTALL
[rpm] + LANG=C
[rpm] + export LANG
[rpm] + unset DISPLAY
[rpm] + /usr/lib/rpm/check-buildroot
[rpm] + /usr/lib/rpm/redhat/brp-compress
[rpm] + /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
[rpm] + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip

what is the possibility of Pcap.nextEx error ?

Hello ^^
Let me explain what i did..
i create Thread to capture packets from each interface. That means if i have 2 available interfaces, i'll have 2 working Threads (1 Thread for 1 interface)

and now, i'm having a problem with using
while(pcap.nextEx(hdr, buf)) in my Thread
the situation is
-i start the my capturing program at Ubuntu1
-then i ping from Ubuntu2 to Ubuntu1 (this works fine: Ubuntu1 can capture ICMP packet)
-while Ubuntu2 pinging to Ubuntu1, i ping from Ubuntu3 to Ubuntu1. But Ubuntu1 can capture only ICMP packet from Ubuntu2 (can capture only packet that come from first client that ping to Ubuntu1)
-after that i stop Ubuntu2 pinging and remain Ubuntu3 pinging
-i found that there's error that make "while(pcap.nextEx)" error (not sure. But it breaks my loop)
-so the capturing thread is stop and now my capturing program can't capture any packet

my question is
1.Can pcap.openLive work simultaneously?
2.What is the error that makes "while loop" breaking?
3.does "while(pcap.nextEx)" always wait for new packet? or just check that, if no new packet it'll break the loop

Thank you very much

Using JNetPcap in RHEL4

I try to use the jnetpcap in RHEL4,
But when try to sendPacket, it failed.
I found that my libpcap version is 0.8.4.
Then I update the libpcap to 0.9.4,
I see in the manul that if libpcap version > 0.9.3, the jnetpcap will support sendpacket API,
But it still failed.
Why?

I see the jnetpcap will support FreeBSD,
Is this version released?

JnetPcap and IPv6

Hi everyone,
I'd like to ask how deeply JnetPcap supports IPv6. I have fastly seen javadoc protocol IPv6 part. But if I capture simple IPv6 icmp echo (rqst, reply) and try to parse it and print out by packet.toString(), it seems that IPv6 header is unrecognized. Cause it prints out:

Frame:
Frame: number = 2
Frame: timestamp = 2010-02-22 17:29:37.69
Frame: wire length = 104 bytes
Frame: captured length = 104 bytes
Frame:
Eth: ******* Ethernet - "Ethernet" - offset=0 (0x0) length=14
Eth:
Eth: destination = 60:0:0:0:0:40
Eth: .... ..0. .... .... = [0] LG bit
Eth: .... ...0 .... .... = [2] IG bit
Eth: source = 3a:40:20:1:15:c0
Eth: .... ..0. .... .... = [0] LG bit
Eth: .... ...0 .... .... = [2] IG bit
Eth: type = 0x65FF (26111)
Eth:
Data: ******* Payload offset=14 (0xE) length=90
Data:
000e: 01 fb 00 00 00 00 00 00 00 02 2a 00 14 50 80 01 ..........*..P..
001e: 00 00 00 00 00 00 00 00 00 69 80 00 e5 6e 46 44 .........i...nFD
002e: 00 02 f1 b0 82 4b 00 00 00 00 ba 88 0a 00 00 00 .....K..........
003e: 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d ................
004e: 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d . !"#$%&'()*+,-
005e: 2e 2f 30 31 32 33 34 35 36 37 ./01234567

Is there any approach how to parse even IPv6 trafic correctly?
Thanks for answers.

Centos 64-bit support?

Hi,

I know that there was this earlier thread:

http://jnetpcap.com/node/492

but figured it'd be better to ask about this in a different thread, since this is for Centos 5 64-bit, rather than Ubuntu.

Do you have any idea if/when you may be having 64-bit support, and specifically for Centos 5?

Also, FYI, the libpcap version on Centos 5 is:

lrwxrwxrwx 1 root root 16 Feb 18 12:59 libpcap.so.0 -> libpcap.so.0.9.4
lrwxrwxrwx 1 root root 16 Feb 18 12:59 libpcap.so.0.9 -> libpcap.so.0.9.4
-rwxr-xr-x 1 root root 167096 Jan 20 2009 libpcap.so.0.9.4

Thanks,
Jim

Win64 support?

Would love to see Windows 64-bit prebuilt packages. Has jnetpcap been tested under win64?

JBuffer object pool

Ok..so this is what I'm doing now:

public void nextPacket(PcapHeader header, JBuffer buffer, ConcurrentLinkedQueue user) {
	fp = FastPacket().getInstance();
	fp.packet = new JBuffer(buffer);
        user.offer(fp);

---------------------------------
I am making a copy of JBuffer in order to preserve it for later use. My question is: Is there a way to avoid creating new reference of JBuffer and just reuse it/reallocate it/fill it up with new data from current temporary JBuffer from the loop? This FastPacket is resued(Object pool) so I would like to reuse the "Jbuffer fp.packet Object" again by just filling it up with new data if possible. Is there a way to do it with transferTo/TransferFrom? The reason I'm asking this is because I have a multi-threaded application and packet processing is delayed so I need to save those packets somewhere and since the application is processing more then 120Mbit of traffic I am trying to cut down on memory use and avoid unnecessary allocations. I started using object pools all over but I'm not really sure how to this with JBuffer...

Please advise,
Thanks,
Damir

Can i use JNetPcap to filter Http contents?

Hello and hope you fine

im java programmer and im developing a cybercafe project and its need filtering the client request and response
specially for kids who enter the cafe
what i want to do is to notify the server that a client is entering an adult site
owner of the cafe can add words to be filtered

so the question is can i use JNetPcap for this job?

thank you very much for your work

java.util.ConcurrentModificationException

java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
at java.util.AbstractList$Itr.next(Unknown Source)
at hr.intendanet.eagleeye.probe.RTPProbe.stop(Unknown Source)
at hr.intendanet.eagleeye.probe.SIPProbe.packetProcessor(Unknown Source)
at hr.intendanet.eagleeye.probe.protocol.ProbeBase$packetProcessor.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

-------------------
I know this bug is listed as fixed but i am still getting this excetions sometimes. I am using 2.b0001 version compiled on Debian 64bit.

The method stop() that is listed as a cause of this error is doing nothing else but setting a boolean variable to true. This variable is checked in JBuffer handler loop, and if true, pcap.breakloop() method is called.

Thank you,
Damir

include directory of jnetpcap

There is a include directory in the jnetpcap-1.3.a1-1.win32.It contains some .h files.
What is their's goal ?

Thank you