netfilter_nft: build testing

This commit is contained in:
Thomas Bernard 2020-10-17 22:52:34 +02:00 committed by BERNARD Thomas
parent bd71e2e279
commit 2595275eb5
3 changed files with 20 additions and 8 deletions

View File

@ -1,5 +1,9 @@
CFLAGS?=-Wall -g -D_GNU_SOURCE -DDEBUG -Wstrict-prototypes -Wdeclaration-after-statement
CFLAGS += -I..
CFLAGS?=-Wall -g -Wstrict-prototypes -Wdeclaration-after-statement
CPPFLAGS += -I.
CPPFLAGS += -D_GNU_SOURCE -DDEBUG
CPPFLAGS += -DUSE_NETFILTER -DUSE_NFTABLES
CPPFLAGS += -DENABLE_UPNPPINHOLE
CPPFLAGS += -DUSE_NFCT
CC = gcc
LIBS = -lnftnl -lmnl
@ -9,9 +13,12 @@ ARCH := $(shell uname -m | grep -q "x86_64" && echo 64)
all: test_nfct_get testnftnlrdr testnftpinhole
clean:
$(RM) *.o testnftnlcrdr testnftpinhole testnftnlrdr_peer \
$(RM) *.o config.h testnftnlcrdr testnftpinhole testnftnlrdr_peer \
test_nfct_get testnftnlrdr
config.h:
touch $@
testnftnlrdr: nftnlrdr.o nftnlrdr_misc.o testnftnlrdr.o $(LIBS)
testnftpinhole: nftpinhole.o nftnlrdr_misc.o testnftpinhole.o \
@ -25,9 +32,12 @@ testnftnlrdr_peer.o: testnftnlrdr_peer.c
testnftnlrdr_dscp.o: testnftnlrdr_dscp.c
nftnlrdr.o: nftnlrdr.c nftnlrdr.h
nftnlrdr.o: nftnlrdr.c nftnlrdr.h config.h
nftnlrdr_misc.o: nftnlrdr_misc.c
nftpinhole.o: nftpinhole.c nftpinhole.h
nftpinhole.o: nftpinhole.c nftpinhole.h config.h
testnftnlrdr.o: config.h nftnlrdr.h nftnlrdr_misc.h
testnftpinhole.o: config.h nftpinhole.h

View File

@ -1,7 +1,7 @@
/* $Id: testnftnlrdr.c,v 1.2 2019/06/30 19:49:18 nanard Exp $ */
/* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2006-2019 Thomas Bernard
* (c) 2006-2020 Thomas Bernard
* This software is subject to the conditions detailed
* in the LICENCE file provided within the distribution */
@ -9,6 +9,8 @@
#include <stdlib.h>
#include <netinet/in.h>
#include <syslog.h>
/* for PRIu64 */
#include <inttypes.h>
#include <linux/netfilter/nf_tables.h>
#include <libnftnl/table.h>

View File

@ -1,7 +1,7 @@
/* $Id: testnftpinhole.c,v 1.2 2019/06/30 19:49:18 nanard Exp $ */
/* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2012-2019 Thomas Bernard
* (c) 2012-2020 Thomas Bernard
* This software is subject to the conditions detailed
* in the LICENCE file provided within the distribution */
@ -10,7 +10,7 @@
#include <netinet/in.h>
#include <syslog.h>
#include "../config.h"
#include "config.h"
#include "../miniupnpdtypes.h"
#include "nftpinhole.h"
#include "../commonrdr.h"