Signed-off-by: Henning Botha <hjbotha at gmail.com>
Index: net/sshtunnel/files/sshtunnel.init
===================================================================
--- net/sshtunnel/files/sshtunnel.init (revision 32927)
+++ net/sshtunnel/files/sshtunnel.init (working copy)
@@ -73,6 +73,24 @@
append_string "ARGS_tunnels" "-D $localaddress:$localport"
}
+load_tunnelW() {
+ config_get section_server $1 server
+ [ "$server" = "$section_server" ] || return 0 # continue to read
next section if this is not for the current server
+ let count++ # count nr of valid sections to make sure there are at
least one
+
+ config_get localdev $1 localdev "*"
+ config_get remotedev $1 remotedev "*"
+ config_get vpntype $1 vpntype "*"
+
+ [ "$vpntype" == "ethernet" ] || [ "$vpntype" == "point-to-point" ]
|| append_string "error" "[tunnelW: $1] vpntype must be \"ethernet\" (tap)
or \"pointopoint\" (tun)" "; "
+ [ "$localdev" == "any" ] || [ "$localdev" -ge 0 ] || append_string
"error" "[tunnelW: $1] localdev must be an integer or \"any\"" "; "
+ [ "$remotedev" == "any" ] || [ "$remotedev" -ge 0 ] ||
append_string "error" "[tunnelW: $1] remotedev must be an integer or
\"any\"" "; "
+ [ "$user" == "root" ] || logger -p user.warn -t "sshtunnel"
"warning: root is required unless the tunnel device has been created
manually"
+ [ -n "$error" ] && return 1
+
+ append_string "ARGS_tunnels" "-w $localdev:$remotedev -o
Tunnel=$vpntype"
+}
+
load_server() {
server="$1"
Index: net/sshtunnel/files/uci_sshtunnel
===================================================================
--- net/sshtunnel/files/uci_sshtunnel (revision 32927)
+++ net/sshtunnel/files/uci_sshtunnel (working copy)
@@ -49,3 +49,15 @@
# option server disney
# option localaddress *
# option localport 4055
+
+# tunnelW - creates TUN/TAP devices on client and server to establish a
VPN tunnel between them
+# vpntypes:
+# point-to-point = TUN
+# ethernet = TAP
+#
+#config tunnelW proxy
+# option server disney
+# option vpntype point-to-point|ethernet
+# option localdev any|0|1|2|...
+# option remotedev any|0|1|2|...
+
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel