Source code of Windows XP (NT5)
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.

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