/*
- * Copyright (c) 2002-2015 Apple Inc. All rights reserved.
+ * Copyright (c) 2002-2018 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
#include "eventmon.h"
-#include "cache.h"
#include "ev_ipv4.h"
-#ifndef kSCEntNetIPv4ARPCollision
-#define kSCEntNetIPv4ARPCollision CFSTR("IPv4ARPCollision")
-#endif /* kSCEntNetIPv4ARPCollision */
-
-#if !TARGET_OS_IPHONE
-#ifndef kSCEntNetIPv4PortInUse
-#define kSCEntNetIPv4PortInUse CFSTR("PortInUse")
-#endif /* kSCEntNetIPv4PortInUse */
-#endif /* !TARGET_OS_IPHONE */
-
#define IP_FORMAT "%d.%d.%d.%d"
#define IP_CH(ip, i) (((u_char *)(ip))[i])
#define IP_LIST(ip) IP_CH(ip,0),IP_CH(ip,1),IP_CH(ip,2),IP_CH(ip,3)
if (CFDictionaryGetValueIfPresent(newIFs, key, (const void **)&dict)) {
newDict = CFDictionaryCreateMutableCopy(NULL, 0, dict);
} else {
- dict = cache_SCDynamicStoreCopyValue(store, key);
+ dict = SCDynamicStoreCopyValue(store, key);
if (dict) {
CFDictionarySetValue(oldIFs, key, dict);
if (isA_CFDictionary(dict)) {
if (!dict || !CFEqual(dict, newDict)) {
if (CFDictionaryGetCount(newDict) > 0) {
SC_log(LOG_DEBUG, "Update interface configuration: %@: %@", key, newDict);
- cache_SCDynamicStoreSetValue(store, key, newDict);
+ SCDynamicStoreSetValue(store, key, newDict);
} else if (dict) {
- SC_log(LOG_DEBUG, "Update interface configuration: %@: <removed>", key);
- cache_SCDynamicStoreRemoveValue(store, key);
+ CFDictionaryRef oldDict;
+
+ oldDict = SCDynamicStoreCopyValue(store, key);
+ if (oldDict != NULL) {
+ SC_log(LOG_DEBUG, "Update interface configuration: %@: <removed>", key);
+ CFRelease(oldDict);
+ }
+ SCDynamicStoreRemoveValue(store, key);
}
network_changed = TRUE;
}
(i == 0) ? "/" : ":", hw_addr_bytes[i]);
}
SC_log(LOG_DEBUG, "Post ARP collision: %@", key);
- cache_SCDynamicStoreNotifyValue(store, key);
+ SCDynamicStoreNotifyValue(store, key);
CFRelease(key);
CFRelease(prefix);
CFRelease(if_name_cf);
kSCEntNetIPv4PortInUse,
port, req_pid);
SC_log(LOG_DEBUG, "Post port-in-use: %@", key);
- cache_SCDynamicStoreNotifyValue(store, key);
+ SCDynamicStoreNotifyValue(store, key);
CFRelease(key);
return;
}
entity);
CFRelease(if_name_cf);
SC_log(LOG_DEBUG, "Post %s: %@", type, key);
- cache_SCDynamicStoreNotifyValue(store, key);
+ SCDynamicStoreNotifyValue(store, key);
CFRelease(key);
return;
}