home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / hamradio / s920603.zip / INTERNET.H < prev    next >
C/C++ Source or Header  |  1992-03-26  |  2KB  |  67 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. #define    IP_PTCL        94    /* IP inside IP */
  17.  
  18. #define    MAXTTL        255    /* Maximum possible IP time-to-live value */
  19.  
  20. /* DoD-style precedences */
  21. #define    IP_PRECEDENCE    0xe0    /* Mask for precedence field */
  22. #define    ROUTINE        0x00
  23. #define    PRIORITY    0x20
  24. #define    IMMEDIATE    0x40
  25. #define    FLASH        0x60
  26. #define    FLASH_OVER    0x80
  27. #define    CRITIC        0xa0
  28. #define    INET_CTL    0xc0
  29. #define    NET_CTL        0xe0
  30.  
  31. /* Amateur-style precedences */
  32. #define    AM_ROUTINE    0x00
  33. #define    AM_WELFARE    0x20
  34. #define    AM_PRIORITY    0x40
  35. #define    AM_EMERGENCY    0x60
  36.  
  37. /* Class-of-service bits */
  38. #define    IP_COS        0x1c    /* Mask for class-of-service bits */
  39. #define    LOW_DELAY    0x10
  40. #define    THROUGHPUT    0x08
  41. #define    RELIABILITY    0x04
  42.  
  43. /* IP TOS fields */
  44. #define    PREC(x)        (((x)>>5) & 0x7)
  45. #define    DELAY        0x10
  46. #define    THRUPUT        0x8
  47. #define    RELIABLITY    0x4
  48.  
  49. /* Pseudo-header for TCP and UDP checksumming */
  50. struct pseudo_header {
  51.     int32 source;        /* IP source */
  52.     int32 dest;        /* IP destination */
  53.     char protocol;        /* Protocol */
  54.     int16 length;        /* Data field length */
  55. };
  56. #define    NULLHEADER    (struct pseudo_header *)0
  57.  
  58. /* Format of a MIB entry for statistics gathering */
  59. struct mib_entry {
  60.     char *name;
  61.     union {
  62.         int32 integer;
  63.     } value;
  64. };
  65.  
  66. #endif    /* _INTERNET_H */
  67.