- 论坛徽章:
- 0
|
我这样指定的:
# export KERNEL_DIR=/usr/src/linux-2.6.19
# export IPTABLES_DIR=/usr/src/iptables-1.3.8
对楼上说的
export IPTABLES_SRC="$your_iptables_patch" KERNEL_SRC="$your_kernel_patch",所谓的your_iptables_patch是iptables-p2p-0.3.0a,your_kernel_patch是netfilter-layer7-v2.14吗,不知我理解的对不对
请圣骑士帮忙:只要在makefile指定,怎么指定呀,我的ipp2p-0.99.3目录下的Makefile内容如下:
[root@sushe src]# ls ipp2p-0.99.3/README
ipp2p-0.99.3/README
[root@sushe src]# more ipp2p-0.99.3/README
IPP2P, an extension to iptables to identify P2P traffic written by Eicke Friedri
ch.
This software is under development but it seems to run pretty stable. Use at you
r own risk!
Installation Instructions:
--------------------------
-modify the Makefile (change "IUSER = -I/usr/src/iptables/include" to wherever i
ptables.h is located)
-type "make"
-copy libipt_ipp2p.so to the iptables lib dir (/usr/lib/iptables/)
-insmod ipt_ipp2p.o / ipt_ipp2p.ko or copy to your kernel modules dir and do a "
depmod -a"
-create your rules
Versions:
---------
Currently IPP2P is tested to be working together with:
-Linux-Kernels 2.6: 2.6.3, 2.6.4, 2.6.6, 2.6.17
-Linux-Kernels 2.4: 2.4.18, 2.4.19, 2.4.20, 2.4.21, 2.4.22, 2.4.23, 2.4.26
-iptables (from netfilter.org) 1.2.7a, 1.2.8, 1.2.9, 1.2.11, 1.3.0, 1.3.1
[root@sushe src]# more ipp2p-0.99.3/Makefile
ifneq ($(KERNELRELEASE),)
obj-m := ipt_ipp2p.o
else
#KERNEL_SRC = /usr/src/linux
KERNEL_SRC ?= $(firstword $(wildcard /lib/modules/$(shell uname -r)/build /usr/s
rc/linux))
ifeq ($(KERNEL_SRC),)
$(error You need to define KERNEL_SRC)
endif
ifneq ($wildcard $(KERNEL_SRC)/include/linux/modversions.h),)
MODVERSIONS = -DMODVERSIONS
endif
_KVER = $(strip $(shell cat $(KERNEL_SRC)/Makefile | grep -e '^VERSION' | cut -d
"=" -f2))
_KPL = $(strip $(shell cat $(KERNEL_SRC)/Makefile | grep -e '^PATCHLEVEL' | cut
-d"=" -f2))
_KSUB = $(strip $(shell cat $(KERNEL_SRC)/Makefile | grep -e '^SUBLEVEL' | cut -
d"=" -f2))
KERNEL_SERIES=$(_KVER).$(_KPL)
ifeq ($(KERNEL_SERIES), 2.6)
TARGET=ipt_ipp2p.ko
else
TARGET=ipt_ipp2p.o
endif
SED = sed
IPTABLES_BIN = iptables
ifndef $(IPTABLES_SRC)
IPTVER = \
$(shell $(IPTABLES_BIN) --version | $(SED) -e 's/^iptables v//')
IPTABLES_SRC = $(wildcard /usr/src/iptables-$(IPTVER))
#IPTABLES_SRC = /var/tmp/portage/net-firewall/iptables-1.3.8-r1/work/iptables-1.
3.8
endif
ifeq ($(IPTABLES_SRC),)
$(warning You need to install iptables sources and maybe set IPTABLES_SRC)
endif
IPTABLES_INCLUDE = -I$(IPTABLES_SRC)/include
ifneq ($(IPTVER),)
IPTABLES_VERSION = $(IPTVER)
else
IPTABLES_VERSION = $(shell cat $(IPTABLES_SRC)/Makefile | grep -e '^IPTA
BLES_VERSION:=' | cut -d"=" -f2)
endif
IPTABLES_OPTION = -DIPTABLES_VERSION=\"$(IPTABLES_VERSION)\"
#CC = /usr/bin/x86_64-pc-linux-gnu-gcc-4.1.2
CC = gcc
CFLAGS = -O3 -Wall
all: modules libipt_ipp2p.so
modules: $(TARGET)
ipt_ipp2p.o: ipt_ipp2p.h ipt_ipp2p.c
$(CC) $(CFLAGS) -I$(KERNEL_SRC)/include -c ipt_ipp2p.c -D__KERNEL__ -DMO
DULE $(MODVERSIONS)
ipt_ipp2p.ko: ipt_ipp2p.h ipt_ipp2p.c
$(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules
libipt_ipp2p.so: libipt_ipp2p.c ipt_ipp2p.h
$(CC) $(CFLAGS) $(IPTABLES_OPTION) $(IPTABLES_INCLUDE) -fPIC -c libipt_i
pp2p.c
$(CC) -shared -o libipt_ipp2p.so libipt_ipp2p.o
clean:
-rm -f *.o *.so *.ko .*.cmd *.mod.c
endif
[root@sushe src]#
对上面热情帮忙的老兄谢谢了 |
|