]> git.saurik.com Git - apple/configd.git/blob - config-agent-info/config_agent_info.h
configd-1109.101.1.tar.gz
[apple/configd.git] / config-agent-info / config_agent_info.h
1 /*
2 * Copyright (c) 2015, 2016, 2018 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #ifndef CONFIG_AGENT_INFO_H
25 #define CONFIG_AGENT_INFO_H
26
27 #include <dnsinfo.h>
28 #include <net/network_agent.h>
29 #include <xpc/private.h>
30
31 __BEGIN_DECLS
32
33 #define kConfigAgentDomain "SystemConfig"
34
35 #define kConfigAgentTypeProxy "ProxyAgent"
36 #define kConfigAgentTypeDNS "DNSAgent"
37
38 /*
39 Returns true for agent with type DNSAgent and domain SystemConfig
40 */
41 boolean_t
42 is_config_agent_type_dns (const struct netagent *agent) API_AVAILABLE(macos(10.12), ios(10.0));
43
44 /*
45 Returns true for agent with type ProxyAgent and domain SystemConfig
46 */
47 boolean_t
48 is_config_agent_type_proxy (const struct netagent *agent) API_AVAILABLE(macos(10.12), ios(10.0));
49
50 /*
51 Returns xpc_object_t corresponding to the raw DNSAgent data
52 NULL if the agent is NOT a DNSAgent
53 */
54 xpc_object_t
55 config_agent_copy_dns_information (const struct netagent *agentStruct) API_AVAILABLE(macos(10.12), ios(10.0));
56
57 /*
58 Returns xpc_object_t (XPC_TYPE_ARRAY) corresponding to the DNS nameservers
59 NULL if the agent is NOT a DNSAgent
60 */
61 xpc_object_t
62 config_agent_get_dns_nameservers (xpc_object_t resolver) API_AVAILABLE(macos(10.12), ios(10.0));
63
64 /*
65 Returns xpc_object_t (XPC_TYPE_ARRAY) corresponding to the DNS search domains
66 NULL if the agent is NOT a DNSAgent
67 */
68 xpc_object_t
69 config_agent_get_dns_searchdomains (xpc_object_t resolver) API_AVAILABLE(macos(10.12), ios(10.0));
70
71 /*
72 Frees the xpc_object_t returned by config_agent_copy_dns_information()
73 */
74 void
75 config_agent_free_dns_information (xpc_object_t resolver) API_AVAILABLE(macos(10.12), ios(10.0));
76
77 /*
78 Returns xpc_object_t corresponding to the raw ProxyAgent data
79 NULL if the agent is NOT a ProxyAgent
80 */
81 xpc_object_t
82 config_agent_copy_proxy_information (const struct netagent *agentStruct) API_AVAILABLE(macos(10.12), ios(10.0));
83
84 /*
85 Updates the proxy config with PAC, if applicable. The proxyConfig MUST be
86 of type XPC_TYPE_ARRAY containing a XPC_TYPE_DICTIONARY. This format is
87 returned by config_agent_copy_proxy_information()
88
89 Returns xpc_object_t to be freed by the caller.
90 NULL if the the provided configuration does not need any update.
91 */
92 xpc_object_t
93 config_agent_update_proxy_information (xpc_object_t proxyConfig) API_AVAILABLE(macos(10.12), ios(10.0));
94
95 /*
96 Frees the xpc_object_t returned by config_agent_copy_proxy_information()
97 */
98 void
99 config_agent_free_proxy_information (xpc_object_t proxyConfig) API_AVAILABLE(macos(10.12), ios(10.0));
100
101 __END_DECLS
102
103 #endif /* CONFIG_AGENT_INFO_H */