From e03ee22d045a77eebee7a8c32d71212e73633c98 Mon Sep 17 00:00:00 2001 From: Álvaro Fernández Rojas Date: Wed, 31 Dec 2014 20:40:56 +0100 Subject: mcproxy: update to latest version, add UCI support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Fernández Rojas --- mcproxy/files/mcproxy.conf | 66 +++++++++++-- mcproxy/files/mcproxy.config | 231 +++++++++++++++++++++++++++++++++++++++++++ mcproxy/files/mcproxy.init | 163 +++++++++++++++++++++++++++++- 3 files changed, 451 insertions(+), 9 deletions(-) create mode 100644 mcproxy/files/mcproxy.config (limited to 'mcproxy/files') 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