home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / chanmux.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  2.2 KB  |  91 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. #ident    "@(#)/usr/include/sys/chanmux.h.sl 1.1 4.0 12/08/90 18539 AT&T-USL"
  11.  
  12. #ifndef    _SYS_CHANMUX_H
  13. #define    _SYS_CHANMUX_H
  14.  
  15. #define    CMUX_NUMSWTCH    10    /* keep history of last 10 switches */
  16. #define    CMUXPSZ    32        /* maximun output packet size */
  17.  
  18. typedef struct cmux_stat {
  19.     unsigned long cmux_num;
  20.     unsigned long cmux_flg;
  21.     queue_t *cmux_rqp;        /* saved pointer to read queue */
  22.     queue_t *cmux_wqp;        /* saved pointer to write queue */
  23.     struct ws_stat *cmux_wsp;
  24.     unsigned long cmux_enqueue;    /* should messages be enqueued? */
  25.     dev_t cmux_dev;            /* device number for this channel */
  26. } cmux_t;
  27.  
  28. struct cmux_swtch {
  29.     clock_t sw_time;
  30.     unsigned long sw_chan; /* channel number made active */
  31. };
  32.  
  33.  
  34. typedef struct cmux_linkblk {
  35.     unsigned long cmlb_iocresp; /* ACK or NACK? */
  36.     unsigned long cmlb_flg; /* in use? */
  37.     mblk_t *cmlb_iocmsg;
  38.     unsigned long cmlb_err;
  39.     struct linkblk cmlb_lblk;
  40. } cmux_link_t;
  41.  
  42.  
  43. typedef struct ws_stat {
  44.     unsigned long w_ioctlchan;
  45.     unsigned long w_ioctllstrm;
  46.     unsigned long w_ioctlcnt;
  47.     mblk_t *w_iocmsg;
  48.     unsigned long w_state;
  49.     cmux_t **w_cmuxpp;
  50.     unsigned long w_numchan;
  51.     cmux_link_t *w_princp; /* numchan allocated */
  52.     cmux_link_t *w_lstrmsp;
  53.     unsigned long w_numlstrms;
  54.     unsigned long w_lstrms;
  55.     unsigned long w_numswitch;
  56.     struct cmux_swtch w_swtchtimes[CMUX_NUMSWTCH];
  57. } cmux_ws_t;
  58.  
  59.  
  60. typedef struct cmux_lstrm {
  61.     cmux_ws_t *lstrm_wsp;
  62.     unsigned long lstrm_flg;
  63.     unsigned long lstrm_id;
  64.     unsigned long lstrm_err;
  65. } cmux_lstrm_t;
  66.  
  67.  
  68. #define    MAXCMUXPSZ    1024
  69. #define    CMUX_STRMALLOC    2
  70. #define    CMUX_CHANALLOC    8
  71. #define CMUX_WSALLOC    4
  72.  
  73.  
  74. /*
  75.  * Internal state bits.
  76.  */
  77.  
  78. #define    CMUX_OPEN    0x1
  79. #define    CMUX_CLOSE    0x2
  80. #define    CMUX_WCLOSE    0x4
  81. #define    CMUX_IOCTL    0x8
  82.  
  83. /*
  84.  * cmux_lstrm_t flag bits
  85.  */
  86.  
  87. #define    CMUX_SECSTRM    0x1
  88. #define    CMUX_PRINCSTRM    0x2
  89. #define    CMUX_PRINCSLEEP    0x4
  90. #endif /* _SYS_CHANMUX_H */
  91.