Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

218 lines
4.3 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. stropts.h
  5. Abstract:
  6. This module defines the STREAMS ioctl message interface.
  7. Author:
  8. Eric Chin (ericc) July 18, 1991
  9. Revision History:
  10. --*/
  11. /*
  12. * Streams ioctl message interface
  13. *
  14. * @(#)stropts.h 1.19 (Spider) 91/11/27
  15. */
  16. #ifndef _SYS_STROPTS_
  17. #define _SYS_STROPTS_
  18. #ifndef _NTDDSTRM_
  19. #include <ntddstrm.h>
  20. #endif
  21. /*
  22. * Read options
  23. */
  24. #define RNORM 0x00 /* Normal - bytes stream */
  25. #define RMSGD 0x01 /* Message, non-discard mode */
  26. #define RMSGN 0x02 /* Message, discard mode */
  27. #define RMASK 0x0F /* mask for read options */
  28. /*
  29. * Protocol read options
  30. */
  31. #define RPROTNORM 0x00 /* Fail reads with EBADMSG */
  32. #define RPROTDIS 0x10 /* Discard proto part */
  33. #define RPROTDAT 0x20 /* Turn proto part into data */
  34. #define RPROTMASK 0xF0 /* mask for protocol read options */
  35. /*
  36. * Values for I_ATMARK argument
  37. */
  38. #define ANYMARK 0 /* check if message is marked */
  39. #define LASTMARK 1 /* check if last one marked */
  40. /*
  41. * Value for I_SWROPT argument
  42. */
  43. #define NOSNDZERO 0 /* disallow zero length sends */
  44. #define SNDZERO 1 /* permit zero length sends */
  45. /*
  46. * STREAMS ioctl defines
  47. */
  48. #define STR ('S'<<8)
  49. #define I_NREAD (STR|1)
  50. #define I_PUSH (STR|2)
  51. #define I_POP (STR|3)
  52. #define I_LOOK (STR|4)
  53. #define I_FLUSH (STR|5)
  54. #define I_SRDOPT (STR|6)
  55. #define I_GRDOPT (STR|7)
  56. #define I_STR (STR|8)
  57. #define I_SETSIG (STR|9)
  58. #define I_GETSIG (STR|10)
  59. #define I_FIND (STR|11)
  60. #define I_LINK (STR|12)
  61. #define I_UNLINK (STR|13)
  62. #define I_PEEK (STR|15)
  63. #define I_FDINSERT (STR|16)
  64. #define I_SENDFD (STR|17)
  65. #define I_RECVFD (STR|18)
  66. #ifdef SVR2
  67. #define I_GETMSG (STR|19)
  68. #define I_PUTMSG (STR|20)
  69. #define I_GETID (STR|21)
  70. #define I_POLL (STR|22)
  71. #endif /*SVR2*/
  72. #define I_SWROPT (STR|23)
  73. #define I_GWROPT (STR|24)
  74. #define I_LIST (STR|25)
  75. #define I_ATMARK (STR|26)
  76. #define I_SETCLTIME (STR|27)
  77. #define I_GETCLTIME (STR|28)
  78. #define I_PLINK (STR|29)
  79. #define I_PUNLINK (STR|30)
  80. #define I_DEBUG (STR|31)
  81. #define I_CLOSE (STR|32)
  82. #define MUXID_ALL -1
  83. /*
  84. * Structure for I_FDINSERT ioctl
  85. */
  86. struct strfdinsert {
  87. struct strbuf ctlbuf;
  88. struct strbuf databuf;
  89. long flags;
  90. HANDLE fildes;
  91. int offset;
  92. };
  93. /*
  94. * Structures for I_DEBUG ioctl
  95. */
  96. typedef enum _str_trace_options {
  97. MSG_TRACE_PRINT = 0x00000001,
  98. MSG_TRACE_FLUSH = 0x00000002,
  99. MSG_TRACE_ON = 0x00000004,
  100. MSG_TRACE_OFF = 0x00000008,
  101. POOL_TRACE_PRINT = 0x00000010,
  102. POOL_TRACE_FLUSH = 0x00000020,
  103. POOL_TRACE_ON = 0x00000040,
  104. POOL_TRACE_OFF = 0x00000080,
  105. POOL_FAIL_ON = 0x00000100,
  106. POOL_FAIL_OFF = 0x00000200,
  107. LOCK_TRACE_ON = 0x00000400,
  108. LOCK_TRACE_OFF = 0x00000800,
  109. QUEUE_PRINT = 0x00001000,
  110. BUFFER_PRINT = 0x00002000,
  111. POOL_LOGGING_ON = 0x00004000,
  112. POOL_LOGGING_OFF = 0x00008000
  113. } str_trace_options;
  114. struct strdebug {
  115. ULONG trace_cmd;
  116. };
  117. /*
  118. * stream I_PEEK ioctl format
  119. */
  120. struct strpeek {
  121. struct strbuf ctlbuf;
  122. struct strbuf databuf;
  123. long flags;
  124. };
  125. /*
  126. * receive file descriptor structure
  127. */
  128. struct strrecvfd {
  129. #ifdef INKERNEL
  130. union {
  131. struct file *fp;
  132. int fd;
  133. } f;
  134. #else
  135. int fd;
  136. #endif
  137. unsigned short uid;
  138. unsigned short gid;
  139. char fill[8];
  140. };
  141. #define FMNAMESZ 8
  142. struct str_mlist {
  143. char l_name[FMNAMESZ+1];
  144. };
  145. struct str_list {
  146. int sl_nmods;
  147. struct str_mlist *sl_modlist;
  148. };
  149. /*
  150. * get/putmsg flags
  151. */
  152. #define RS_HIPRI 1 /* High priority message */
  153. #define MORECTL 1
  154. #define MOREDATA 2
  155. /*
  156. * M_SETSIG flags
  157. */
  158. #define S_INPUT 1
  159. #define S_HIPRI 2
  160. #define S_OUTPUT 4
  161. #define S_MSG 8
  162. #define S_ERROR 16
  163. #define S_HANGUP 32
  164. /*
  165. * Flags for MFLUSH messages
  166. */
  167. #define FLUSHW 01 /* flush downstream */
  168. #define FLUSHR 02 /* flush upstream */
  169. #define FLUSHRW (FLUSHR | FLUSHW)
  170. #endif /* _SYS_STROPTS_ */