]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCDynamicStoreCopyDHCPInfo.h
configd-53.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCDynamicStoreCopyDHCPInfo.h
1 /*
2 * Copyright (c) 2001-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22
23 #ifndef _SCDYNAMICSTORECOPYDHCPINFO_H
24 #define _SCDYNAMICSTORECOPYDHCPINFO_H
25
26 #include <sys/cdefs.h>
27 #include <CoreFoundation/CoreFoundation.h>
28 #include <SystemConfiguration/SCDynamicStore.h>
29
30
31 /*!
32 @header SCDynamicStoreCopyDHCPInfo.h
33 The following APIs allow an application to retrieve DHCP/BOOTP
34 information, in particular DHCP/BOOTP options.
35 */
36
37
38 __BEGIN_DECLS
39
40 /*!
41 @function SCDynamicStoreCopyDHCPInfo
42 @discussion Copies the DHCP/BOOTP information dictionary for the
43 requested serviceID, or the primary service if
44 serviceID == NULL.
45 @param store An SCDynamicStoreRef that should be used for communication
46 with the server.
47 If NULL, a temporary session will be used.
48 @param serviceID A CFStringRef containing the requested service.
49 If NULL, returns information for the primary service.
50 @result A dictionary containing DHCP/BOOTP information if successful,
51 NULL otherwise.
52 Use the DHCPInfoGetOption() to retrieve
53 individual options from the returned dictionary.
54
55 A non-NULL return value must be released using CFRelease().
56 */
57 CFDictionaryRef
58 SCDynamicStoreCopyDHCPInfo(SCDynamicStoreRef store, CFStringRef serviceID);
59
60 /*!
61 @function DHCPInfoGetOptionData
62 @discussion Returns a non-NULL CFDataRef containing the BOOTP/DHCP
63 option data if present, NULL otherwise.
64 @param info The non-NULL DHCP information dictionary returned by
65 calling SCDynamicStoreCopyDHCPInfo.
66 @param code The DHCP/BOOTP option code (see RFC 2132) to return
67 data for.
68 @result A non-NULL CFDataRef containing the option data,
69 NULL otherwise.
70
71 The return value must NOT be released.
72 */
73 CFDataRef
74 DHCPInfoGetOptionData(CFDictionaryRef info, UInt8 code);
75
76 /*!
77 @function DHCPInfoGetLeaseStartTime
78 @discussion Returns a CFDateRef corresponding to the lease start time,
79 if present, NULL otherwise. A NULL return value is returned
80 if the configuration method is BOOTP.
81 @param info The non-NULL DHCP information dictionary returned by
82 calling SCDynamicStoreCopyDHCPInfo.
83 @result A non-NULL CFDateRef if present, NULL otherwise.
84
85 The return value must NOT be released.
86 */
87 CFDateRef
88 DHCPInfoGetLeaseStartTime(CFDictionaryRef info);
89
90 __END_DECLS
91
92 #endif /* _SCDYNAMICSTORECOPYDHCPINFO_H */