summaryrefslogtreecommitdiff
path: root/minimalist-pcproxy
diff options
context:
space:
mode:
authorMarkus Stenberg <markus.stenberg@iki.fi>2014-05-26 17:19:42 +0300
committerMarkus Stenberg <markus.stenberg@iki.fi>2014-06-03 00:48:28 +0300
commit9d6f368724e98b8031819e30cbbb1131a0c0aec3 (patch)
treefc9bcee2a9f2a4e815623b642713bf9ef74351cc /minimalist-pcproxy
parente58c0555a1fbc37273c89a504ba7a1363089b671 (diff)
minimalist-pcproxy: Added.
hnetd: Added use of minimalist-pcproxy(/miniupnpd) for PCP, if present.
Diffstat (limited to 'minimalist-pcproxy')
-rw-r--r--minimalist-pcproxy/Makefile56
-rw-r--r--minimalist-pcproxy/files/minimalist-pcproxy.defaults15
2 files changed, 71 insertions, 0 deletions
diff --git a/minimalist-pcproxy/Makefile b/minimalist-pcproxy/Makefile
new file mode 100644
index 0000000..1a4f16d
--- /dev/null
+++ b/minimalist-pcproxy/Makefile
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=minimalist-pcproxy
+PKG_SOURCE_VERSION:=c8d47ff42c4354f502830faeae13bd8f269401af
+PKG_VERSION:=2014-06-02-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://github.com/fingon/minimalist-pcproxy.git
+PKG_MAINTAINER:=Markus Stenberg <fingon@iki.fi>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/minimalist-pcproxy
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=Lightweight PCP proxy
+ URL:=https://github.com/fingon/minimalist-pcproxy
+ DEPENDS:=+libubox +@IPV6
+endef
+
+define Package/minimalist-pcproxy/description
+This package contains a daemon which can be used to forward
+PCP (Port Control Protocol - RFC6887) requests requests to PCP remote servers.
+
+In and of itself, it is not very useful, but combined with hnetd+miniupnpd
+it allows for control of NAT forwarding and firewall pinholes from multiple
+hops away.
+endef
+
+define Package/minimalist-pcproxy/install
+ $(INSTALL_DIR) $(1)/usr/sbin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/minimalist-pcproxy $(1)/usr/sbin/
+ $(INSTALL_DIR) $(1)/etc/uci-defaults
+ $(INSTALL_BIN) ./files/minimalist-pcproxy.defaults $(1)/etc/uci-defaults/x-minimalist-pcproxy.defaults
+endef
+
+define Package/minimalist-pcproxy/postinst
+!/bin/sh
+[ -n "$${IPKG_INSTROOT}" ] || {
+ (. /etc/uci-defaults/x-minimalist-pcproxy.defaults) && rm -f /etc/uci-defaults/x-minimalist-pcproxy.defaults
+}
+exit 0
+endef
+
+$(eval $(call BuildPackage,minimalist-pcproxy))
diff --git a/minimalist-pcproxy/files/minimalist-pcproxy.defaults b/minimalist-pcproxy/files/minimalist-pcproxy.defaults
new file mode 100644
index 0000000..4e041e5
--- /dev/null
+++ b/minimalist-pcproxy/files/minimalist-pcproxy.defaults
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+if [ `uci get -q upnpd.config._pcproxy_configured` = "1" ]
+then
+ exit
+fi
+
+uci batch <<EOF
+set upnpd.config.enable_upnp=0
+set upnpd.config.pcp_allow_thirdparty=1
+set upnpd.config.internal_iface=loopback
+set upnpd.config.ipv6_listening_ip=::1
+set upnpd.config._pcproxy_configured=1
+commit upnpd
+EOF