git-svn-id: svn://db.shs.com.ru/pip@225 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -799,13 +799,7 @@ PIEthernet::InterfaceList PIEthernet::interfaces() {
|
||||
while (pAdapter) {
|
||||
ci.name = PIString(pAdapter->AdapterName);
|
||||
ci.index = pAdapter->Index;
|
||||
ci.address = PIString(pAdapter->IpAddressList.IpAddress.String);
|
||||
if (ci.address == "0.0.0.0") {
|
||||
pAdapter = pAdapter->Next;
|
||||
continue;
|
||||
}
|
||||
ci.mac = macFromBytes(PIByteArray(pAdapter->Address, pAdapter->AddressLength));
|
||||
ci.netmask = PIString(pAdapter->IpAddressList.IpMask.String);
|
||||
ci.flags = PIEthernet::ifActive | PIEthernet::ifRunning;
|
||||
//if (ret->ifa_flags & IFF_BROADCAST) ci.flags |= PIEthernet::ifBroadcast;
|
||||
//if (ret->ifa_flags & IFF_MULTICAST) ci.flags |= PIEthernet::ifMulticast;
|
||||
@@ -813,11 +807,22 @@ PIEthernet::InterfaceList PIEthernet::interfaces() {
|
||||
if (pAdapter->Type == MIB_IF_TYPE_LOOPBACK) ci.flags |= PIEthernet::ifLoopback;
|
||||
ci.broadcast.clear();
|
||||
ci.ptp.clear();
|
||||
IP_ADDR_STRING * as = &(pAdapter->IpAddressList);
|
||||
while (as) {
|
||||
// piCout << "[pAdapter]" << ci.name << PIString(as->IpAddress.String);
|
||||
ci.address = PIString(as->IpAddress.String);
|
||||
ci.netmask = PIString(as->IpMask.String);
|
||||
if (ci.address == "0.0.0.0") {
|
||||
as = as->Next;
|
||||
continue;
|
||||
}
|
||||
il << ci;
|
||||
as = as->Next;
|
||||
}
|
||||
/*if (ci.flags[PIEthernet::ifBroadcast])
|
||||
ci.broadcast = getSockAddr(ret->ifa_broadaddr);
|
||||
if (ci.flags[PIEthernet::ifPTP])
|
||||
ci.ptp = getSockAddr(ret->ifa_dstaddr);*/
|
||||
il << ci;
|
||||
pAdapter = pAdapter->Next;
|
||||
}
|
||||
} else
|
||||
@@ -1019,6 +1024,8 @@ PIStringList PIEthernet::allAddresses() {
|
||||
PIStringList al;
|
||||
piForeachC (PIEthernet::Interface & i, il)
|
||||
al << i.address;
|
||||
// piCout << "[PIEthernet::allAddresses]" << al;
|
||||
if (!al.contains("127.0.0.1")) al << "127.0.0.1";
|
||||
return al.removeStrings("0.0.0.0");
|
||||
//#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user