home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / bin / ipexport.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-11  |  5.3 KB  |  140 lines

  1. /********************************************************************/
  2. /**                     Microsoft LAN Manager                      **/
  3. /**               Copyright(c) Microsoft Corp., 1990-1992          **/
  4. /********************************************************************/
  5. /* :ts=4 */
  6.  
  7. //** IPEXPORT.H - IP public definitions.
  8. //
  9. //  This file contains public definitions exported to transport layer and
  10. //  application software.
  11. //
  12.  
  13. #ifndef IP_EXPORT_INCLUDED
  14. #define IP_EXPORT_INCLUDED  1
  15.  
  16. /*NOINC*/
  17.  
  18. //
  19. // IP type definitions.
  20. //
  21. typedef unsigned long   IPAddr;     // An IP address.
  22. typedef unsigned long   IPMask;     // An IP subnet mask.
  23. typedef unsigned long   IP_STATUS;  // Status code returned from IP APIs.
  24.  
  25.  
  26. /*INC*/
  27.  
  28. //
  29. // The ip_option_information structure describes the options to be
  30. // included in the header of an IP packet. The TTL, TOS, and Flags
  31. // values are carried in specific fields in the header. The OptionsData
  32. // bytes are carried in the options area following the standard IP header.
  33. // With the exception of source route options, this data must be in the
  34. // format to be transmitted on the wire as specified in RFC 791. A source
  35. // route option should contain the full route - first hop thru final
  36. // destination - in the route data. The first hop will be pulled out of the
  37. // data and the option will be reformatted accordingly. Otherwise, the route
  38. // option should be formatted as specified in RFC 791.
  39. //
  40. struct ip_option_information {
  41.     unsigned char      Ttl;             // Time To Live
  42.     unsigned char      Tos;             // Type Of Service
  43.     unsigned char      Flags;           // IP header flags
  44.     unsigned char      OptionsSize;     // Size in bytes of options data
  45.     unsigned char FAR *OptionsData;     // Pointer to options data
  46. }; /* ip_option_information */
  47.  
  48. //
  49. // The icmp_echo_reply structure describes the data returned in response
  50. // to an echo request.
  51. //
  52. struct icmp_echo_reply {
  53.     IPAddr                         Address;         // Replying address
  54.     unsigned long                  Status;          // Reply IP_STATUS
  55.     unsigned long                  RoundTripTime;   // RTT in milliseconds
  56.     unsigned short                 DataSize;        // Reply data size in bytes
  57.     unsigned short                 Reserved;        // Reserved for system use
  58.     void FAR                      *Data;            // Pointer to the reply data
  59.     struct ip_option_information   Options;         // Reply options
  60. }; /* icmp_echo_reply */
  61.  
  62.  
  63. /*NOINC*/
  64.  
  65. typedef struct ip_option_information IP_OPTION_INFORMATION,
  66.                                      FAR *PIP_OPTION_INFORMATION;
  67.  
  68. typedef struct icmp_echo_reply ICMP_ECHO_REPLY,
  69.                                FAR *PICMP_ECHO_REPLY;
  70.  
  71. /*INC*/
  72.  
  73. //
  74. // IP_STATUS codes returned from IP APIs
  75. //
  76.  
  77. #define IP_STATUS_BASE              11000
  78.  
  79. #define IP_SUCCESS                  0
  80. #define IP_BUF_TOO_SMALL            (IP_STATUS_BASE + 1)
  81. #define IP_DEST_NET_UNREACHABLE     (IP_STATUS_BASE + 2)
  82. #define IP_DEST_HOST_UNREACHABLE    (IP_STATUS_BASE + 3)
  83. #define IP_DEST_PROT_UNREACHABLE    (IP_STATUS_BASE + 4)
  84. #define IP_DEST_PORT_UNREACHABLE    (IP_STATUS_BASE + 5)
  85. #define IP_NO_RESOURCES             (IP_STATUS_BASE + 6)
  86. #define IP_BAD_OPTION               (IP_STATUS_BASE + 7)
  87. #define IP_HW_ERROR                 (IP_STATUS_BASE + 8)
  88. #define IP_PACKET_TOO_BIG           (IP_STATUS_BASE + 9)
  89. #define IP_REQ_TIMED_OUT            (IP_STATUS_BASE + 10)
  90. #define IP_BAD_REQ                  (IP_STATUS_BASE + 11)
  91. #define IP_BAD_ROUTE                (IP_STATUS_BASE + 12)
  92. #define IP_TTL_EXPIRED_TRANSIT      (IP_STATUS_BASE + 13)
  93. #define IP_TTL_EXPIRED_REASSEM      (IP_STATUS_BASE + 14)
  94. #define IP_PARAM_PROBLEM            (IP_STATUS_BASE + 15)
  95. #define IP_SOURCE_QUENCH            (IP_STATUS_BASE + 16)
  96. #define IP_OPTION_TOO_BIG           (IP_STATUS_BASE + 17)
  97. #define IP_BAD_DESTINATION          (IP_STATUS_BASE + 18)
  98.  
  99.  
  100. //
  101. // The next group are status codes passed up on status indications to
  102. // transport layer protocols.
  103. //
  104. #define IP_ADDR_DELETED             (IP_STATUS_BASE + 19)
  105. #define IP_SPEC_MTU_CHANGE          (IP_STATUS_BASE + 20)
  106. #define IP_MTU_CHANGE               (IP_STATUS_BASE + 21)
  107. #define IP_UNLOAD                   (IP_STATUS_BASE + 22)
  108.  
  109. #define IP_GENERAL_FAILURE          (IP_STATUS_BASE + 50)
  110. #define MAX_IP_STATUS               IP_GENERAL_FAILURE
  111. #define IP_PENDING                  (IP_STATUS_BASE + 255)
  112.  
  113.  
  114. //
  115. // Values used in the IP header Flags field.
  116. //
  117. #define IP_FLAG_DF      0x2         // Don't fragment this packet.
  118.  
  119. //
  120. // Supported IP Option Types.
  121. //
  122. // These types define the options which may be used in the OptionsData field
  123. // of the ip_option_information structure.  See RFC 791 for a complete
  124. // description of each.
  125. //
  126. #define IP_OPT_EOL      0          // End of list option
  127. #define IP_OPT_NOP      1          // No operation
  128. #define IP_OPT_SECURITY 0x82       // Security option
  129. #define IP_OPT_LSRR     0x83       // Loose source route
  130. #define IP_OPT_SSRR     0x89       // Strict source route
  131. #define IP_OPT_RR       0x7        // Record route
  132. #define IP_OPT_TS       0x44       // Timestamp
  133. #define IP_OPT_SID      0x88       // Stream ID (obsolete)
  134.  
  135. #define MAX_OPT_SIZE    40         // Maximum length of IP options in bytes
  136.  
  137.  
  138. #endif // IP_EXPORT_INCLUDED
  139.  
  140.