A userspace application that filters DHCP floods to protect a DHCP server. It uses the Netfilter userspace packet queuing API.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

Makefile 974B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. CC := gcc
  2. CCFLAGS := -Wall -O2
  3. LDFLAGS := -lnetfilter_queue
  4. TARGETS:= dhcp_protect
  5. MAINS := $(dhcp_protect .o, $(TARGETS) )
  6. OBJ := dhcp_protect.o $(MAINS)
  7. DEPS := dhcp_protect.h
  8. .PHONY: all clean install uninstall
  9. help:
  10. @echo "make <all|clean|install|uninstall>"
  11. all: $(TARGETS)
  12. clean:
  13. rm -f $(TARGETS) $(OBJ)
  14. install:
  15. systemctl stop dhcp_protect || true
  16. cp dhcp_protect /usr/local/bin/
  17. cp dhcp_protect.conf /usr/local/etc/
  18. cp dhcp_protect.service /etc/systemd/system/
  19. chmod 644 /etc/systemd/system/dhcp_protect.service
  20. systemctl enable dhcp_protect
  21. systemctl start dhcp_protect
  22. uninstall:
  23. systemctl stop dhcp_protect || true
  24. systemctl disable dhcp_protect || true
  25. rm -f /usr/local/bin/dhcp_protect
  26. rm -f /usr/local/etc/dhcp_protect.conf
  27. rm -f /etc/systemd/system/dhcp_protect.service
  28. $(OBJ): %.o : %.c $(DEPS)
  29. $(CC) -c -o $@ $< $(CCFLAGS)
  30. $(TARGETS): % : $(filter-out $(MAINS), $(OBJ)) %.o
  31. $(CC) -o $@ $(LIBS) $^ $(CCFLAGS) $(LDFLAGS)