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