]> git.ipfire.org Git - people/ms/network.git/blobdiff - functions.device
hostapd: Enable WMM by default.
[people/ms/network.git] / functions.device
index 6de949e02038b5d9e69454b6655d008d5ae841c3..b15e15ec96d190df16074a89393b0d146f07eb2b 100644 (file)
@@ -146,6 +146,16 @@ function device_get_ifindex() {
        print "$(<${path})"
 }
 
+# Check if the device is a batman-adv bridge
+function device_is_batman_adv() {
+       [ -d "${SYS_CLASS_NET}/${1}/mesh" ]
+}
+
+# Check if the device is a batman-adv bridge port
+function device_is_batman_adv_port() {
+       [ -d "${SYS_CLASS_NET}/${1}/batman_adv" ]
+}
+
 # Check if the device is a bonding device
 function device_is_bonding() {
        [ -d "/sys/class/net/${1}/bonding" ]
@@ -165,7 +175,6 @@ function device_is_bridge() {
 
 function device_is_bridge_attached() {
        local device=${1}
-
        [ -d "${SYS_CLASS_NET}/${device}/brport" ]
 }
 
@@ -297,6 +306,12 @@ function device_get_type() {
        elif device_is_ppp ${device}; then
                echo "ppp"
 
+       elif device_is_batman_adv ${device}; then
+               echo "batman-adv"
+
+       elif device_is_batman_adv_port ${device}; then
+               echo "batman-adv-port"
+
        elif device_is_loopback ${device}; then
                echo "loopback"