aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-06-07 14:55:26 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-06-07 14:55:26 +0000
commitec1352fc73964c21b9820ae388d11e89e2138a8b (patch)
treedf2abd243ea2113b36647ddf6bf6d4d32930cf56 /package/base-files/files/lib
parent50a8a64404c42e45e3f6f1cc18f794e6e7df241e (diff)
downloadupstream-ec1352fc73964c21b9820ae388d11e89e2138a8b.tar.gz
upstream-ec1352fc73964c21b9820ae388d11e89e2138a8b.tar.bz2
upstream-ec1352fc73964c21b9820ae388d11e89e2138a8b.zip
[package] base-files: implement network_defer_device() and network_ready_device() wrappers for upcoming netifd iface deferring support
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32106 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/lib')
-rw-r--r--package/base-files/files/lib/functions/network.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions/network.sh b/package/base-files/files/lib/functions/network.sh
index 684ba63570..8b06e8cd41 100644
--- a/package/base-files/files/lib/functions/network.sh
+++ b/package/base-files/files/lib/functions/network.sh
@@ -62,3 +62,19 @@ network_is_up()
network_get_device() { __network_device "$1" "$2" l3_device; }
network_get_physdev() { __network_device "$1" "$2" device; }
+
+
+__network_defer()
+{
+ local __device="$1"
+ local __defer="$2"
+
+ json_init
+ json_add_string name "$__device"
+ json_add_boolean defer "$__defer"
+
+ ubus call network.device set_state "$(json_dump)" 2>/dev/null
+}
+
+network_defer_device() { __network_defer "$1" 1; }
+network_ready_device() { __network_defer "$1" 0; }