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) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _LIBDLVNIC_H
2N/A#define _LIBDLVNIC_H
2N/A
2N/A#include <sys/types.h>
2N/A#include <netinet/in.h>
2N/A#include <libdladm.h>
2N/A#include <libdladm_impl.h>
2N/A#include <sys/mac_flow.h>
2N/A#include <sys/vnic.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A/*
2N/A * Notification when VNICs are created/modified/deleted.
2N/A */
2N/A
2N/A#define DL_VIRTUAL_LINK_UPDATE 1
2N/A
2N/A#define DL_NV_LINKID "VNIC_Event_LINKID"
2N/A#define DL_NV_VLINKID "VNIC_Event_VLINKID"
2N/A#define DL_NV_VID "VNIC_Event_VID"
2N/A#define DL_NV_VSITYPE "VNIC_Event_VSITYPE"
2N/A#define DL_NV_VSIVERS "VNIC_Event_VSIVERSION"
2N/A#define DL_NV_VSIMGRID "VNIC_Event_VSIMGRID"
2N/A#define DL_NV_VSIMGRENC "VNIC_Event_VSIMGRENC"
2N/A#define DL_NV_ISPRIM "VNIC_Event_ISPRIM"
2N/A#define DL_NV_OPERATION "VNIC_Event_OPERATION"
2N/A
2N/Atypedef struct dladm_vnic_attr {
2N/A datalink_id_t va_vnic_id;
2N/A datalink_id_t va_link_id;
2N/A zoneid_t va_owner_zone_id;
2N/A zoneid_t va_zone_id;
2N/A boolean_t va_onloan;
2N/A vnic_mac_addr_type_t va_mac_addr_type;
2N/A uint_t va_mac_len;
2N/A uchar_t va_mac_addr[MAXMACADDRLEN];
2N/A int va_mac_slot;
2N/A uint_t va_mac_prefix_len;
2N/A uint16_t va_vid;
2N/A boolean_t va_force;
2N/A vrid_t va_vrid;
2N/A int va_af;
2N/A mac_resource_props_t va_resource_props;
2N/A} dladm_vnic_attr_t;
2N/A
2N/Aextern dladm_status_t dladm_vnic_create(dladm_handle_t, const char *,
2N/A datalink_id_t, zoneid_t,
2N/A vnic_mac_addr_type_t, uchar_t *,
2N/A uint_t, int *, uint_t, uchar_t *, size_t, uint16_t,
2N/A vrid_t, int, datalink_id_t *, dladm_arg_list_t *,
2N/A uint32_t);
2N/Aextern dladm_status_t dladm_vnic_modify(dladm_handle_t, datalink_id_t,
2N/A datalink_id_t, zoneid_t,
2N/A vnic_mac_addr_type_t, uchar_t *,
2N/A uint_t, int *, uint_t, uchar_t *, size_t, uint16_t,
2N/A vrid_t, int, dladm_arg_list_t *, uint32_t);
2N/Aextern dladm_status_t dladm_vnic_delete(dladm_handle_t, datalink_id_t,
2N/A uint32_t);
2N/Aextern dladm_status_t dladm_vnic_info(dladm_handle_t, datalink_id_t,
2N/A dladm_vnic_attr_t *, uint32_t);
2N/A
2N/Aextern dladm_status_t dladm_vnic_up(dladm_handle_t, datalink_id_t, uint32_t);
2N/Aextern dladm_status_t dladm_vnic_down(dladm_handle_t, datalink_id_t,
2N/A uint32_t);
2N/A
2N/Aextern dladm_status_t dladm_vnic_str2macaddrtype(const char *,
2N/A vnic_mac_addr_type_t *);
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _LIBDLVNIC_H */