Print this page
12694 race between write() and shutdown() for unix sockets


   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 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  22 /*      All Rights Reserved     */
  23 
  24 
  25 /*
  26  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.

  27  */
  28 
  29 #ifndef _SYS_TIHDR_H
  30 #define _SYS_TIHDR_H
  31 
  32 #include <sys/types.h>
  33 /*
  34  * Include declarations implicit to TPI and shared with user level code
  35  */
  36 #include <sys/tpicommon.h>
  37 
  38 #ifdef  __cplusplus
  39 extern "C" {
  40 #endif
  41 
  42 /*
  43  * The feature test macro, _SUN_TPI_VERSION makes some of additional
  44  * declarations available and changes some existing ones. There was
  45  * some changes done to this interface and this feature test macro
  46  * enables transitioning to those changes while maintaining retaining


 163 #define T_CAPABILITY_REQ        30
 164 #define T_CAPABILITY_ACK        31
 165 #endif /* _SUN_TPI_VERSION > 1 */
 166 
 167 #ifdef _KERNEL
 168 /*
 169  * Sun private TPI extensions. They are currently used for transparently
 170  * passing options through the connection-oriented loopback transport.
 171  * Values assigned to them may change.
 172  *
 173  * T_EXTCONN_IND (extended T_CONN_IND) is used to return dst as well as
 174  * src addr/port.
 175  */
 176 #define T_OPTDATA_REQ   0x1001  /* data (with options) request  */
 177 #define T_OPTDATA_IND   0x1002  /* data (with options) indication */
 178 #define T_EXTCONN_IND   0x1003  /* extended T_CONN_IND to return dst as well */
 179 
 180 #endif /* _KERNEL */
 181 
 182 /*
 183  * The following are the events that drive the state machine
 184  */
 185 /* Initialization events */
 186 #define TE_BIND_REQ     0       /* bind request                         */
 187 #define TE_UNBIND_REQ   1       /* unbind request                       */
 188 #define TE_OPTMGMT_REQ  2       /* manage options req                   */
 189 #define TE_BIND_ACK     3       /* bind acknowledment                   */
 190 #define TE_OPTMGMT_ACK  4       /* manage options ack                   */
 191 #define TE_ERROR_ACK    5       /* error acknowledgment                 */
 192 #define TE_OK_ACK1      6       /* ok ack  seqcnt == 0                  */
 193 #define TE_OK_ACK2      7       /* ok ack  seqcnt == 1, q == resq       */
 194 #define TE_OK_ACK3      8       /* ok ack  seqcnt == 1, q != resq       */
 195 #define TE_OK_ACK4      9       /* ok ack  seqcnt > 1                        */
 196 
 197 /* Connection oriented events */
 198 #define TE_CONN_REQ     10      /* connection request                   */
 199 #define TE_CONN_RES     11      /* connection response                  */
 200 #define TE_DISCON_REQ   12      /* disconnect request                   */
 201 #define TE_DATA_REQ     13      /* data request                         */
 202 #define TE_EXDATA_REQ   14      /* expedited data request               */
 203 #define TE_ORDREL_REQ   15      /* orderly release req                  */
 204 #define TE_CONN_IND     16      /* connection indication                */
 205 #define TE_CONN_CON     17      /* connection confirmation              */
 206 #define TE_DATA_IND     18      /* data indication                      */
 207 #define TE_EXDATA_IND   19      /* expedited data indication            */
 208 #define TE_ORDREL_IND   20      /* orderly release ind                  */
 209 #define TE_DISCON_IND1  21      /* disconnect indication seq == 0       */
 210 #define TE_DISCON_IND2  22      /* disconnect indication seq == 1       */
 211 #define TE_DISCON_IND3  23      /* disconnect indication seq > 1     */
 212 #define TE_PASS_CONN    24      /* pass connection                      */
 213 
 214 /* Unit data events */
 215 #define TE_UNITDATA_REQ 25      /* unitdata request                     */
 216 #define TE_UNITDATA_IND 26      /* unitdata indication                  */
 217 #define TE_UDERROR_IND  27      /* unitdata error indication            */
 218 
 219 #define TE_NOEVENTS     28
 220 /*
 221  * The following are the possible states of the Transport
 222  * Service Interface
 223  */
 224 
 225 #define TS_UNBND                0       /* unbound                      */
 226 #define TS_WACK_BREQ            1       /* waiting ack of BIND_REQ      */
 227 #define TS_WACK_UREQ            2       /* waiting ack of UNBIND_REQ    */
 228 #define TS_IDLE                 3       /* idle                         */
 229 #define TS_WACK_OPTREQ          4       /* wait ack options request     */
 230 #define TS_WACK_CREQ            5       /* waiting ack of CONN_REQ      */
 231 #define TS_WCON_CREQ            6       /* waiting confirm of CONN_REQ  */
 232 #define TS_WRES_CIND            7       /* waiting response of CONN_IND */
 233 #define TS_WACK_CRES            8       /* waiting ack of CONN_RES      */
 234 #define TS_DATA_XFER            9       /* data transfer                */
 235 #define TS_WIND_ORDREL          10      /* releasing rd but not wr      */
 236 #define TS_WREQ_ORDREL          11      /* wait to release wr but not rd */
 237 #define TS_WACK_DREQ6           12      /* waiting ack of DISCON_REQ    */
 238 #define TS_WACK_DREQ7           13      /* waiting ack of DISCON_REQ    */
 239 #define TS_WACK_DREQ9           14      /* waiting ack of DISCON_REQ    */
 240 #define TS_WACK_DREQ10          15      /* waiting ack of DISCON_REQ    */




   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 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  22 /*      All Rights Reserved     */
  23 
  24 
  25 /*
  26  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  27  * Copyright 2020 Joyent, Inc.
  28  */
  29 
  30 #ifndef _SYS_TIHDR_H
  31 #define _SYS_TIHDR_H
  32 
  33 #include <sys/types.h>
  34 /*
  35  * Include declarations implicit to TPI and shared with user level code
  36  */
  37 #include <sys/tpicommon.h>
  38 
  39 #ifdef  __cplusplus
  40 extern "C" {
  41 #endif
  42 
  43 /*
  44  * The feature test macro, _SUN_TPI_VERSION makes some of additional
  45  * declarations available and changes some existing ones. There was
  46  * some changes done to this interface and this feature test macro
  47  * enables transitioning to those changes while maintaining retaining


 164 #define T_CAPABILITY_REQ        30
 165 #define T_CAPABILITY_ACK        31
 166 #endif /* _SUN_TPI_VERSION > 1 */
 167 
 168 #ifdef _KERNEL
 169 /*
 170  * Sun private TPI extensions. They are currently used for transparently
 171  * passing options through the connection-oriented loopback transport.
 172  * Values assigned to them may change.
 173  *
 174  * T_EXTCONN_IND (extended T_CONN_IND) is used to return dst as well as
 175  * src addr/port.
 176  */
 177 #define T_OPTDATA_REQ   0x1001  /* data (with options) request  */
 178 #define T_OPTDATA_IND   0x1002  /* data (with options) indication */
 179 #define T_EXTCONN_IND   0x1003  /* extended T_CONN_IND to return dst as well */
 180 
 181 #endif /* _KERNEL */
 182 
 183 /*






































 184  * The following are the possible states of the Transport
 185  * Service Interface
 186  */
 187 
 188 #define TS_UNBND                0       /* unbound                      */
 189 #define TS_WACK_BREQ            1       /* waiting ack of BIND_REQ      */
 190 #define TS_WACK_UREQ            2       /* waiting ack of UNBIND_REQ    */
 191 #define TS_IDLE                 3       /* idle                         */
 192 #define TS_WACK_OPTREQ          4       /* wait ack options request     */
 193 #define TS_WACK_CREQ            5       /* waiting ack of CONN_REQ      */
 194 #define TS_WCON_CREQ            6       /* waiting confirm of CONN_REQ  */
 195 #define TS_WRES_CIND            7       /* waiting response of CONN_IND */
 196 #define TS_WACK_CRES            8       /* waiting ack of CONN_RES      */
 197 #define TS_DATA_XFER            9       /* data transfer                */
 198 #define TS_WIND_ORDREL          10      /* releasing rd but not wr      */
 199 #define TS_WREQ_ORDREL          11      /* wait to release wr but not rd */
 200 #define TS_WACK_DREQ6           12      /* waiting ack of DISCON_REQ    */
 201 #define TS_WACK_DREQ7           13      /* waiting ack of DISCON_REQ    */
 202 #define TS_WACK_DREQ9           14      /* waiting ack of DISCON_REQ    */
 203 #define TS_WACK_DREQ10          15      /* waiting ack of DISCON_REQ    */