home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 202.img / SCO386N2.TD0 / usr / include / sys / tihdr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-18  |  11.8 KB  |  377 lines

  1. /*
  2.  *    @(#) tihdr.h 1.1 88/05/18 
  3.  *
  4.  *    Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987, 1988.
  5.  *    Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987, 1988.
  6.  *    This Module contains Proprietary Information of
  7.  *    The Santa Cruz Operation, Microsoft Corporation
  8.  *    and AT&T, and should be treated as Confidential.
  9.  */
  10.  
  11. /*
  12.  * THIS FILE CONTAINS CODE WHICH IS DESIGNED TO BE
  13.  * PORTABLE BETWEEN DIFFERENT MACHINE ARCHITECTURES
  14.  * AND CONFIGURATIONS. IT SHOULD NOT REQUIRE ANY
  15.  * MODIFICATIONS WHEN ADAPTING XENIX TO NEW HARDWARE.
  16.  */
  17.  
  18. /*
  19.  * The following is all the information
  20.  * needed by the Transport Service Interface.
  21.  */
  22.  
  23.  
  24. /* Number of TLI service end points.  NOTE: This needs to
  25.    be made configurable asap.
  26.  */
  27. #define NTLISP        64
  28.  
  29.  
  30. /* 
  31.  * The following are the definitions of the Transport
  32.  * Service Interface primitives.
  33.  */
  34.  
  35. /* 
  36.  * Primitives that are initiated by the transport user.
  37.  */
  38.  
  39. #define    T_CONN_REQ    0    /* connection request     */
  40. #define T_CONN_RES    1    /* connection response    */
  41. #define T_DISCON_REQ    2    /* disconnect request     */
  42. #define T_DATA_REQ    3    /* data request              */
  43. #define T_EXDATA_REQ    4    /* expedited data request */
  44. #define T_INFO_REQ    5    /* information request    */
  45. #define T_BIND_REQ    6    /* bind request          */
  46. #define T_UNBIND_REQ    7    /* unbind request      */
  47. #define T_UNITDATA_REQ    8    /* unitdata request       */
  48. #define T_OPTMGMT_REQ   9    /* manage options req     */
  49. #define T_ORDREL_REQ   10       /* orderly release req    */
  50.  
  51. /* 
  52.  * Primitives that are initiated by the transport provider.
  53.  */
  54.  
  55. #define T_CONN_IND    11    /* connection indication      */
  56. #define T_CONN_CON    12    /* connection confirmation    */
  57. #define T_DISCON_IND    13    /* disconnect indication      */
  58. #define T_DATA_IND    14    /* data indication          */
  59. #define T_EXDATA_IND    15    /* expeditied data indication */
  60. #define T_INFO_ACK    16    /* information acknowledgment */
  61. #define T_BIND_ACK    17    /* bind acknowledment          */
  62. #define T_ERROR_ACK    18    /* error acknowledgment       */
  63. #define T_OK_ACK    19    /* ok acknowledgment          */
  64. #define T_UNITDATA_IND    20    /* unitdata indication          */
  65. #define T_UDERROR_IND    21    /* unitdata error indication  */
  66. #define T_OPTMGMT_ACK   22      /* manage options ack         */
  67. #define T_ORDREL_IND    23      /* orderly release ind           */
  68.  
  69. /*
  70.  * The following are the events that drive the state machine
  71.  */
  72. /* Initialization events */
  73. #define TE_BIND_REQ    0    /* bind request                  */
  74. #define TE_UNBIND_REQ    1    /* unbind request              */
  75. #define TE_OPTMGMT_REQ  2    /* manage options req             */
  76. #define TE_BIND_ACK    3    /* bind acknowledment                  */
  77. #define TE_OPTMGMT_ACK  4       /* manage options ack                 */
  78. #define TE_ERROR_ACK    5    /* error acknowledgment               */
  79. #define TE_OK_ACK1    6    /* ok ack  seqcnt == 0               */
  80. #define TE_OK_ACK2    7    /* ok ack  seqcnt == 1, q == resq          */
  81. #define TE_OK_ACK3    8    /* ok ack  seqcnt == 1, q != resq       */
  82. #define TE_OK_ACK4    9    /* ok ack  seqcnt > 1                */
  83.  
  84. /* Connection oriented events */
  85. #define    TE_CONN_REQ    10    /* connection request             */
  86. #define TE_CONN_RES    11    /* connection response            */
  87. #define TE_DISCON_REQ    12    /* disconnect request             */
  88. #define TE_DATA_REQ    13    /* data request                      */
  89. #define TE_EXDATA_REQ    14    /* expedited data request         */
  90. #define TE_ORDREL_REQ   15      /* orderly release req            */
  91. #define TE_CONN_IND    16    /* connection indication              */
  92. #define TE_CONN_CON    17    /* connection confirmation            */
  93. #define TE_DATA_IND    18    /* data indication                  */
  94. #define TE_EXDATA_IND    19    /* expedited data indication         */
  95. #define TE_ORDREL_IND   20      /* orderly release ind                   */
  96. #define TE_DISCON_IND1    21    /* disconnect indication seq == 0          */
  97. #define TE_DISCON_IND2    22    /* disconnect indication seq == 1       */
  98. #define TE_DISCON_IND3    23    /* disconnect indication seq > 1      */
  99. #define TE_PASS_CONN    24    /* pass connection                   */
  100.  
  101. /* Unit data events */
  102. #define TE_UNITDATA_REQ    25    /* unitdata request               */
  103. #define TE_UNITDATA_IND    26    /* unitdata indication                  */
  104. #define TE_UDERROR_IND    27    /* unitdata error indication          */
  105.  
  106. #define TE_NOEVENTS    28
  107. /*
  108.  * The following are the possible states of the Transport
  109.  * Service Interface
  110.  */
  111.  
  112. #define TS_UNBND        0    /* unbound                    */
  113. #define    TS_WACK_BREQ        1    /* waiting ack of BIND_REQ      */
  114. #define TS_WACK_UREQ        2    /* waiting ack of UNBIND_REQ    */
  115. #define TS_IDLE            3    /* idle                 */
  116. #define TS_WACK_OPTREQ        4    /* wait ack options request     */
  117. #define TS_WACK_CREQ        5    /* waiting ack of CONN_REQ      */
  118. #define TS_WCON_CREQ        6    /* waiting confirm of CONN_REQ  */
  119. #define    TS_WRES_CIND        7    /* waiting response of CONN_IND */
  120. #define TS_WACK_CRES        8    /* waiting ack of CONN_RES      */
  121. #define TS_DATA_XFER        9    /* data transfer        */
  122. #define TS_WIND_ORDREL         10    /* releasing rd but not wr      */
  123. #define TS_WREQ_ORDREL        11      /* wait to release wr but not rd*/
  124. #define TS_WACK_DREQ6        12    /* waiting ack of DISCON_REQ    */
  125. #define TS_WACK_DREQ7        13    /* waiting ack of DISCON_REQ    */
  126. #define TS_WACK_DREQ9        14    /* waiting ack of DISCON_REQ    */
  127. #define TS_WACK_DREQ10        15    /* waiting ack of DISCON_REQ    */
  128. #define TS_WACK_DREQ11        16    /* waiting ack of DISCON_REQ    */
  129.  
  130. #define TS_NOSTATES        17
  131.  
  132.  
  133. /* 
  134.  * The following structure definitions define the format of the
  135.  * stream message block of the above primitives.
  136.  * (everything is declared long to ensure proper alignment
  137.  *  across different machines)
  138.  */
  139.  
  140. /* connection request */
  141.  
  142. struct T_conn_req {
  143.     long    PRIM_type;    /* always T_CONN_REQ  */
  144.     long    DEST_length;    /* dest addr length   */
  145.     long    DEST_offset;    /* dest addr offset   */
  146.     long    OPT_length;    /* options length     */
  147.     long    OPT_offset;    /* options offset     */
  148. };
  149.  
  150. /* connect response */
  151.  
  152. struct T_conn_res {
  153.     long    PRIM_type;    /* always T_CONN_RES       */
  154.     queue_t *QUEUE_ptr;    /* responding queue ptr    */
  155.     long    OPT_length;    /* options length          */
  156.     long    OPT_offset;    /* options offset          */
  157.     long    SEQ_number;    /* sequence number          */
  158. };
  159.  
  160. /* disconnect request */
  161.  
  162. struct T_discon_req {
  163.     long    PRIM_type;    /* always T_DISCON_REQ */
  164.     long    SEQ_number;    /* sequnce number      */
  165. };
  166.  
  167. /* data request */
  168.  
  169. struct T_data_req {
  170.     long    PRIM_type;    /* always T_DATA_REQ */
  171.     long    MORE_flag;    /* more data         */
  172. };
  173.  
  174. /* expedited data request */
  175.  
  176. struct T_exdata_req {
  177.     long    PRIM_type;    /* always T_EXDATA_REQ */
  178.     long    MORE_flag;    /* more data           */
  179. };
  180.  
  181. /* information request */
  182.  
  183. struct T_info_req {
  184.     long    PRIM_type;    /* always T_INFO_REQ */
  185. };
  186.  
  187. /* bind request */
  188.  
  189. struct T_bind_req {
  190.     long        PRIM_type;    /* always T_BIND_REQ            */
  191.     long        ADDR_length;    /* addr length                    */
  192.     long        ADDR_offset;    /* addr offset                    */
  193.     unsigned long    CONIND_number;    /*connect indications requested */
  194. };
  195.  
  196. /* unbind request */
  197.  
  198. struct T_unbind_req {
  199.     long    PRIM_type;    /* always T_UNBIND_REQ */
  200. };
  201.  
  202. /* unitdata request */
  203.  
  204. struct T_unitdata_req {
  205.     long    PRIM_type;    /* always T_UNITDATA_REQ  */
  206.     long    DEST_length;    /* dest addr length       */
  207.     long    DEST_offset;    /* dest addr offset       */
  208.     long    OPT_length;    /* options length         */
  209.     long    OPT_offset;    /* options offset         */
  210. };
  211.  
  212. /* manage options request */
  213.  
  214. struct T_optmgmt_req {
  215.     long    PRIM_type;    /* always T_OPTMGMT_REQ   */
  216.     long    OPT_length;    /* options length         */
  217.     long    OPT_offset;    /* options offset         */
  218.     long    MGMT_flags;    /* options flags          */
  219. };
  220.  
  221. /* orderly release request */
  222.  
  223. struct T_ordrel_req {
  224.     long    PRIM_type;    /* always T_ORDREL_REQ */
  225. };
  226.  
  227. /* connect indication */
  228.  
  229. struct T_conn_ind {
  230.     long    PRIM_type;    /* always T_CONN_IND */
  231.     long    SRC_length;    /* src addr length   */
  232.     long    SRC_offset;    /* src addr offset   */
  233.     long    OPT_length;    /* option length     */
  234.     long    OPT_offset;    /* option offset     */
  235.     long    SEQ_number;    /* sequnce number    */
  236. };
  237.  
  238. /* connect confirmation */
  239.  
  240. struct T_conn_con {
  241.     long    PRIM_type;    /* always T_CONN_CON      */
  242.     long    RES_length;    /* responding addr length */
  243.     long    RES_offset;    /* responding addr offset */
  244.     long    OPT_length;    /* option length          */
  245.     long    OPT_offset;    /* option offset          */
  246. };
  247.  
  248. /* disconnect indication */
  249.  
  250. struct T_discon_ind {
  251.     long    PRIM_type;    /* always T_DISCON_IND     */
  252.     long    DISCON_reason;    /* disconnect reason    */
  253.     long    SEQ_number;    /* sequnce number       */
  254. };
  255.  
  256. /* data indication */
  257.  
  258. struct T_data_ind {
  259.     long     PRIM_type;    /* always T_DATA_IND */
  260.     long    MORE_flag;    /* more data          */
  261. };
  262.  
  263. /* expedited data indication */
  264.  
  265. struct T_exdata_ind {
  266.     long    PRIM_type;    /* always T_EXDATA_IND */
  267.     long    MORE_type;    /* more data           */
  268. };
  269.  
  270. /* information acknowledgment */
  271.  
  272. struct T_info_ack {
  273.     long    PRIM_type;    /* always T_INFO_ACK     */
  274.     long    TSDU_size;    /* max TSDU size         */
  275.     long    ETSDU_size;    /* max ETSDU size        */
  276.     long    CDATA_size;    /* max connect data size */
  277.     long    DDATA_size;    /* max discon data size  */
  278.     long    ADDR_size;    /* address size         */
  279.     long    OPT_size;    /* options size         */
  280.     long    TIDU_size;    /* max TIDU size         */
  281.     long    SERV_type;    /* provider service type */
  282.     long    CURRENT_state;  /* current state         */
  283. };
  284.  
  285. /* bind acknowledgment */
  286.  
  287. struct T_bind_ack {
  288.     long        PRIM_type;    /* always T_BIND_ACK        */
  289.     long        ADDR_length;    /* addr length              */
  290.     long        ADDR_offset;    /* addr offset              */
  291.     unsigned long    CONIND_number;    /* connect ind to be queued */
  292. };
  293.  
  294. /* error acknowledgment */
  295.  
  296. struct T_error_ack { 
  297.     long     PRIM_type;    /* always T_ERROR_ACK  */
  298.     long    ERROR_prim;    /* primitive in error  */
  299.     long    TLI_error;    /* TLI error code      */
  300.     long    UNIX_error;    /* UNIX error code     */
  301. };
  302.  
  303. /* ok acknowledgment */
  304.  
  305. struct T_ok_ack {
  306.     long     PRIM_type;    /* always T_OK_ACK   */
  307.     long    CORRECT_prim;    /* correct primitive */
  308. };
  309.  
  310. /* unitdata indication */
  311.  
  312. struct T_unitdata_ind {
  313.     long    PRIM_type;    /* always T_UNITDATA_IND  */
  314.     long    SRC_length;    /* source addr length     */
  315.     long    SRC_offset;    /* source addr offset     */
  316.     long    OPT_length;    /* options length         */
  317.     long    OPT_offset;    /* options offset         */
  318. };
  319.  
  320. /* unitdata error indication */
  321.  
  322. struct T_uderror_ind {
  323.     long    PRIM_type;    /* always T_UDERROR_IND   */
  324.     long    DEST_length;    /* dest addr length       */
  325.     long    DEST_offset;    /* dest addr offset       */
  326.     long    OPT_length;    /* options length         */
  327.     long    OPT_offset;    /* options offset         */
  328.     long    ERROR_type;    /* error type              */
  329. };
  330.  
  331. /* manage options ack */
  332.  
  333. struct T_optmgmt_ack {
  334.     long    PRIM_type;    /* always T_OPTMGMT_ACK   */
  335.     long    OPT_length;    /* options length         */
  336.     long    OPT_offset;    /* options offset         */
  337.     long    MGMT_flags;    /* managment flags        */
  338. };
  339.  
  340. /* orderly release indication */
  341.  
  342. struct T_ordrel_ind {
  343.     long    PRIM_type;    /* always T_ORDREL_IND */
  344. };
  345.  
  346. /*
  347.  * The following is a union of the primitives
  348.  */
  349. union T_primitives {
  350.     long            type;        /* primitive type     */
  351.     struct T_conn_req    conn_req;    /* connect request    */
  352.     struct T_conn_res    conn_res;    /* connect response   */
  353.     struct T_discon_req    discon_req;    /* disconnect request */
  354.     struct T_data_req    data_req;    /* data request       */
  355.     struct T_exdata_req    exdata_req;    /* expedited data req */
  356.     struct T_info_req    info_req;    /* information req    */
  357.     struct T_bind_req    bind_req;    /* bind request       */
  358.     struct T_unbind_req    unbind_req;    /* unbind request     */
  359.     struct T_unitdata_req    unitdata_req;    /* unitdata requset   */
  360.     struct T_optmgmt_req    optmgmt_req;    /* manage opt req     */
  361.     struct T_ordrel_req    ordrel_req;    /* orderly rel req    */
  362.     struct T_conn_ind    conn_ind;    /* connect indication */
  363.     struct T_conn_con    conn_con;    /* connect corfirm    */
  364.     struct T_discon_ind    discon_ind;    /* discon indication  */
  365.     struct T_data_ind    data_ind;    /* data indication    */
  366.     struct T_exdata_ind    exdata_ind;    /* expedited data ind */
  367.     struct T_info_ack    info_ack;    /* info ack          */
  368.     struct T_bind_ack    bind_ack;    /* bind ack          */
  369.     struct T_error_ack    error_ack;    /* error ack          */
  370.     struct T_ok_ack        ok_ack;        /* ok ack          */
  371.     struct T_unitdata_ind    unitdata_ind;    /* unitdata ind       */
  372.     struct T_uderror_ind    uderror_ind;    /* unitdata error ind */
  373.     struct T_optmgmt_ack    optmgmt_ack;    /* manage opt ack     */
  374.     struct T_ordrel_ind    ordrel_ind;    /* orderly rel ind    */
  375. };
  376.  
  377.