Implement DNS server with fake IP address replacements.

The IPv4 addresses in the answer will be hash-mapped to addresses in the pool.
This commit is contained in:
2025-04-03 10:06:12 +08:00
parent f409f72cec
commit 7a3b18b848
2 changed files with 786 additions and 0 deletions

22
Makefile Normal file
View File

@@ -0,0 +1,22 @@
CC=gcc
CFLAGS=-Wall
LDFLAGS=
DEPS=$(wildcard *.h)
SRC=$(wildcard src/*.c)
OBJ=$(patsubst src/%.c, build/%.o, $(SRC))
.PHONY: all clean
all: build/dotp
clean:
rm $(OBJ)
rm build/dotp
build/%.o: src/%.c $(DEPS)
mkdir -p build
$(CC) -c -o $@ $< $(CFLAGS)
build/dotp: $(OBJ)
mkdir -p build
$(CC) -o $@ $^ $(LDFLAGS) -lev -lnftables