+ local network direction altnets device up
+
+ config_get network $1 network
+ config_get direction $1 direction
+ config_get altnets $1 altnet
+
+ local status="$(ubus -S call "network.interface.$network" status)"
+ [ -n "$status" ] || return
+
+ json_load "$status"
+ json_get_var device l3_device
+ json_get_var up up
+
+ [ -n "$device" -a "$up" = "1" ] || {
+ procd_append_param error "$network is not up"
+ return;
+ }
+
+ append netdevs "$device"
+
+ [[ "$direction" = "upstream" ]] && has_upstream=1
+
+ echo -e "\nphyint $device $direction ratelimit 0 threshold 1" >> /var/etc/igmpproxy.conf
+
+ if [ -n "$altnets" ]; then
+ local altnet
+ for altnet in $altnets; do
+ echo -e "\taltnet $altnet" >> /var/etc/igmpproxy.conf
+ done
+ fi
+}
+
+igmp_add_network() {
+ local network
+
+ config_get network $1 network
+ procd_add_interface_trigger "interface.*" $network /etc/init.d/igmpproxy reload
+}