xref: /illumos-gate/usr/src/uts/common/net/simnet.h (revision b509e89b)
1*b509e89bSRishi Srivatsavai /*
2*b509e89bSRishi Srivatsavai  * CDDL HEADER START
3*b509e89bSRishi Srivatsavai  *
4*b509e89bSRishi Srivatsavai  * The contents of this file are subject to the terms of the
5*b509e89bSRishi Srivatsavai  * Common Development and Distribution License (the "License").
6*b509e89bSRishi Srivatsavai  * You may not use this file except in compliance with the License.
7*b509e89bSRishi Srivatsavai  *
8*b509e89bSRishi Srivatsavai  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*b509e89bSRishi Srivatsavai  * or http://www.opensolaris.org/os/licensing.
10*b509e89bSRishi Srivatsavai  * See the License for the specific language governing permissions
11*b509e89bSRishi Srivatsavai  * and limitations under the License.
12*b509e89bSRishi Srivatsavai  *
13*b509e89bSRishi Srivatsavai  * When distributing Covered Code, include this CDDL HEADER in each
14*b509e89bSRishi Srivatsavai  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*b509e89bSRishi Srivatsavai  * If applicable, add the following below this CDDL HEADER, with the
16*b509e89bSRishi Srivatsavai  * fields enclosed by brackets "[]" replaced with your own identifying
17*b509e89bSRishi Srivatsavai  * information: Portions Copyright [yyyy] [name of copyright owner]
18*b509e89bSRishi Srivatsavai  *
19*b509e89bSRishi Srivatsavai  * CDDL HEADER END
20*b509e89bSRishi Srivatsavai  */
21*b509e89bSRishi Srivatsavai /*
22*b509e89bSRishi Srivatsavai  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23*b509e89bSRishi Srivatsavai  * Use is subject to license terms.
24*b509e89bSRishi Srivatsavai  */
25*b509e89bSRishi Srivatsavai 
26*b509e89bSRishi Srivatsavai #ifndef	_SYS_SIMNET_H
27*b509e89bSRishi Srivatsavai #define	_SYS_SIMNET_H
28*b509e89bSRishi Srivatsavai 
29*b509e89bSRishi Srivatsavai #include <sys/types.h>
30*b509e89bSRishi Srivatsavai #include <sys/mac.h>
31*b509e89bSRishi Srivatsavai #include <sys/dld_ioc.h>
32*b509e89bSRishi Srivatsavai 
33*b509e89bSRishi Srivatsavai #ifdef	__cplusplus
34*b509e89bSRishi Srivatsavai extern "C" {
35*b509e89bSRishi Srivatsavai #endif
36*b509e89bSRishi Srivatsavai 
37*b509e89bSRishi Srivatsavai /* Simnet IOCTL commands handled via DLD driver */
38*b509e89bSRishi Srivatsavai #define	SIMNET_IOC_CREATE	SIMNETIOC(1)
39*b509e89bSRishi Srivatsavai #define	SIMNET_IOC_DELETE	SIMNETIOC(2)
40*b509e89bSRishi Srivatsavai #define	SIMNET_IOC_INFO		SIMNETIOC(3)
41*b509e89bSRishi Srivatsavai #define	SIMNET_IOC_MODIFY	SIMNETIOC(4)
42*b509e89bSRishi Srivatsavai 
43*b509e89bSRishi Srivatsavai typedef struct simnet_ioc_create {
44*b509e89bSRishi Srivatsavai 	datalink_id_t	sic_link_id;
45*b509e89bSRishi Srivatsavai 	uint_t		sic_type;	/* DL_ETHER or DL_WiFi */
46*b509e89bSRishi Srivatsavai 	uint_t		sic_mac_len;
47*b509e89bSRishi Srivatsavai 	uint_t		sic_flags;
48*b509e89bSRishi Srivatsavai 	uchar_t		sic_mac_addr[MAXMACADDRLEN];
49*b509e89bSRishi Srivatsavai } simnet_ioc_create_t;
50*b509e89bSRishi Srivatsavai 
51*b509e89bSRishi Srivatsavai typedef struct simnet_ioc_delete {
52*b509e89bSRishi Srivatsavai 	datalink_id_t	sid_link_id;
53*b509e89bSRishi Srivatsavai 	uint_t		sid_flags;
54*b509e89bSRishi Srivatsavai } simnet_ioc_delete_t;
55*b509e89bSRishi Srivatsavai 
56*b509e89bSRishi Srivatsavai typedef struct simnet_ioc_info {
57*b509e89bSRishi Srivatsavai 	datalink_id_t	sii_link_id;
58*b509e89bSRishi Srivatsavai 	datalink_id_t	sii_peer_link_id;
59*b509e89bSRishi Srivatsavai 	uint_t		sii_type;	/* DL_ETHER or DL_WiFi */
60*b509e89bSRishi Srivatsavai 	uint_t		sii_mac_len;
61*b509e89bSRishi Srivatsavai 	uint_t		sii_flags;
62*b509e89bSRishi Srivatsavai 	uchar_t		sii_mac_addr[MAXMACADDRLEN];
63*b509e89bSRishi Srivatsavai } simnet_ioc_info_t;
64*b509e89bSRishi Srivatsavai 
65*b509e89bSRishi Srivatsavai typedef struct simnet_ioc_modify {
66*b509e89bSRishi Srivatsavai 	datalink_id_t	sim_link_id;
67*b509e89bSRishi Srivatsavai 	datalink_id_t	sim_peer_link_id;
68*b509e89bSRishi Srivatsavai 	uint_t		sim_flags;
69*b509e89bSRishi Srivatsavai } simnet_ioc_modify_t;
70*b509e89bSRishi Srivatsavai 
71*b509e89bSRishi Srivatsavai #ifdef	__cplusplus
72*b509e89bSRishi Srivatsavai }
73*b509e89bSRishi Srivatsavai #endif
74*b509e89bSRishi Srivatsavai 
75*b509e89bSRishi Srivatsavai #endif /* _SYS_SIMNET_H */