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.

292 lines
7.4 KiB

  1. /********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright (c) Microsoft Corporation. All rights reserved. **/
  4. /********************************************************************/
  5. /* :ts=4 */
  6. //** IPINFO.H - IP SNMP information definitions..
  7. //
  8. // This file contains all of the definitions for IP that are
  9. // related to SNMP information gathering.
  10. #ifndef IPINFO_INCLUDED
  11. #define IPINFO_INCLUDED
  12. #pragma warning(push)
  13. #pragma warning(disable:4201) // nameless struct/union
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. #ifndef CTE_TYPEDEFS_DEFINED
  18. #define CTE_TYPEDEFS_DEFINED
  19. typedef unsigned long ulong;
  20. typedef unsigned short ushort;
  21. typedef unsigned char uchar;
  22. typedef unsigned int uint;
  23. #endif // CTE_TYPEDEFS_DEFINED
  24. typedef struct IPSNMPInfo {
  25. ulong ipsi_forwarding;
  26. ulong ipsi_defaultttl;
  27. ulong ipsi_inreceives;
  28. ulong ipsi_inhdrerrors;
  29. ulong ipsi_inaddrerrors;
  30. ulong ipsi_forwdatagrams;
  31. ulong ipsi_inunknownprotos;
  32. ulong ipsi_indiscards;
  33. ulong ipsi_indelivers;
  34. ulong ipsi_outrequests;
  35. ulong ipsi_routingdiscards;
  36. ulong ipsi_outdiscards;
  37. ulong ipsi_outnoroutes;
  38. ulong ipsi_reasmtimeout;
  39. ulong ipsi_reasmreqds;
  40. ulong ipsi_reasmoks;
  41. ulong ipsi_reasmfails;
  42. ulong ipsi_fragoks;
  43. ulong ipsi_fragfails;
  44. ulong ipsi_fragcreates;
  45. ulong ipsi_numif;
  46. ulong ipsi_numaddr;
  47. ulong ipsi_numroutes;
  48. } IPSNMPInfo;
  49. typedef struct ICMPStats {
  50. ulong icmps_msgs;
  51. ulong icmps_errors;
  52. ulong icmps_destunreachs;
  53. ulong icmps_timeexcds;
  54. ulong icmps_parmprobs;
  55. ulong icmps_srcquenchs;
  56. ulong icmps_redirects;
  57. ulong icmps_echos;
  58. ulong icmps_echoreps;
  59. ulong icmps_timestamps;
  60. ulong icmps_timestampreps;
  61. ulong icmps_addrmasks;
  62. ulong icmps_addrmaskreps;
  63. } ICMPStats;
  64. typedef struct ICMPSNMPInfo {
  65. ICMPStats icsi_instats;
  66. ICMPStats icsi_outstats;
  67. } ICMPSNMPInfo;
  68. typedef struct ICMPv6Stats {
  69. ulong icmps_msgs;
  70. ulong icmps_errors;
  71. ulong icmps_typecount[256];
  72. } ICMPv6Stats;
  73. typedef struct ICMPv6SNMPInfo {
  74. ICMPv6Stats icsi_instats;
  75. ICMPv6Stats icsi_outstats;
  76. } ICMPv6SNMPInfo;
  77. #define IP_FORWARDING 1
  78. #define IP_NOT_FORWARDING 2
  79. typedef struct IPAddrEntry {
  80. ulong iae_addr;
  81. ulong iae_index;
  82. ulong iae_mask;
  83. ulong iae_bcastaddr;
  84. ulong iae_reasmsize;
  85. ushort iae_context;
  86. ushort iae_pad;
  87. } IPAddrEntry;
  88. typedef struct IPRouteEntry {
  89. ulong ire_dest;
  90. ulong ire_index;
  91. ulong ire_metric1;
  92. ulong ire_metric2;
  93. ulong ire_metric3;
  94. ulong ire_metric4;
  95. ulong ire_nexthop;
  96. ulong ire_type;
  97. ulong ire_proto;
  98. ulong ire_age;
  99. ulong ire_mask;
  100. ulong ire_metric5;
  101. #ifdef NT
  102. ulong ire_context;
  103. #endif
  104. } IPRouteEntry;
  105. typedef struct IPRouteBlock {
  106. ulong numofroutes;
  107. IPRouteEntry route[1];
  108. } IPRouteBlock;
  109. //
  110. // Route with multiple nexthops and associated defns
  111. //
  112. typedef struct IPRouteNextHopEntry {
  113. ulong ine_iretype;
  114. ulong ine_nexthop;
  115. ulong ine_ifindex;
  116. #ifdef NT
  117. ulong ine_context;
  118. #endif
  119. } IPRouteNextHopEntry;
  120. typedef struct IPMultihopRouteEntry {
  121. ulong imre_numnexthops;
  122. ulong imre_flags;
  123. IPRouteEntry imre_routeinfo;
  124. IPRouteNextHopEntry imre_morenexthops[1];
  125. } IPMultihopRouteEntry;
  126. #define IMRE_FLAG_DELETE_DEST 0x00000001
  127. //
  128. // Input context to pass when querying a route
  129. //
  130. typedef enum {
  131. IPNotifyNotification = 0,
  132. IPNotifySynchronization,
  133. IPNotifyMaximumVersion
  134. } IPNotifyVersion;
  135. typedef struct IPNotifyData {
  136. ulong Version; // See IPNotifyVersion above.
  137. ulong Add;
  138. char Info[1];
  139. } IPNotifyData, *PIPNotifyData;
  140. typedef struct IPNotifyOutput {
  141. ulong ino_addr;
  142. ulong ino_mask;
  143. ulong ino_info[6];
  144. } IPNotifyOutput, *PIPNotifyOutput;
  145. typedef union IPRouteNotifyOutput {
  146. IPNotifyOutput irno_info;
  147. struct {
  148. ulong irno_dest;
  149. ulong irno_mask;
  150. ulong irno_nexthop;
  151. ulong irno_proto;
  152. ulong irno_ifindex;
  153. ulong irno_metric;
  154. ulong irno_flags;
  155. };
  156. } IPRouteNotifyOutput, *PIPRouteNotifyOutput;
  157. #define IRNO_FLAG_ADD 0x00000001
  158. #define IRNO_FLAG_DELETE 0x00000002
  159. //
  160. // Input context to pass when querying a route
  161. //
  162. typedef struct IPRouteLookupData {
  163. ulong Version; //version of this structure
  164. ulong DestAdd;
  165. ulong SrcAdd;
  166. char Info[1];
  167. } IPRouteLookupData, *PIPRouteLookupData;
  168. typedef struct AddrXlatInfo {
  169. ulong axi_count;
  170. ulong axi_index;
  171. } AddrXlatInfo;
  172. #define IRE_TYPE_OTHER 1
  173. #define IRE_TYPE_INVALID 2
  174. #define IRE_TYPE_DIRECT 3
  175. #define IRE_TYPE_INDIRECT 4
  176. #define IRE_PROTO_OTHER 1
  177. #define IRE_PROTO_LOCAL 2
  178. #define IRE_PROTO_NETMGMT 3
  179. #define IRE_PROTO_ICMP 4
  180. #define IRE_PROTO_EGP 5
  181. #define IRE_PROTO_GGP 6
  182. #define IRE_PROTO_HELLO 7
  183. #define IRE_PROTO_RIP 8
  184. #define IRE_PROTO_IS_IS 9
  185. #define IRE_PROTO_ES_IS 10
  186. #define IRE_PROTO_CISCO 11
  187. #define IRE_PROTO_BBN 12
  188. #define IRE_PROTO_OSPF 13
  189. #define IRE_PROTO_BGP 14
  190. #define IRE_METRIC_UNUSED 0xffffffff
  191. #define IP_MIB_STATS_ID 1
  192. #define IP_MIB_RTCHANGE_NOTIFY_ID 2
  193. #define ICMP_MIB_STATS_ID 1
  194. #define AT_MIB_ADDRXLAT_INFO_ID 1
  195. #define AT_MIB_ADDRXLAT_ENTRY_ID 0x101
  196. #define IP_MIB_RTTABLE_ENTRY_ID 0x101
  197. #define IP_MIB_ADDRTABLE_ENTRY_ID 0x102
  198. #define IP_MIB_RTTABLE_ENTRY_ID_EX 0x103
  199. #define IP_INTFC_FLAG_P2P 1
  200. #define IP_INTFC_FLAG_P2MP 2
  201. #define IP_INTFC_FLAG_UNIDIRECTIONAL 4
  202. typedef struct IPInterfaceInfo {
  203. ulong iii_flags;
  204. ulong iii_mtu;
  205. ulong iii_speed;
  206. ulong iii_addrlength;
  207. uchar iii_addr[1];
  208. } IPInterfaceInfo;
  209. #define IP_INTFC_INFO_ID 0x103
  210. #define IP_MIB_SINGLE_RT_ENTRY_ID 0x104
  211. #define IP_GET_BEST_SOURCE 0x105
  212. #ifndef s6_addr
  213. struct in6_addr {
  214. union {
  215. unsigned char Byte[16];
  216. unsigned short Word[8];
  217. } u;
  218. };
  219. #define in_addr6 in6_addr
  220. /*
  221. ** Defines to match RFC 2553.
  222. */
  223. #define _S6_un u
  224. #define _S6_u8 Byte
  225. #define s6_addr _S6_un._S6_u8
  226. /*
  227. ** Defines for our implementation.
  228. */
  229. #define s6_bytes u.Byte
  230. #define s6_words u.Word
  231. #endif
  232. typedef struct IP6RouteEntry {
  233. ulong ire_Length;
  234. struct in6_addr ire_Source;
  235. ulong ire_ScopeId;
  236. ulong ire_IfIndex;
  237. } IP6RouteEntry;
  238. #define IP6_MIB_STATS_ID IP_MIB_STATS_ID
  239. #define IP6_GET_BEST_ROUTE_ID 3
  240. #define ICMP6_MIB_STATS_ID 4
  241. #pragma warning(pop)
  242. #endif // IPINFO_INCLUDED