API

Help building jnetpcap on AIX

Hi

I really need help compiling jnetpcap on AIX, currently i'm using version jnetpcap-src-1.4.r1425-1 to compile the code.
Everytime i run command: 'ant clean comp-jni-aix-cc -verbose' or 'ant clean comp-jni-aix-xlc -verbose' it failed BUILD ERROR.

running: ant clean comp-jni-aix-cc

Use the arrow to expand or collapse this section
comp-jni-aix-cc:
[echo] objfile=./build/obj
[copy] Copying 1 file to /apps/IsoMsgETL/jnetpcap-src-1.4.r1425-1/build/obj
[echo] Value of outfile = ${outfile}
[echo] arch=ppc64
[echo] name=AIX
[echo] Using pcap version 0x100
[echo] compiling JNI C++ files to object code
[echo] using g++ compiler
[echo] system include = /usr/java6_64/include
[cc] 25 total files to be compiled.
[cc] Starting link
[cc] ld: 0706-027 The -x flag is ignored.
[cc] ld: 0706-012 The -6 flag is not recognized.
[cc] ld: 0706-012 The -4 flag is not recognized.
[cc] ld: 0706-012 The -p flag is not recognized.
[cc] ld: 0706-012 The -1 flag is not recognized.
[cc] ld: 0706-012 The -q flag is not recognized.
[cc] ld: 0706-027 The -k shrobj flag is ignored.
[cc] collect2: error: ld returned 255 exit status

BUILD FAILED
/apps/IsoMsgETL/jnetpcap-src-1.4.r1425-1/build.xml:952: gcc failed with return code 1

running: ant clean comp-jni-aix-cc

comp-jni-aix-xlc:
[echo] kobjfile=./build/obj
[echo] Value of outfile = ${outfile}
[echo] arch=ppc64
[echo] name=AIX
[echo] Using pcap version 0x100
[echo] compiling JNI C++ files to object code
[echo] using g++ compiler
[echo] system include = /usr/java6_64/include
[exec] /apps/IsoMsgETL/jnetpcap-src-1.4.r1425-1/src/c/jnetpcap.cpp:
[exec] "/apps/IsoMsgETL/jnetpcap-src-1.4.r1425-1/src/c/packet_jscanner.h", line 287.18: 1540-2891 (Drunk The array member "header_t pkt_headers[]" may only be followed by members of consistent type.

Sniff packets as a 3rd host

Hi I'm Kaan,

Can I do something like this =>

I have a 3 host in network and a router.
Router default gateway is '192.168.2.1'
and host A Ip is '192.168.2.10'
and host B Ip is '192.168.2.20'
and host C Ip is '192.168.2.30'

A and B communicate each other with Udp protocol,
and C sniff that packets with Jnetpcap.

I made some tests but I couldn't sniffed packets.

Thanks for your interests,

change jNetpcap to jNetWORKS SDK?

Hi, I have an application that uses jNetpcap, I want to buy a Napatech card, do I have to redo my entire application with the SDK jNetWORKS?. Thanks.

erro Sending packets isn't supported in cooked mode (SO Ubuntu)

Hello guys.

I try send the packet using method pcap.sendPacket(packet);
but I received Sending packets isn't supported in cooked mode

my device is ppp0 and I have capture my packets very well, but not send.

my code is simple:
Pcap ppp0 = Pcap.openLive("ppp0", capturaAllPacket, Pcap.MODE_PROMISCUOUS, timeout, erros);
ppp0.activate();
ppp0.loop(Pcap.LOOP_INFINITE, new JpacketHandler(ppp0), "ppp0");

this capture the packets sends and so:
my handler:

public void nextPacket(PcapPacket packet, String user) {

if (packet.toString().toUpperCase().contains("HTTP")) {
try{
int send = pcap.sendPacket(packet); //this packet is correct, because I use the packet capture...
if(send != Pcap.OK){
System.out.println(erros + "\n" + pcap.getErr());//Send packets isn't supported in cooked mode
}
}catch(Throwable e){
e.printStackTrace();
}
}

}

How to detect which network interface is used

Hi all,

I'm trying to get some information providing from my web browser and I follow the documentation and other topics but I don't find any solution for my issue.

I would like to use openLive method but replace device.getName() by a method returning my used device. So does exist a method for detecting which device is used ?

NB:
Pcap pcap = Pcap.openLive(device.getName(), snaplen, flags, timeout, errbuf);

Thanks in advance,
Regards,
Jessy

Syndicate content