]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkSignature.h
configd-204.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCNetworkSignature.h
1 /*
2 * Copyright (c) 2006 Apple Computer, 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 _SCNETWORKSIGNATURE_H
25 #define _SCNETWORKSIGNATURE_H
26
27 #include <AvailabilityMacros.h>
28 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
29
30 #include <CoreFoundation/CFString.h>
31 #include <CoreFoundation/CFArray.h>
32 #include <netinet/in.h>
33
34 /*!
35 @header SCNetworkSignature
36 @discussion The SCNetworkSignature API provides access to the
37 network identification information. Each routable network
38 has an associated signature that is assigned a unique
39 identifier. The unique identifier allows an application
40 to associate settings with a particular network
41 or set of networks.
42 */
43
44 /*!
45 @const kSCNetworkSignatureActiveChangedNotifyName
46 @discussion The name to use with the notify(3) API's to monitor
47 when the list of active signatures changes.
48 */
49 extern const char * kSCNetworkSignatureActiveChangedNotifyName;
50
51 /*!
52 @function SCNetworkSignatureCopyActiveIdentifiers
53 @discussion Find all currently active networks and return a list of
54 (string) identifiers, one for each network.
55 @param allocator The CFAllocator that should be used to allocate
56 memory for the local dynamic store object.
57 This parameter may be NULL in which case the current
58 default CFAllocator is used. If this reference is not
59 a valid CFAllocator, the behavior is undefined.
60 @result A CFArrayRef containing a list of (string) identifiers,
61 NULL if no networks are currently active.
62 */
63 CFArrayRef /* of CFStringRef's */
64 SCNetworkSignatureCopyActiveIdentifiers(CFAllocatorRef alloc);
65
66 /*!
67 @function SCNetworkSignatureCopyActiveIdentifierForAddress
68 @discussion Find the one active network associated with the specified
69 address and return the unique (string) identifier that
70 represents it.
71 @param allocator The CFAllocator that should be used to allocate
72 memory for the local dynamic store object.
73 This parameter may be NULL in which case the current
74 default CFAllocator is used. If this reference is not
75 a valid CFAllocator, the behavior is undefined.
76 @param addr The address of interest. Note: currently only AF_INET
77 0.0.0.0 is supported, passing anything else always returns
78 NULL.
79 @result The unique (string) identifier associated with the address,
80 NULL if no network is known.
81 */
82 CFStringRef
83 SCNetworkSignatureCopyActiveIdentifierForAddress(CFAllocatorRef alloc,
84 const struct sockaddr * addr);
85
86 #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
87
88 #endif /* _SCNETWORKSIGNATURE_H */