增加地域白名单

This commit is contained in:
2024-08-07 16:48:01 +08:00
parent 2e650b5893
commit 7a692a8d39
18 changed files with 847 additions and 83 deletions

View File

@@ -6,6 +6,11 @@ LIB = -lssh2 -pthread
forward-tunnel = forward-tunnel
reverse-tunnel = reverse-tunnel
ip2region_SRC := ip2region/ip2region.c ip2region/xdb_searcher.c
ip2region_OBJS := $(ip2region_SRC:.c=.o)
ip2region_CFLAGS := -Os -g -Wall -I/ip2region
ifeq ($(shell uname -o), GNU/Linux)
ifeq ($(shell lsb_release -si), Debian)
LIB += -static
@@ -17,7 +22,7 @@ endif
all:forward-tunnel reverse-tunnel
forward-tunnel: forward-tunnel.o thpool.o
forward-tunnel: forward-tunnel.o thpool.o $(ip2region_OBJS)
$(CC) $(CFLAGS) -o $(forward-tunnel) $^ $(SSH2_LIB) $(LIB)
$(STRIP) forward-tunnel
@@ -28,6 +33,9 @@ reverse-tunnel: reverse-tunnel.o
.c.o:
$(CC) $(CFLAGS) -c $<
ip2region/%.o: ip2region/%.c
$(CC) $(ip2region_CFLAGS) -c $< -o $@
clean:
rm -rf *.o
rm reverse-tunnel forward-tunnel
rm -rf *.o $(ip2region_SRC:.c=.o)
rm -rf reverse-tunnel forward-tunnel