jNetPcap
jNetPcap是libpcap的一个Java完整封装。jNetPcap使用与libpcap相同风格的API。libpcap是unix/linux平台下的网络数据包捕获函数库,大多数网络监控软件都以它为基础。 Libpcap可以在绝大多数类unix平台下工作。Libpcap提供了系统独立的用户级别网络数据包捕获接口,并充分考虑到应用程序的可移植性。
It came out better than I expected. I've been able to scan more and more files with various protocols. Here is the output from TextFormatter of one of the packets. The last portion of the packet is a 'hexdump' of the X11 header since I haven't written a definition for it. I truncated it a little bit since its very long.
Ethernet: ******* Ethernet (Eth) offset=0 length=14 Ethernet: Ethernet: destination = 00-60-08-9F-B1-F3 Ethernet: source = 00-40-05-40-EF-24 Ethernet: protocol = 0x8100 (33024) Ethernet: 802.1q: ******* 802.1q (vlan) offset=14 length=4 802.1q: 802.1q: priority = 0 802.1q: cfi = 0 802.1q: id = 32 802.1q: type = 0x800 (2048) 802.1q: ip4: ******* ip4 (ip) offset=18 length=20 ip4: ip4: version = 4 ip4: hlen = 5 [*4 = 20 bytes] ip4: diffs = 0x0 (0) ip4: 0000 00.. = [0] reserved bit: not set ip4: .... ..0. = [0] ECN bit: ECN capable transport: no ip4: .... ...0 = [0] ECE bit: ECE-CE: no ip4: length = 932
|