home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / nxtproto.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  2.5 KB  |  70 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_NXTPROTO_H
  11. #define _SYS_NXTPROTO_H
  12.  
  13. #ident    "@(#)/usr/include/sys/nxtproto.h.sl 1.1 4.0 12/08/90 52143 AT&T-USL"
  14.  
  15. /*
  16.  * nxtproto.h -- xt packet protocol definitions.
  17.  *
  18.  * For additional information on xt packet structure, see the big comment
  19.  * at the beginning of xt.c.
  20.  */
  21.  
  22. typedef    unsigned char    Pbyte;            /* The unit of communication */
  23.  
  24. #define    NPCBUFS        2            /* Double buffered protocol */
  25. #define    MAXPCHAN    8            /* Maximum channel number */
  26. #define    CHANBITS    3            /* Bits for channel number */
  27. #define    CHANMASK    07            /* 2**CHANBITS - 1 */
  28. #define PKTHEADSIZE    (2 * sizeof(Pbyte))    /* Header size */
  29. #define NETHEADSIZE    (3 * sizeof(Pbyte))    /* Header size for network xt */
  30. #define    MAXPKTDSIZE    (32 * sizeof(Pbyte))    /* Maximum data part size 
  31.                            for incoming packets. */
  32. #define MAXOUTDSIZE    (252 * sizeof(Pbyte))    /* Maximum data part size
  33.                            for outgoing packets. */
  34. #define    EDSIZE        (2 * sizeof(Pbyte))    /* Error detection part size */
  35. #define    SEQMOD        8            /* Sequence number modulus */
  36. #define    SEQBITS        3            /* Bits for sequence number */
  37. #define    SEQMASK        07            /* 2**SEQBITS - 1 */
  38.  
  39. /*
  40.  * Control codes.
  41.  */
  42.  
  43. #define    PCDATA        (Pbyte)002        /* Data only control packet */
  44. #define    ACK        (Pbyte)006        /* Last packet with same sequence ok and in sequence */
  45. #define    NAK        (Pbyte)025        /* Last packet with same sequence received out of sequence */
  46.  
  47. /*
  48.  * Receive packet states.
  49.  */
  50.  
  51. #define PR_NOINPUT    0x80        /* additional input not needed */
  52.  
  53. #define    PR_NULL        (1)        /* New packet expected */
  54. #define    PR_GETBUF    (2|PR_NOINPUT)    /* About to get buffer */
  55. #define    PR_SIZE        (3)        /* Size byte next */
  56. #define    PR_DATA        (4)        /* Receiving data */
  57. #define    PR_SENDUP    (5|PR_NOINPUT)    /* Send valid packet upstream */
  58.  
  59. #define    PR_NETNULL    (6|PR_NOINPUT)    /* Same states for network xt */
  60. #define    PR_NETSIZE1    (7)
  61. #define    PR_NETSIZE2    (8)        /* Two size bytes for network xt */
  62. #define    PR_NETGETBUF    (9|PR_NOINPUT)
  63. #define    PR_NETGETCMD    (10)        /* Get the command byte next */
  64. #define    PR_NETDATA    (11)        /* Get the rest of the data */
  65. #define PR_NETLOGPKT    (12|PR_NOINPUT)    /* About to log the packet */
  66. #define    PR_NETSENDUP    (13|PR_NOINPUT)    /* Send buffer upstream */
  67. #define    PR_NETERROR    (14)        /* Got an error in network xt */
  68.  
  69. #endif    /* _SYS_NXTPROTO_H */
  70.