1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11 /*
12 * Copyright 2015 Joyent, Inc.
13 */
14
15 #ifndef _SYS_ZFD_H
16 #define _SYS_ZFD_H
17
18 #include <sys/types.h>
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /*
25 * Minor node name of the global zone side (often called the "master" side)
26 * of the zfd dev.
27 */
28 #define ZFD_MASTER_NAME "master"
29
30 /*
31 * Minor node name of the non-global zone side (often called the "slave"
32 * side) of the zfd dev.
33 */
34 #define ZFD_SLAVE_NAME "slave"
35
36 #define ZFD_NAME_LEN 16
37
38 /*
39 * ZFD_IOC forms the base for all zfd ioctls.
40 */
41 #define ZFD_IOC (('Z' << 24) | ('f' << 16) | ('d' << 8))
42
43 /*
44 * This ioctl tells the slave side it should push the TTY stream modules
45 * so that the fd looks like a tty.
46 */
47 #define ZFD_MAKETTY (ZFD_IOC | 0)
48
49 /*
50 * This ioctl puts a hangup into the stream so that the slave side sees EOF.
51 */
52 #define ZFD_EOF (ZFD_IOC | 1)
53
54 /*
55 * This ioctl succeeds if the slave side is open.
56 */
57 #define ZFD_HAS_SLAVE (ZFD_IOC | 2)
58
59 /*
60 * This ioctl links two streams into a multiplexer configuration for in-zone
61 * logging.
62 */
63 #define ZFD_MUX (ZFD_IOC | 3)
64
65 /*
66 * This ioctl controls the flow control setting for the log multiplexer stream
67 * (1 = true, 0 = false). The default is false which implies teeing into the
68 * log stream is "best-effort" but data will be discarded if the stream
69 * becomes full. If set and the log stream begins to fill up, the primary
70 * stream will stop flowing.
71 */
72 #define ZFD_MUX_FLOWCON (ZFD_IOC | 4)
73
74 #ifdef __cplusplus
75 }
76 #endif
77
78 #endif /* _SYS_ZFD_H */