2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _LIBDLAGGR_H
2N/A#define _LIBDLAGGR_H
2N/A
2N/A/*
2N/A * This file includes structures, macros and routines used by aggregation link
2N/A * administration.
2N/A */
2N/A
2N/A#include <sys/types.h>
2N/A#include <sys/aggr.h>
2N/A#include <libdladm.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A/*
2N/A * Modification flags sent with the LAIOC_MODIFY ioctl
2N/A */
2N/A#define DLADM_AGGR_MODIFY_POLICY 0x01
2N/A#define DLADM_AGGR_MODIFY_MAC 0x02
2N/A#define DLADM_AGGR_MODIFY_LACP_MODE 0x04
2N/A#define DLADM_AGGR_MODIFY_LACP_TIMER 0x08
2N/A#define DLADM_AGGR_MODIFY_AGGR_MODE 0x10
2N/A
2N/Atypedef struct dladm_aggr_port_attr_db {
2N/A datalink_id_t lp_linkid;
2N/A} dladm_aggr_port_attr_db_t;
2N/A
2N/Atypedef struct dladm_aggr_port_attr {
2N/A datalink_id_t lp_linkid;
2N/A uchar_t lp_mac[ETHERADDRL];
2N/A aggr_port_state_t lp_state;
2N/A aggr_lacp_state_t lp_lacp_state;
2N/A} dladm_aggr_port_attr_t;
2N/A
2N/Atypedef struct dladm_aggr_grp_attr {
2N/A datalink_id_t lg_linkid;
2N/A uint32_t lg_key;
2N/A uint32_t lg_nports;
2N/A dladm_aggr_port_attr_t *lg_ports;
2N/A aggr_mode_t lg_aggr_mode;
2N/A uint32_t lg_policy;
2N/A uchar_t lg_mac[ETHERADDRL];
2N/A boolean_t lg_mac_fixed;
2N/A boolean_t lg_force;
2N/A aggr_lacp_mode_t lg_lacp_mode;
2N/A aggr_lacp_timer_t lg_lacp_timer;
2N/A} dladm_aggr_grp_attr_t;
2N/A
2N/Aextern dladm_status_t dladm_aggr_create(dladm_handle_t, const char *,
2N/A uint16_t, uint32_t, dladm_aggr_port_attr_db_t *,
2N/A aggr_mode_t, uint32_t, boolean_t, const uchar_t *,
2N/A aggr_lacp_mode_t, aggr_lacp_timer_t, uint32_t);
2N/Aextern dladm_status_t dladm_aggr_delete(dladm_handle_t, datalink_id_t,
2N/A uint32_t);
2N/Aextern dladm_status_t dladm_aggr_add(dladm_handle_t, datalink_id_t, uint32_t,
2N/A dladm_aggr_port_attr_db_t *, uint32_t);
2N/Aextern dladm_status_t dladm_aggr_remove(dladm_handle_t, datalink_id_t,
2N/A uint32_t, dladm_aggr_port_attr_db_t *, uint32_t);
2N/Aextern dladm_status_t dladm_aggr_modify(dladm_handle_t, datalink_id_t,
2N/A uint32_t, aggr_mode_t, uint32_t, boolean_t,
2N/A const uchar_t *, aggr_lacp_mode_t,
2N/A aggr_lacp_timer_t, uint32_t);
2N/Aextern dladm_status_t dladm_aggr_up(dladm_handle_t, datalink_id_t);
2N/Aextern dladm_status_t dladm_aggr_down(dladm_handle_t, datalink_id_t);
2N/Aextern dladm_status_t dladm_aggr_info(dladm_handle_t, datalink_id_t,
2N/A dladm_aggr_grp_attr_t *, uint32_t);
2N/A
2N/Aextern boolean_t dladm_aggr_str2policy(const char *, uint32_t *);
2N/Aextern char *dladm_aggr_policy2str(uint32_t, char *);
2N/Aextern boolean_t dladm_aggr_str2macaddr(const char *, boolean_t *,
2N/A uchar_t *);
2N/Aextern const char *dladm_aggr_macaddr2str(const unsigned char *, char *);
2N/Aextern boolean_t dladm_aggr_str2lacpmode(const char *,
2N/A aggr_lacp_mode_t *);
2N/Aextern const char *dladm_aggr_lacpmode2str(aggr_lacp_mode_t, char *);
2N/Aextern boolean_t dladm_aggr_str2lacptimer(const char *,
2N/A aggr_lacp_timer_t *);
2N/Aextern const char *dladm_aggr_lacptimer2str(aggr_lacp_timer_t, char *);
2N/Aextern const char *dladm_aggr_portstate2str(aggr_port_state_t, char *);
2N/Aextern dladm_status_t dladm_key2linkid(dladm_handle_t, uint16_t,
2N/A datalink_id_t *, uint32_t);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _LIBDLAGGR_H */