Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Ref - Packet Filter compilation problem: (7 Items)
   
Ref - Packet Filter compilation problem  
Hi ,

I have copied the sample code for PF from QNX site and try to compile in QNX x86 PC but it throws an error.

Please tell me how to compile and load.

make -j 1 -Cdll -fMakefile
make[1]: Entering directory `/home/senthil/pfil/x86/dll'
../../common.mk:10: /home/senthil/pfil/../lsm.mk: No such file or directory
make[1]: *** No rule to make target `/home/senthil/pfil/../lsm.mk'.  Stop.
make[1]: Leaving directory `/home/senthil/pfil/x86/dll'
make: *** [all] Error 2

Thanks
K.Senthil
Re: Ref - Packet Filter compilation problem  
On Wed, Jun 24, 2009 at 05:00:19AM -0400, Senthil K wrote:
> Hi ,
> 
> I have copied the sample code for PF from QNX site and try to compile in QNX x86 PC but it throws an error.
> 
> Please tell me how to compile and load.
> 
> make -j 1 -Cdll -fMakefile
> make[1]: Entering directory `/home/senthil/pfil/x86/dll'
> ../../common.mk:10: /home/senthil/pfil/../lsm.mk: No such file or directory
> make[1]: *** No rule to make target `/home/senthil/pfil/../lsm.mk'.  Stop.
> make[1]: Leaving directory `/home/senthil/pfil/x86/dll'
> make: *** [all] Error 2
> 
> Thanks
> K.Senthil

Looks like you didn't copy enough.  Please see this page.
Picking out an isolated piece and trying to build it
isn't a supported configuration.

http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Source_Guide

-seanb
Re: Ref - Packet Filter compilation problem  
Hi,

I copied from their and compile the previous problem got solved but another problem i faced.

Please find the below errors

make -j 1 -Cx86 -fMakefile
make[1]: Entering directory `/home/senthil/pfil/x86'
make -j 1 -Cdll -fMakefile
make[2]: Entering directory `/home/senthil/pfil/x86/dll'
/usr/qnx640/host/qnx6/x86/usr/bin/qcc -Vgcc_ntox86 -c -Wc,-Wall -Wc,-Wno-parentheses  -O -DNDEBUG   -I. -I/home/senthil/
pfil/x86/dll -I/home/senthil/pfil/x86 -I/home/senthil/pfil -I/usr/qnx640/target/qnx6/usr/include      -shared -
DVARIANT_dll -DBUILDENV_qss  /home/senthil/pfil/pfhook.c
/home/senthil/pfil/pfhook.c: In function 'deinit_module':
/home/senthil/pfil/pfhook.c:61: warning: implicit declaration of function 'pfil_remove_hook'
/home/senthil/pfil/pfhook.c:63: warning: implicit declaration of function 'pfil_head_get'
/home/senthil/pfil/pfhook.c:63: warning: assignment makes pointer from integer without a cast
/home/senthil/pfil/pfhook.c: At top level:
/home/senthil/pfil/pfhook.c:78: warning: 'struct _iopkt_self' declared inside parameter list
/home/senthil/pfil/pfhook.c:78: warning: its scope is only this definition or declaration, which is probably not what 
you want
/home/senthil/pfil/pfhook.c: In function 'pfil_entry':
/home/senthil/pfil/pfhook.c:83: warning: implicit declaration of function 'pfil_add_hook'
/home/senthil/pfil/pfhook.c:86: warning: assignment makes pointer from integer without a cast
/home/senthil/pfil/pfhook.c: At top level:
/home/senthil/pfil/pfhook.c:98: warning: parameter names (without types) in function declaration
-------------------------------------------------------------------------------
/home/senthil/pfil/pfhook.c:98: error: function 'IOPKT_LSM_ENTRY_SYM' is initialized like a variable
/home/senthil/pfil/pfhook.c:99: warning: implicit declaration of function 'IOPKT_LSM_ENTRY_SYM_INIT'
cc: /usr/qnx640/host/qnx6/x86/usr/lib/gcc/i386-pc-nto-qnx6.4.0/4.2.4/cc1 error 1
make[2]: *** [pfhook.o] Error 1
-------------------------------------------------------------------------------

