xref: /titanic_50/usr/src/lib/libbc/inc/include/sys/stropts.h (revision 711890bc9379ceea66272dc8d4981812224ea86e)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 #ifndef _sys_stropts_h
31 #define	_sys_stropts_h
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 /*
36  * Read options
37  */
38 #define RNORM	0			/* read msg norm */
39 #define RMSGD	1			/* read msg discard */
40 #define RMSGN	2			/* read msg no discard */
41 
42 /*
43  * Flush options
44  */
45 
46 #define FLUSHR	1			/* flush read queue */
47 #define FLUSHW	2			/* flush write queue */
48 #define FLUSHRW	3			/* flush both queues */
49 
50 /*
51  * Events for which to be sent SIGPOLL signal
52  */
53 #define S_INPUT		001		/* regular priority msg on read Q */
54 #define S_HIPRI		002		/* high priority msg on read Q */
55 #define S_OUTPUT	004		/* write Q no longer full */
56 #define S_MSG		010		/* signal msg at front of read Q */
57 
58 /*
59  * Flags for recv() and send() syscall arguments
60  */
61 #define RS_HIPRI	1		/* send/recv high priority message */
62 
63 /*
64  * Flags returned as value of recv() syscall
65  */
66 #define MORECTL		1		/* more ctl info is left in message */
67 #define MOREDATA	2		/* more data is left in message */
68 
69 #ifndef FMNAMESZ
70 #define	FMNAMESZ	8
71 #endif
72 
73 #include <sys/ioccom.h>
74 
75 /*
76  *  Stream Ioctl defines
77  */
78 #define I_NREAD		_IOR('S',01,int)
79 #define I_PUSH		_IOWN('S',02,FMNAMESZ+1)
80 #define I_POP		_IO('S',03)
81 #define I_LOOK		_IORN('S',04,FMNAMESZ+1)
82 #define I_FLUSH		_IO('S',05)
83 #define I_SRDOPT	_IO('S',06)
84 #define I_GRDOPT	_IOR('S',07,int)
85 #define I_STR		_IOWR('S',010,struct strioctl)
86 #define I_SETSIG	_IO('S',011)
87 #define I_GETSIG	_IOR('S',012,int)
88 #define I_FIND		_IOWN('S',013,FMNAMESZ+1)
89 #define I_LINK		_IO('S',014)
90 #define I_UNLINK	_IO('S',015)
91 #define I_PEEK		_IOWR('S',017,struct strpeek)
92 #define I_FDINSERT	_IOW('S',020,struct strfdinsert)
93 #define I_SENDFD	_IO('S',021)
94 #define I_RECVFD	_IOR('S',022,struct strrecvfd)
95 #define I_PLINK		_IO('S',023)
96 #define I_PUNLINK	_IO('S',024)
97 
98 
99 /*
100  * User level ioctl format for ioctl that go downstream I_STR
101  */
102 struct strioctl {
103 	int 	ic_cmd;			/* command */
104 	int	ic_timout;		/* timeout value */
105 	int	ic_len;			/* length of data */
106 	char	*ic_dp;			/* pointer to data */
107 };
108 
109 
110 /*
111  * Value for timeouts (ioctl, select) that denotes infinity
112  */
113 #define INFTIM		-1
114 
115 
116 /*
117  * Stream buffer structure for send and recv system calls
118  */
119 struct strbuf {
120 	int	maxlen;			/* no. of bytes in buffer */
121 	int	len;			/* no. of bytes returned */
122 	char	*buf;			/* pointer to data */
123 };
124 
125 
126 /*
127  * stream I_PEEK ioctl format
128  */
129 
130 struct strpeek {
131 	struct strbuf ctlbuf;
132 	struct strbuf databuf;
133 	long	      flags;
134 };
135 
136 /*
137  * stream I_FDINSERT ioctl format
138  */
139 struct strfdinsert {
140 	struct strbuf ctlbuf;
141 	struct strbuf databuf;
142 	long	      flags;
143 	int	      fildes;
144 	int	      offset;
145 };
146 
147 
148 /*
149  * receive file descriptor structure
150  */
151 struct strrecvfd {
152 	int fd;
153 	unsigned short uid;
154 	unsigned short gid;
155 	char fill[8];
156 };
157 
158 #endif /* !_sys_stropts_h */
159