validate_tunnelR_section() {
uci_load_validate sshtunnel tunnelR "$1" "$2" \
+ 'enabled:bool:1' \
'remoteaddress:or(host, "*")' \
'remoteport:port' \
'localaddress:host' \
validate_tunnelL_section() {
uci_load_validate sshtunnel tunnelL "$1" "$2" \
+ 'enabled:bool:1' \
'remoteaddress:host' \
'remoteport:port' \
'localaddress:or(host, "*")' \
validate_tunnelD_section() {
uci_load_validate sshtunnel tunnelD "$1" "$2" \
+ 'enabled:bool:1' \
'localaddress:or(host, "*")' \
'localport:port'
}
validate_tunnelW_section() {
uci_load_validate sshtunnel tunnelW "$1" "$2" \
+ 'enabled:bool:1' \
'vpntype:or("ethernet", "point-to-point"):point-to-point' \
'localdev:or("any", min(0))' \
'remotedev:or("any", min(0))'
load_tunnelR() {
config_get section_server "$1" "server"
+ [ "$enabled" = 0 ] && return 0
# continue to read next section if this is not for the current server
[ "$server" = "$section_server" ] || return 0
load_tunnelL() {
config_get section_server "$1" "server"
+ [ "$enabled" = 0 ] && return 0
# continue to read next section if this is not for the current server
[ "$server" = "$section_server" ] || return 0
load_tunnelD() {
config_get section_server "$1" "server"
+ [ "$enabled" = 0 ] && return 0
# continue to read next section if this is not for the current server
[ "$server" = "$section_server" ] || return 0
load_tunnelW() {
config_get section_server "$1" "server"
+ [ "$enabled" = 0 ] && return 0
# continue to read next section if this is not for the current server
[ "$server" = "$section_server" ] || return 0