* Implemented operator<() for AF_LINK addresses as well; now NetworkStatus
actually marks the currently associated network. * Removed unused code from NetworkDevice.cpp - doesn't look like we're going to use it anymore. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39793 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c416526666
commit
0a8ad865de
@ -1117,6 +1117,17 @@ BNetworkAddress::operator<(const BNetworkAddress& other) const
|
|||||||
sizeof(address.sin6_addr));
|
sizeof(address.sin6_addr));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case AF_LINK:
|
||||||
|
if (LinkLevelAddressLength() < other.LinkLevelAddressLength())
|
||||||
|
return true;
|
||||||
|
if (LinkLevelAddressLength() > other.LinkLevelAddressLength())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// TODO: could compare index, and name, too
|
||||||
|
compare = memcmp(LinkLevelAddress(), other.LinkLevelAddress(),
|
||||||
|
LinkLevelAddressLength());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compare < 0)
|
if (compare < 0)
|
||||||
|
@ -64,43 +64,6 @@ get_80211(const char* name, int32 type, void* data, int32& length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
static status_t
|
|
||||||
set_80211(const char* name, int32 type, void* data,
|
|
||||||
int32 length = 0, int32 value = 0)
|
|
||||||
{
|
|
||||||
int socket = ::socket(AF_INET, SOCK_DGRAM, 0);
|
|
||||||
if (socket < 0)
|
|
||||||
return errno;
|
|
||||||
|
|
||||||
FileDescriptorCloser closer(socket);
|
|
||||||
|
|
||||||
struct ieee80211req ireq;
|
|
||||||
strlcpy(ireq.i_name, name, IF_NAMESIZE);
|
|
||||||
ireq.i_type = type;
|
|
||||||
ireq.i_val = value;
|
|
||||||
ireq.i_len = length;
|
|
||||||
ireq.i_data = data;
|
|
||||||
|
|
||||||
if (ioctl(socket, SIOCS80211, &ireq, sizeof(struct ieee80211req)) < 0)
|
|
||||||
return errno;
|
|
||||||
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T> status_t
|
|
||||||
set_80211(const char* name, int32 type, T& data, int32 length = 0,
|
|
||||||
int32 value = 0)
|
|
||||||
{
|
|
||||||
if (length == 0)
|
|
||||||
length = sizeof(T);
|
|
||||||
|
|
||||||
return set_80211(name, &data, length, value);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T> status_t
|
template<typename T> status_t
|
||||||
do_request(T& request, const char* name, int option)
|
do_request(T& request, const char* name, int option)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user