2 * Copyright (c) 2004, 2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef _BONDCONFIGURATION_H
25 #define _BONDCONFIGURATION_H
28 @header BONDCONFIGURATION
31 #include <AvailabilityMacros.h>
32 #include <sys/cdefs.h>
33 #include <CoreFoundation/CoreFoundation.h>
34 #include <SystemConfiguration/SCNetworkConfiguration.h>
36 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
38 typedef const struct __BondInterface
* BondInterfaceRef
;
40 typedef const struct __BondPreferences
* BondPreferencesRef
;
42 typedef const struct __BondStatus
* BondStatusRef
;
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 */
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
;
62 extern const CFStringRef kSCNetworkInterfaceTypeBOND
;
65 SCNetworkInterfaceSupportsBonding (SCNetworkInterfaceRef interface
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
68 SCNetworkInterfaceCreateWithBond (BondInterfaceRef bond
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
73 IsBondSupported (CFStringRef device
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
; // e.g. "en0", "en1", ...
78 BondInterfaceGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
81 BondInterfaceGetInterface (BondInterfaceRef bond
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
; // returns "bond0", "bond1", ...
83 CFArrayRef
/* of CFStringRef's */
84 BondInterfaceGetDevices (BondInterfaceRef bond
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
87 BondInterfaceGetOptions (BondInterfaceRef bond
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
; // e.g. UserDefinedName, ...
92 BondPreferencesGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
95 BondPreferencesCreate (CFAllocatorRef allocator
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
97 CFArrayRef
/* of BondInterfaceRef's */
98 BondPreferencesCopyInterfaces (BondPreferencesRef prefs
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
101 BondPreferencesCreateInterface (BondPreferencesRef prefs
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
104 BondPreferencesRemoveInterface (BondPreferencesRef prefs
,
105 BondInterfaceRef bond
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
108 BondPreferencesAddDevice (BondPreferencesRef prefs
,
109 BondInterfaceRef bond
,
110 CFStringRef device
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
; // e.g. "en0", "en1", ...
113 BondPreferencesRemoveDevice (BondPreferencesRef prefs
,
114 BondInterfaceRef bond
,
115 CFStringRef device
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
; // e.g. "en0", "en1", ...
118 BondPreferencesSetOptions (BondPreferencesRef prefs
,
119 BondInterfaceRef bond
,
120 CFDictionaryRef newOptions
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
123 BondPreferencesCommitChanges (BondPreferencesRef prefs
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
126 BondPreferencesApplyChanges (BondPreferencesRef prefs
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
131 BondStatusGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
134 BondInterfaceCopyStatus (BondInterfaceRef bond
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
137 BondStatusGetDevices (BondStatusRef bondStatus
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
140 BondStatusGetInterfaceStatus (BondStatusRef bondStatus
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
143 BondStatusGetDeviceStatus (BondStatusRef bondStatus
,
144 CFStringRef device
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
148 #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
150 #endif /* _BONDCONFIGURATION_H */