]> git.saurik.com Git - apple/configd.git/blob - IPMonitorControl/IPMonitorControlPrivate.h
configd-1061.101.1.tar.gz
[apple/configd.git] / IPMonitorControl / IPMonitorControlPrivate.h
1
2 #ifndef _IPMONITOR_CONTROL_PRIVATE_H
3 #define _IPMONITOR_CONTROL_PRIVATE_H
4
5 #define kIPMonitorControlServerName \
6 "com.apple.SystemConfiguration.IPMonitorControl"
7
8 typedef CF_ENUM(uint32_t, IPMonitorControlRequestType) {
9 kIPMonitorControlRequestTypeNone = 0,
10 kIPMonitorControlRequestTypeSetInterfaceRank = 1,
11 kIPMonitorControlRequestTypeGetInterfaceRank = 2,
12 kIPMonitorControlRequestTypeSetInterfaceAdvisory = 3,
13 kIPMonitorControlRequestTypeInterfaceAdvisoryIsSet = 4,
14 kIPMonitorControlRequestTypeAnyInterfaceAdvisoryIsSet = 5,
15 };
16
17 /*
18 * kIPMonitorControlRequestKey*
19 * - keys used to communicate a request to the server
20 */
21 #define kIPMonitorControlRequestKeyType "Type"
22 #define kIPMonitorControlRequestKeyProcessName "ProcessName"
23 #define kIPMonitorControlRequestKeyInterfaceName "InterfaceName"
24 #define kIPMonitorControlRequestKeyPrimaryRank "PrimaryRank"
25 #define kIPMonitorControlRequestKeyAdvisory "Advisory"
26 #define kIPMonitorControlRequestKeyReason "Reason"
27
28 /*
29 * kIPMonitorControlResponseKey*
30 * - keys used to communicate the response from the server
31 */
32 #define kIPMonitorControlResponseKeyError "Error"
33 #define kIPMonitorControlResponseKeyPrimaryRank "PrimaryRank"
34 #define kIPMonitorControlResponseKeyAdvisoryIsSet "AdvisoryIsSet"
35
36 static inline CFStringRef
37 _IPMonitorControlCopyInterfaceAdvisoryNotificationKey(CFStringRef ifname)
38 {
39 return SCDynamicStoreKeyCreateNetworkInterfaceEntity(NULL,
40 kSCDynamicStoreDomainState,
41 ifname,
42 CFSTR("Advisory"));
43 }
44
45 static inline void
46 my_CFRelease(void * t)
47 {
48 void * * obj = (void * *)t;
49 if (obj && *obj) {
50 CFRelease(*obj);
51 *obj = NULL;
52 }
53 return;
54 }
55
56 #endif /* _IPMONITOR_CONTROL_PRIVATE_H */