]> git.saurik.com Git - apple/xnu.git/blob - bsd/net/if_bond_var.h
07b0eb37945190f4b5a5ca4e06e162d8b8e06d6d
[apple/xnu.git] / bsd / net / if_bond_var.h
1 /*
2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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
11 * file.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #ifndef _NET_IF_BOND_VAR_H_
25 #define _NET_IF_BOND_VAR_H_
26
27 #include <sys/types.h>
28
29 #include <net/lacp.h>
30
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
35
36 struct if_bond_partner_state {
37 lacp_system ibps_system;
38 lacp_system_priority ibps_system_priority;
39 lacp_key ibps_key;
40 lacp_port ibps_port;
41 lacp_port_priority ibps_port_priority;
42 lacp_actor_partner_state ibps_state;
43 u_char ibps_reserved1;
44 };
45
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
49
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];
57 };
58
59 #define IF_BOND_STATUS_REQ_VERSION 1
60
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;
68 } ibsr_ibsru;
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 */
72 };
73
74 #if defined(__LP64__)
75 #define ibsr_buffer ibsr_ibsru.ibsru_buffer64
76 #else
77 #define ibsr_buffer ibsr_ibsru.ibsru_buffer32
78 #endif
79
80 struct if_bond_req {
81 u_int32_t ibr_op; /* operation */
82 union {
83 char ibru_if_name[IFNAMSIZ]; /* interface name */
84 struct if_bond_status_req ibru_status; /* status information */
85 int ibru_int_val;
86 } ibr_ibru;
87 };
88
89 #ifdef KERNEL_PRIVATE
90 int bond_family_init(void);
91 #endif KERNEL_PRIVATE
92
93 #endif /* _NET_IF_BOND_VAR_H_ */