home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / internet / tcpipsrc / h / if / INTERNET < prev    next >
Text File  |  1992-02-14  |  2KB  |  52 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 protocol;          /* Protocol */
  44.         int16 length;           /* Data field length */
  45. };
  46. #define NULLHEADER      (struct pseudo_header *)0
  47.  
  48. void tcp_input(struct mbuf *, char, int32, int32, char, int16, char);
  49. void udp_input(struct mbuf *, char, int32, int32, char, int16, char);
  50. int16 cksum(struct pseudo_header *, struct mbuf *, int16);
  51. int ip_send(int32, int32, char, char, char, struct mbuf *, int16, int16, char);
  52.