Questions tagged [pcap4j]

A Java library for capturing, crafting, and sending packets.

A Java library for capturing, crafting, and sending packets.

28 questions
0
votes
0 answers

Pcap4j return null packets header depending on runtime environment

I'm actually developing a contextual data generator for Weka and I package it as a Weka plugins (using the templates here: https://github.com/bnjmn/weka/tree/master/packages/templates). A part of my plugins is to reading data from a pcap file so I'm…
PierreBls
  • 19
  • 5
0
votes
0 answers

Java - Send a TCP packet to loopback address using pcap4j

I got PacketSendPacket failed: The request is not supported. (50) While i try to send a simple packet to loopback import org.pcap4j.core.PcapHandle; import org.pcap4j.core.PcapNetworkInterface; import org.pcap4j.core.Pcaps; import…
0
votes
1 answer

java and pcap4j on linux Problem to load class

I have tried to write a program using pcap4j for java. I have downloaded and built it. Then I wrote this code using maven: import java.net.*; import org.pcap4j.core.*; import org.pcap4j.core.PcapNativeException; /** * Hello world! * */ public…
Mihail HRS
  • 115
  • 1
  • 1
  • 9
0
votes
1 answer

pcap4j+winpcap should I run rpcapd.exe manually?

Hi I have downloaded pcap4j and winpcap and all jar (jna, pcap4j-core-1.8.2, slf4j-api-1.7.25, slf4j-simple-1.7.25) dependency manually. Added to the project and all compile well. BUT: when I began to sniff packet.getHeader() and packet.getPayload()…
sefiroths
  • 1,555
  • 3
  • 14
  • 29
0
votes
1 answer

I am getting " was resolved to null" message while using SendArpRequest class from Pcap4j library. How to implement it properly?

I am trying to get MAC address of the device in a local network by using its IP address. To implement this in java I found a library name Pcap4j. I am using its class SendArpRequest to generate ARP request and receive a reply, but it always says…
Md Nafis Khan
  • 60
  • 1
  • 8
0
votes
1 answer

Java - Pcap4j only detects host device's adress

I've been trying to write a sniffer for ARP-packet detection. I've gotten the Pcap4j library to run and detect my network, but it only shows the computer that it's currently running on in the list of adresses. There are a lot of different devices…
0
votes
1 answer

PcapNetworkInterface returns null on given IP

I am trying to capture packages. In my "exploration" example I use the IP of a website that I visit in the browser. I am using PCAP4J to capture package information. Based on step 3 on https://www.pcap4j.org/ I have the impression that I can simply…
Crittje
  • 101
  • 1
  • 3
  • 11
0
votes
1 answer

OSGI JNA native library pcap not found

I'm using pcap4j in my OSGI project. The devices the application is running on is running openembedded. When I'm running my code in a standalone application (non OSGI) on a device, it works without problem. When running inside an OSGI it doesn't. I…
Maarten
  • 41
  • 5
0
votes
0 answers

Pcap4j java library : unable to catch more than one packet using the same ping

when I capture a specific packet I can't reproduce the same thing using the same ping. ( for example when you run the project and you go the cmd "ping somethingthatdoesntwork.comm" result : couldn't reach the page, the second time you do the same…
0
votes
2 answers

UnsatisfiedLinkError: Native library (com/sun/jna/android-x86-64/libjnidispatch.so) not found in resource path (.)

i'm develop android app for sniffing packets from device. I'm using pcap4j library, but when call Pcaps.getDevByAddress(), launches the exception. Can you help me? This is snipped code: InetAddress destAddr = parsedPacket; PcapNetworkInterface nif…
paky
  • 1
  • 2
0
votes
1 answer

Pcap4J: Unable to load library 'pcap'

I run an application uses Pcap4J on Windows 10. It worked correct (with Admin privileges). When I run the same application on Linux (Cent OS 7) I got this error: java.lang.UnsatisfiedLinkError: Unable to load library 'pcap': Native library…
Aleks Ya
  • 859
  • 5
  • 15
  • 27
0
votes
0 answers

Pcap4j packet capture on loopback doesn't differentiate between Incoming and Outgoing packets

I am writing a simple packet capture & processing engine for my project using pacp4j. Below is the code that I am using to capture packets but when I use it to capture ONLY incoming packets on loopback address it gives me both outgoing and incoming…
Nullpointer
  • 1,086
  • 7
  • 20
0
votes
2 answers

How to implement ping like functionality using pcap4j library

I want to implement basic network check functionality to test if the provided url is responding or not (eg. ping www.google.com).It must provide operational information indicating, for example, that a requested service is not available or that a…
Swapnil
  • 1,004
  • 1
  • 13
  • 21
1
2