I want to convert pcap files in plain text files like Wireshark does, from Java source code. Anyone knows how can I do it? asked 28 Jul '15, 13:25 Miguel Freitas |
2 Answers:
There are at least two libraries: pcap4j and jNetPcap. It seems as though pcap4j is working on OS X, while the other is not. (And it is newer). There is a sample for reading a file:
answered 21 Oct ‘15, 10:49 user1234 |
While there are some pcap libraries for Java (as mentioned by @user1234), they don't have (by far) the dissection functionality of Wireshark. As there is no (official) Wireshark library to use, you can run tshark (CLI tool) and parse the output with Java. See the following similar questions:
In my answer to the following question I mentioned some links to the 'unofficial' libwireshark. Maybe you can adapt some of the methods for your Java tool.
Regards answered 21 Oct '15, 13:22 Kurt Knochner ♦ |