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