home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / lihdr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  5.5 KB  |  212 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_LIHDR_H
  11. #define _SYS_LIHDR_H
  12.  
  13. #ident    "@(#)/usr/include/sys/lihdr.h.sl 1.1 4.0 12/08/90 31676 AT&T-USL"
  14.  
  15. /*
  16.  * Data Link Level Interface standard definitions.
  17.  */
  18.  
  19.  
  20. /*
  21.  *    Primitive that are initiated by the Link-Layer user
  22.  */
  23.  
  24. #define    DL_INFO_REQ    0    /* data link layer protocol parameter sizes*/
  25. #define DL_BIND_REQ    1    /* bind protocol address request        */
  26. #define    DL_UNBIND_REQ    2    /* unbind protocol address request        */
  27. #define    DL_UNITDATA_REQ    7    /* unit_data send request            */
  28.  
  29.  
  30. /*
  31.  *    Primitives that are initiated by the Link-Layer provider
  32.  */
  33.  
  34. #define    DL_INFO_ACK    3    /* protocol information acknowledgement */
  35. #define    DL_BIND_ACK    4    /* protocol bind acknowledgement     */
  36. #define    DL_ERROR_ACK    5    /* error acknowledgement         */
  37. #define    DL_OK_ACK    6    /* success acknowledgement         */
  38. #define    DL_UNITDATA_IND    8    /* unitdata receive indication         */
  39. #define    DL_UDERROR_IND    9    /* unitdata receive indication         */
  40.  
  41.  
  42. /*
  43.  *    Primitive Non-fatal error return codes
  44.  */
  45.  
  46. #define DLBADSAP    0    /* bad LSAP selector             */
  47. #define    DLACCES        2    /* inproper permissions          */
  48. #define    DLOUTSTATE    3    /* Link layer interface out of state     */
  49. #define    DLSYSERR    4    /* Unix system error              */
  50.  
  51.  
  52. /*
  53.  *    Subnetwork types
  54.  */
  55.  
  56. #define    DL_CSMACD    0    /* CSMA/CD network (802.3)   */
  57. #define    DL_TPB        1    /* Token Passing Bus (802.4) */
  58. #define    DL_TPR        2    /* Token Ring Bus (802.5)    */
  59. #define    DL_METRO    3    /* Metro Net (802.6)         */
  60. #define    DL_ETHER    4    /* ETHERNET bus          */
  61.  
  62.  
  63. /*
  64.  *    Link-Layer service classes
  65.  */
  66.  
  67. #define    DL_NOSERV    0    /* No service class    */
  68. #define    DL_CLASSES    1    /* Has a service class */
  69.  
  70.  
  71. /*
  72.  *    Link-Layer current state definitions
  73.  */
  74.  
  75. #define    DL_UNBND    0    /* LL not bound          */
  76. #define    DL_WACK_B    1    /* LL waiting for bind ack   */
  77. #define    DL_WACK_U    2    /* LL waiting for unbind ack */
  78. #define    DL_IDLE        3    /* LL is active             */
  79.  
  80.  
  81. /*
  82.  * The following structure definitions define the format of the 
  83.  * streams message blocks used to define the Link-Layer Interface.
  84.  */
  85.  
  86.  
  87. /* 
  88.  *    User Originated Primitives
  89.  */
  90.  
  91. struct DL_info_req {
  92.     long    PRIM_type;        /* always DL_INFO_REQ */
  93. };
  94.  
  95.  
  96. struct    DL_bind_req {
  97.     long    PRIM_type;        /* always DL_BIND_REQ */
  98.     long    LLC_sap;        /* the LSAP selector */
  99.     long    GROWTH_field[2];    /* 802.2 llc type 2 fields */
  100. };
  101.  
  102.  
  103. struct DL_unbind_req {
  104.     long    PRIM_type;        /* always DL_UNBIND_REQ */
  105. };
  106.  
  107.  
  108. struct DL_unitdata_req {
  109.     long    PRIM_type;        /* always DL_UNITDATA_REQ */
  110.     long    RA_length;        /* dest LSAP addr length */
  111.     long    RA_offset;        /* dest LSAP addr offset */
  112.     long    SERV_class;        /* service class */
  113.     long    FILLER_field;        /* 802.2 LLC2 field */
  114. };
  115.  
  116.  
  117. /* 
  118.  *    Provider Originated Primitives
  119.  */
  120.  
  121. struct DL_info_ack {
  122.     long    PRIM_type;        /* always DL_INFO_ACK */
  123.     long    SDU_max;        /* max lsdu size */
  124.     long    SDU_min;        /* min lsdu size */
  125.     long    ADDR_length;        /* LSAP address length in bytes */
  126.     long    SUBNET_type;        /* subnet type */
  127.     long    SERV_class;        /* service class */
  128.     long    CURRENT_state;        /* link layer state */
  129.     long    GROWTH_field[2];    /* 802.2 LLC2 fields */
  130. };
  131.  
  132.  
  133. struct DL_bind_ack {
  134.     long    PRIM_type;        /* always DL_BIND_ACK */
  135.     long    LLC_sap;        /* lsap selector */
  136.     long    ADDR_length;        /* LSAP address length in bytes */
  137.     long    ADDR_offset;        /* LSAP address offset in the message */
  138.     long    GROWTH_field[2];    /* 802.2 LLC2 fields */
  139. };
  140.  
  141.  
  142. struct DL_error_ack {
  143.     long    PRIM_type;        /* always DL_ERROR_ACK */
  144.     long    ERROR_prim;        /* primitive in error */
  145.     long    LLC_error;        /* LLC error code */
  146.     long    UNIX_error;        /* UNIX error code */
  147. };
  148.  
  149.  
  150. struct DL_ok_ack {
  151.     long    PRIM_type;        /* always DL_OK_ACK */
  152.     long    CORRECT_prim;        /* correct primitive */
  153. };
  154.  
  155.  
  156. struct DL_unitdata_ind {
  157.     long    PRIM_type;        /* always DL_UNITDATA_IND */
  158.     long    RA_length;        /* dest LSAP address length in bytes */
  159.     long    RA_offset;        /* dest offset LSAP into message */
  160.     long    LA_length;        /* src LSAP address length in bytes */
  161.     long    LA_offset;        /* src offset LSAP into message */
  162.     long    SERV_class;        /* service class */
  163. };
  164.  
  165.  
  166. struct DL_uderror_ind {
  167.     long    PRIM_type;        /* always DL_UDERROR_IND */
  168.     long    RA_length;        /* dest LSAP address length in bytes */
  169.     long    RA_offset;        /* dest LSAP offset into msg in bytes */
  170.     long    SERV_class;        /* service class */
  171.     long    ERROR_type;        /* error type */
  172. };
  173.  
  174.  
  175. /*
  176.  *     The following is a union of all the primitives.
  177.  */
  178.  
  179. union DL_primitives {
  180.     long            prim_type;
  181.     struct DL_info_req    info_req;
  182.     struct DL_bind_req    bind_req;
  183.     struct DL_unbind_req    unbind_req;
  184.     struct DL_unitdata_req    data_req;
  185.     struct DL_info_ack    info_ack;
  186.     struct DL_bind_ack    bind_ack;
  187.     struct DL_error_ack    error_ack;
  188.     struct DL_ok_ack    ok_ack;
  189.     struct DL_unitdata_ind    data_ind;
  190.     struct DL_uderror_ind    error_ind;
  191. };
  192.  
  193.  
  194. /*
  195.  *    Structure/union size constants.
  196.  */
  197.  
  198. #define DL_INFO_REQ_SIZE    sizeof(struct DL_info_req)
  199. #define DL_BIND_REQ_SIZE    sizeof(struct DL_bind_req)
  200. #define DL_UNBIND_REQ_SIZE    sizeof(struct DL_unbind_req)
  201. #define DL_INFO_ACK_SIZE    sizeof(struct DL_info_ack)
  202. #define DL_BIND_ACK_SIZE    sizeof(struct DL_bind_ack)
  203. #define DL_ERROR_ACK_SIZE    sizeof(struct DL_error_ack)
  204. #define DL_OK_ACK_SIZE        sizeof(struct DL_ok_ack)
  205. #define DL_UNITDATA_REQ_SIZE    sizeof(struct DL_unitdata_req)
  206. #define DL_UNITDATA_IND_SIZE    sizeof(struct DL_unitdata_ind)
  207. #define DL_UDERROR_IND_SIZE    sizeof(struct DL_uderror_ind)
  208. #define DL_PRIMITIVES_SIZE    sizeof(union DL_primitives)
  209.  
  210.  
  211. #endif    /* _SYS_LIHDR_H */
  212.