]> git.saurik.com Git - apple/xnu.git/blob - bsd/net/if_bond_var.h
xnu-792.22.5.tar.gz
[apple/xnu.git] / bsd / net / if_bond_var.h
1 /*
2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29 #ifndef _NET_IF_BOND_VAR_H_
30 #define _NET_IF_BOND_VAR_H_
31
32 #include <sys/types.h>
33
34 #include <net/lacp.h>
35
36 #define IF_BOND_OP_ADD_INTERFACE 1
37 #define IF_BOND_OP_REMOVE_INTERFACE 2
38 #define IF_BOND_OP_GET_STATUS 3
39 #define IF_BOND_OP_SET_VERBOSE 4
40
41 struct if_bond_partner_state {
42 lacp_system ibps_system;
43 lacp_system_priority ibps_system_priority;
44 lacp_key ibps_key;
45 lacp_port ibps_port;
46 lacp_port_priority ibps_port_priority;
47 lacp_actor_partner_state ibps_state;
48 u_char ibps_reserved1;
49 };
50
51 #define IF_BOND_STATUS_SELECTED_STATE_UNSELECTED 0
52 #define IF_BOND_STATUS_SELECTED_STATE_SELECTED 1
53 #define IF_BOND_STATUS_SELECTED_STATE_STANDBY 2
54
55 struct if_bond_status {
56 char ibs_if_name[IFNAMSIZ]; /* interface name */
57 lacp_port_priority ibs_port_priority;
58 lacp_actor_partner_state ibs_state;
59 u_char ibs_selected_state;
60 struct if_bond_partner_state ibs_partner_state;
61 u_int32_t ibs_reserved[8];
62 };
63
64 #define IF_BOND_STATUS_REQ_VERSION 1
65
66 struct if_bond_status_req {
67 int ibsr_version; /* version */
68 int ibsr_total; /* returned number of struct if_bond_status's */
69 int ibsr_count; /* number that will fit in ibsr_buffer */
70 union { /* buffer to hold if_bond_status's */
71 char * ibsru_buffer32;
72 u_int64_t ibsru_buffer64;
73 } ibsr_ibsru;
74 lacp_key ibsr_key; /* returned */
75 u_int16_t ibsr_reserved0; /* for future use */
76 u_int32_t ibsr_reserved[3];/* for future use */
77 };
78
79 #if defined(__LP64__)
80 #define ibsr_buffer ibsr_ibsru.ibsru_buffer64
81 #else
82 #define ibsr_buffer ibsr_ibsru.ibsru_buffer32
83 #endif
84
85 struct if_bond_req {
86 u_int32_t ibr_op; /* operation */
87 union {
88 char ibru_if_name[IFNAMSIZ]; /* interface name */
89 struct if_bond_status_req ibru_status; /* status information */
90 int ibru_int_val;
91 } ibr_ibru;
92 };
93
94 #ifdef KERNEL_PRIVATE
95 int bond_family_init(void);
96 #endif KERNEL_PRIVATE
97
98 #endif /* _NET_IF_BOND_VAR_H_ */