2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 #ifndef _NET_IF_BOND_VAR_H_
24 #define _NET_IF_BOND_VAR_H_
26 #include <sys/types.h>
30 #define IF_BOND_OP_ADD_INTERFACE 1
31 #define IF_BOND_OP_REMOVE_INTERFACE 2
32 #define IF_BOND_OP_GET_STATUS 3
33 #define IF_BOND_OP_SET_VERBOSE 4
35 struct if_bond_partner_state
{
36 lacp_system ibps_system
;
37 lacp_system_priority ibps_system_priority
;
40 lacp_port_priority ibps_port_priority
;
41 lacp_actor_partner_state ibps_state
;
42 u_char ibps_reserved1
;
45 #define IF_BOND_STATUS_SELECTED_STATE_UNSELECTED 0
46 #define IF_BOND_STATUS_SELECTED_STATE_SELECTED 1
47 #define IF_BOND_STATUS_SELECTED_STATE_STANDBY 2
49 struct if_bond_status
{
50 char ibs_if_name
[IFNAMSIZ
]; /* interface name */
51 lacp_port_priority ibs_port_priority
;
52 lacp_actor_partner_state ibs_state
;
53 u_char ibs_selected_state
;
54 struct if_bond_partner_state ibs_partner_state
;
55 u_int32_t ibs_reserved
[8];
58 #define IF_BOND_STATUS_REQ_VERSION 1
60 struct if_bond_status_req
{
61 int ibsr_version
; /* version */
62 int ibsr_total
; /* returned number of struct if_bond_status's */
63 int ibsr_count
; /* number that will fit in ibsr_buffer */
64 union { /* buffer to hold if_bond_status's */
65 char * ibsru_buffer32
;
66 u_int64_t ibsru_buffer64
;
68 lacp_key ibsr_key
; /* returned */
69 u_int16_t ibsr_reserved0
; /* for future use */
70 u_int32_t ibsr_reserved
[3];/* for future use */
74 #define ibsr_buffer ibsr_ibsru.ibsru_buffer64
76 #define ibsr_buffer ibsr_ibsru.ibsru_buffer32
80 u_int32_t ibr_op
; /* operation */
82 char ibru_if_name
[IFNAMSIZ
]; /* interface name */
83 struct if_bond_status_req ibru_status
; /* status information */
89 int bond_family_init(void);
92 #endif /* _NET_IF_BOND_VAR_H_ */