1843e1988Sjohnlev /* 2843e1988Sjohnlev * CDDL HEADER START 3843e1988Sjohnlev * 4843e1988Sjohnlev * The contents of this file are subject to the terms of the 5843e1988Sjohnlev * Common Development and Distribution License (the "License"). 6843e1988Sjohnlev * You may not use this file except in compliance with the License. 7843e1988Sjohnlev * 8843e1988Sjohnlev * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9843e1988Sjohnlev * or http://www.opensolaris.org/os/licensing. 10843e1988Sjohnlev * See the License for the specific language governing permissions 11843e1988Sjohnlev * and limitations under the License. 12843e1988Sjohnlev * 13843e1988Sjohnlev * When distributing Covered Code, include this CDDL HEADER in each 14843e1988Sjohnlev * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15843e1988Sjohnlev * If applicable, add the following below this CDDL HEADER, with the 16843e1988Sjohnlev * fields enclosed by brackets "[]" replaced with your own identifying 17843e1988Sjohnlev * information: Portions Copyright [yyyy] [name of copyright owner] 18843e1988Sjohnlev * 19843e1988Sjohnlev * CDDL HEADER END 20843e1988Sjohnlev */ 21843e1988Sjohnlev /* 22d62bc4baSyz147064 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23843e1988Sjohnlev * Use is subject to license terms. 24843e1988Sjohnlev */ 25843e1988Sjohnlev 26843e1988Sjohnlev #ifndef _LIBDLVNIC_H 27843e1988Sjohnlev #define _LIBDLVNIC_H 28843e1988Sjohnlev 29843e1988Sjohnlev #include <sys/types.h> 30843e1988Sjohnlev #include <netinet/in.h> 31843e1988Sjohnlev #include <libdladm.h> 32*da14cebeSEric Cheng #include <libdladm_impl.h> 33*da14cebeSEric Cheng #include <sys/mac_flow.h> 34843e1988Sjohnlev #include <sys/vnic.h> 35843e1988Sjohnlev 36843e1988Sjohnlev #ifdef __cplusplus 37843e1988Sjohnlev extern "C" { 38843e1988Sjohnlev #endif 39843e1988Sjohnlev 40*da14cebeSEric Cheng typedef struct dladm_vnic_attr { 41d62bc4baSyz147064 datalink_id_t va_vnic_id; 42d62bc4baSyz147064 datalink_id_t va_link_id; 43843e1988Sjohnlev vnic_mac_addr_type_t va_mac_addr_type; 44843e1988Sjohnlev uint_t va_mac_len; 45*da14cebeSEric Cheng uchar_t va_mac_addr[MAXMACADDRLEN]; 46*da14cebeSEric Cheng int va_mac_slot; 47*da14cebeSEric Cheng uint_t va_mac_prefix_len; 48*da14cebeSEric Cheng uint16_t va_vid; 49*da14cebeSEric Cheng boolean_t va_force; 50*da14cebeSEric Cheng boolean_t va_hwrings; 51*da14cebeSEric Cheng mac_resource_props_t va_resource_props; 52*da14cebeSEric Cheng } dladm_vnic_attr_t; 53843e1988Sjohnlev 54d62bc4baSyz147064 extern dladm_status_t dladm_vnic_create(const char *, datalink_id_t, 55*da14cebeSEric Cheng vnic_mac_addr_type_t, uchar_t *, int, int *, 56*da14cebeSEric Cheng uint_t, uint16_t, datalink_id_t *, 57*da14cebeSEric Cheng dladm_arg_list_t *, uint32_t); 58*da14cebeSEric Cheng 59d62bc4baSyz147064 extern dladm_status_t dladm_vnic_delete(datalink_id_t, uint32_t); 60*da14cebeSEric Cheng extern dladm_status_t dladm_vnic_info(datalink_id_t, dladm_vnic_attr_t *, 61d62bc4baSyz147064 uint32_t); 62*da14cebeSEric Cheng 63*da14cebeSEric Cheng extern dladm_status_t dladm_vnic_up(datalink_id_t, uint32_t); 64d62bc4baSyz147064 extern dladm_status_t dladm_vnic_str2macaddrtype(const char *, 65843e1988Sjohnlev vnic_mac_addr_type_t *); 66843e1988Sjohnlev 67843e1988Sjohnlev #ifdef __cplusplus 68843e1988Sjohnlev } 69843e1988Sjohnlev #endif 70843e1988Sjohnlev 71843e1988Sjohnlev #endif /* _LIBDLVNIC_H */ 72