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 <[email protected]>
Index: trunk/feeds/packages/net/linuxigd2/patches/001-destdir-support.patch =================================================================== --- trunk/feeds/packages/net/linuxigd2/patches/001-destdir-support.patch (revision 0) +++ trunk/feeds/packages/net/linuxigd2/patches/001-destdir-support.patch (revision 0) @@ -0,0 +1,53 @@ +--- linuxigd2-1.0/linuxigd2/Makefile.orig 2012-05-18 14:03:44.000000000 -0600 ++++ linuxigd2-1.0/linuxigd2/Makefile 2012-05-18 14:20:59.787184769 -0600 +@@ -72,23 +72,32 @@ clean: + dist: clean + tar --transform 's,^,/$(DISTDIR)/,' --exclude=*.o --exclude=.* --exclude=*.tar.gz -pzcf $(DISTDIR).tar.gz $(DISTFILES) + +-install: upnpd +- install -d /etc/linuxigd +- install configs/ligd.png /etc/linuxigd +- install configs/gatedesc.xml /etc/linuxigd +- install configs/gatedesc1.xml /etc/linuxigd +- install configs/gateconnSCPD.xml /etc/linuxigd +- install configs/gateicfgSCPD.xml /etc/linuxigd +- install configs/lanhostconfigSCPD.xml /etc/linuxigd +- install configs/gateEthlcfgSCPD.xml /etc/linuxigd +- install configs/wanipv6fwctrlSCPD.xml /etc/linuxigd +- install configs/dummy.xml /etc/linuxigd +- install $(BIN)upnpd $(PREFIX)/sbin +- install doc/upnpd.8 $(PREFIX)/share/man/man8 +- if [ ! -f /etc/upnpd.conf ]; then install configs/upnpd.conf /etc; fi ++install: install-bin install-man install-cfg ++ ++install-bin: upnpd ++ mkdir -p $(DESTDIR)$(PREFIX)/sbin ++ install $(BIN)upnpd $(DESTDIR)$(PREFIX)/sbin ++ ++install-man: ++ mkdir -p $(DESTDIR)$(PREFIX)/share/man/man8 ++ install doc/upnpd.8 $(DESTDIR)$(PREFIX)/share/man/man8 ++ ++install-cfg: ++ mkdir -p $(DESTDIR)$(PREFIX)/etc/linuxigd ++ install -d $(DESTDIR)/etc/linuxigd ++ install configs/ligd.png $(DESTDIR)/etc/linuxigd ++ install configs/gatedesc.xml $(DESTDIR)/etc/linuxigd ++ install configs/gatedesc1.xml $(DESTDIR)/etc/linuxigd ++ install configs/gateconnSCPD.xml $(DESTDIR)/etc/linuxigd ++ install configs/gateicfgSCPD.xml $(DESTDIR)/etc/linuxigd ++ install configs/lanhostconfigSCPD.xml $(DESTDIR)/etc/linuxigd ++ install configs/gateEthlcfgSCPD.xml $(DESTDIR)/etc/linuxigd ++ install configs/wanipv6fwctrlSCPD.xml $(DESTDIR)/etc/linuxigd ++ install configs/dummy.xml $(DESTDIR)/etc/linuxigd ++ if [ ! -f $(DESTDIR)/etc/upnpd.conf ]; then install configs/upnpd.conf $(DESTDIR)/etc; fi + + uninstall: +- rm -Rf /etc/linuxigd* +- rm /etc/upnpd.conf +- rm /usr/sbin/upnpd +- rm /usr/share/man/man8/upnpd.8 ++ rm -Rf $(DESTDIR)/etc/linuxigd* ++ rm $(DESTDIR)/etc/upnpd.conf ++ rm $(DESTDIR)/usr/sbin/upnpd ++ rm $(DESTDIR)/usr/share/man/man8/upnpd.8 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,71 @@ +# +# 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:=1.0 +PKG_REV:=d94ee42f5b1b0687ccb3462f2e0f6fcf4a97ea39 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=git://gitorious.org/igd2-for-linux/igd2-for-linux.git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=git + +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)/$(PKG_NAME) \ + $(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" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/linuxigd2/conffiles +/etc/upnpd.conf +endef + +define Package/linuxigd2/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upnpd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/linuxigd $(1)/etc/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/upnpd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/upnpd.init $(1)/etc/init.d/upnpd +endef + +$(eval $(call BuildPackage,linuxigd2)) 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
_______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
