libpcap port for QNX 6.3.0

Does anybody know of a libpcap port for QNX 6.3.0? My application uses this library which I am supposed to port on QNX. It would be of great help if I get some pointers.

Thanks
Nayak

Nayak,

If you install tcpdump from the 3rd party software CD you will get a copy of libpcap installed which you can then link against.

In Photon use the Launch->Installer and select QNX WWW Respository. This will show all the 3rd party software you can download. Grab tcpdump.

The library installs in /opt/lib directory.

Tim

Hi Kim ,
thanks for the reply. I have installed the QNX 6.3.0 Momentics on my windows host. I couldnt find Photon or launch-> Installer. It might be a odd question but could you please direct me to to the 3rd party software.

regards
Nayak

Nayak,

Ah, you don’t even have a QNX target machine set up yet. Photon runs on a QNX machine, not under windows. I don’t think any 3rd party software installs on Windows

I’ve attached libpcap.a to this post. Just download it and install it in the Momentics folder (I’ll leave that exercise up to you to find and place it with all the other libraries)

Tim

Hi Tim,
Thanks for the file. The thing is I am not working ona Neutrino hosted system. I work on windows hosted system and I even have a target connection setup on the same. I even compiled some sample application and ran on the target. Just a basic question, is it really necessary to have a Neutrino hosted system for any porting or development work?

regards
Nayak

No it is not, but you cannot install a library with your Photon Installer on Windows. You can install the pcap-library on your target with the installer and for binding this lib to your app, just import the lib from your target to your windows host.

thanks again for the reply. One more doubt. If I have a libcap open source code then can I import the whole project into my IDE and build it? I mean the libcap might allready have a Makefile for the source and can I use the same make file? How did you do that when you install the tcpdump code. What if I need to load the lib on the target which is other than the x86? Sorry for asking too many questions. Since I am new to QNX I am asking may questions.

If the source and the makefile provide a build-chain for QNX you could actually import it in one step. But if this is not provided you will have to manage your own Makefile.

Micro lets assume if I have the makefile for QNX but my final lib should go to a target other than the x86. How will I manage it or where should I change it?

Check your calling parameters for qcc (you will have to change the compiler to qcc i think)

Nayak,

As Micro said, you’ll need to change to use qcc in the Makefile and specify the target processor.

I do something like this:

CC = qcc -V3.3.5,gcc_ntox86_cpp

for specifying the 3.3.5 version of the compiler for X86. You should be able to get a list of options for qcc supported processors someplace in the Momentics help.

Then on my actual compile lines I have:

foo.o: foo.cpp
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

where CFLAGS is the compiler options and INCLUDES are all my include paths. The stuff at the end of the line is just some wildcarding so I don’t have to type the file names out again.

Tim

Hi Micro, Tim thanks for your replies. I will try with qcc.

Nayak

HI again,
I tried to build the code with saem make file and as I told I am working ona windows hosted system with Momentics IDE. I get some errors in #include<windows.h> which is defined for OPENSSL_SYS_WINDOWS somewhere. I couldnt find any defines for QNX. does that measn I have to define the macro for QNX in all those files for the build?

This sounds like you are trying to build this for windows. There is no windows.h in QNX. I guess you are not using the correct buildfile nor the correct libraries.
You must NOT build for windows but for QNX.

Let me explain what I am doing. I have created a project in Momentcs IDE and then tried to build the downloaded openssl code. I just started with a folder called apps. Since we have to create many number of projects if we have to build the project I started with a single folder which has a make file. But I got this error which complains of windows.h. I want to build the code for QNX but since the source code which I have downloaded is not yet ported on qnx its complaining about that file thats what I think. So in turn to compile it on qnx do I have to define the macros for QNX and something like that? I hope I am clear with my question.

Once more, you won´t need windows.h, add a -D__QNXNTO__ to your makefile or your Projectsettings, this define is generally available if you build for QNX Neutrino but it looks like your makefile tries building for windows. As Tim already mentioned, you have to put “gcc_ntox86” somewhere, this is a special argument for the QCC, which tells the compiler to use gcc and build vor QNX Neutrino on X86 Platform. If this is understood by QCC it will NOT try to load windows.h!

Addendum:
If gcc_ntox86 is understood by the compiler and your makefile supports building for QNXNTO it will not try to load windows.h.
Otherwise you will have to write your own makefile or edit the existing.

Hi Micro thanks. I will try to build it with this definition. What option should I give for motorola targets specifically for mpc5200b board.

Best to check your qcc documentation, or calling qcc -V