2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 #ifndef _NET_IF_BOND_VAR_H_
30 #define _NET_IF_BOND_VAR_H_
32 #include <sys/types.h>
36 #define IF_BOND_OP_ADD_INTERFACE 1
37 #define IF_BOND_OP_REMOVE_INTERFACE 2
38 #define IF_BOND_OP_GET_STATUS 3
39 #define IF_BOND_OP_SET_VERBOSE 4
41 struct if_bond_partner_state
{
42 lacp_system ibps_system
;
43 lacp_system_priority ibps_system_priority
;
46 lacp_port_priority ibps_port_priority
;
47 lacp_actor_partner_state ibps_state
;
48 u_char ibps_reserved1
;
51 #define IF_BOND_STATUS_SELECTED_STATE_UNSELECTED 0
52 #define IF_BOND_STATUS_SELECTED_STATE_SELECTED 1
53 #define IF_BOND_STATUS_SELECTED_STATE_STANDBY 2
55 struct if_bond_status
{
56 char ibs_if_name
[IFNAMSIZ
]; /* interface name */
57 lacp_port_priority ibs_port_priority
;
58 lacp_actor_partner_state ibs_state
;
59 u_char ibs_selected_state
;
60 struct if_bond_partner_state ibs_partner_state
;
61 u_int32_t ibs_reserved
[8];
64 #define IF_BOND_STATUS_REQ_VERSION 1
66 struct if_bond_status_req
{
67 int ibsr_version
; /* version */
68 int ibsr_total
; /* returned number of struct if_bond_status's */
69 int ibsr_count
; /* number that will fit in ibsr_buffer */
70 union { /* buffer to hold if_bond_status's */
71 char * ibsru_buffer32
;
72 u_int64_t ibsru_buffer64
;
74 lacp_key ibsr_key
; /* returned */
75 u_int16_t ibsr_reserved0
; /* for future use */
76 u_int32_t ibsr_reserved
[3];/* for future use */
80 #define ibsr_buffer ibsr_ibsru.ibsru_buffer64
82 #define ibsr_buffer ibsr_ibsru.ibsru_buffer32
86 u_int32_t ibr_op
; /* operation */
88 char ibru_if_name
[IFNAMSIZ
]; /* interface name */
89 struct if_bond_status_req ibru_status
; /* status information */
95 int bond_family_init(void);
98 #endif /* _NET_IF_BOND_VAR_H_ */