]>
git.saurik.com Git - apple/configd.git/blob - config-agent-info/config_agent_info.h
2 * Copyright (c) 2015, 2016 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 CONFIG_AGENT_INFO_H
25 #define CONFIG_AGENT_INFO_H
28 #include <net/network_agent.h>
29 #include <xpc/private.h>
33 #define kConfigAgentDomain "SystemConfig"
35 #define kConfigAgentTypeProxy "ProxyAgent"
36 #define kConfigAgentTypeDNS "DNSAgent"
39 Returns true for agent with type DNSAgent and domain SystemConfig
42 is_config_agent_type_dns (const struct netagent
*agent
) __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
45 Returns true for agent with type ProxyAgent and domain SystemConfig
48 is_config_agent_type_proxy (const struct netagent
*agent
) __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
51 Returns xpc_object_t corresponding to the raw DNSAgent data
52 NULL if the agent is NOT a DNSAgent
55 config_agent_copy_dns_information (const struct netagent
*agentStruct
) __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
58 Returns xpc_object_t (XPC_TYPE_ARRAY) corresponding to the DNS nameservers
59 NULL if the agent is NOT a DNSAgent
62 config_agent_get_dns_nameservers (xpc_object_t resolver
) __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
65 Returns xpc_object_t (XPC_TYPE_ARRAY) corresponding to the DNS search domains
66 NULL if the agent is NOT a DNSAgent
69 config_agent_get_dns_searchdomains (xpc_object_t resolver
) __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
72 Frees the xpc_object_t returned by config_agent_copy_dns_information()
75 config_agent_free_dns_information (xpc_object_t resolver
) __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
78 Returns xpc_object_t corresponding to the raw ProxyAgent data
79 NULL if the agent is NOT a ProxyAgent
82 config_agent_copy_proxy_information (const struct netagent
*agentStruct
) __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
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()
89 Returns xpc_object_t to be freed by the caller.
90 NULL if the the provided configuration does not need any update.
93 config_agent_update_proxy_information (xpc_object_t proxyConfig
) __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
96 Frees the xpc_object_t returned by config_agent_copy_proxy_information()
99 config_agent_free_proxy_information (xpc_object_t proxyConfig
) __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
103 #endif /* CONFIG_AGENT_INFO_H */