From 2595275eb58e6a3a10d68ba8223ed3c62892c1f4 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Sat, 17 Oct 2020 22:52:34 +0200 Subject: [PATCH] netfilter_nft: build testing --- miniupnpd/netfilter_nft/Makefile | 20 +++++++++++++++----- miniupnpd/netfilter_nft/testnftnlrdr.c | 4 +++- miniupnpd/netfilter_nft/testnftpinhole.c | 4 ++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/miniupnpd/netfilter_nft/Makefile b/miniupnpd/netfilter_nft/Makefile index 63cc38d..8340da7 100644 --- a/miniupnpd/netfilter_nft/Makefile +++ b/miniupnpd/netfilter_nft/Makefile @@ -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 diff --git a/miniupnpd/netfilter_nft/testnftnlrdr.c b/miniupnpd/netfilter_nft/testnftnlrdr.c index 5de251e..1005d51 100644 --- a/miniupnpd/netfilter_nft/testnftnlrdr.c +++ b/miniupnpd/netfilter_nft/testnftnlrdr.c @@ -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 #include #include +/* for PRIu64 */ +#include #include #include diff --git a/miniupnpd/netfilter_nft/testnftpinhole.c b/miniupnpd/netfilter_nft/testnftpinhole.c index a704525..e1c96a2 100644 --- a/miniupnpd/netfilter_nft/testnftpinhole.c +++ b/miniupnpd/netfilter_nft/testnftpinhole.c @@ -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 #include -#include "../config.h" +#include "config.h" #include "../miniupnpdtypes.h" #include "nftpinhole.h" #include "../commonrdr.h"