summaryrefslogtreecommitdiff
path: root/package/base-files/files
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-12-16 16:28:45 +0000
committerJo-Philipp Wich <jow@openwrt.org>2013-12-16 16:28:45 +0000
commitfe230cac1807fe6e595672d566e20d341211fbcf (patch)
treef57b986ffe4c63d976becb41d10430f4068bd550 /package/base-files/files
parent5d79ad06c105dbc6b331f5c1de36aaf2f3bf89a3 (diff)
downloadmtk-20170518-fe230cac1807fe6e595672d566e20d341211fbcf.zip
mtk-20170518-fe230cac1807fe6e595672d566e20d341211fbcf.tar.gz
mtk-20170518-fe230cac1807fe6e595672d566e20d341211fbcf.tar.bz2
base-files: add network_get_protocol() to /lib/functions/network.sh
SVN-Revision: 39099
Diffstat (limited to 'package/base-files/files')
-rw-r--r--package/base-files/files/lib/functions/network.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/package/base-files/files/lib/functions/network.sh b/package/base-files/files/lib/functions/network.sh
index 0ff11c3..7d06aa4 100644
--- a/package/base-files/files/lib/functions/network.sh
+++ b/package/base-files/files/lib/functions/network.sh
@@ -174,8 +174,8 @@ __network_parse_ifstatus()
fi
done
- # parse up state, device and physdev
- for __field in "up" "l3_device" "device"; do
+ # parse up state, proto, device and physdev
+ for __field in "up" "proto" "l3_device" "device"; do
if json_get_type __tmp "$__field"; then
__network_set_cache "${__key}_${__field}" "$__field"
fi
@@ -381,6 +381,11 @@ network_is_up()
__network_device __up "$1" up && [ $__up -eq 1 ]
}
+# determine the protocol of the given logical interface
+# 1: destination variable
+# 2: interface
+network_get_protocol() { __network_device "$1" "$2" proto; }
+
# determine the layer 3 linux network device of the given logical interface
# 1: destination variable
# 2: interface