diff --git a/package/ddhcpd-nextnode/Makefile b/package/ddhcpd-nextnode/Makefile new file mode 100644 index 00000000..ecb5fe83 --- /dev/null +++ b/package/ddhcpd-nextnode/Makefile @@ -0,0 +1,19 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=ddhcpd-nextnode +PKG_RELEASE:=1 + +include ../gluon.mk + +define Package/ddhcpd-nextnode + SECTION:=net + CATEGORY:=Network + DEPENDS:=+ddhcpd + TITLE:=ddhcpd nextnode integration +endef + +define Package/ddhcpd-nextnode/description + nextnode integration for ddhcpd +endef + +$(eval $(call BuildPackage,ddhcpd-nextnode)) diff --git a/package/ddhcpd-nextnode/check_site.lua b/package/ddhcpd-nextnode/check_site.lua new file mode 100644 index 00000000..b26ac216 --- /dev/null +++ b/package/ddhcpd-nextnode/check_site.lua @@ -0,0 +1 @@ +need_string_match(in_domain({'next_node', 'ip4'}), '^%d+.%d+.%d+.%d+$') diff --git a/package/ddhcpd-nextnode/luasrc/lib/gluon/upgrade/500-ddhcpd-option-nextnode b/package/ddhcpd-nextnode/luasrc/lib/gluon/upgrade/500-ddhcpd-option-nextnode new file mode 100755 index 00000000..bea3d765 --- /dev/null +++ b/package/ddhcpd-nextnode/luasrc/lib/gluon/upgrade/500-ddhcpd-option-nextnode @@ -0,0 +1,21 @@ +#!/usr/bin/lua + +local uci = require('simple-uci').cursor() +local site = require "gluon.site" + +local payload = site.next_node.ip4() +local len = 4 -- this has to be 4 + +uci:section('ddhcpd', 'dhcp_option', 'nextnode_router', { + len = len, + payload = payload, + code = '3', +}) + +uci:section('ddhcpd', 'dhcp_option', 'nextnode_dns', { + len = len, + payload = payload, + code = '6', +}) + +uci:save('ddhcpd')