home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff225.lzh / AmigaTCP / src / internet.h < prev    next >
C/C++ Source or Header  |  1989-06-24  |  1KB  |  49 lines

  1. /* Global structures and constants pertaining to the interface between IP and
  2.  *     higher level protocols
  3.  */
  4.  
  5. /* IP protocol field values */
  6. #define    ICMP_PTCL    1    /* Internet Control Message Protocol */
  7. #define    TCP_PTCL    6    /* Transmission Control Protocol */
  8. #define    UDP_PTCL    17    /* User Datagram Protocol */
  9.  
  10. #define    MAXTTL        255    /* Maximum possible IP time-to-live value */
  11.  
  12. /* DoD-style precedences */
  13. #define    ROUTINE        0x00
  14. #define    PRIORITY    0x20
  15. #define    IMMEDIATE    0x40
  16. #define    FLASH        0x60
  17. #define    FLASH_OVER    0x80
  18. #define    CRITIC        0xa0
  19. #define    INET_CTL    0xc0
  20. #define    NET_CTL        0xe0
  21.  
  22. /* Amateur-style precedences */
  23. #define    AM_ROUTINE    0x00
  24. #define    AM_WELFARE    0x20
  25. #define    AM_PRIORITY    0x40
  26. #define    AM_EMERGENCY    0x60
  27.  
  28. /* Class-of-service bits */
  29. #define    LOW_DELAY    0x10
  30. #define    THROUGHPUT    0x08
  31. #define    RELIABILITY    0x04
  32.  
  33. /* IP TOS fields */
  34. #define    PREC(x)        ((x)>>5 & 7)
  35. #define    DELAY        0x10
  36. #define    THRUPUT        0x8
  37. #define    RELIABLITY    0x4
  38.  
  39. /* Pseudo-header for TCP and UDP checksumming */
  40. struct pseudo_header {
  41.     int32 source;        /* IP source */
  42.     int32 dest;        /* IP destination */
  43.     char zero;
  44.     char protocol;        /* Protocol */
  45.     int16 length;        /* Data field length */
  46. };
  47. #define    NULLHEADER    (struct pseudo_header *)NULL
  48. void tcp_input(),udp_input(),ip_send(),dump_ip();
  49.