The original linuxigd has pretty much been unchanged for about 4 years. Some folks at France Telecom did a rewrite to support the IGDv2 schemas which includes better IPv6 support, and means to avoid clashing when dynamically allocating an unused external port.
Signed-off-by: Philip Prindeville <phil...@redfish-solutions.com>
Index: trunk/feeds/packages/net/linuxigd2/files/upnpd.init =================================================================== --- trunk/feeds/packages/net/linuxigd2/files/upnpd.init (revision 0) +++ trunk/feeds/packages/net/linuxigd2/files/upnpd.init (revision 0) @@ -0,0 +1,25 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org +# Copyright (C) 2006 loswillios + +START=65 + +include /lib/network + +start() { + scan_interfaces + config_get wan_if 'wan' 'ifname' + config_get lan_if 'lan' 'ifname' + [ -n "$wan_if" ] || return 1 + + [ -n "$lan_if" ] && route add -net 239.0.0.0 netmask 255.0.0.0 $lan_if + service_start /usr/sbin/upnpd $wan_if $lan_if +} + +stop() { + scan_interfaces + config_get lan_if 'lan' 'ifname' + + service_stop /usr/sbin/upnpd + [ -n "$lan_if" ] && route del -net 239.0.0.0 netmask 255.0.0.0 $lan_if +} Index: trunk/feeds/packages/net/linuxigd2/files/upnpd.conf =================================================================== --- trunk/feeds/packages/net/linuxigd2/files/upnpd.conf (revision 0) +++ trunk/feeds/packages/net/linuxigd2/files/upnpd.conf (revision 0) @@ -0,0 +1,71 @@ +# +# The full path and name of the iptables executable, +# (enclosed in quotes). +# +iptables_location = "/usr/sbin/iptables" + +# +# Daemon debug level. Messages are logged via syslog to debug. +# 0 - no debug messages +# 1 - log errors +# 2 - log errors and basic info +# 3 - log errors and verbose info +# default = 0 +debug_mode = 2 + +# +# Should the daemon insert rules in the forward chain +# This is necessary if your firewall has a drop or reject +# policy in your forward chain. +# allowed values: yes,no +# default = no +insert_forward_rules = yes + +# +# The name of the chain to put the forward rules in. +# This directive is only activ if "insert_forward_rules = yes" +# above. +# allowed values: a-z, A-Z, _, - +# default = FORWARD +forward_chain_name = forwarding_wan + +# +# The name of the chain to put prerouting rules in. +# allowed values: a-z, A-Z, _, - +# default = PREROUTING +prerouting_chain_name = prerouting_wan + +# +# The internet line upstream bit rate reported from +# the daemon. Value in bits per second +# default = 0 +upstream_bitrate = 512000 + +# +# The internet line downstream bit rate reported from +# the daemon. Value in bits per second +# default = 0 +downstream_bitrate = 512000 + +# +# The default duration of port mappings, used when the client +# doesn't specify a duration. +# Can have the following values: +# 0 - no default duration specified +# seconds | HH:MM - duration from the time of addition +# @seconds | @HH:MM - expire mapping at the specified time of day +# default = 0 +duration = 0 + +# The name of the igd device xml description document +# default = gatedesc.xml +description_document_name = gatedesc.xml + +# The path to the xml documents +# Do not include the trailing "/" +# default = /etc/linuxigd +# WARNING! The make install does put the xml files +# in /etc/linuxigd, if you change this variable +# you have to make sure the xml docs are in the +# right place +xml_document_path = /etc/linuxigd Index: trunk/feeds/packages/net/linuxigd2/patches/.empty =================================================================== Index: trunk/feeds/packages/net/linuxigd2/Makefile =================================================================== --- trunk/feeds/packages/net/linuxigd2/Makefile (revision 0) +++ trunk/feeds/packages/net/linuxigd2/Makefile (revision 0) @@ -0,0 +1,73 @@ +# +# Copyright (C) 2012 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:=linuxigd2 +# PKG_VERSION:=0.4 +PKG_VERSION:=13acfdc5e9e10b96d02209f810ca73be726544e8 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +#PKG_SOURCE_URL:=@SF/linux-igd +#PKG_MD5SUM:=2c25db20a020d3a239a4e4dbf22b06db + +# PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +PKG_BUILD_DEPENDS:=iptables libupnp + +include $(INCLUDE_DIR)/package.mk + +define Package/linuxigd2 + SECTION:=net + CATEGORY:=Network + TITLE:=UPnP daemon + SUBMENU:=Firewall + DEPENDS:=+libip4tc +libupnp +libpthread # +dhcp-relay + URL:=https://gitorious.org/igd2-for-linux +endef + +define Package/linuxigd2/description + It implements the UPnP Internet Gateway Device version 2 + specification (IGDv2) and allows UPnP aware clients, such + as MSN Messenger, Azureus or Miranda to work properly from + behind a NAT firewall. + + Please edit /etc/upnpd.conf before using upnpd! +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -DIPTABLES_143 -Wl,-rpath-link=$(STAGING_DIR)/usr/lib" \ + BINDIR="/usr/sbin" \ + MANDIR="/usr/man" \ + HAVE_LIBIPTC=1 \ + LIBIPTC_PREFIX="$(STAGING_DIR)/usr" \ + LIBUPNP_PREFIX="$(STAGING_DIR)/usr" \ + LIBS="-lpthread -lupnp -lixml -lthreadutil -lip4tc -L../lib" \ + all +endef + +define Package/linuxigd2/conffiles +/etc/upnpd.conf +endef + +define Package/linuxigd2/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/upnpd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/linuxigd + $(INSTALL_DATA) $(PKG_BUILD_DIR)/configs/*.png $(1)/etc/linuxigd/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/configs/*.xml $(1)/etc/linuxigd/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/configs/upnpd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/configs/upnpd.init $(1)/etc/init.d/upnpd +endef + +$(eval $(call BuildPackage,linuxigd2))
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel