xref: /titanic_41/usr/src/uts/common/sys/ipd.h (revision abe46a257624ffebd8b6980e1dd7170838b8405a)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
24  */
25 
26 /*
27  * These definitions are private to ipd and ipdadm.
28  */
29 
30 #ifndef _SYS_IPD_H
31 #define	_SYS_IPD_H
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #define	IPD_DEV_PATH	"/dev/ipd"
38 #define	IPD_MAX_DELAY	10000		/* 10 ms in us */
39 
40 typedef struct ipd_ioc_perturb {
41 	zoneid_t	ipip_zoneid;
42 	uint32_t	ipip_arg;
43 } ipd_ioc_perturb_t;
44 
45 typedef struct ipd_ioc_info {
46 	zoneid_t	ipii_zoneid;
47 	uint32_t	ipii_corrupt;
48 	uint32_t	ipii_drop;
49 	uint32_t	ipii_delay;
50 } ipd_ioc_info_t;
51 
52 #ifdef _KERNEL
53 
54 typedef struct ipd_ioc_list32 {
55 	uint_t		ipil_nzones;
56 	caddr32_t	ipil_info;
57 } ipd_ioc_list32_t;
58 
59 #endif /* _KERNEL */
60 
61 typedef struct ipd_ioc_list {
62 	uint_t		ipil_nzones;
63 	ipd_ioc_info_t	*ipil_info;
64 } ipd_ioc_list_t;
65 
66 #define	IPD_CORRUPT	0x1
67 #define	IPD_DELAY	0x2
68 #define	IPD_DROP	0x4
69 
70 #define	IPDIOC		(('i' << 24) | ('p' << 16) | ('d' << 8))
71 #define	IPDIOC_CORRUPT	(IPDIOC | 1)		/* disable ipd */
72 #define	IPDIOC_DELAY	(IPDIOC | 2)		/* disable ipd */
73 #define	IPDIOC_DROP	(IPDIOC | 3)		/* disable ipd */
74 #define	IPDIOC_LIST	(IPDIOC | 4)		/* enable ipd */
75 #define	IPDIOC_REMOVE	(IPDIOC | 5)		/* disable ipd */
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif	/* _SYS_IPD_H */
82