2 * Copyright (c) 2012, 2013, 2015-2018 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef _LIBSYSTEMCONFIGURATION_CLIENT_H
25 #define _LIBSYSTEMCONFIGURATION_CLIENT_H
27 #include <os/availability.h>
28 #include <TargetConditionals.h>
29 #include <sys/cdefs.h>
30 #include <dispatch/dispatch.h>
33 // ------------------------------------------------------------
36 #pragma mark [XPC] DNS configuration server
38 #define DNSINFO_SERVER_VERSION 20130408
40 #if !TARGET_OS_SIMULATOR || TARGET_OS_IOSMAC
41 #define DNSINFO_SERVICE_NAME "com.apple.SystemConfiguration.DNSConfiguration"
42 #else // !TARGET_OS_SIMULATOR || TARGET_OS_IOSMAC
43 #define DNSINFO_SERVICE_NAME "com.apple.SystemConfiguration.DNSConfiguration_sim"
44 #endif // !TARGET_OS_SIMULATOR || TARGET_OS_IOSMAC
46 #define DNSINFO_PROC_NAME "proc_name" // string
48 #define DNSINFO_REQUEST "request_op" // int64
51 DNSINFO_REQUEST_COPY
= 0x10001,
52 DNSINFO_REQUEST_ACKNOWLEDGE
,
55 #define DNSINFO_CONFIGURATION "configuration" // data
56 #define DNSINFO_GENERATION "generation" // uint64
58 // ------------------------------------------------------------
61 #pragma mark [XPC] Network information (nwi) server
63 #define NWI_SERVER_VERSION 20130408
65 #if !TARGET_OS_SIMULATOR || TARGET_OS_IOSMAC
66 #define NWI_SERVICE_NAME "com.apple.SystemConfiguration.NetworkInformation"
67 #else // !TARGET_OS_SIMULATOR || TARGET_OS_IOSMAC
68 #define NWI_SERVICE_NAME "com.apple.SystemConfiguration.NetworkInformation_sim"
69 #endif // !TARGET_OS_SIMULATOR || TARGET_OS_IOSMAC
71 #define NWI_PROC_NAME "proc_name" // string
73 #define NWI_REQUEST "request_op" // int64
76 /* NWI state requests */
77 NWI_STATE_REQUEST_COPY
= 0x20001,
78 NWI_STATE_REQUEST_ACKNOWLEDGE
,
80 #if !TARGET_OS_SIMULATOR || TARGET_OS_IOSMAC
81 /* NWI config agent requests */
82 NWI_CONFIG_AGENT_REQUEST_COPY
83 #endif // !TARGET_OS_SIMULATOR || TARGET_OS_IOSMAC
86 #define NWI_CONFIGURATION "configuration" // data
87 #define NWI_GENERATION "generation" // uint64
89 // ------------------------------------------------------------
93 xpc_connection_t connection
;
94 char *service_description
;
96 } libSC_info_client_t
;
98 // ------------------------------------------------------------
103 libSC_info_available (void);
105 libSC_info_client_t
*
106 libSC_info_client_create (
108 const char *service_name
,
109 const char *service_description
113 libSC_info_client_release (
114 libSC_info_client_t
*client
118 libSC_send_message_with_reply_sync (
119 libSC_info_client_t
*client
,
125 #endif // _LIBSYSTEMCONFIGURATION_CLIENT_H