}
add_assoc_zval(&iface, "unicast", &unicast);
+ add_assoc_bool(&iface, "up", (p->OperStatus == IfOperStatusUp));
+
add_assoc_zval(return_value, p->AdapterName, &iface);
}
array_init(return_value);
for (p = addrs; p; p = p->ifa_next) {
zval *iface = zend_hash_str_find(Z_ARR_P(return_value), p->ifa_name, strlen(p->ifa_name));
- zval *unicast;
+ zval *unicast, *status;
if (!iface) {
zval newif;
p->ifa_addr, p->ifa_netmask,
(p->ifa_flags & IFF_BROADCAST) ? p->ifa_broadaddr : NULL,
(p->ifa_flags & IFF_POINTOPOINT) ? p->ifa_dstaddr : NULL);
+ status = zend_hash_str_find(Z_ARR_P(iface), "up", sizeof("up") - 1);
+ if (!status) {
+ add_assoc_bool(iface, "up", ((p->ifa_flags & IFF_UP) != 0));
+ }
}
freeifaddrs(addrs);