4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
30 * This file includes structures, macros and routines used by aggregation link
34 #include <sys/types.h>
43 * Modification flags sent with the LAIOC_MODIFY ioctl
45 #define DLADM_AGGR_MODIFY_POLICY 0x01
46 #define DLADM_AGGR_MODIFY_MAC 0x02
47 #define DLADM_AGGR_MODIFY_LACP_MODE 0x04
48 #define DLADM_AGGR_MODIFY_LACP_TIMER 0x08
50 typedef struct dladm_aggr_port_attr_db
{
51 datalink_id_t lp_linkid
;
52 } dladm_aggr_port_attr_db_t
;
54 typedef struct dladm_aggr_port_attr
{
55 datalink_id_t lp_linkid
;
56 uchar_t lp_mac
[ETHERADDRL
];
57 aggr_port_state_t lp_state
;
58 aggr_lacp_state_t lp_lacp_state
;
59 } dladm_aggr_port_attr_t
;
61 typedef struct dladm_aggr_grp_attr
{
62 datalink_id_t lg_linkid
;
65 dladm_aggr_port_attr_t
*lg_ports
;
67 uchar_t lg_mac
[ETHERADDRL
];
68 boolean_t lg_mac_fixed
;
70 aggr_lacp_mode_t lg_lacp_mode
;
71 aggr_lacp_timer_t lg_lacp_timer
;
72 } dladm_aggr_grp_attr_t
;
74 extern dladm_status_t
dladm_aggr_create(dladm_handle_t
, const char *,
75 uint16_t, uint32_t, dladm_aggr_port_attr_db_t
*,
76 uint32_t, boolean_t
, const uchar_t
*,
77 aggr_lacp_mode_t
, aggr_lacp_timer_t
, uint32_t);
78 extern dladm_status_t
dladm_aggr_delete(dladm_handle_t
, datalink_id_t
,
80 extern dladm_status_t
dladm_aggr_add(dladm_handle_t
, datalink_id_t
, uint32_t,
81 dladm_aggr_port_attr_db_t
*, uint32_t);
82 extern dladm_status_t
dladm_aggr_remove(dladm_handle_t
, datalink_id_t
,
83 uint32_t, dladm_aggr_port_attr_db_t
*, uint32_t);
84 extern dladm_status_t
dladm_aggr_modify(dladm_handle_t
, datalink_id_t
,
85 uint32_t, uint32_t, boolean_t
, const uchar_t
*,
86 aggr_lacp_mode_t
, aggr_lacp_timer_t
, uint32_t);
87 extern dladm_status_t
dladm_aggr_up(dladm_handle_t
, datalink_id_t
);
88 extern dladm_status_t
dladm_aggr_info(dladm_handle_t
, datalink_id_t
,
89 dladm_aggr_grp_attr_t
*, uint32_t);
91 extern boolean_t
dladm_aggr_str2policy(const char *, uint32_t *);
92 extern char *dladm_aggr_policy2str(uint32_t, char *);
93 extern boolean_t
dladm_aggr_str2macaddr(const char *, boolean_t
*,
95 extern const char *dladm_aggr_macaddr2str(const unsigned char *, char *);
96 extern boolean_t
dladm_aggr_str2lacpmode(const char *,
98 extern const char *dladm_aggr_lacpmode2str(aggr_lacp_mode_t
, char *);
99 extern boolean_t
dladm_aggr_str2lacptimer(const char *,
100 aggr_lacp_timer_t
*);
101 extern const char *dladm_aggr_lacptimer2str(aggr_lacp_timer_t
, char *);
102 extern const char *dladm_aggr_portstate2str(aggr_port_state_t
, char *);
103 extern dladm_status_t
dladm_key2linkid(dladm_handle_t
, uint16_t,
104 datalink_id_t
*, uint32_t);
110 #endif /* _LIBDLAGGR_H */