]>
Commit | Line | Data |
---|---|---|
91447636 A |
1 | /* |
2 | * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
37839358 A |
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. | |
91447636 | 11 | * |
37839358 A |
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 | |
91447636 A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
37839358 A |
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the |
17 | * License for the specific language governing rights and limitations | |
18 | * under the License. | |
91447636 A |
19 | * |
20 | * @APPLE_LICENSE_HEADER_END@ | |
21 | */ | |
22 | ||
23 | #ifndef _NET_IF_BOND_VAR_H_ | |
24 | #define _NET_IF_BOND_VAR_H_ | |
25 | ||
26 | #include <sys/types.h> | |
27 | ||
28 | #include <net/lacp.h> | |
29 | ||
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 | |
34 | ||
35 | struct if_bond_partner_state { | |
36 | lacp_system ibps_system; | |
37 | lacp_system_priority ibps_system_priority; | |
38 | lacp_key ibps_key; | |
39 | lacp_port ibps_port; | |
40 | lacp_port_priority ibps_port_priority; | |
41 | lacp_actor_partner_state ibps_state; | |
42 | u_char ibps_reserved1; | |
43 | }; | |
44 | ||
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 | |
48 | ||
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]; | |
56 | }; | |
57 | ||
58 | #define IF_BOND_STATUS_REQ_VERSION 1 | |
59 | ||
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; | |
67 | } ibsr_ibsru; | |
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 */ | |
71 | }; | |
72 | ||
73 | #if defined(__LP64__) | |
74 | #define ibsr_buffer ibsr_ibsru.ibsru_buffer64 | |
75 | #else | |
76 | #define ibsr_buffer ibsr_ibsru.ibsru_buffer32 | |
77 | #endif | |
78 | ||
79 | struct if_bond_req { | |
80 | u_int32_t ibr_op; /* operation */ | |
81 | union { | |
82 | char ibru_if_name[IFNAMSIZ]; /* interface name */ | |
83 | struct if_bond_status_req ibru_status; /* status information */ | |
84 | int ibru_int_val; | |
85 | } ibr_ibru; | |
86 | }; | |
87 | ||
88 | #ifdef KERNEL_PRIVATE | |
89 | int bond_family_init(void); | |
90 | #endif KERNEL_PRIVATE | |
91 | ||
92 | #endif /* _NET_IF_BOND_VAR_H_ */ |