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