]> git.saurik.com Git - apple/xnu.git/blame - bsd/net/if_bond_var.h
xnu-1228.7.58.tar.gz
[apple/xnu.git] / bsd / net / if_bond_var.h
CommitLineData
91447636 1/*
5d5c5d0d
A
2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
3 *
2d21ac55 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
91447636 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.
8f6c56a5 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.
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
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.
8f6c56a5 25 *
2d21ac55 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
91447636
A
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
2d21ac55
A
36#pragma pack(4)
37
91447636
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
2d21ac55
A
42#define IF_BOND_OP_SET_MODE 5
43
44#define IF_BOND_MODE_LACP 0
45#define IF_BOND_MODE_STATIC 1
91447636
A
46
47struct if_bond_partner_state {
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;
55};
56
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
60
61struct if_bond_status {
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];
68};
69
70#define IF_BOND_STATUS_REQ_VERSION 1
71
72struct if_bond_status_req {
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 */
2d21ac55 77 void * ibsru_buffer;
91447636
A
78 u_int64_t ibsru_buffer64;
79 } ibsr_ibsru;
80 lacp_key ibsr_key; /* returned */
2d21ac55
A
81 u_int8_t ibsr_mode; /* returned (IF_BOND_MODE_{LACP, STATIC}) */
82 u_int8_t ibsr_reserved0; /* for future use */
91447636
A
83 u_int32_t ibsr_reserved[3];/* for future use */
84};
2d21ac55 85#define ibsr_buffer ibsr_ibsru.ibsru_buffer
91447636
A
86
87struct 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
2d21ac55
A
96#pragma pack()
97
91447636 98#ifdef KERNEL_PRIVATE
2d21ac55 99int bond_family_init(void) __attribute__((section("__TEXT, initcode")));
91447636
A
100#endif KERNEL_PRIVATE
101
102#endif /* _NET_IF_BOND_VAR_H_ */