2 * Copyright (c) 2004 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 _NET_IF_BOND_VAR_H_
25 #define _NET_IF_BOND_VAR_H_
27 #include <sys/types.h>
31 #define IF_BOND_OP_ADD_INTERFACE 1
32 #define IF_BOND_OP_REMOVE_INTERFACE 2
33 #define IF_BOND_OP_GET_STATUS 3
34 #define IF_BOND_OP_SET_VERBOSE 4
36 struct if_bond_partner_state
{
37 lacp_system ibps_system
;
38 lacp_system_priority ibps_system_priority
;
41 lacp_port_priority ibps_port_priority
;
42 lacp_actor_partner_state ibps_state
;
43 u_char ibps_reserved1
;
46 #define IF_BOND_STATUS_SELECTED_STATE_UNSELECTED 0
47 #define IF_BOND_STATUS_SELECTED_STATE_SELECTED 1
48 #define IF_BOND_STATUS_SELECTED_STATE_STANDBY 2
50 struct if_bond_status
{
51 char ibs_if_name
[IFNAMSIZ
]; /* interface name */
52 lacp_port_priority ibs_port_priority
;
53 lacp_actor_partner_state ibs_state
;
54 u_char ibs_selected_state
;
55 struct if_bond_partner_state ibs_partner_state
;
56 u_int32_t ibs_reserved
[8];
59 #define IF_BOND_STATUS_REQ_VERSION 1
61 struct if_bond_status_req
{
62 int ibsr_version
; /* version */
63 int ibsr_total
; /* returned number of struct if_bond_status's */
64 int ibsr_count
; /* number that will fit in ibsr_buffer */
65 union { /* buffer to hold if_bond_status's */
66 char * ibsru_buffer32
;
67 u_int64_t ibsru_buffer64
;
69 lacp_key ibsr_key
; /* returned */
70 u_int16_t ibsr_reserved0
; /* for future use */
71 u_int32_t ibsr_reserved
[3];/* for future use */
75 #define ibsr_buffer ibsr_ibsru.ibsru_buffer64
77 #define ibsr_buffer ibsr_ibsru.ibsru_buffer32
81 u_int32_t ibr_op
; /* operation */
83 char ibru_if_name
[IFNAMSIZ
]; /* interface name */
84 struct if_bond_status_req ibru_status
; /* status information */
90 int bond_family_init(void);
93 #endif /* _NET_IF_BOND_VAR_H_ */