0

hey i am trying to capture all ICMP Traffic and i stack with this exception:

Opening file for reading: tmp-capture-file.pcap
Src: 192.168.1.15 Dst: 192.168.1.22
Exception in thread "main" java.lang.NullPointerException
    at org.jnetpcap.nio.JBuffer.check(JBuffer.java:108)
    at org.jnetpcap.nio.JBuffer.getUShort(JBuffer.java:415)
    at org.jnetpcap.protocol.tcpip.Tcp.destination(Tcp.java:1199)
    at Main$3.nextPacket(Main.java:304)
    at Main$3.nextPacket(Main.java:1)
    at org.jnetpcap.Pcap.loop(Native Method)
    at org.jnetpcap.Pcap.loop(Pcap.java:2445)
    at Main.Check(Main.java:344)
    at Main.main(Main.java:43)

TCP , UDP working fine but ICMP dont allow me to Continue

Daniel Mamary
  • 29
  • 1
  • 6
  • It'll be useful to know which version you are running. Does your PCAP file have truncated packets by any chance? – fpga_magik Jul 13 '17 at 10:20
  • I didnt understand your question how can i check my pcap file properties? – Daniel Mamary Jul 16 '17 at 18:50
  • Did you capture it or were given it? You can load it into wireshark and get some information from there - I can't remember exactly, perhaps look at the help. – fpga_magik Jul 18 '17 at 09:11
  • when i am using wireshark to load pcap file everything is fine and i have the list of the (icmp) packets but the problem is when i am using my code to load the pcap file to analysis i getting this exception i read about this exception and its something with the buffer – Daniel Mamary Jul 29 '17 at 14:48
  • Wireshark copes with truncated packets, probably the code doesn't. Does wireshark inform the packets are truncated? – fpga_magik Aug 03 '17 at 10:54
  • wireshark copes with truncated packets my code doing it too because my code can fetch the data of TCP,UDP packets but maybe ICMP have other properties its mean maybe we need think about the buffer size look into exception – Daniel Mamary Aug 09 '17 at 18:35

0 Answers0