home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d145 / dnet.lha / Dnet / unix / dnet / channel.h next >
Text File  |  1988-05-26  |  2KB  |  78 lines

  1.  
  2. /*
  3.  *  CHANNEL.H
  4.  *
  5.  *    DNET (c)Copyright 1988, Matthew Dillon, All Rights Reserved
  6.  *
  7.  *  Channel structures for SCMD_* channel commands.
  8.  *
  9.  *  NOTE: These structures may be ONLY 0,2,4, or 6 bytes in size.
  10.  */
  11.  
  12. #define CSWITCH struct _CSWITCH
  13. #define COPEN    struct _COPEN
  14. #define CCLOSE    struct _CCLOSE
  15. #define CACKCMD struct _CACKCMD
  16. #define CEOFCMD struct _CEOFCMD
  17. #define CIOCTL  struct _CIOCTL
  18.  
  19. CSWITCH {        /*  SWITCH current data channel */
  20.     ubyte   chanh;    /*  channel to switch to    */
  21.     ubyte   chanl;
  22. };
  23.  
  24. COPEN {         /*  OPEN port on channel    */
  25.     ubyte   chanh;    /*  try to use this channel     */
  26.     ubyte   chanl;
  27.     ubyte   porth;    /*  requested port from client  */
  28.     ubyte   portl;
  29.     ubyte   error;    /*  error return 0=ok        */
  30.     char    pri;    /*  chan. priority -127 to 126  */
  31. };
  32.  
  33. CCLOSE {        /*  CLOSE a channel        */
  34.     ubyte   chanh;    /*  channel to close        */
  35.     ubyte   chanl;
  36. };
  37.  
  38. CACKCMD {        /*  Acknowledge an open            */
  39.     ubyte   chanh;    /*  channel               */
  40.     ubyte   chanl;
  41.     ubyte   error;    /*  0=ok 1=fail 33=retry w/ different channel    */
  42.     ubyte   filler;
  43. };
  44.  
  45. CEOFCMD {        /*  Send [R/W] EOF        */
  46.     ubyte   chanh;    /*  channel to send EOF on    */
  47.     ubyte   chanl;
  48.     ubyte   flags;    /*  CHANF_ROK/WOK (bits to clear)  */
  49.     ubyte   filler;
  50. };
  51.  
  52. CIOCTL {
  53.     ubyte   chanh;    /* channel            */
  54.     ubyte   chanl;
  55.     ubyte   cmd;    /* ioctl command        */
  56.     ubyte   valh;    /* ioctl value            */
  57.     ubyte   vall;
  58.     ubyte   valaux;    /* auxillary field        */
  59. };
  60.  
  61. #define CIO_SETROWS    1    /* PTY's only            */
  62. #define CIO_SETCOLS    2    /* PTY's only            */
  63. #define CIO_STOP    3    /* any channel, flow control    */
  64. #define CIO_START    4    /* any channel, flow control    */
  65. #define CIO_FLUSH    5    /* any channel, flush pending     */  
  66.                 /* writes down the toilet    */
  67.  
  68. #define CHAN    struct _CHAN
  69.  
  70. CHAN {
  71.     int        fd;        /*    file descriptor for channel        */
  72.     uword   port;    /*    port#  (used in open sequence)        */
  73.     ubyte   state;    /*    state of channel            */
  74.     ubyte   flags;    /*    channel flags                */
  75.     char    pri;    /*    priority of channel            */
  76. };
  77.  
  78.