]>
Commit | Line | Data |
---|---|---|
5e9ce69e | 1 | /* |
c956c85e | 2 | * Copyright (c) 2012, 2013, 2015-2019 Apple Inc. All rights reserved. |
5e9ce69e A |
3 | * |
4 | * @APPLE_LICENSE_HEADER_START@ | |
942cecd7 | 5 | * |
5e9ce69e A |
6 | * This file contains Original Code and/or Modifications of Original Code |
7 | * as defined in and that are subject to the Apple Public Source License | |
8 | * Version 2.0 (the 'License'). You may not use this file except in | |
9 | * compliance with the License. Please obtain a copy of the License at | |
10 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
11 | * file. | |
942cecd7 | 12 | * |
5e9ce69e A |
13 | * The Original Code and all software distributed under the License are |
14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
18 | * Please see the License for the specific language governing rights and | |
19 | * limitations under the License. | |
942cecd7 | 20 | * |
5e9ce69e A |
21 | * @APPLE_LICENSE_HEADER_END@ |
22 | */ | |
23 | ||
24 | #ifndef _LIBSYSTEMCONFIGURATION_CLIENT_H | |
25 | #define _LIBSYSTEMCONFIGURATION_CLIENT_H | |
26 | ||
f715d946 | 27 | #include <os/availability.h> |
5e9ce69e A |
28 | #include <TargetConditionals.h> |
29 | #include <sys/cdefs.h> | |
30 | #include <dispatch/dispatch.h> | |
31 | #include <xpc/xpc.h> | |
32 | ||
33 | // ------------------------------------------------------------ | |
34 | ||
35 | #pragma mark - | |
36 | #pragma mark [XPC] DNS configuration server | |
37 | ||
38 | #define DNSINFO_SERVER_VERSION 20130408 | |
39 | ||
c956c85e | 40 | #if !TARGET_OS_SIMULATOR || TARGET_OS_MACCATALYST |
5e9ce69e | 41 | #define DNSINFO_SERVICE_NAME "com.apple.SystemConfiguration.DNSConfiguration" |
c956c85e | 42 | #else // !TARGET_OS_SIMULATOR || TARGET_OS_MACCATALYST |
5e9ce69e | 43 | #define DNSINFO_SERVICE_NAME "com.apple.SystemConfiguration.DNSConfiguration_sim" |
c956c85e | 44 | #endif // !TARGET_OS_SIMULATOR || TARGET_OS_MACCATALYST |
5e9ce69e A |
45 | |
46 | #define DNSINFO_PROC_NAME "proc_name" // string | |
47 | ||
48 | #define DNSINFO_REQUEST "request_op" // int64 | |
49 | ||
50 | enum { | |
51 | DNSINFO_REQUEST_COPY = 0x10001, | |
52 | DNSINFO_REQUEST_ACKNOWLEDGE, | |
53 | }; | |
54 | ||
55 | #define DNSINFO_CONFIGURATION "configuration" // data | |
56 | #define DNSINFO_GENERATION "generation" // uint64 | |
57 | ||
58 | // ------------------------------------------------------------ | |
59 | ||
60 | #pragma mark - | |
61 | #pragma mark [XPC] Network information (nwi) server | |
62 | ||
63 | #define NWI_SERVER_VERSION 20130408 | |
64 | ||
c956c85e | 65 | #if !TARGET_OS_SIMULATOR || TARGET_OS_MACCATALYST |
5e9ce69e | 66 | #define NWI_SERVICE_NAME "com.apple.SystemConfiguration.NetworkInformation" |
c956c85e | 67 | #else // !TARGET_OS_SIMULATOR || TARGET_OS_MACCATALYST |
5e9ce69e | 68 | #define NWI_SERVICE_NAME "com.apple.SystemConfiguration.NetworkInformation_sim" |
c956c85e | 69 | #endif // !TARGET_OS_SIMULATOR || TARGET_OS_MACCATALYST |
5e9ce69e A |
70 | |
71 | #define NWI_PROC_NAME "proc_name" // string | |
72 | ||
73 | #define NWI_REQUEST "request_op" // int64 | |
74 | ||
75 | enum { | |
942cecd7 A |
76 | /* NWI state requests */ |
77 | NWI_STATE_REQUEST_COPY = 0x20001, | |
78 | NWI_STATE_REQUEST_ACKNOWLEDGE, | |
79 | ||
c956c85e | 80 | #if !TARGET_OS_SIMULATOR || TARGET_OS_MACCATALYST |
942cecd7 A |
81 | /* NWI config agent requests */ |
82 | NWI_CONFIG_AGENT_REQUEST_COPY | |
c956c85e | 83 | #endif // !TARGET_OS_SIMULATOR || TARGET_OS_MACCATALYST |
5e9ce69e A |
84 | }; |
85 | ||
86 | #define NWI_CONFIGURATION "configuration" // data | |
87 | #define NWI_GENERATION "generation" // uint64 | |
88 | ||
89 | // ------------------------------------------------------------ | |
90 | ||
91 | typedef struct { | |
92 | _Bool active; | |
93 | xpc_connection_t connection; | |
94 | char *service_description; | |
95 | char *service_name; | |
96 | } libSC_info_client_t; | |
97 | ||
98 | // ------------------------------------------------------------ | |
99 | ||
100 | __BEGIN_DECLS | |
101 | ||
942cecd7 | 102 | _Bool |
f715d946 | 103 | libSC_info_available (void); |
942cecd7 | 104 | |
5e9ce69e A |
105 | libSC_info_client_t * |
106 | libSC_info_client_create ( | |
107 | dispatch_queue_t q, | |
108 | const char *service_name, | |
109 | const char *service_description | |
110 | ); | |
111 | ||
112 | void | |
113 | libSC_info_client_release ( | |
114 | libSC_info_client_t *client | |
115 | ); | |
116 | ||
117 | xpc_object_t | |
118 | libSC_send_message_with_reply_sync ( | |
119 | libSC_info_client_t *client, | |
120 | xpc_object_t message | |
121 | ); | |
122 | ||
123 | __END_DECLS | |
124 | ||
f715d946 | 125 | #endif // _LIBSYSTEMCONFIGURATION_CLIENT_H |