xref: /titanic_50/usr/src/lib/libdladm/common/libdlvnic.h (revision 843e19887f64dde75055cf8842fc4db2171eff45)
1*843e1988Sjohnlev /*
2*843e1988Sjohnlev  * CDDL HEADER START
3*843e1988Sjohnlev  *
4*843e1988Sjohnlev  * The contents of this file are subject to the terms of the
5*843e1988Sjohnlev  * Common Development and Distribution License (the "License").
6*843e1988Sjohnlev  * You may not use this file except in compliance with the License.
7*843e1988Sjohnlev  *
8*843e1988Sjohnlev  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*843e1988Sjohnlev  * or http://www.opensolaris.org/os/licensing.
10*843e1988Sjohnlev  * See the License for the specific language governing permissions
11*843e1988Sjohnlev  * and limitations under the License.
12*843e1988Sjohnlev  *
13*843e1988Sjohnlev  * When distributing Covered Code, include this CDDL HEADER in each
14*843e1988Sjohnlev  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*843e1988Sjohnlev  * If applicable, add the following below this CDDL HEADER, with the
16*843e1988Sjohnlev  * fields enclosed by brackets "[]" replaced with your own identifying
17*843e1988Sjohnlev  * information: Portions Copyright [yyyy] [name of copyright owner]
18*843e1988Sjohnlev  *
19*843e1988Sjohnlev  * CDDL HEADER END
20*843e1988Sjohnlev  */
21*843e1988Sjohnlev /*
22*843e1988Sjohnlev  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23*843e1988Sjohnlev  * Use is subject to license terms.
24*843e1988Sjohnlev  */
25*843e1988Sjohnlev 
26*843e1988Sjohnlev #ifndef _LIBDLVNIC_H
27*843e1988Sjohnlev #define	_LIBDLVNIC_H
28*843e1988Sjohnlev 
29*843e1988Sjohnlev #pragma ident	"%Z%%M%	%I%	%E% SMI"
30*843e1988Sjohnlev 
31*843e1988Sjohnlev #include <sys/types.h>
32*843e1988Sjohnlev #include <netinet/in.h>
33*843e1988Sjohnlev #include <libdladm.h>
34*843e1988Sjohnlev #include <sys/vnic.h>
35*843e1988Sjohnlev 
36*843e1988Sjohnlev #ifdef	__cplusplus
37*843e1988Sjohnlev extern "C" {
38*843e1988Sjohnlev #endif
39*843e1988Sjohnlev 
40*843e1988Sjohnlev typedef struct dladm_vnic_attr_sys {
41*843e1988Sjohnlev 	uint_t			va_vnic_id;
42*843e1988Sjohnlev 	char			va_dev_name[MAXNAMELEN + 1];
43*843e1988Sjohnlev 	vnic_mac_addr_type_t	va_mac_addr_type;
44*843e1988Sjohnlev 	uchar_t			va_mac_addr[ETHERADDRL];
45*843e1988Sjohnlev 	uint_t			va_mac_len;
46*843e1988Sjohnlev } dladm_vnic_attr_sys_t;
47*843e1988Sjohnlev 
48*843e1988Sjohnlev /*
49*843e1988Sjohnlev  * General operations flags.
50*843e1988Sjohnlev  */
51*843e1988Sjohnlev #define	DLADM_VNIC_OPT_TEMP	0x00000001
52*843e1988Sjohnlev #define	DLADM_VNIC_OPT_AUTOID	0x00000002
53*843e1988Sjohnlev 
54*843e1988Sjohnlev /*
55*843e1988Sjohnlev  * Modification flags for dladm_vnic_modify().
56*843e1988Sjohnlev  */
57*843e1988Sjohnlev #define	DLADM_VNIC_MODIFY_ADDR		0x01
58*843e1988Sjohnlev 
59*843e1988Sjohnlev extern dladm_status_t dladm_vnic_create(uint_t, char *, vnic_mac_addr_type_t,
60*843e1988Sjohnlev     uchar_t *, int, uint_t *, uint32_t);
61*843e1988Sjohnlev extern dladm_status_t dladm_vnic_modify(uint_t, uint32_t, vnic_mac_addr_type_t,
62*843e1988Sjohnlev     uint_t, uchar_t *, uint32_t);
63*843e1988Sjohnlev extern dladm_status_t dladm_vnic_delete(uint_t, uint32_t);
64*843e1988Sjohnlev extern dladm_status_t dladm_vnic_walk_sys(
65*843e1988Sjohnlev 	dladm_status_t (*)(void *, dladm_vnic_attr_sys_t *), void *);
66*843e1988Sjohnlev extern boolean_t dladm_vnic_mac_addr_str_to_type(const char *,
67*843e1988Sjohnlev     vnic_mac_addr_type_t *);
68*843e1988Sjohnlev 
69*843e1988Sjohnlev #ifdef	__cplusplus
70*843e1988Sjohnlev }
71*843e1988Sjohnlev #endif
72*843e1988Sjohnlev 
73*843e1988Sjohnlev #endif	/* _LIBDLVNIC_H */
74