home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / misc / tcpipsrc / internet.h < prev    next >
C/C++ Source or Header  |  1990-09-01  |  1KB  |  64 lines

  1. #ifndef    _INTERNET_H
  2. #define    _INTERNET_H
  3.  
  4. #ifndef    _GLOBAL_H
  5. #include "global.h"
  6. #endif
  7.  
  8. /* Global structures and constants pertaining to the interface between IP and
  9.  *     higher level protocols
  10.  */
  11.  
  12. /* IP protocol field values */
  13. #define    ICMP_PTCL    1    /* Internet Control Message Protocol */
  14. #define    TCP_PTCL    6    /* Transmission Control Protocol */
  15. #define    UDP_PTCL    17    /* User Datagram Protocol */
  16.  
  17. #define    MAXTTL        255    /* Maximum possible IP time-to-live value */
  18.  
  19. /* DoD-style precedences */
  20. #define    ROUTINE        0x00
  21. #define    PRIORITY    0x20
  22. #define    IMMEDIATE    0x40
  23. #define    FLASH        0x60
  24. #define    FLASH_OVER    0x80
  25. #define    CRITIC        0xa0
  26. #define    INET_CTL    0xc0
  27. #define    NET_CTL        0xe0
  28.  
  29. /* Amateur-style precedences */
  30. #define    AM_ROUTINE    0x00
  31. #define    AM_WELFARE    0x20
  32. #define    AM_PRIORITY    0x40
  33. #define    AM_EMERGENCY    0x60
  34.  
  35. /* Class-of-service bits */
  36. #define    LOW_DELAY    0x10
  37. #define    THROUGHPUT    0x08
  38. #define    RELIABILITY    0x04
  39.  
  40. /* IP TOS fields */
  41. #define    PREC(x)        ((x)>>5 & 7)
  42. #define    DELAY        0x10
  43. #define    THRUPUT        0x8
  44. #define    RELIABLITY    0x4
  45.  
  46. /* Pseudo-header for TCP and UDP checksumming */
  47. struct pseudo_header {
  48.     int32 source;        /* IP source */
  49.     int32 dest;        /* IP destination */
  50.     char protocol;        /* Protocol */
  51.     int16 length;        /* Data field length */
  52. };
  53. #define    NULLHEADER    (struct pseudo_header *)0
  54.  
  55. /* Format of a MIB entry for statistics gathering */
  56. struct mib_entry {
  57.     char *name;
  58.     union {
  59.         int32 integer;
  60.     } value;
  61. };
  62.  
  63. #endif    /* _INTERNET_H */
  64.