From 223cae9fe6bae99b3fb03efa0f42a9987f30eaca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 10 Nov 2010 22:16:48 +0000 Subject: [PATCH] * Implemented IsEthernet(), and IsWireless() temporarily, but this will do for some drivers at least. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39393 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/network/libnetapi/NetworkDevice.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/kits/network/libnetapi/NetworkDevice.cpp b/src/kits/network/libnetapi/NetworkDevice.cpp index 2f709ce790..15da58a5f5 100644 --- a/src/kits/network/libnetapi/NetworkDevice.cpp +++ b/src/kits/network/libnetapi/NetworkDevice.cpp @@ -13,7 +13,7 @@ #include extern "C" { -#include +# include } @@ -40,6 +40,7 @@ get_80211(const char* name, int32 type, void* data, int32& length) return B_OK; } + #if 0 static status_t set_80211(const char* name, int32 type, void* data, @@ -76,6 +77,7 @@ set_80211(const char* name, int32 type, T& data, int32 length = 0, } #endif + template status_t do_request(T& request, const char* name, int option) { @@ -211,6 +213,21 @@ BNetworkDevice::GetHardwareAddress(BNetworkAddress& address) } +bool +BNetworkDevice::IsEthernet() +{ + return !IsWireless(); +} + + +bool +BNetworkDevice::IsWireless() +{ + // TODO: fix me! + return strstr(Name(), "wifi") != NULL; +} + + ssize_t BNetworkDevice::CountScanResults() {