Software Release

If the post is related to software release

jNetPcap 1.3 beta 2 released

New release is available. This is beta 2 release of jnetpcap 1.3. No new features have been added but numerous bugs have been fixed that were found in beta 1.

Download: jnetpcap/1.3/stable

Release overview: jNetPcap 1.3 Overview

Dropped Packets & Testing?

I was wondering what the best way is to see if there is dropped packets or if I am losing anything? Below is my code which is pretty newbieish. But what I am trying to do is capture packets and look for keywords in the packets in a separate method which is hand written code of my own method in another class. I put a 30 minute timeout, does that mean it will queue packets in memory if there is a blocking occurring in the nextPacket method? My java class puts all the packets into an MySQL database to be searched on and also allows someone to filter keywords or target keywords so it only puts those in the MySQL db. Let me know if I am completely not handling this situation right:

package dovestech;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.*;
import org.jnetpcap.Pcap;
import org.jnetpcap.PcapIf;
import org.jnetpcap.packet.*;

public class pcapDumper extends Thread implements ServletContextListener {

public static void main(String[] args) {

}
public void contextInitialized(ServletContextEvent sce)
{
try
{
pcap.close();
}
catch (Exception e)
{

}
running = true;
Thread thread = new pcapDumper(); thread.start();
}
public void contextDestroyed(ServletContextEvent sce)
{
running = false;
try
{
pcap.close();
}
catch (Exception e)
{

}
}
private String[] commaParse(String aString){
String[] splittArray = null;
if (aString != null || !aString.equalsIgnoreCase("")){
splittArray = aString.split(",");
System.out.println(aString + " " + splittArray);
}
return splittArray;
}
@Override
public void run()
{
if (dovestech.filterLargePackets.equals("true"))
{
filterLarge = 1514;
}
else
{
filterLarge = 99999;

Status 9/15/10

Only 3 more bugs to fix, which I should be able to finish tomorrow. During my testing and especially handling of multitude of different packet types, I have found few additional bugs.

I also hit the Tcp and Udp protocol headers hard. Updated every possible javadoc, added a bunch of RFC extracts and quotes as documentation. Finished off TcpOptions, setters/getters etc.. These 2 protocols look real good and complete now.

I also expanded the TestUtils under the tests/java directory a bit to make it easier to write more complex test cases. I added JPacketBuffer type class which can load into memory a bunch of pcap headers and packets and allow test cases to work with those packets directly out of memory. Not everything in the API needs to work with open pcap captures all the time. This greatly sped up some test cases.

Also I have been a little disappointed with performance of these fast in-memory buffers. Not much we can do with the 1.X API, but there will be significant performance gains with the 2.X API architecture. Especially when it comes to peering and referencing data in native land. Peering in 2.X API is pure natively handled with no JNI calls. Currently there are too many JNI calls to perform a java object to native memory peer. The 2.X API architecture fixes all these deficiencies with the benefit being, super fast peers. My rough measurements take down a peering call from 100ns to between 5-10ns. Also the scanner improvements, I am confident I can at minimum double performance of jnetpcap if not triple it.

64bit support of v1.3

Hi,
I need a 64bit of the stable version (v1.3).
Does anybody know that if I recompile the source code on a 64bit platfrom (Centos 5.4 with 64bit jvm), will it work?

thanks.

Syndicate content