[Winpcap-announce] jNetPcap: a java wrapper for libpcap and winpcap

Mark Bednarczyk voytechs at yahoo.com
Fri Aug 10 16:58:24 GMT 2007


Hi everyone, here is a neat open source project. I have released new version
of jNetPcap loaded with functionality. This is the 3rd beta release, right
on track to production quality status. 

jNetPcap is a true java wrapper around the native libpcap and winpcap
libraries, exposing all of their functions and structures. Through the use
of java's JNI API, methods are proxied and structures are peered with their
java cousins. I stress the "all" exported functions fact, to point out that
no other java library does this today and that is how jNetPcap
differentiates itself, among other things. 

Some Features: 
- No packet data copies - passed by reference into java as a direct nio byte
buffer 
- Provides "all" libpcap functions and structures - very few exceptions that
just did not make sense in java 
- Also comes with all WinPcap extensions 
- Tune kernel buffers and behavior from java 
- Transmit at link layer with any size sendqueues 
- Remote captures 
- Allows the kernel gather statistics much more efficiently 
- LGPL licensed - source in SVN on sf.net 

Some note worthy methods: 
* openLive - opens a live capture from network interface 
* openOffline - opens a capture file 
* findAllDevsEx - extended version of Pcap.findAllDevs which allows you to
not only find network interfaces, but also PCAP files. This can be done
locally or remotely. 
* liveDump - which can dump captured packets to a savefile automatically at
the kernel level. 
* sendQueueTransmit - and related method, which allow raw packets to be sent
in bulk, efficiently. 
* setMinToCopy, setMode and setBuf - allow tweaking of kernel buffers and
enable/disable statistical captures 
* offlineFilter - ability to apply the BPF filter on your own packets
without a capture 
* setSampling - changes the mode of the capture where only samples of a
capture are retruend. packets 
* statEx - extended statistics that include counters on RPCAP remote
connection 

The best way to see this in action is to look at an example: 
http://jnetpcap.sourceforge.net/?q=node/48 

Homepage: 
http://jnetpcap.sf.net
 
Cheers,
mark...



More information about the Winpcap-announce mailing list