list port '123'
list port '8942'
option interface 'loopback'
- option max_cookies '1024'
option max_tunnels '1024'
- option port_base '20000'
option tunnel_id_base '100'
- option tunnel_timeout '60'
option pmtu '0'
- option namespace 'production'
option connection_rate_limit '0.2'
+ option connection_rate_limit_per_ip_count '0'
+ option connection_rate_limit_per_ip_time '0'
config log
- option filename '/dev/null'
option verbosity 'INFO'
option log_ip_addresses '0'
+
+# To automatically put tunnel interfaces into pre-exitsing bridges
+# via the hook scripts, then create a bridge section for each
+# supported mtu. If pmtu is set to non-zero above, then only that
+# bridge is needed. To isolate the bridge ports, set isolate to '1'.
+# '0' is the default
+#config bridge
+# option interface 'br-mybridge'
+# option mtu '1446'
+# option isolate '1'
cfg_append_kv address "${address}"
}
- OPTIONS="max_cookies max_tunnels port_base tunnel_id_base tunnel_timeout namespace connection_rate_limit pmtu"
+ OPTIONS="max_tunnels tunnel_id_base connection_rate_limit connection_rate_limit_per_ip_count connection_rate_limit_per_ip_time pmtu"
for option in ${OPTIONS}; do
cfg_append_option "$section" "${option}" "${option}"
done
cfg_append_kv "session.up" "${HOOKPATH}/setup"
cfg_append_kv "session.pre-down" "${HOOKPATH}/teardown"
cfg_append_kv "session.mtu-changed" "${HOOKPATH}/mtu-changed"
+ cfg_append_kv "broker.connection-rate-limit" "${HOOKPATH}/connection-rate-limit"
}
parse_log() {
local section="$1"
cfg_append_section log
- OPTIONS="filename verbosity"
+ OPTIONS="verbosity"
for option in ${OPTIONS}; do
cfg_append_option "$section" "${option}" "${option}"
done
procd_set_param command "/usr/bin/python"
procd_append_param command -m tunneldigger_broker.main
procd_append_param command "${CONFIGFILE}"
+
+ # Set up a trigger when the interface changes state
+ local netdev
+ network_get_physdev netdev $(uci show "tunneldigger-broker.@broker[0].interface" | cut -d \' -f 2)
+ procd_set_param netdev $netdev
+
procd_set_param respawn
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
+
+reload_service() {
+ restart
+}
+
+service_triggers() {
+ local interface=$(uci show "tunneldigger-broker.@broker[0].interface" | cut -d \' -f 2)
+ procd_add_interface_trigger "interface.*.up" $interface /etc/init.d/tunneldigger-broker restart
+ procd_add_reload_trigger "tunneldigger-broker"
+}
+