1/*
2 * Copyright (c) 2000-2010, 2013 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/*
25 * sysconfig.h
26 * - system configuration related functions
27 */
28
29/*
30 * Modification History
31 *
32 * June 23, 2009	Dieter Siegmund (dieter@apple.com)
33 * - split out from ipconfigd.c
34 */
35
36#ifndef _S_SYSCONFIG_H
37#define _S_SYSCONFIG_H
38
39#include <CoreFoundation/CFDictionary.h>
40#include <CoreFoundation/CFString.h>
41#include <SystemConfiguration/SCDynamicStore.h>
42#include <stdint.h>
43#include "timer.h"
44#include "ipconfigd_types.h"
45#include "dhcp_options.h"
46#include "DHCPv6Options.h"
47
48CFDictionaryRef
49my_SCDynamicStoreCopyDictionary(SCDynamicStoreRef session, CFStringRef key);
50
51/*
52 * Function: my_SCDynamicStoreSetService
53 * Purpose:
54 *   Accumulate the keys to set/remove for a particular service.
55 * Note:
56 *   This function does not update the SCDynamicStore, it just
57 *   accumulates keys/values.
58 */
59void
60my_SCDynamicStoreSetService(SCDynamicStoreRef store,
61			    CFStringRef serviceID,
62			    CFStringRef * entities,
63			    CFDictionaryRef * values,
64			    int count,
65			    boolean_t alternate_location);
66
67/*
68 * Function: my_SCDynamicStoreSetInterface
69 * Purpose:
70 *   Accumulate the keys to set/remove for a particular interface.
71 * Note:
72 *   This function does not update the SCDynamicStore, it just
73 *   accumulates keys/values.
74 */
75void
76my_SCDynamicStoreSetInterface(SCDynamicStoreRef store,
77			      CFStringRef ifname,
78			      CFStringRef entity,
79			      CFDictionaryRef value);
80
81/*
82 * Function: my_SCDynamicStorePublish
83 * Purpose:
84 *   Update the SCDynamicStore with the accumulated keys/values generated
85 *   by previous calls to my_SCDynamicStoreSetService().
86 */
87void
88my_SCDynamicStorePublish(SCDynamicStoreRef store);
89
90CFDictionaryRef
91DHCPInfoDictionaryCreate(ipconfig_method_t method, dhcpol_t * options_p,
92			 absolute_time_t start_time,
93			 absolute_time_t expiration_time);
94
95CFDictionaryRef
96DHCPv6InfoDictionaryCreate(DHCPv6OptionListRef options);
97
98CFStringRef
99IPv4ARPCollisionKeyParse(CFStringRef cache_key, struct in_addr * ipaddr_p,
100			 void * * hwaddr, int * hwlen);
101
102CFDictionaryRef
103DNSEntityCreateWithDHCPv4AndDHCPv6Info(dhcp_info_t * info_v4_p,
104				       dhcpv6_info_t * info_v6_p);
105void *
106bytesFromColonHexString(CFStringRef colon_hex, int * len);
107
108#endif /* _S_SYSCONFIG_H */
109