Results 1 to 8 of 8

Thread: jpcap funtions

  1. #1
    barnaba is offline Member
    Join Date
    Feb 2016
    Posts
    5
    Rep Power
    0

    Default jpcap funtions

    hi there !!! please any one i need help in this, jpcap has a function to get packet length i want to know how can i get the packet size in term of bytes ?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: jpcap funtions

    Do you have a sample of what you've got so far?

    I'm not sure where your issue is, as the Packet class has a getData method that returns a byte[].
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    barnaba is offline Member
    Join Date
    Feb 2016
    Posts
    5
    Rep Power
    0

    Default Re: jpcap funtions

    i don have so far but my point was to get a means to access packet size that i can term size as bandwidth consumption in my application

  4. #4
    barnaba is offline Member
    Join Date
    Feb 2016
    Posts
    5
    Rep Power
    0

    Default Re: jpcap funtions

    hello !!!!!
    when i run this code using java netbeans 8.1 version

    package mybreath;
    import jpcap.JpcapCaptor;
    import jpcap.NetworkInterface;
    public class Mybreath {

    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
    NetworkInterface[] arr;
    NetworkInterface nic;
    arr = JpcapCaptor.getDeviceList();
    for(int i=0; i<arr.length; i++){
    cbox1.addItem(arr[i].description);
    }
    }

    }

    gives me this error

    Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no jpcap in java.library.path

    i have installed java netbeans 7.2 and 8.1 versions

    what can do to remove the error??
    Last edited by barnaba; 02-18-2016 at 01:43 PM.

  5. #5
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,989
    Rep Power
    8

    Default Re: jpcap funtions

    Sounds like you have a missing jpcap.dll in your path.

    https://duckduckgo.com/?q=java.lang....a.library.path
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  6. #6
    barnaba is offline Member
    Join Date
    Feb 2016
    Posts
    5
    Rep Power
    0

    Default Re: jpcap funtions

    thanks Tolls your solution work but it didn't solve my problem what i need is how can i get exactly packet size such as kilobytes, megabytes and so forth ? i decided to use jpcap library to capture the packets .

  7. #7
    barnaba is offline Member
    Join Date
    Feb 2016
    Posts
    5
    Rep Power
    0

    Default Re: jpcap funtions

    in my application i has used jpcap library to capture the packet , i failed to get the data in the packet i used getData() function in a class Packet that return the byte[] when i convert the byte[] to string, the string information returned was encrypted how to decrypt that string to plain text ? and i don know which algorithms was used to encrypt the raw data in the packet
    Last edited by barnaba; 02-20-2016 at 03:48 AM.

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: jpcap funtions

    If you don't know how it was encrypted then you're probably not going to have much success decrypting it.

    As for packet size, I would assume that's closest to the number of header bytes plus the number of data bytes.
    That would at least be a start point.
    Depends on the message possibly?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. JPCAP and WINPCAP Help
    By togreatmind in forum Networking
    Replies: 2
    Last Post: 05-14-2012, 02:53 PM
  2. JPCAP and WINPCAP Help
    By togreatmind in forum Advanced Java
    Replies: 1
    Last Post: 05-14-2012, 02:31 PM
  3. help for jpcap
    By prashant in forum Networking
    Replies: 1
    Last Post: 02-02-2009, 04:01 PM
  4. about using jpcap
    By prashant in forum Networking
    Replies: 1
    Last Post: 12-28-2008, 04:28 PM
  5. random numbers without using java funtions
    By carlos123 in forum New To Java
    Replies: 8
    Last Post: 11-16-2007, 10:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •