]>
Commit | Line | Data |
---|---|---|
91447636 | 1 | /* |
5d5c5d0d A |
2 | * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. |
3 | * | |
2d21ac55 | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
0a7de745 | 5 | * |
2d21ac55 A |
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. | |
0a7de745 | 14 | * |
2d21ac55 A |
15 | * Please obtain a copy of the License at |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
0a7de745 | 17 | * |
2d21ac55 A |
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 | |
8f6c56a5 A |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
2d21ac55 A |
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. | |
0a7de745 | 25 | * |
2d21ac55 | 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
91447636 A |
27 | */ |
28 | ||
29 | #ifndef _NET_IF_BOND_VAR_H_ | |
0a7de745 | 30 | #define _NET_IF_BOND_VAR_H_ |
91447636 A |
31 | |
32 | #include <sys/types.h> | |
33 | ||
34 | #include <net/lacp.h> | |
35 | ||
2d21ac55 A |
36 | #pragma pack(4) |
37 | ||
0a7de745 A |
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 | #define IF_BOND_OP_SET_MODE 5 | |
2d21ac55 | 43 | |
0a7de745 A |
44 | #define IF_BOND_MODE_LACP 0 |
45 | #define IF_BOND_MODE_STATIC 1 | |
91447636 A |
46 | |
47 | struct if_bond_partner_state { | |
0a7de745 A |
48 | lacp_system ibps_system; |
49 | lacp_system_priority ibps_system_priority; | |
50 | lacp_key ibps_key; | |
51 | lacp_port ibps_port; | |
52 | lacp_port_priority ibps_port_priority; | |
53 | lacp_actor_partner_state ibps_state; | |
54 | u_char ibps_reserved1; | |
91447636 A |
55 | }; |
56 | ||
0a7de745 A |
57 | #define IF_BOND_STATUS_SELECTED_STATE_UNSELECTED 0 |
58 | #define IF_BOND_STATUS_SELECTED_STATE_SELECTED 1 | |
59 | #define IF_BOND_STATUS_SELECTED_STATE_STANDBY 2 | |
91447636 A |
60 | |
61 | struct if_bond_status { | |
0a7de745 A |
62 | char ibs_if_name[IFNAMSIZ];/* interface name */ |
63 | lacp_port_priority ibs_port_priority; | |
64 | lacp_actor_partner_state ibs_state; | |
65 | u_char ibs_selected_state; | |
66 | struct if_bond_partner_state ibs_partner_state; | |
67 | u_int32_t ibs_reserved[8]; | |
91447636 A |
68 | }; |
69 | ||
0a7de745 | 70 | #define IF_BOND_STATUS_REQ_VERSION 1 |
91447636 A |
71 | |
72 | struct if_bond_status_req { | |
0a7de745 A |
73 | int ibsr_version;/* version */ |
74 | int ibsr_total; /* returned number of struct if_bond_status's */ | |
75 | int ibsr_count; /* number that will fit in ibsr_buffer */ | |
76 | union { /* buffer to hold if_bond_status's */ | |
77 | void * ibsru_buffer; | |
78 | u_int64_t ibsru_buffer64; | |
79 | } ibsr_ibsru; | |
80 | lacp_key ibsr_key; /* returned */ | |
81 | u_int8_t ibsr_mode; /* returned (IF_BOND_MODE_{LACP, STATIC}) */ | |
82 | u_int8_t ibsr_reserved0;/* for future use */ | |
83 | u_int32_t ibsr_reserved[3];/* for future use */ | |
91447636 | 84 | }; |
0a7de745 | 85 | #define ibsr_buffer ibsr_ibsru.ibsru_buffer |
91447636 A |
86 | |
87 | struct if_bond_req { | |
0a7de745 A |
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; | |
91447636 A |
94 | }; |
95 | ||
2d21ac55 A |
96 | #pragma pack() |
97 | ||
316670eb | 98 | #include <net/if_bond_internal.h> |
91447636 A |
99 | |
100 | #endif /* _NET_IF_BOND_VAR_H_ */ |