Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

151 lines
4.7 KiB

  1. /********************************************************************/
  2. /** Copyright(c) Microsoft Corp., 1990-1998 **/
  3. /********************************************************************/
  4. //
  5. // This file contains public definitions exported to transport layer and
  6. // application software.
  7. //
  8. //
  9. // IP type definitions.
  10. //
  11. typedef unsigned long IPAddr; // An IP address.
  12. //
  13. // The ip_option_information structure describes the options to be
  14. // included in the header of an IP packet. The TTL, TOS, and Flags
  15. // values are carried in specific fields in the header. The OptionsData
  16. // bytes are carried in the options area following the standard IP header.
  17. // With the exception of source route options, this data must be in the
  18. // format to be transmitted on the wire as specified in RFC 791. A source
  19. // route option should contain the full route - first hop thru final
  20. // destination - in the route data. The first hop will be pulled out of the
  21. // data and the option will be reformatted accordingly. Otherwise, the route
  22. // option should be formatted as specified in RFC 791.
  23. //
  24. struct ip_option_information {
  25. unsigned char Ttl; // Time To Live
  26. unsigned char Tos; // Type Of Service
  27. unsigned char Flags; // IP header flags
  28. unsigned char OptionsSize; // Size in bytes of options data
  29. unsigned char FAR *OptionsData; // Pointer to options data
  30. }; /* ip_option_information */
  31. #define MAX_OPT_SIZE 40 // Maximum length of IP options in bytes
  32. #define TCP_SOCKET_NODELAY 1
  33. #define TCP_SOCKET_KEEPALIVE 2
  34. #define TCP_SOCKET_OOBINLINE 3
  35. #define TCP_SOCKET_BSDURGENT 4
  36. #define TCP_SOCKET_ATMARK 5
  37. #define TCP_SOCKET_WINDOW 6
  38. #define AO_OPTION_TTL 1
  39. #define AO_OPTION_MCASTTTL 2
  40. #define AO_OPTION_MCASTIF 3
  41. #define AO_OPTION_XSUM 4
  42. #define AO_OPTION_IPOPTIONS 5
  43. #define AO_OPTION_ADD_MCAST 6
  44. #define AO_OPTION_DEL_MCAST 7
  45. #define AO_OPTION_TOS 8
  46. #define AO_OPTION_IP_DONTFRAGMENT 9
  47. typedef struct IPSNMPInfo {
  48. ulong ipsi_forwarding;
  49. ulong ipsi_defaultttl;
  50. ulong ipsi_inreceives;
  51. ulong ipsi_inhdrerrors;
  52. ulong ipsi_inaddrerrors;
  53. ulong ipsi_forwdatagrams;
  54. ulong ipsi_inunknownprotos;
  55. ulong ipsi_indiscards;
  56. ulong ipsi_indelivers;
  57. ulong ipsi_outrequests;
  58. ulong ipsi_routingdiscards;
  59. ulong ipsi_outdiscards;
  60. ulong ipsi_outnoroutes;
  61. ulong ipsi_reasmtimeout;
  62. ulong ipsi_reasmreqds;
  63. ulong ipsi_reasmoks;
  64. ulong ipsi_reasmfails;
  65. ulong ipsi_fragoks;
  66. ulong ipsi_fragfails;
  67. ulong ipsi_fragcreates;
  68. ulong ipsi_numif;
  69. ulong ipsi_numaddr;
  70. ulong ipsi_numroutes;
  71. } IPSNMPInfo;
  72. typedef struct IPAddrEntry {
  73. ulong iae_addr;
  74. ulong iae_index;
  75. ulong iae_mask;
  76. ulong iae_bcastaddr;
  77. ulong iae_reasmsize;
  78. ushort iae_context;
  79. ushort iae_pad;
  80. } IPAddrEntry;
  81. #define IP_MIB_STATS_ID 1
  82. #define IP_MIB_ADDRTABLE_ENTRY_ID 0x102
  83. #define IP_INTFC_FLAG_P2P 1
  84. typedef struct IPInterfaceInfo {
  85. ulong iii_flags;
  86. ulong iii_mtu;
  87. ulong iii_speed;
  88. ulong iii_addrlength;
  89. uchar iii_addr[1];
  90. } IPInterfaceInfo;
  91. #define IF_MIB_STATS_ID 1
  92. #define MAX_PHYSADDR_SIZE 8
  93. #define MAX_IFDESCR_LEN 256
  94. typedef struct IFEntry {
  95. ulong if_index;
  96. ulong if_type;
  97. ulong if_mtu;
  98. ulong if_speed;
  99. ulong if_physaddrlen;
  100. uchar if_physaddr[MAX_PHYSADDR_SIZE];
  101. ulong if_adminstatus;
  102. ulong if_operstatus;
  103. ulong if_lastchange;
  104. ulong if_inoctets;
  105. ulong if_inucastpkts;
  106. ulong if_innucastpkts;
  107. ulong if_indiscards;
  108. ulong if_inerrors;
  109. ulong if_inunknownprotos;
  110. ulong if_outoctets;
  111. ulong if_outucastpkts;
  112. ulong if_outnucastpkts;
  113. ulong if_outdiscards;
  114. ulong if_outerrors;
  115. ulong if_outqlen;
  116. ulong if_descrlen;
  117. uchar if_descr[1];
  118. } IFEntry;
  119. //
  120. // Device Name - this string is the name of the device. It is the name
  121. // that should be passed to CreateFile when accessing the device.
  122. //
  123. #define DD_TCP_DEVICE_NAME L"\\Device\\Tcp"
  124. #define DD_UDP_DEVICE_NAME L"\\Device\\Udp"
  125. #define DD_RAW_IP_DEVICE_NAME L"\\Device\\RawIp"
  126. #define FSCTL_TCP_BASE FILE_DEVICE_NETWORK
  127. #define _TCP_CTL_CODE(function, method, access) \
  128. CTL_CODE(FSCTL_TCP_BASE, function, method, access)
  129. #define IOCTL_TCP_QUERY_INFORMATION_EX \
  130. _TCP_CTL_CODE(0, METHOD_NEITHER, FILE_ANY_ACCESS)
  131. #define IOCTL_TCP_SET_INFORMATION_EX \
  132. _TCP_CTL_CODE(1, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  133. #define IP_INTFC_INFO_ID 0x103