]> git.saurik.com Git - apple/xnu.git/blob - bsd/net/if_bond_var.h
xnu-792.12.6.tar.gz
[apple/xnu.git] / bsd / net / if_bond_var.h
1 /*
2 * Copyright (c) 2006 Apple Computer, Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_OSREFERENCE_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. 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
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
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.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
29 */
30
31 #ifndef _NET_IF_BOND_VAR_H_
32 #define _NET_IF_BOND_VAR_H_
33
34 #include <sys/types.h>
35
36 #include <net/lacp.h>
37
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
42
43 struct if_bond_partner_state {
44 lacp_system ibps_system;
45 lacp_system_priority ibps_system_priority;
46 lacp_key ibps_key;
47 lacp_port ibps_port;
48 lacp_port_priority ibps_port_priority;
49 lacp_actor_partner_state ibps_state;
50 u_char ibps_reserved1;
51 };
52
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
56
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];
64 };
65
66 #define IF_BOND_STATUS_REQ_VERSION 1
67
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;
75 } ibsr_ibsru;
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 */
79 };
80
81 #if defined(__LP64__)
82 #define ibsr_buffer ibsr_ibsru.ibsru_buffer64
83 #else
84 #define ibsr_buffer ibsr_ibsru.ibsru_buffer32
85 #endif
86
87 struct if_bond_req {
88 u_int32_t ibr_op; /* operation */
89 union {
90 char ibru_if_name[IFNAMSIZ]; /* interface name */
91 struct if_bond_status_req ibru_status; /* status information */
92 int ibru_int_val;
93 } ibr_ibru;
94 };
95
96 #ifdef KERNEL_PRIVATE
97 int bond_family_init(void);
98 #endif KERNEL_PRIVATE
99
100 #endif /* _NET_IF_BOND_VAR_H_ */