home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / RDP / rdp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-18  |  2.4 KB  |  84 lines

  1. /**************************************************************************/
  2. /*       Copyright(c) 1987, 1992 by BBN Systems and Technologies,         */
  3. /*         A Division of Bolt Beranek and Newman Inc.                     */
  4. /*                                                                        */
  5. /*       RDP implementation for 4.2/4.3bsd by Craig Partridge             */
  6. /*                                                                        */
  7. /*  Permission to use, copy, modify, distribute, and sell this software   */
  8. /*  and its documentation for any purpose is hereby granted without fee,  */
  9. /*  provided that the above copyright notice and this permission appear   */
  10. /*  in all copies and in supporting documentation, and that the name of   */
  11. /*  Bolt Beranek and Newman Inc.  not be used in advertising or           */
  12. /*  publicity pertaining to distribution of the software without          */
  13. /*  specific, written prior permission. BBN makes no representations      */
  14. /*  about the suitability of this software for any purposes.  It is       */
  15. /*  provided "AS IS" without express or implied warranties.               */
  16. /**************************************************************************/
  17.  
  18. #ifndef IPPROTO_RDP
  19. #define IPPROTO_RDP 27        /* check this! */
  20. #endif
  21.  
  22. /*
  23.  * header size and variable size
  24.  */
  25.  
  26. #define R_HDRSIZE    18
  27. #define R_VARSIZE    6
  28.  
  29. /*
  30.  * RDP header per RFC 908
  31.  */
  32.  
  33. struct rdphdr {
  34.     u_char  rh_flags;    /* ack, eack, etc */
  35.  
  36. #define RH_SYN  0x80
  37. #define RH_ACK    0x40
  38. #define RH_EACK 0x20
  39. #define RH_RST  0x10
  40. #define RH_NULL 0x08
  41.  
  42. #define RH_VERBITS     0x3
  43.  
  44. #define R_VERSION    0x2    /* version #1 */
  45.  
  46.  
  47.     u_char  rh_hlen;    /* header length */
  48.     u_short  rh_sp;    /* source port */
  49.     u_short  rh_dp;    /* dest port */
  50.     u_short rh_len;    /* data length */
  51.     u_long  rh_sn;    /* sequence number */
  52.     u_long  rh_an;    /* ack number */
  53.     u_short  rh_sum;    /* checksum */
  54.     /* optional data follows */
  55. };
  56.  
  57. #define R_ALLOC_PORT    63    /* allocable boundary */
  58.  
  59. /*
  60.  *  syn stuff
  61.  */
  62.  
  63. struct rdpsyn {
  64.     u_short    rs_mos;        /* max outstanding segments */
  65.     u_short    rs_mss;        /* max segment size */
  66.     u_short    rs_ff;        /* options flag field */
  67. } ;
  68.  
  69. #define RS_SDM        0x1     /* syn options field */
  70.  
  71. /*
  72.  * macros to compare acks
  73.  */
  74.  
  75. /* a < b */
  76. #define seq_lt(a,b)        ((int)((a)-(b)) < 0)
  77. /* a <= b */
  78. #define seq_le(a,b)        ((int)((a)-(b)) <= 0)
  79. /* a > b */
  80. #define seq_gt(a,b)        ((int)((a)-(b)) > 0)
  81. /* a >= b */
  82. #define seq_ge(a,b)        ((int)((a)-(b)) >= 0)
  83.  
  84.