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