SF# 3563626: For Win32 set Up/Running flags on NetworkInterface

This commit is contained in:
Aleksandar Fabijanic
2012-09-06 03:59:16 +00:00
parent 10267b5899
commit 32cc64a5b8

View File

@@ -125,6 +125,7 @@ public:
#if defined(POCO_OS_FAMILY_WINDOWS)
void setFlags(DWORD flags, DWORD iftype);
void setRunning(bool running);
#else
void setFlags(short flags);
#endif
@@ -416,7 +417,7 @@ inline bool NetworkInterfaceImpl::up() const
void NetworkInterfaceImpl::setFlags(DWORD flags, DWORD iftype)
{
_running = _up = true;
_running = _up = false;
switch (iftype) {
case IF_TYPE_ETHERNET_CSMACD:
case IF_TYPE_ISO88025_TOKENRING:
@@ -437,6 +438,11 @@ void NetworkInterfaceImpl::setFlags(DWORD flags, DWORD iftype)
_multicast = true;
}
void NetworkInterfaceImpl::setRunning(bool running)
{
_running = running;
}
#else
void NetworkInterfaceImpl::setFlags(short flags)
@@ -989,6 +995,7 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
ifIt->second.impl().setFlags(pAddress->Flags, pAddress->IfType);
ifIt->second.impl().setMtu(pAddress->Mtu);
ifIt->second.impl().setUp(pAddress->OperStatus == IfOperStatusUp);
ifIt->second.impl().setRunning(pAddress->ReceiveLinkSpeed > 0 || pAddress->TransmitLinkSpeed > 0);
ifIt->second.impl().setType(fromNative(pAddress->IfType));
if (pAddress->PhysicalAddressLength)
ifIt->second.impl().setMACAddress(pAddress->PhysicalAddress, pAddress->PhysicalAddressLength);