close(s);
return NET_TYPE_ETHERNET;
}
+#else
+ char devtype[32];
+
+ if (!sysfs_devtype(devtype, sizeof(devtype), ifname))
+ return NET_TYPE_OTHER;
+
+ /* Default to Ethernet when no devtype is available */
+ if (!devtype[0])
+ return NET_TYPE_ETHERNET;
+
+ if (strcmp(devtype, "wlan") == 0)
+ return NET_TYPE_WIRELESS;
+
+ if (strcmp(devtype, "wwan") == 0)
+ return NET_TYPE_OTHER;
+
+ return NET_TYPE_OTHER;
#endif
+ return NET_TYPE_OTHER;
}
const char *first_eth_interface(const net_type_t type) {