Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Help with newtwork packet sniffer

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with newtwork packet sniffer

    Trying to write a network packet sniffer using jpcap in eclipse. At runtime i get this error:

    Exception in thread "main" java.lang.UnsatisfiedLinkError: jpcap.JpcapCaptor.getDeviceList()[Ljpcap/NetworkInterface;
    at jpcap.JpcapCaptor.getDeviceList(Native Method)
    at pktSniffer.main(pktSniffer.java:20)


    import jpcap.*;
    import jpcap.packet.Packet;
    import jpcap.PacketReceiver;
     
    public class pktSniffer implements PacketReceiver {
     
    public void receivePacket(Packet packet){
     
            System.out.println(packet);
    }
     
    public static void main(String[] args) throws java.io.IOException{
     
        NetworkInterface[] lists=jpcap.JpcapCaptor.getDeviceList();
     
        System.out.println("\n\t\t***Network Sniffer***\n");
     
        System.out.println("Found the following devices : ");
     
        for(NetworkInterface s: lists)
        {
            System.out.println("Name: " + s.name +" Description: " + s.description);
        }
     
        JpcapCaptor jpcap=JpcapCaptor.openDevice(JpcapCaptor.getDeviceList()[1],1000,false,20);
        jpcap.loopPacket(-1,new pktSniffer());
     
        }
    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Help with newtwork packet sniffer

    Have you looked up the definition of that error in the API doc?
    Look for the class: UnsatisfiedLinkError

  3. #3

    Default Re: Help with newtwork packet sniffer

    Why are you trying to sniff packets? Is it a Java exercise or is it just to see what packets are being transmitted?

    If your goal is just to sniff packets to see them, Wireshark is a great tool to use.

    Wireshark Go deep.
    Kenneth Walter
    Software Developer
    http://kennywalter.com

  4. #4
    Junior Member
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help with newtwork packet sniffer

    Actually was tyring to sniff packets so i could sniff out and save the packets (cookies)

Similar Threads

  1. Help in stopping thread (Packet sniffer)
    By adilet23 in forum Threads
    Replies: 3
    Last Post: September 9th, 2011, 01:15 AM
  2. How to set the format of a udp packet ?
    By Mezzo in forum Java Networking
    Replies: 0
    Last Post: January 19th, 2011, 06:43 PM
  3. HTTPS packet Capturing
    By zeerussia in forum Java Networking
    Replies: 0
    Last Post: November 10th, 2010, 01:58 AM
  4. Decode Binary Packet via TCP Socket
    By maxice in forum Java Networking
    Replies: 0
    Last Post: November 8th, 2010, 03:38 PM
  5. Replies: 6
    Last Post: October 23rd, 2009, 03:53 AM