2 * Copyright (c) 2003 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 <sys/cdefs.h>
32 #include <CoreFoundation/CoreFoundation.h>
33 #include <SystemConfiguration/SCNetworkConfiguration.h>
36 typedef const struct __BondInterface
* BondInterfaceRef
;
38 typedef const struct __BondPreferences
* BondPreferencesRef
;
40 typedef const struct __BondStatus
* BondStatusRef
;
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 */
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
;
60 extern const CFStringRef kSCNetworkInterfaceTypeBOND
;
63 SCNetworkInterfaceSupportsBonding (SCNetworkInterfaceRef interface
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
66 SCNetworkInterfaceCreateWithBond (BondInterfaceRef bond
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
71 IsBondSupported (CFStringRef device
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
; // e.g. "en0", "en1", ...
76 BondInterfaceGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
79 BondInterfaceGetInterface (BondInterfaceRef bond
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
; // returns "bond0", "bond1", ...
81 CFArrayRef
/* of CFStringRef's */
82 BondInterfaceGetDevices (BondInterfaceRef bond
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
85 BondInterfaceGetOptions (BondInterfaceRef bond
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
; // e.g. UserDefinedName, ...
90 BondPreferencesGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
93 BondPreferencesCreate (CFAllocatorRef allocator
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
95 CFArrayRef
/* of BondInterfaceRef's */
96 BondPreferencesCopyInterfaces (BondPreferencesRef prefs
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
99 BondPreferencesCreateInterface (BondPreferencesRef prefs
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
102 BondPreferencesRemoveInterface (BondPreferencesRef prefs
,
103 BondInterfaceRef bond
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
106 BondPreferencesAddDevice (BondPreferencesRef prefs
,
107 BondInterfaceRef bond
,
108 CFStringRef device
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
; // e.g. "en0", "en1", ...
111 BondPreferencesRemoveDevice (BondPreferencesRef prefs
,
112 BondInterfaceRef bond
,
113 CFStringRef device
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
; // e.g. "en0", "en1", ...
116 BondPreferencesSetOptions (BondPreferencesRef prefs
,
117 BondInterfaceRef bond
,
118 CFDictionaryRef newOptions
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
121 BondPreferencesCommitChanges (BondPreferencesRef prefs
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
124 BondPreferencesApplyChanges (BondPreferencesRef prefs
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
129 BondStatusGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
132 BondInterfaceCopyStatus (BondInterfaceRef bond
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
135 BondStatusGetDevices (BondStatusRef bondStatus
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
138 BondStatusGetInterfaceStatus (BondStatusRef bondStatus
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
141 BondStatusGetDeviceStatus (BondStatusRef bondStatus
,
142 CFStringRef device
) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
;
146 #endif /* _BONDCONFIGURATION_H */