v1.2 (via Maven)
Looking at: http://jnetpcap.com/docs/javadoc/jnetpcap-javadoc/index.html
I'm a little confused about how I get the ToS from the header
when using the javadoc-mentioned Pcap.dispatch() method that takes a ByteBufferHandler (does not mention the other dispatch methods are thread-safe, so if another version would give me better return objects for this purpose that would be good to know).
The handler interface's returned PcapHeader doesn't seem to have an API for IP header values, though I see in one of the examples an annotation-based class that would provide such an API call (but this is a different header, that maybe I have to peer to the ByteBuffer returned), though don't see that class actually in the API. Wondering if I should be "peering" something to tease this value out... ?
All suggestions welcome.
Thanks.
If you want decoded packets, you should use Pcap.dispatch/loop that takes JPacketHandler which will dispatch fully decoded packets to you. Then to get at individual parts of the ip header use Ip4 object which provides the neccessary accessors. I would also suggest using the loop call, not the dispatch, unless you have very specific reason to do so.
pcap.loop
Thanks!