mirror of https://github.com/hak5/openwrt.git
base-files: add network_get_protocol() to /lib/functions/network.sh
SVN-Revision: 39099lede-17.01
parent
5d79ad06c1
commit
fe230cac18
|
@ -174,8 +174,8 @@ __network_parse_ifstatus()
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# parse up state, device and physdev
|
# parse up state, proto, device and physdev
|
||||||
for __field in "up" "l3_device" "device"; do
|
for __field in "up" "proto" "l3_device" "device"; do
|
||||||
if json_get_type __tmp "$__field"; then
|
if json_get_type __tmp "$__field"; then
|
||||||
__network_set_cache "${__key}_${__field}" "$__field"
|
__network_set_cache "${__key}_${__field}" "$__field"
|
||||||
fi
|
fi
|
||||||
|
@ -381,6 +381,11 @@ network_is_up()
|
||||||
__network_device __up "$1" up && [ $__up -eq 1 ]
|
__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
|
# determine the layer 3 linux network device of the given logical interface
|
||||||
# 1: destination variable
|
# 1: destination variable
|
||||||
# 2: interface
|
# 2: interface
|
||||||
|
|
Loading…
Reference in New Issue