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