Importing a Windows application to other OS

3 replies [Last post]
ChemaRamirez
Offline
Joined: 03/17/2010

Hello.
We are developing an application that uses JNetPCap, and we want to develop a version of that application for other operating systems.

Here are a few questions:
1.- Can JNetPCap be used in other OS's different from windows (Unix, Linux, etc.)

2.- If yes, which WinPCap alternative must be used?

3.- What JNetPCap classes/objects/methods must be modified, we use the following classes:
org.jnetpcap.Pcap;
org.jnetpcap.PcapIf;
org.jnetpcap.packet.PcapPacket;
org.jnetpcap.packet.PcapPacketHandler;
org.jnetpcap.protocol.network.Ip4;
org.jnetpcap.protocol.tcpip.Http;
org.jnetpcap.protocol.tcpip.Tcp;

thanks.

Mark Bednarczyk
Mark Bednarczyk's picture
Offline
Joined: 03/22/2008
You can probably make

You can probably make jnetpcap work on any os that supports Java, JNI and libpcap or WinPcap, a gcc compiler.

Sly Technologies, Inc.
R&D

ChemaRamirez
Offline
Joined: 03/17/2010
Thanks. So, there's no need

Thanks.

So, there's no need for code modification when changing the O.S.?

Mark Bednarczyk
Mark Bednarczyk's picture
Offline
Joined: 03/22/2008
There is only 1 function

There is only 1 function which looks up the MAC address of an interface that is OS specific. Everything else is libpcap and OS neutral. That method has now been ported to all of the platforms (well, pretty much all of them) even though jnetpcap is not available for them all as a whole yet.

If this is going to be a private port and you don't need the MAC address function, you could theoretically omit it if needed or no easy way to implement it (I'm thinking mobile OS here). I don't know your exact requirements.

Other then that, only build scripts would have to be updated to provide a build target for your new platform.

Sly Technologies, Inc.
R&D

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.