home *** CD-ROM | disk | FTP | other *** search
/ Steganos Hacker Tools / SHT151.iso / programme / scanner / nmapNTsp1 / Win_2000.exe / nmapNT-src / nmapNT / IPExport.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-27  |  7.6 KB  |  218 lines

  1. /********************************************************************/
  2. /**                     Microsoft LAN Manager                      **/
  3. /**               Copyright(c) Microsoft Corp., 1990-1999          **/
  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. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19.  
  20. //#include <windef.h> // for FAR decl
  21. #undef FAR
  22. #define FAR
  23.  
  24. //
  25. // IP type definitions.
  26. //
  27. typedef unsigned long   IPAddr;     // An IP address.
  28. typedef unsigned long   IPMask;     // An IP subnet mask.
  29. typedef unsigned long   IP_STATUS;  // Status code returned from IP APIs.
  30.  
  31.  
  32. /*INC*/
  33.  
  34. //
  35. // The ip_option_information structure describes the options to be
  36. // included in the header of an IP packet. The TTL, TOS, and Flags
  37. // values are carried in specific fields in the header. The OptionsData
  38. // bytes are carried in the options area following the standard IP header.
  39. // With the exception of source route options, this data must be in the
  40. // format to be transmitted on the wire as specified in RFC 791. A source
  41. // route option should contain the full route - first hop thru final
  42. // destination - in the route data. The first hop will be pulled out of the
  43. // data and the option will be reformatted accordingly. Otherwise, the route
  44. // option should be formatted as specified in RFC 791.
  45. //
  46. struct ip_option_information {
  47.     unsigned char      Ttl;             // Time To Live
  48.     unsigned char      Tos;             // Type Of Service
  49.     unsigned char      Flags;           // IP header flags
  50.     unsigned char      OptionsSize;     // Size in bytes of options data
  51.     unsigned char FAR *OptionsData;     // Pointer to options data
  52. }; /* ip_option_information */
  53.  
  54. //
  55. // The icmp_echo_reply structure describes the data returned in response
  56. // to an echo request.
  57. //
  58. struct icmp_echo_reply {
  59.     IPAddr                         Address;         // Replying address
  60.     unsigned long                  Status;          // Reply IP_STATUS
  61.     unsigned long                  RoundTripTime;   // RTT in milliseconds
  62.     unsigned short                 DataSize;        // Reply data size in bytes
  63.     unsigned short                 Reserved;        // Reserved for system use
  64.     void FAR                      *Data;            // Pointer to the reply data
  65.     struct ip_option_information   Options;         // Reply options
  66. }; /* icmp_echo_reply */
  67.  
  68.  
  69. /*NOINC*/
  70.  
  71. typedef struct ip_option_information IP_OPTION_INFORMATION,
  72.                                      FAR *PIP_OPTION_INFORMATION;
  73.  
  74. typedef struct icmp_echo_reply ICMP_ECHO_REPLY,
  75.                                FAR *PICMP_ECHO_REPLY;
  76.  
  77. /*INC*/
  78.  
  79.  
  80.  
  81. struct ArpRequestBuffer {
  82.    IPAddr DestAddress;
  83.    IPAddr SrcAddress;
  84. }; /* ArpRequestBuffer */
  85.  
  86. /*NOINC*/
  87.  
  88. typedef struct ArpRequestBuffer ARP_SEND_REPLY,
  89.                                FAR *PARP_SEND_REPLY;
  90.  
  91. typedef struct _TCP_RESERVE_PORT_RANGE
  92. {
  93.  
  94.    USHORT  UpperRange;
  95.    USHORT  LowerRange;
  96. }TCP_RESERVE_PORT_RANGE, *PTCP_RESERVE_PORT_RANGE;
  97.  
  98. #define MAX_ADAPTER_NAME 128
  99.  
  100. typedef struct _IP_ADAPTER_INDEX_MAP
  101. {
  102.    ULONG Index;
  103.    WCHAR  Name[MAX_ADAPTER_NAME];
  104. }IP_ADAPTER_INDEX_MAP, *PIP_ADAPTER_INDEX_MAP;
  105.  
  106. typedef struct _IP_INTERFACE_INFO
  107. {
  108.      LONG    NumAdapters;
  109.      IP_ADAPTER_INDEX_MAP Adapter[1];
  110. } IP_INTERFACE_INFO,*PIP_INTERFACE_INFO;
  111.  
  112. typedef struct _IP_UNIDIRECTIONAL_ADAPTER_ADDRESS
  113. {
  114.      ULONG    NumAdapters;
  115.      IPAddr  Address[1];
  116. } IP_UNIDIRECTIONAL_ADAPTER_ADDRESS, *PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS;
  117.  
  118. typedef struct _IP_ADAPTER_ORDER_MAP
  119. {
  120.     ULONG NumAdapters;
  121.     ULONG AdapterOrder[1];
  122. } IP_ADAPTER_ORDER_MAP, *PIP_ADAPTER_ORDER_MAP;
  123.  
  124. //
  125. // IP_STATUS codes returned from IP APIs
  126. //
  127.  
  128. #define IP_STATUS_BASE              11000
  129.  
  130. #define IP_SUCCESS                  0
  131. #define IP_BUF_TOO_SMALL            (IP_STATUS_BASE + 1)
  132. #define IP_DEST_NET_UNREACHABLE     (IP_STATUS_BASE + 2)
  133. #define IP_DEST_HOST_UNREACHABLE    (IP_STATUS_BASE + 3)
  134. #define IP_DEST_PROT_UNREACHABLE    (IP_STATUS_BASE + 4)
  135. #define IP_DEST_PORT_UNREACHABLE    (IP_STATUS_BASE + 5)
  136. #define IP_NO_RESOURCES             (IP_STATUS_BASE + 6)
  137. #define IP_BAD_OPTION               (IP_STATUS_BASE + 7)
  138. #define IP_HW_ERROR                 (IP_STATUS_BASE + 8)
  139. #define IP_PACKET_TOO_BIG           (IP_STATUS_BASE + 9)
  140. #define IP_REQ_TIMED_OUT            (IP_STATUS_BASE + 10)
  141. #define IP_BAD_REQ                  (IP_STATUS_BASE + 11)
  142. #define IP_BAD_ROUTE                (IP_STATUS_BASE + 12)
  143. #define IP_TTL_EXPIRED_TRANSIT      (IP_STATUS_BASE + 13)
  144. #define IP_TTL_EXPIRED_REASSEM      (IP_STATUS_BASE + 14)
  145. #define IP_PARAM_PROBLEM            (IP_STATUS_BASE + 15)
  146. #define IP_SOURCE_QUENCH            (IP_STATUS_BASE + 16)
  147. #define IP_OPTION_TOO_BIG           (IP_STATUS_BASE + 17)
  148. #define IP_BAD_DESTINATION          (IP_STATUS_BASE + 18)
  149.  
  150.  
  151. //
  152. // The next group are status codes passed up on status indications to
  153. // transport layer protocols.
  154. //
  155. #define IP_ADDR_DELETED             (IP_STATUS_BASE + 19)
  156. #define IP_SPEC_MTU_CHANGE          (IP_STATUS_BASE + 20)
  157. #define IP_MTU_CHANGE               (IP_STATUS_BASE + 21)
  158. #define IP_UNLOAD                   (IP_STATUS_BASE + 22)
  159. #define IP_ADDR_ADDED               (IP_STATUS_BASE + 23)
  160. #define IP_MEDIA_CONNECT            (IP_STATUS_BASE + 24)
  161. #define IP_MEDIA_DISCONNECT         (IP_STATUS_BASE + 25)
  162. #define IP_BIND_ADAPTER             (IP_STATUS_BASE + 26)
  163. #define IP_UNBIND_ADAPTER           (IP_STATUS_BASE + 27)
  164. #define IP_DEVICE_DOES_NOT_EXIST    (IP_STATUS_BASE + 28)
  165. #define IP_DUPLICATE_ADDRESS        (IP_STATUS_BASE + 29)
  166. #define IP_INTERFACE_METRIC_CHANGE  (IP_STATUS_BASE + 30)
  167. #define IP_RECONFIG_SECFLTR         (IP_STATUS_BASE + 31)
  168. #define IP_NEGOTIATING_IPSEC        (IP_STATUS_BASE + 32)
  169. #define IP_INTERFACE_WOL_CAPABILITY_CHANGE  (IP_STATUS_BASE + 33)
  170. #define IP_DUPLICATE_IPADD          (IP_STATUS_BASE + 34)
  171.  
  172. #define IP_GENERAL_FAILURE          (IP_STATUS_BASE + 50)
  173. #define MAX_IP_STATUS               IP_GENERAL_FAILURE
  174. #define IP_PENDING                  (IP_STATUS_BASE + 255)
  175.  
  176.  
  177. //
  178. // Values used in the IP header Flags field.
  179. //
  180. #define IP_FLAG_DF      0x2         // Don't fragment this packet.
  181.  
  182. //
  183. // Supported IP Option Types.
  184. //
  185. // These types define the options which may be used in the OptionsData field
  186. // of the ip_option_information structure.  See RFC 791 for a complete
  187. // description of each.
  188. //
  189. #define IP_OPT_EOL      0          // End of list option
  190. #define IP_OPT_NOP      1          // No operation
  191. #define IP_OPT_SECURITY 0x82       // Security option
  192. #define IP_OPT_LSRR     0x83       // Loose source route
  193. #define IP_OPT_SSRR     0x89       // Strict source route
  194. #define IP_OPT_RR       0x7        // Record route
  195. #define IP_OPT_TS       0x44       // Timestamp
  196. #define IP_OPT_SID      0x88       // Stream ID (obsolete)
  197. #define IP_OPT_ROUTER_ALERT 0x94  // Router Alert Option
  198.  
  199. #define MAX_OPT_SIZE    40         // Maximum length of IP options in bytes
  200.  
  201. #ifdef CHICAGO
  202.  
  203. // Ioctls code exposed by Memphis tcpip stack.
  204. // For NT these ioctls are define in ntddip.h  (private\inc)
  205.  
  206. #define IOCTL_IP_RTCHANGE_NOTIFY_REQUEST   101
  207. #define IOCTL_IP_ADDCHANGE_NOTIFY_REQUEST  102
  208. #define IOCTL_ARP_SEND_REQUEST             103
  209. #define IOCTL_IP_INTERFACE_INFO            104
  210. #define IOCTL_IP_GET_BEST_INTERFACE        105
  211. #define IOCTL_IP_UNIDIRECTIONAL_ADAPTER_ADDRESS        106
  212.  
  213. #endif
  214.  
  215.  
  216. #endif // IP_EXPORT_INCLUDED
  217.  
  218.