LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   MoBlock install problems (https://www.linuxquestions.org/questions/linux-newbie-8/moblock-install-problems-729462/)

threatingbehaviour 05-30-2009 02:38 AM

MoBlock install problems
 
ok I'm trying to install moblock so I follow the directions and run "make" and I get a big string of error messages ok so I open the make file....

# To use the old-soon-to-be-deprecated libipq interface
# uncomment the following line and comment the NFQUEUE one,
# then comment the gcc line with netfilter_queue and
# uncomment the following one.

#QUEUE_LIB=LIBIPQ
QUEUE_LIB=NFQUEUE

CFLAGS=-Wall -O2 -march=i586 -mtune=i686 -fomit-frame-pointer -ffast-math \
-D_GNU_SOURCE -D$(QUEUE_LIB) -L/usr/include/libipq
CC=gcc

all: moblock


moblock: MoBlock.o rbt.o
gcc -o $@ MoBlock.o rbt.o -lnetfilter_queue -lnfnetlink
#gcc -o $@ MoBlock.o rbt.o -lipq
strip $@

moblock-static: MoBlock.o rbt.o
gcc -static -o $@ MoBlock.o rbt.o -lnetfilter_queue -lnfnetlink
#gcc -static -o $@ MoBlock.o rbt.o -lipq
strip $@

clean:
rm -f *.o *~ *# moblock

install:
install -m 755 moblock $(DESTDIR)/usr/bin

.PHONY: clean

so what are the "following lines" and comment the "NFQUEUE" with what? (I'm assuming this is what I have to do because like I said when I run make I just get a big string of error messages) any suggestions

threatingbehaviour 05-30-2009 02:40 AM

and this is the error message I get when I run make....
gcc -Wall -O2 -march=i586 -mtune=i686 -fomit-frame-pointer -ffast-math -D_GNU_SOURCE -DNFQUEUE -L/usr/include/libipq -c -o MoBlock.o MoBlock.c
In file included from /usr/include/linux/netfilter_ipv4.h:8,
from MoBlock.c:35:
/usr/include/linux/netfilter.h:40: error: expected specifier-qualifier-list before ‘__u32’
MoBlock.c:46:52: error: libnetfilter_queue/libnetfilter_queue.h: No such file or directory
MoBlock.c:377: warning: ‘struct nfq_data’ declared inside parameter list
MoBlock.c:377: warning: its scope is only this definition or declaration, which is probably not what you want
MoBlock.c:377: warning: ‘struct nfgenmsg’ declared inside parameter list
MoBlock.c:377: warning: ‘struct nfq_q_handle’ declared inside parameter list
MoBlock.c: In function ‘nfqueue_cb’:
MoBlock.c:384: warning: implicit declaration of function ‘nfq_get_msg_packet_hdr’
MoBlock.c:384: warning: assignment makes pointer from integer without a cast
MoBlock.c:386: error: dereferencing pointer to incomplete type
MoBlock.c:387: warning: implicit declaration of function ‘nfq_get_payload’
MoBlock.c:389: error: dereferencing pointer to incomplete type
MoBlock.c:392: warning: implicit declaration of function ‘nfq_set_verdict’
MoBlock.c: In function ‘netlink_loop’:
MoBlock.c:497: warning: implicit declaration of function ‘nfq_open’
MoBlock.c:497: warning: assignment makes pointer from integer without a cast
MoBlock.c:503: warning: implicit declaration of function ‘nfq_unbind_pf’
MoBlock.c:508: warning: implicit declaration of function ‘nfq_bind_pf’
MoBlock.c:514: warning: implicit declaration of function ‘nfq_create_queue’
MoBlock.c:514: warning: assignment makes pointer from integer without a cast
MoBlock.c:520: warning: implicit declaration of function ‘nfq_set_mode’
MoBlock.c:520: error: ‘NFQNL_COPY_PACKET’ undeclared (first use in this function)
MoBlock.c:520: error: (Each undeclared identifier is reported only once
MoBlock.c:520: error: for each function it appears in.)
MoBlock.c:525: warning: implicit declaration of function ‘nfq_nfnlh’
MoBlock.c:525: warning: assignment makes pointer from integer without a cast
MoBlock.c:526: warning: implicit declaration of function ‘nfnl_fd’
MoBlock.c:529: warning: implicit declaration of function ‘nfq_handle_packet’
MoBlock.c:533: warning: implicit declaration of function ‘nfq_destroy_queue’
MoBlock.c:534: warning: implicit declaration of function ‘nfq_close’
make: *** [MoBlock.o] Error 1

Samotnik 05-30-2009 03:09 AM

It means you shoult uncomment line with LIBIPQ, and comment one witn NFQUEUE
Code:

QUEUE_LIB=LIBIPQ
#QUEUE_LIB=NFQUEUE


jdkaye 05-30-2009 03:13 AM

The first error means you need to install libnetfilter-queue-dev or whatever the equivalent package is called in OpenSUSE.
cheers,
jdk

knudfl 05-30-2009 05:40 AM

Quote:

..error:libnetfilter_queue/libnetfilter_queue.h:No such file or..
No package in the repo ( # zypper se netfilter ),
but there is a Suse 11 package here
http://rpm.pbone.net/index.php3/stat....i586.rpm.html
> libnetfilter_queue-devel-0.0.17-jen0.i586.rpm
Depends on libnetfilter_queue1
http://rpm.pbone.net/index.php3/stat....i586.rpm.html
> libnetfilter_queue1-0.0.17-jen0.i586.rpm
which depends on libnfnetlink0
http://rpm.pbone.net/index.php3/stat....i586.rpm.html
> libnfnetlink0-0.0.41-jen0.i586.rpm
... All together 26 KB !
( http://rpm.pbone.net > > Search > "Advanced Search" )

Please install with # rpm -Uvh <package> <package> <package>
... to get /usr/include/libnetfilter_queue/libnetfilter_queue.h
There is a libnfnetlink-devel-0.0.41-jen0.i586.rpm ( also required ) here
http://rpm.pbone.net/index.php3/stat....i586.rpm.html

.....
Good luck !
.....

threatingbehaviour 05-30-2009 01:01 PM

ok I did this and this is the message I get...

gcc -Wall -O2 -march=i586 -mtune=i686 -fomit-frame-pointer -ffast-math -D_GNU_SOURCE -DNFQUEUE -L/usr/include/libipq -c -o MoBlock.o MoBlock.c
In file included from /usr/include/linux/netfilter_ipv4.h:8,
from MoBlock.c:35:
/usr/include/linux/netfilter.h:40: error: expected specifier-qualifier-list before ‘__u32’
make: *** [MoBlock.o] Error 1

knudfl 05-30-2009 02:54 PM

Well, the test I made this morning, was on Suse 11.1,
kernel 2.6.27.5 . Suse 11, kernel 2.5.25.xx : the kernel
headers in /usr/include/linux are 2.6.25.5, and three
of the required headers are different from other
versions or missing ( compiler.h ).
MoBlock may compile on anything else but Suse11/2.6.25.

Suggest : use the static package
http://download.berlios.de/moblock/M...c-i586.tar.bz2
Quote:

The static version was compiled on Slackware 10.2 with gcc 3.4.5, if you
don't want to install the libnetfilter libraries try it, just rename it
to "moblock".
( There is a work around, using 2.6.27.x headers in Moblock-0.8/,
linux-2.6.27.x/include/linux/netfilter_ipv4.h, netfilter.h, compiler.h,
and changing some lines from #include </linux/file.h> to
#include "file.h" .)
.....

threatingbehaviour 05-30-2009 04:07 PM

I did use the static version the only difference is the static version comes with a executable file named moblock-static

There is a work around, using 2.6.27.x headers in Moblock-0.8/,
linux-2.6.27.x/include/linux/netfilter_ipv4.h, netfilter.h, compiler.h,
and changing some lines from #include </linux/file.h> to
#include "file.h

and you'll have to be more specific on how to do this as I have only been using linux for about a month so alot of this is still new to me

knudfl 05-30-2009 05:24 PM

No need to compile MoBlock, the static 'moblock' is OK,
just rename it as quoted above.

But here it is :

Copy headers e.g. linux-2.6.27.2/include/linux/netfilter_ipv4.h,
netfilter.h, compiler.h
to your source code folder Moblock-0.8/

Edit MoBlock.c line 35, #include <linux/netfilter_ipv4.h>
to #include "netfilter_ipv4.h"

Edit netfilter_ipv4.h line??, #include <linux/netfilter.h>
to #include "netfilter.h"

Edit netfilter.h line??, #include <linux/compiler.h>
to #include "compiler.h"
.....
Line numbers will depend on header version.
.....
P.S.: A Linux OS with 2.6.26.8 headers works too,
pclos2009 was used.
.....

threatingbehaviour 05-30-2009 06:41 PM

Quote:

Originally Posted by knudfl (Post 3557727)

Copy headers e.g. linux-2.6.27.2/include/linux/netfilter_ipv4.h,
netfilter.h, compiler.h
to your source code folder Moblock-0.8/

Edit netfilter_ipv4.h line??, #include <linux/netfilter.h>
to #include "netfilter.h"

Edit netfilter.h line??, #include <linux/compiler.h>
to #include "compiler.h"
.....

.....

I'm sorry I don't understand these directions I mean you have to be REALLY REALLY specific I'm like a virgin who's never even seen a naked lady when it comes to this...or do you mean just copy the whole netfilter.h,ect,ect to the source code file? because I'm looking at the netfilter.h file right now and I don't see #include lines...or do I add the include lines to the netfilter.h file? I'm confused hope you don't get too irritated with all these questions

knudfl 05-31-2009 03:08 AM

1 Attachment(s)
Sorry ... then no need to do complicated stuff.

Please use MoBlock-0.8-static-i586, no reason
not to use a package (static). Is meant to be used ..
.....

The modifying example: The idea is to use headers
( files.h ) from a different kernel source, which
you probably haven't got in your archive.
( Linux source code : http://www.kernel.org/ )
.....

knudfl 05-31-2009 03:34 AM

2 Attachment(s)
..... Please rename files to " .h "
.....

threatingbehaviour 06-01-2009 01:39 AM

Quote:

Originally Posted by knudfl (Post 3557996)

The modifying example: The idea is to use headers
( files.h ) from a different kernel source, which
you probably haven't got in your archive.
( Linux source code : http://www.kernel.org/ )
.....

I'm really very sorry I know your really trying to help me I just don't understand I downloaded the "patch-2.6.29.4 and I have no idea how you got headers out of it (complier.h) and the file type of patch-2.6.. is "differences between files" what does that mean? should I update my kernel? and if so how should I go about doing this and also I have done what you have said yet I get nothing when I click on the moblock-static executiable file...
P.S according to the maker MoBlock wont work with kernels 2.6.23 or newer (http://www.ngohq.com/general-softwar...for-linux.html) you should email the developers and tell them of your work I think they'd love to hear from you

knudfl 06-01-2009 06:57 AM

No need to download any "-2.6.29.4", may be of no use.
Who says headers from 2.6.29.4 would work ?
A patch most often is a text file, the whole linux-2.6.29
is a 54 MB file, 321 MB when unpacked.

The 3 headers, you want ( 2 modified ) are attached, post # 12.
Click them, and you have them.
Origin : 2.6.27.2 .
.....
And I can repeat :
"No need to compile MoBlock, the static 'moblock' is OK,
just rename it as quoted above." ( see post #7 ).
.....

threatingbehaviour 06-02-2009 01:41 AM

oh wait moblock doesn't have a graphical interface shit sorry for my absent mindedness


All times are GMT -5. The time now is 12:41 AM.