How wifidog/wifidog-gateway works
Project type and purpose
• This is the WiFiDog Gateway: an embedded, C-based captive-portal client/daemon that runs on a wireless gateway device.
• Its purpose is to intercept and redirect HTTP requests from end-users to a remote auth server, enforce firewall rules (via iptables), maintain client state, and lift restrictions once users authenticate.
File structure
• Top level: autotools files (configure.in, Makefile.am, autogen.sh), packaging & contrib scripts, documentation.
• libhttpd/: a small HTTP server library used by the gateway.
• src/: core gateway logic, organized into modules (auth, centralserver, client_list, firewall, http/httpd_thread, configuration, threads, utilities, wdctl control interface).
• contrib/: build recipes for Debian/OpenWRT, load-testing tools, sample init scripts.
README for additional insights
• The client daemon (“gateway”) implements WifiDog Protocol v1, offloading authentication to a separate auth server.
• It listens on the LAN side, redirects unauthenticated users to the auth server, polls the auth server (ping thread) for session status, and updates netfilter rules accordingly.