]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/BondConfiguration.h
156ebd3060e9aff3a702adc2edfc480ab74e295a
[apple/configd.git] / SystemConfiguration.fproj / BondConfiguration.h
1 /*
2 * Copyright (c) 2004, 2005 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 _BONDCONFIGURATION_H
25 #define _BONDCONFIGURATION_H
26
27 /*!
28 @header BONDCONFIGURATION
29 */
30
31 #include <AvailabilityMacros.h>
32 #include <sys/cdefs.h>
33 #include <CoreFoundation/CoreFoundation.h>
34 #include <SystemConfiguration/SCNetworkConfiguration.h>
35
36 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
37
38 typedef const struct __BondInterface * BondInterfaceRef;
39
40 typedef const struct __BondPreferences * BondPreferencesRef;
41
42 typedef const struct __BondStatus * BondStatusRef;
43
44
45 enum {
46 kSCBondStatusOK = 0, /* enabled, active, running, ... */
47 kSCBondStatusLinkInvalid = 1, /* The link state was not valid (i.e. down, half-duplex, wrong speed) */
48 kSCBondStatusNoPartner = 2, /* The port on the switch that the device is connected doesn't seem to have 802.3ad Link Aggregation enabled */
49 kSCBondStatusNotInActiveGroup = 3, /* We're talking to a partner, but the link aggregation group is different from the one that's active */
50 kSCBondStatusUnknown = 999 /* Non-specific failure */
51 };
52
53 extern const CFStringRef kSCBondStatusDeviceAggregationStatus /* CFNumber */ AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
54 extern const CFStringRef kSCBondStatusDeviceCollecting /* CFNumber (0 or 1) */ AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
55 extern const CFStringRef kSCBondStatusDeviceDistributing /* CFNumber (0 or 1) */ AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
56
57
58 __BEGIN_DECLS
59
60 // ----------
61
62 extern const CFStringRef kSCNetworkInterfaceTypeBOND;
63
64 Boolean
65 SCNetworkInterfaceSupportsBonding (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
66
67 SCNetworkInterfaceRef
68 SCNetworkInterfaceCreateWithBond (BondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
69
70 // ----------
71
72 Boolean
73 IsBondSupported (CFStringRef device) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // e.g. "en0", "en1", ...
74
75 // ----------
76
77 CFTypeID
78 BondInterfaceGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
79
80 CFStringRef
81 BondInterfaceGetInterface (BondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // returns "bond0", "bond1", ...
82
83 CFArrayRef /* of CFStringRef's */
84 BondInterfaceGetDevices (BondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
85
86 CFDictionaryRef
87 BondInterfaceGetOptions (BondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // e.g. UserDefinedName, ...
88
89 // ----------
90
91 CFTypeID
92 BondPreferencesGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
93
94 BondPreferencesRef
95 BondPreferencesCreate (CFAllocatorRef allocator) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
96
97 CFArrayRef /* of BondInterfaceRef's */
98 BondPreferencesCopyInterfaces (BondPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
99
100 BondInterfaceRef
101 BondPreferencesCreateInterface (BondPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
102
103 Boolean
104 BondPreferencesRemoveInterface (BondPreferencesRef prefs,
105 BondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
106
107 Boolean
108 BondPreferencesAddDevice (BondPreferencesRef prefs,
109 BondInterfaceRef bond,
110 CFStringRef device) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // e.g. "en0", "en1", ...
111
112 Boolean
113 BondPreferencesRemoveDevice (BondPreferencesRef prefs,
114 BondInterfaceRef bond,
115 CFStringRef device) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // e.g. "en0", "en1", ...
116
117 Boolean
118 BondPreferencesSetOptions (BondPreferencesRef prefs,
119 BondInterfaceRef bond,
120 CFDictionaryRef newOptions) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
121
122 Boolean
123 BondPreferencesCommitChanges (BondPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
124
125 Boolean
126 BondPreferencesApplyChanges (BondPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
127
128 // ----------
129
130 CFTypeID
131 BondStatusGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
132
133 BondStatusRef
134 BondInterfaceCopyStatus (BondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
135
136 CFArrayRef
137 BondStatusGetDevices (BondStatusRef bondStatus) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
138
139 CFDictionaryRef
140 BondStatusGetInterfaceStatus (BondStatusRef bondStatus) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
141
142 CFDictionaryRef
143 BondStatusGetDeviceStatus (BondStatusRef bondStatus,
144 CFStringRef device) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
145
146 __END_DECLS
147
148 #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
149
150 #endif /* _BONDCONFIGURATION_H */