mirror of
https://github.com/openwrt/routing.git
synced 2026-07-15 21:21:54 +04:00
minimalist-pcproxy: Added.
hnetd: Added use of minimalist-pcproxy(/miniupnpd) for PCP, if present.
This commit is contained in:
@@ -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))
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user