|
|
1.1 root 1: /*++
2:
3: Copyright (c) 1991 Microsoft Corporation
4:
5: Module Name:
6:
7: stropts.h
8:
9: Abstract:
10:
11: This module defines the STREAMS ioctl message interface.
12:
13: Author:
14:
15: Eric Chin (ericc) July 18, 1991
16:
17: Revision History:
18:
19: --*/
20:
21: /*
22: * Streams ioctl message interface
23: *
24: * @(#)stropts.h 1.19 (Spider) 91/11/27
25: */
26:
27: #ifndef _SYS_STROPTS_
28: #define _SYS_STROPTS_
29:
30:
31: /*
32: * Read options
33: */
34:
35: #define RNORM 0x00 /* Normal - bytes stream */
36: #define RMSGD 0x01 /* Message, non-discard mode */
37: #define RMSGN 0x02 /* Message, discard mode */
38:
39: #define RMASK 0x0F /* mask for read options */
40:
41: /*
42: * Protocol read options
43: */
44:
45: #define RPROTNORM 0x00 /* Fail reads with EBADMSG */
46: #define RPROTDIS 0x10 /* Discard proto part */
47: #define RPROTDAT 0x20 /* Turn proto part into data */
48:
49: #define RPROTMASK 0xF0 /* mask for protocol read options */
50:
51: /*
52: * Values for I_ATMARK argument
53: */
54:
55: #define ANYMARK 0 /* check if message is marked */
56: #define LASTMARK 1 /* check if last one marked */
57:
58: /*
59: * Value for I_SWROPT argument
60: */
61:
62: #define NOSNDZERO 0 /* disallow zero length sends */
63: #define SNDZERO 1 /* permit zero length sends */
64:
65: /*
66: * STREAMS ioctl defines
67: */
68:
69: #define STR ('S'<<8)
70: #define I_NREAD (STR|1)
71: #define I_PUSH (STR|2)
72: #define I_POP (STR|3)
73: #define I_LOOK (STR|4)
74: #define I_FLUSH (STR|5)
75: #define I_SRDOPT (STR|6)
76: #define I_GRDOPT (STR|7)
77: #define I_STR (STR|8)
78: #define I_SETSIG (STR|9)
79: #define I_GETSIG (STR|10)
80: #define I_FIND (STR|11)
81: #define I_LINK (STR|12)
82: #define I_UNLINK (STR|13)
83: #define I_PEEK (STR|15)
84: #define I_FDINSERT (STR|16)
85: #define I_SENDFD (STR|17)
86: #define I_RECVFD (STR|18)
87: #ifdef SVR2
88: #define I_GETMSG (STR|19)
89: #define I_PUTMSG (STR|20)
90: #define I_GETID (STR|21)
91: #define I_POLL (STR|22)
92: #endif /*SVR2*/
93: #define I_SWROPT (STR|23)
94: #define I_GWROPT (STR|24)
95: #define I_LIST (STR|25)
96: #define I_ATMARK (STR|26)
97: #define I_SETCLTIME (STR|27)
98: #define I_GETCLTIME (STR|28)
99: #define I_PLINK (STR|29)
100: #define I_PUNLINK (STR|30)
101: #define I_DEBUG (STR|31)
102: #define I_CLOSE (STR|32)
103:
104:
105: #define MUXID_ALL -1
106:
107:
108: /*
109: * General buffer structure (putmsg, getmsg, etc)
110: */
111:
112: struct strbuf {
113: int maxlen; /* no. of bytes in buffer */
114: int len; /* no. of bytes returned */
115: char *buf; /* pointer to data */
116: };
117:
118: /*
119: * General ioctl
120: */
121:
122: struct strioctl {
123: int ic_cmd; /* command */
124: int ic_timout; /* timeout value */
125: int ic_len; /* length of data */
126: char *ic_dp; /* pointer to data */
127: };
128:
129: /*
130: * Structure for I_FDINSERT ioctl
131: */
132:
133: struct strfdinsert {
134: struct strbuf ctlbuf;
135: struct strbuf databuf;
136: long flags;
137: HANDLE fildes;
138: int offset;
139: };
140:
141:
142: /*
143: * Structures for I_DEBUG ioctl
144: */
145: typedef enum _str_trace_options {
146: MSG_TRACE_PRINT = 0x00000001,
147: MSG_TRACE_FLUSH = 0x00000002,
148: MSG_TRACE_ON = 0x00000004,
149: MSG_TRACE_OFF = 0x00000008,
150: POOL_TRACE_PRINT = 0x00000010,
151: POOL_TRACE_FLUSH = 0x00000020,
152: POOL_TRACE_ON = 0x00000040,
153: POOL_TRACE_OFF = 0x00000080,
154: POOL_FAIL_ON = 0x00000100,
155: POOL_FAIL_OFF = 0x00000200,
156: LOCK_TRACE_ON = 0x00000400,
157: LOCK_TRACE_OFF = 0x00000800,
158: QUEUE_PRINT = 0x00001000,
159: BUFFER_PRINT = 0x00002000,
160: POOL_LOGGING_ON = 0x00004000,
161: POOL_LOGGING_OFF = 0x00008000
162: } str_trace_options;
163:
164:
165: struct strdebug {
166: ULONG trace_cmd;
167: };
168:
169:
170: /*
171: * stream I_PEEK ioctl format
172: */
173:
174: struct strpeek {
175: struct strbuf ctlbuf;
176: struct strbuf databuf;
177: long flags;
178: };
179:
180: /*
181: * receive file descriptor structure
182: */
183: struct strrecvfd {
184: #ifdef INKERNEL
185: union {
186: struct file *fp;
187: int fd;
188: } f;
189: #else
190: int fd;
191: #endif
192: unsigned short uid;
193: unsigned short gid;
194: char fill[8];
195: };
196:
197: #define FMNAMESZ 8
198:
199: struct str_mlist {
200: char l_name[FMNAMESZ+1];
201: };
202:
203: struct str_list {
204: int sl_nmods;
205: struct str_mlist *sl_modlist;
206: };
207:
208: /*
209: * get/putmsg flags
210: */
211:
212: #define RS_HIPRI 1 /* High priority message */
213:
214: #define MORECTL 1
215: #define MOREDATA 2
216:
217:
218: /*
219: * M_SETSIG flags
220: */
221:
222: #define S_INPUT 1
223: #define S_HIPRI 2
224: #define S_OUTPUT 4
225: #define S_MSG 8
226: #define S_ERROR 16
227: #define S_HANGUP 32
228:
229: /*
230: * Flags for MFLUSH messages
231: */
232: #define FLUSHW 01 /* flush downstream */
233: #define FLUSHR 02 /* flush upstream */
234: #define FLUSHRW (FLUSHR | FLUSHW)
235:
236: #endif /* _SYS_STROPTS_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.