Files
packages/net/shunt/Makefile
Dirk BrenkenandClaude 6990c0a844 shunt: update 0.1.10
* snooped elements expire with the TTL of the DNS answer,
  clamped to 60..entry_ttl; entry_ttl is now the ceiling, polled elements still use it
* write cache tracks the expiry it last wrote per element and rewrites
  when the new expiry moves by at least half of the answer's lifetime, in either direction
* a flow's route is decided on its first packet and kept on the conntrack entry:
  route statements set ct mark, one restore rule per policy marks later packets
  of the original direction, settled flows skip the lookups
* LuCI: change the entry_ttl option text
* update the README

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-09-18 16:06:46 +02:00

68 lines
1.9 KiB
Makefile

# shunt - policy based routing via passive DNS observation
# Copyright (c) 2026 Dirk Brenken (dev@brenken.org)
# This is free software, licensed under the GNU General Public License v3.
include $(TOPDIR)/rules.mk
PKG_NAME:=shunt
PKG_VERSION:=0.1.10
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
include $(INCLUDE_DIR)/package.mk
define Package/shunt
SECTION:=net
CATEGORY:=Network
TITLE:=Policy based routing via passive DNS observation
DEPENDS:=+ucode +ucode-mod-fs +ucode-mod-socket +ucode-mod-uci \
+ucode-mod-uloop +ucode-mod-resolv +ucode-mod-ubus \
+ucode-mod-rtnl +ucode-mod-log +rpcd-mod-ucode +nftables-json
PKGARCH:=all
endef
define Package/shunt/description
Routes traffic by source, destination and domain into policy interfaces.
Domain addresses are learned resolver-independently: a poll loop resolves the
configured names and a passive AF_PACKET observer picks every DNS answer off
the wire, so shunt works unchanged with dnsmasq, unbound or any other backend.
Marks are applied via an own nftables table with per-element
counters, routing via fwmark rules and per-policy tables written over
rtnetlink, with gateway discovery and interface events from netifd.
endef
define Package/shunt/conffiles
/etc/config/shunt
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/shunt/install
$(INSTALL_DIR) $(1)/usr/share/ucode/shunt
$(INSTALL_DATA) ./src/*.uc $(1)/usr/share/ucode/shunt/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) ./files/shunt.uc $(1)/usr/sbin/shunt
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/shunt.init $(1)/etc/init.d/shunt
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/shunt.config $(1)/etc/config/shunt
$(INSTALL_DIR) $(1)/usr/share/rpcd/ucode
$(INSTALL_DATA) ./files/shunt.rpcd $(1)/usr/share/rpcd/ucode/shunt
endef
$(eval $(call BuildPackage,shunt))