OpenQNX :: The QNX Community Portal

Jul 05, 2008 - 12:13 AM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 50 unlogged users and 0 registered users online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
nayak
Post subject: libpcap port for QNX 6.3.0  PostPosted: Nov 19, 2007 - 09:34 AM
Active Member


Joined: Nov 19, 2007
Posts: 16

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
 
 View user's profile Send private message  
Reply with quote Back to top
Tim
Post subject:   PostPosted: Nov 19, 2007 - 07:10 PM
Senior Member


Joined: Mar 10, 2004
Posts: 536

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
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
nayak
Post subject:   PostPosted: Nov 20, 2007 - 04:33 AM
Active Member


Joined: Nov 19, 2007
Posts: 16

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
 
 View user's profile Send private message  
Reply with quote Back to top
Tim
Post subject:   PostPosted: Nov 20, 2007 - 07:51 PM
Senior Member


Joined: Mar 10, 2004
Posts: 536

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



libpcap.rar
 Description:

Download
 Filename:  libpcap.rar
 Filesize:  45.91 KB
 Downloaded:  48 Time(s)

 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
nayak
Post subject:   PostPosted: Nov 21, 2007 - 04:46 AM
Active Member


Joined: Nov 19, 2007
Posts: 16

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
 
 View user's profile Send private message  
Reply with quote Back to top
micro
Post subject:   PostPosted: Nov 21, 2007 - 09:56 AM
Senior Member


Joined: Jul 22, 2004
Posts: 325

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.
 
 View user's profile Send private message  
Reply with quote Back to top
nayak
Post subject:   PostPosted: Nov 21, 2007 - 11:19 AM
Active Member


Joined: Nov 19, 2007
Posts: 16

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.
 
 View user's profile Send private message  
Reply with quote Back to top
micro
Post subject:   PostPosted: Nov 21, 2007 - 12:45 PM
Senior Member


Joined: Jul 22, 2004
Posts: 325

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.
 
 View user's profile Send private message  
Reply with quote Back to top
nayak
Post subject:   PostPosted: Nov 21, 2007 - 01:15 PM
Active Member


Joined: Nov 19, 2007
Posts: 16

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?
 
 View user's profile Send private message  
Reply with quote Back to top
micro
Post subject:   PostPosted: Nov 21, 2007 - 01:19 PM
Senior Member


Joined: Jul 22, 2004
Posts: 325

Check your calling parameters for qcc (you will have to change the compiler to qcc i think)
 
 View user's profile Send private message  
Reply with quote Back to top
Tim
Post subject:   PostPosted: Nov 21, 2007 - 03:14 PM
Senior Member


Joined: Mar 10, 2004
Posts: 536

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
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
nayak
Post subject:   PostPosted: Nov 22, 2007 - 04:20 AM
Active Member


Joined: Nov 19, 2007
Posts: 16

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

Nayak
 
 View user's profile Send private message  
Reply with quote Back to top
nayak
Post subject:   PostPosted: Nov 22, 2007 - 11:56 AM
Active Member


Joined: Nov 19, 2007
Posts: 16

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?
 
 View user's profile Send private message  
Reply with quote Back to top
micro
Post subject:   PostPosted: Nov 22, 2007 - 12:58 PM
Senior Member


Joined: Jul 22, 2004
Posts: 325

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.
 
 View user's profile Send private message  
Reply with quote Back to top
nayak
Post subject:   PostPosted: Nov 23, 2007 - 04:37 AM
Active Member


Joined: Nov 19, 2007
Posts: 16

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.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.