Thanks and Regards
K.Senthil
Re: Ref - Packet Filter compilation problem  
On Thu, Jun 25, 2009 at 01:53:05AM -0400, Senthil K wrote:
> Hi,
> 
> I copied from their and compile the previous problem got solved but another problem i faced.
> 
> Please find the below errors
> 
> make -j 1 -Cx86 -fMakefile
> make[1]: Entering directory `/home/senthil/pfil/x86'
> make -j 1 -Cdll -fMakefile
> make[2]: Entering directory `/home/senthil/pfil/x86/dll'
> /usr/qnx640/host/qnx6/x86/usr/bin/qcc -Vgcc_ntox86 -c -Wc,-Wall -Wc,-Wno-parentheses  -O -DNDEBUG   -I. -I/home/
senthil/pfil/x86/dll -I/home/senthil/pfil/x86 -I/home/senthil/pfil -I/usr/qnx640/target/qnx6/usr/include      -shared -
DVARIANT_dll -DBUILDENV_qss  /home/senthil/pfil/pfhook.c
> /home/senthil/pfil/pfhook.c: In function 'deinit_module':
> /home/senthil/pfil/pfhook.c:61: warning: implicit declaration of function 'pfil_remove_hook'
> /home/senthil/pfil/pfhook.c:63: warning: implicit declaration of function 'pfil_head_get'
> /home/senthil/pfil/pfhook.c:63: warning: assignment makes pointer from integer without a cast
> /home/senthil/pfil/pfhook.c: At top level:
> /home/senthil/pfil/pfhook.c:78: warning: 'struct _iopkt_self' declared inside parameter list
> /home/senthil/pfil/pfhook.c:78: warning: its scope is only this definition or declaration, which is probably not what 
you want
> /home/senthil/pfil/pfhook.c: In function 'pfil_entry':
> /home/senthil/pfil/pfhook.c:83: warning: implicit declaration of function 'pfil_add_hook'
> /home/senthil/pfil/pfhook.c:86: warning: assignment makes pointer from integer without a cast
> /home/senthil/pfil/pfhook.c: At top level:
> /home/senthil/pfil/pfhook.c:98: warning: parameter names (without types) in function declaration

You need to include <net/pfil.h> and have _KERNEL defined.

> -------------------------------------------------------------------------------
> /home/senthil/pfil/pfhook.c:98: error: function 'IOPKT_LSM_ENTRY_SYM' is initialized like a variable
> /home/senthil/pfil/pfhook.c:99: warning: implicit declaration of function 'IOPKT_LSM_ENTRY_SYM_INIT'
> cc: /usr/qnx640/host/qnx6/x86/usr/lib/gcc/i386-pc-nto-qnx6.4.0/4.2.4/cc1 error 1
> make[2]: *** [pfhook.o] Error 1
> -------------------------------------------------------------------------------

<sys/io-pkt.h>

-seanb
Re: Ref - Packet Filter compilation problem  
Hi ,

I have attached the code tell me if any thing wrong.

Thanks and Regards
K.Senthil

Attachment: Text pfhook.c 2.11 KB
Re: Ref - Packet Filter compilation problem  
Hi ,

After adding the _KERNEL macro and <net/pfil.h> file.
still i m getting the error

Thanks and Regards
K.Senthil

Re: Ref - Packet Filter compilation problem  
On Fri, Jun 26, 2009 at 01:46:43AM -0400, Senthil K wrote:
> Hi ,
> 
> After adding the _KERNEL macro and <net/pfil.h> file.
> still i m getting the error

The following works for, where /home/seanb/io-pkt
is where I have the networking repo checked out.

$ cc -shared  -I /home/seanb/io-pkt/sys -Wall -fno-builtin-log \
 -D_KERNEL -Wp,-include -Wp,/home/seanb/io-pkt/sys/qnx.h \
 -Wl,-Bsymbolic -o lsm-senthil.so s.c