diff --git a/Makefile b/src/Makefile similarity index 71% rename from Makefile rename to src/Makefile index 63507d8..3fdc7b7 100644 --- a/Makefile +++ b/src/Makefile @@ -2,8 +2,8 @@ ifndef MSYSTEM CPREFIX = x86_64-w64-mingw32- endif -WINDIVERTHEADERS = ../../include -WINDIVERTLIBS = ../binary +WINDIVERTHEADERS = ../../../include +WINDIVERTLIBS = ../../binary TARGET = goodbyedpi.exe LIBS = -L$(WINDIVERTLIBS) -lWinDivert -lws2_32 @@ -18,8 +18,8 @@ LDFLAGS = -Wl,-O1,--sort-common,--as-needed default: manifest $(TARGET) all: default -OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c)) goodbyedpi-rc.o -HEADERS = $(wildcard *.h) +OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c utils/*.c)) goodbyedpi-rc.o +HEADERS = $(wildcard *.h utils/*.h) %.o: %.c $(HEADERS) $(CC) $(CFLAGS) -c $< -o $@ @@ -30,8 +30,8 @@ manifest: .PRECIOUS: $(TARGET) $(OBJECTS) $(TARGET): $(OBJECTS) - $(CC) $(OBJECTS) -Wall $(LDFLAGS) $(LIBS) -s -o $@ + $(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -s -o $@ clean: - -rm -f *.o + -rm -f *.o utils/*.o -rm -f $(TARGET) diff --git a/blackwhitelist.c b/src/blackwhitelist.c similarity index 98% rename from blackwhitelist.c rename to src/blackwhitelist.c index b04b6ff..edea7a9 100644 --- a/blackwhitelist.c +++ b/src/blackwhitelist.c @@ -8,8 +8,8 @@ #include #include #include "goodbyedpi.h" -#include "uthash.h" -#include "getline.h" +#include "utils/uthash.h" +#include "utils/getline.h" typedef struct blackwhitelist_record { const char *host; diff --git a/blackwhitelist.h b/src/blackwhitelist.h similarity index 100% rename from blackwhitelist.h rename to src/blackwhitelist.h diff --git a/dnsredir.c b/src/dnsredir.c similarity index 99% rename from dnsredir.c rename to src/dnsredir.c index 27adc8c..d514712 100644 --- a/dnsredir.c +++ b/src/dnsredir.c @@ -15,7 +15,7 @@ #include #include "goodbyedpi.h" #include "dnsredir.h" -#include "uthash.h" +#include "utils/uthash.h" /* key ('4' for IPv4 or '6' for IPv6 + srcip[16] + srcport[2]) */ #define UDP_CONNRECORD_KEY_LEN 19 diff --git a/dnsredir.h b/src/dnsredir.h similarity index 100% rename from dnsredir.h rename to src/dnsredir.h diff --git a/goodbyedpi-rc.rc b/src/goodbyedpi-rc.rc similarity index 100% rename from goodbyedpi-rc.rc rename to src/goodbyedpi-rc.rc diff --git a/goodbyedpi.c b/src/goodbyedpi.c similarity index 99% rename from goodbyedpi.c rename to src/goodbyedpi.c index 85cb677..72ac2a3 100644 --- a/goodbyedpi.c +++ b/src/goodbyedpi.c @@ -13,7 +13,7 @@ #include #include "windivert.h" #include "goodbyedpi.h" -#include "repl_str.h" +#include "utils/repl_str.h" #include "service.h" #include "dnsredir.h" #include "blackwhitelist.h" diff --git a/goodbyedpi.exe.manifest b/src/goodbyedpi.exe.manifest similarity index 83% rename from goodbyedpi.exe.manifest rename to src/goodbyedpi.exe.manifest index 830d7de..02047ab 100644 --- a/goodbyedpi.exe.manifest +++ b/src/goodbyedpi.exe.manifest @@ -1,7 +1,7 @@ - - Divert + + GoodbyeDPI @@ -9,4 +9,4 @@ - + diff --git a/goodbyedpi.h b/src/goodbyedpi.h similarity index 100% rename from goodbyedpi.h rename to src/goodbyedpi.h diff --git a/icon.ico b/src/icon.ico similarity index 100% rename from icon.ico rename to src/icon.ico diff --git a/service.c b/src/service.c similarity index 100% rename from service.c rename to src/service.c diff --git a/service.h b/src/service.h similarity index 100% rename from service.h rename to src/service.h diff --git a/getline.c b/src/utils/getline.c similarity index 100% rename from getline.c rename to src/utils/getline.c diff --git a/getline.h b/src/utils/getline.h similarity index 100% rename from getline.h rename to src/utils/getline.h diff --git a/repl_str.c b/src/utils/repl_str.c similarity index 100% rename from repl_str.c rename to src/utils/repl_str.c diff --git a/repl_str.h b/src/utils/repl_str.h similarity index 100% rename from repl_str.h rename to src/utils/repl_str.h diff --git a/uthash.h b/src/utils/uthash.h similarity index 100% rename from uthash.h rename to src/utils/uthash.h