diff --git a/mcproxy/Makefile b/mcproxy/Makefile index ef0b09e..cb3fb20 100644 --- a/mcproxy/Makefile +++ b/mcproxy/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2011 OpenWrt.org +# Copyright (C) 2014 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mcproxy -PKG_SOURCE_VERSION:=6638aa9aabd2ccdde8915b61a8e0fb995b1f91a3 -PKG_VERSION:=2014-05-31-$(PKG_SOURCE_VERSION) +PKG_SOURCE_VERSION:=b7bd2d0809a0d1f177181c361b9a6c83e193b79a +PKG_VERSION:=2014-12-31-$(PKG_SOURCE_VERSION) PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git @@ -40,11 +40,15 @@ endef define Package/mcproxy/conffiles /etc/mcproxy.conf +/etc/config/mcproxy endef define Package/mcproxy/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/mcproxy.conf $(1)/etc/mcproxy.conf + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/mcproxy.config $(1)/etc/config/mcproxy $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_CONF) ./files/mcproxy.conf $(1)/etc $(INSTALL_BIN) ./files/mcproxy.init $(1)/etc/init.d/mcproxy $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/mcproxy-bin $(1)/usr/sbin/mcproxy diff --git a/mcproxy/files/mcproxy.conf b/mcproxy/files/mcproxy.conf index 60a655e..936cdda 100644 --- a/mcproxy/files/mcproxy.conf +++ b/mcproxy/files/mcproxy.conf @@ -2,13 +2,67 @@ ##-- mcproxy configuration script --## ###################################### -# Erase or comment out the following line when configured -disable; - # Protocol: IGMPv1|IGMPv2|IGMPv3 (IPv4) - MLDv1|MLDv2 (IPv6) protocol IGMPv3; +########################################### + # Proxy Instance: upstream ==> downstream -pinstance proxy1: eth1 ==> "eth0.1"; -#pinstance proxy2: "eth0.2" ==> "br-lan"; -#pinstance proxy3: eth0 ==> eth1 eth2; +pinstance A: ap a1 ==> ap a2; +pinstance B: bp b1 ==> bp b2; + +########################################### + +# Tables +table allways { + (*|*) +}; + +table piA_peering_ifs { + ap(*|*) +}; + +table piA_upstreams { + a1(*|*) +}; + +table piB_peering_ifs { + bp(*|*) +}; + +table piB_upstreams { + b1(*|*) +}; + +########################################### + +# Instance Behaviour +pinstance A upstream * in rulematching mutex 10; #or 25ms (u4) +#pinstance A upstream * out rulematching all; #default + +pinstance A upstream ap out blacklist table allways; #(u1) +#pinstance A upstream ap in whitelist table {(*|*)}; #default (u2, u3) + +pinstance A upstream a1 out blacklist table piA_peering_ifs; #(u3_1) +#pinstance A upstream a1 in whitelist table {(*|*)}; #default + +pinstance A downstream ap in blacklist table allways; #(d1) +pinstance A downstream ap out blacklist table piA_upstreams; #(d2, d2_1, d3, d4) + +#pinstance A downstream a2 in whitelist table {(*|*)}; #default +#pinstance A downstream a2 out whitelist table {(*|*)}; #default + +pinstance B upstream * in rulematching mutex 10; #or 25ms (u4) +#pinstance B upstream * out rulematching all; #default + +pinstance B upstream bp out blacklist table allways; #(u1) +#pinstance B upstream bp in whitelist table {(*|*)}; #default (u2, u3) + +pinstance B upstream b1 out blacklist table piB_peering_ifs; #(u3_1) +#pinstance b upstream b1 in whitelist table {(*|*)}; #default + +pinstance B downstream bp in blacklist table allways; #(d1) +pinstance B downstream bp out blacklist table piB_upstreams; #(d2, d2_1, d3, d4) + +#pinstance B downstream b2 in whitelist table {(*|*)}; #default +#pinstance B downstream b2 out whitelist table {(*|*)}; #default diff --git a/mcproxy/files/mcproxy.config b/mcproxy/files/mcproxy.config new file mode 100644 index 0000000..10cc410 --- /dev/null +++ b/mcproxy/files/mcproxy.config @@ -0,0 +1,231 @@ +# Use your own MCProxy config file +config mcproxy 'mcproxy_file' + option disabled '1' + option respawn '1' + option file '/etc/mcproxy.conf' + +# Use OpenWrt UCI config +config mcproxy 'mcproxy' + option disabled '1' + option respawn '1' + option protocol 'IGMPv3' + +########################################### + +# Simple configuration examples + +config instance + option disabled '1' + option name 'proxy1' + list upstream 'eth1' + list downstream 'eth0.2' + +config instance + option disabled '1' + option name 'proxy2' + list upstream 'eth0.2' + list downstream 'eth0.4' + list downstream 'br-lan' + +config instance + option disabled '1' + option name 'proxy3' + list upstream 'eth1.2' + list upstream 'eth1.4' + list downstream 'eth0.1' + +########################################### + +# Advanced configuration example + +config instance + option name 'A' + list upstream 'ap' + list upstream 'a1' + list downstream 'ap' + list downstream 'a2' + +config instance + option name 'B' + list upstream 'bp' + list upstream 'b1' + list downstream 'bp' + list downstream 'b2' + +config table + option name 'allways' + list entries '(*|*)' + +config table + option name 'piA_peering_ifs' + list entries 'ap(*|*)' + +config table + option name 'piA_upstreams' + list entries 'a1(*|*)' + +config table + option name 'piB_peering_ifs' + list entries 'bp(*|*)' + +config table + option name 'piB_upstreams' + list entries 'b1(*|*)' + +config behaviour + option instance 'A' + option section 'upstream' + option interface '*' + option direction 'in' + option rulematching 'mutex 10' + +config behaviour + option disabled '1' + option instance 'A' + option section 'upstream' + option interface '*' + option direction 'out' + option rulematching 'all' + +config behaviour + option instance 'A' + option section 'upstream' + option interface 'ap' + option direction 'out' + option table 'allways' + +config behaviour + option disabled '1' + option instance 'A' + option section 'upstream' + option interface 'ap' + option direction 'in' + option whitelist '1' + option table '{(*|*)}' + +config behaviour + option instance 'A' + option section 'upstream' + option interface 'a1' + option direction 'out' + option table 'piA_peering_ifs' + +config behaviour + option disabled '1' + option instance 'A' + option section 'upstream' + option interface 'a1' + option direction 'in' + option whitelist '1' + option table '{(*|*)}' + +config behaviour + option instance 'A' + option section 'downstream' + option interface 'ap' + option direction 'in' + option table 'allways' + +config behaviour + option instance 'A' + option section 'downstream' + option interface 'ap' + option direction 'out' + option table 'piA_upstreams' + +config behaviour + option disabled '1' + option instance 'A' + option section 'downstream' + option interface 'a2' + option direction 'in' + option whitelist '1' + option table '{(*|*)}' + +config behaviour + option disabled '1' + option instance 'A' + option section 'downstream' + option interface 'a2' + option direction 'out' + option whitelist '1' + option table '{(*|*)}' + +config behaviour + option instance 'B' + option section 'upstream' + option interface '*' + option direction 'in' + option rulematching 'mutex 10' + +config behaviour + option disabled '1' + option instance 'B' + option section 'upstream' + option interface '*' + option direction 'out' + option rulematching 'all' + +config behaviour + option instance 'B' + option section 'upstream' + option interface 'bp' + option direction 'out' + option table 'allways' + +config behaviour + option disabled '1' + option instance 'B' + option section 'upstream' + option interface 'bp' + option direction 'in' + option whitelist '1' + option table '{(*|*)}' + +config behaviour + option instance 'B' + option section 'upstream' + option interface 'b1' + option direction 'out' + option table 'piB_peering_ifs' + +config behaviour + option disabled '1' + option instance 'B' + option section 'upstream' + option interface 'b1' + option direction 'in' + option whitelist '1' + option table '{(*|*)}' + +config behaviour + option instance 'B' + option section 'downstream' + option interface 'bp' + option direction 'in' + option table 'allways' + +config behaviour + option instance 'B' + option section 'downstream' + option interface 'bp' + option direction 'out' + option table 'piB_upstreams' + +config behaviour + option disabled '1' + option instance 'B' + option section 'downstream' + option interface 'b2' + option direction 'in' + option whitelist '1' + option table '{(*|*)}' + +config behaviour + option disabled '1' + option instance 'B' + option section 'downstream' + option interface 'b2' + option direction 'out' + option whitelist '1' + option table '{(*|*)}' diff --git a/mcproxy/files/mcproxy.init b/mcproxy/files/mcproxy.init index 7a33030..a7584e8 100644 --- a/mcproxy/files/mcproxy.init +++ b/mcproxy/files/mcproxy.init @@ -1,14 +1,171 @@ #!/bin/sh /etc/rc.common +# Copyright (C) 2014 OpenWrt.org START=50 USE_PROCD=1 -start_service() { +# mcproxy_list_iface