This patch adds udpxy -- multicast video streams retranslator
---
Index: net/udpxy/files/udpxy.hotplug
===================================================================
--- net/udpxy/files/udpxy.hotplug (revision 0)
+++ net/udpxy/files/udpxy.hotplug (revision 0)
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+/etc/init.d/udpxy enabled && {
+ local extif
+ config_load udpxy
+ config_get extif config external_iface
+
+ if [ "$ACTION" = add ] && [ "$INTERFACE" = "$extif" ]; then
+ local active
+ config_get active "$INTERFACE" ifname
+
+ [ -z "$active" ] && {
+ logger -t udpxy "adding $INTERFACE ($DEVICE) to
firewall"
+
+ iptables -A input_rule -i $DEVICE -p igmp -j ACCEPT
+ iptables -A input_rule -i $DEVICE -d 224.0.0.0/4 -p udp
-j ACCEPT
+
+ uci_set_state udpxy "$INTERFACE" "" firewall
+ uci_set_state udpxy "$INTERFACE" ifname "$DEVICE"
+ }
+ elif [ "$ACTION" = remove ] && [ "$INTERFACE" = "$extif" ]; then
+ local ifname
+ config_get ifname "$INTERFACE" ifname
+
+ [ -n "$ifname" ] && {
+ logger -t udpxy "removing $INTERFACE ($ifname) from
firewall"
+
+ iptables -D input_rule -i $ifname -p igmp -j ACCEPT
+ iptables -D input_rule -i $ifname -d 224.0.0.0/4 -p udp
-j ACCEPT
+ uci_revert_state udpxy "$INTERFACE"
+ }
+ fi
+}
Index: net/udpxy/files/udpxy.init
===================================================================
--- net/udpxy/files/udpxy.init (revision 0)
+++ net/udpxy/files/udpxy.init (revision 0)
@@ -0,0 +1,57 @@
+#!/bin/sh /etc/rc.common
+START=95
+
+start() {
+ config_load "udpxy"
+ local extiface port max_clients logging enabled
+
+ config_get extiface config external_iface wan
+ config_get port config web_port 8881
+ config_get max_clients config max_clients 3
+ config_get_bool logging config log_output 0
+ config_get_bool enabled config enabled 0
+
+ include /lib/network
+ scan_interfaces
+
+ config_get extifname $extiface ifname
+
+ local args="-p $port"
+
+ if [ "$max_clients" -ne 0 ]; then
+ if [ "$max_clients" -lt 3 -o "$max_clients" -gt 16 ]; then
+ logger -t "udpxy" "max_clients is not in [3,16] range,
not starting"
+ return
+ fi
+ append args "-c $max_clients"
+ fi
+
+ if [ "$logging" = "1" ]; then
+ [ "$enabled" -gt 0 ] && eval start-stop-daemon -S -x udpxy --
$args -v -S -T 2>&1 | logger -t udpxy &
+ else
+ [ "$enabled" -gt 0 ] && eval start-stop-daemon -S -x udpxy --
$args 2>/dev/null
+ fi
+
+ local zone
+ config_load firewall
+ config_get zone core "${extiface}_zone"
+
+ [ -n "$zone" ] && \
+ ACTION=add INTERFACE="$extiface" DEVICE="$extifname" \
+ . /etc/hotplug.d/firewall/50-udpxy
+}
+
+clear_fw_rule() {
+ ACTION=remove INTERFACE="$1" . /etc/hotplug.d/firewall/50-udpxy
+}
+
+stop() {
+ config_load udpxy
+ local port
+ config_get port config web_port 8881
+
+ start-stop-daemon -K -q -x udpxy -p /var/run/udpxy"$port".pid
+ rm -f /var/run/udpxy"$port".pid
+
+ config_foreach clear_fw_rule firewall
+}
Property changes on: net/udpxy/files/udpxy.init
___________________________________________________________________
Added: svn:executable
+ *
Index: net/udpxy/files/udpxy.config
===================================================================
--- net/udpxy/files/udpxy.config (revision 0)
+++ net/udpxy/files/udpxy.config (revision 0)
@@ -0,0 +1,6 @@
+config udpxy config
+ option enabled 1
+ option external_iface wan
+ option web_port 8881
+ option max_clients 3
+ option log_output 0
Index: net/udpxy/Makefile
===================================================================
--- net/udpxy/Makefile (revision 0)
+++ net/udpxy/Makefile (revision 0)
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2010 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:=udpxy
+PKG_VERSION:=1.0-Chipmunk-16
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=...@sf/udpxy
+PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
+PKG_MD5SUM:=0bba6fd3e0b0065424b198abdf0acb7d
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/udpxy
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=multimedia
+ TITLE:=Multicast video streams retranslator
+ URL:=http://udpxy.sourceforge.net/
+ MAINTAINER:=Mikhail Gusarov <[email protected]>
+endef
+
+define Package/udpxy/conffiles
+ /etc/config/udpxy
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) "CC=$(TARGET_CC)" "CFLAGS=$(TARGET_CFLAGS)"
+endef
+
+define Package/udpxy/install
+ $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d $(1)/etc/config
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/firewall
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/udpxy $(1)/usr/bin/udpxy
+ $(LN) udpxy $(1)/usr/bin/udpxrec
+ $(INSTALL_BIN) ./files/udpxy.init $(1)/etc/init.d/udpxy
+ $(INSTALL_CONF) ./files/udpxy.config $(1)/etc/config/udpxy
+ $(INSTALL_DATA) ./files/udpxy.hotplug $(1)/etc/hotplug.d/firewall/50-udpxy
+endef
+
+$(eval $(call BuildPackage,udpxy))
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel