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.

5490 lines
236 KiB

  1. cpp_quote("//=============================================================================")
  2. cpp_quote("// Microsoft (R) Network Monitor (tm). ")
  3. cpp_quote("// Copyright (C) Microsoft Corporation. All rights reserved.")
  4. cpp_quote("//")
  5. cpp_quote("// MODULE: netmon.h")
  6. cpp_quote("//")
  7. cpp_quote("// This is the consolidated include file for all Network Monitor components.")
  8. cpp_quote("//")
  9. cpp_quote("// It contains the contents of these files from previous SDKs:")
  10. cpp_quote("//")
  11. cpp_quote("// NPPTypes.h")
  12. cpp_quote("// NMEvent.h (previously Event.h)")
  13. cpp_quote("// NMmcs.h (previously mcs.h)")
  14. cpp_quote("// NMmonitor.h (previously monitor.h)")
  15. cpp_quote("// Finder.h")
  16. cpp_quote("// NMSupp.h")
  17. cpp_quote("// BHTypes.h")
  18. cpp_quote("// NMErr.h")
  19. cpp_quote("// BHFilter.h")
  20. cpp_quote("// Frame.h")
  21. cpp_quote("// Parser.h")
  22. cpp_quote("// IniLib.h")
  23. cpp_quote("// NMExpert.h (previously Expert.h)")
  24. cpp_quote("// Netmon.h (previously bh.h)")
  25. cpp_quote("// NMBlob.h (previously blob.h)")
  26. cpp_quote("// NMRegHelp.h (previously reghelp.h)")
  27. cpp_quote("// NMIpStructs.h (previously IpStructs.h)")
  28. cpp_quote("// NMIcmpStructs.h (previously IcmpStructs.h)")
  29. cpp_quote("// NMIpxStructs.h (previously IpxStructs.h)")
  30. cpp_quote("// NMTcpStructs.h (previously TcpStructs.h)")
  31. cpp_quote("//")
  32. cpp_quote("// IDelaydC.idl")
  33. cpp_quote("// IESP.idl")
  34. cpp_quote("// IRTC.idl")
  35. cpp_quote("// IStats.idl")
  36. cpp_quote("//")
  37. cpp_quote("//=============================================================================")
  38. import "unknwn.idl";
  39. cpp_quote("#include <winerror.h>")
  40. //cpp_quote("#include <tchar.h>")
  41. // this first part is so that the idl file gets the proper packing
  42. #ifdef _X86_
  43. #pragma pack(1)
  44. #else
  45. #pragma pack()
  46. #endif
  47. cpp_quote("// For backward compatability with old SDK versions, all structures within this header")
  48. cpp_quote("// file will be byte packed on x86 platforms. All other platforms will only have those")
  49. cpp_quote("// structures that will be used to decode network data packed.")
  50. // this next part is so that the resultant header file will be correct regardless of
  51. // which platform the idl file was compiled for
  52. cpp_quote("#ifdef _X86_")
  53. cpp_quote("#pragma pack(1)")
  54. cpp_quote("#else")
  55. cpp_quote("#pragma pack()")
  56. cpp_quote("#endif")
  57. cpp_quote("")
  58. cpp_quote("// yes we know that many of our structures have:")
  59. cpp_quote("// warning C4200: nonstandard extension used : zero-sized array in struct/union")
  60. cpp_quote("// this is OK and intended")
  61. #pragma warning(disable:4200)
  62. cpp_quote("//=============================================================================")
  63. cpp_quote("//=============================================================================")
  64. cpp_quote("// (NPPTypes.h)")
  65. cpp_quote("//=============================================================================")
  66. cpp_quote("//=============================================================================")
  67. // normally MAX_PATH is not defined for our MIDL builds
  68. #ifndef MAX_PATH
  69. #define MAX_PATH 260
  70. #endif
  71. #ifndef LPBYTE
  72. typedef BYTE *LPBYTE;
  73. #endif //LPBYTE
  74. typedef const void * HBLOB;
  75. cpp_quote("//=============================================================================")
  76. cpp_quote("// General constants.")
  77. cpp_quote("//=============================================================================")
  78. const DWORD MAC_TYPE_UNKNOWN = 0;
  79. const DWORD MAC_TYPE_ETHERNET = 1;
  80. const DWORD MAC_TYPE_TOKENRING = 2;
  81. const DWORD MAC_TYPE_FDDI = 3;
  82. const DWORD MAC_TYPE_ATM = 4;
  83. const DWORD MAC_TYPE_1394 = 5;
  84. const DWORD MACHINE_NAME_LENGTH = 16 ;
  85. const DWORD USER_NAME_LENGTH = 32 ;
  86. const DWORD ADAPTER_COMMENT_LENGTH = 32 ;
  87. const DWORD CONNECTION_FLAGS_WANT_CONVERSATION_STATS =0x00000001;
  88. cpp_quote("//=============================================================================")
  89. cpp_quote("// Transmit statistics structure.")
  90. cpp_quote("//=============================================================================")
  91. typedef struct _TRANSMITSTATS
  92. {
  93. DWORD TotalFramesSent;
  94. DWORD TotalBytesSent;
  95. DWORD TotalTransmitErrors;
  96. } TRANSMITSTATS;
  97. typedef TRANSMITSTATS *LPTRANSMITSTATS;
  98. const DWORD TRANSMITSTATS_SIZE =sizeof(TRANSMITSTATS);
  99. cpp_quote("//=============================================================================")
  100. cpp_quote("// Statistics structure.")
  101. cpp_quote("//=============================================================================")
  102. typedef struct _STATISTICS
  103. {
  104. __int64 TimeElapsed; // in millionths of a second
  105. //...Buffer statistics
  106. DWORD TotalFramesCaptured;
  107. DWORD TotalBytesCaptured;
  108. //...Filtered statistics
  109. DWORD TotalFramesFiltered;
  110. DWORD TotalBytesFiltered;
  111. DWORD TotalMulticastsFiltered;
  112. DWORD TotalBroadcastsFiltered;
  113. //...Overall statistics.
  114. DWORD TotalFramesSeen;
  115. DWORD TotalBytesSeen;
  116. DWORD TotalMulticastsReceived;
  117. DWORD TotalBroadcastsReceived;
  118. DWORD TotalFramesDropped;
  119. DWORD TotalFramesDroppedFromBuffer;
  120. //... Statistics kept by MAC driver.
  121. DWORD MacFramesReceived;
  122. DWORD MacCRCErrors;
  123. __int64 MacBytesReceivedEx;
  124. DWORD MacFramesDropped_NoBuffers;
  125. DWORD MacMulticastsReceived;
  126. DWORD MacBroadcastsReceived;
  127. DWORD MacFramesDropped_HwError;
  128. } STATISTICS;
  129. typedef STATISTICS *LPSTATISTICS;
  130. const DWORD STATISTICS_SIZE =sizeof(STATISTICS);
  131. cpp_quote("//=============================================================================")
  132. cpp_quote("// Address structures")
  133. cpp_quote("//=============================================================================")
  134. cpp_quote("")
  135. cpp_quote("// These structures are used to decode network data and so need to be packed")
  136. #pragma pack(push, 1)
  137. const DWORD MAX_NAME_SIZE =32;
  138. const DWORD IP_ADDRESS_SIZE =4;
  139. const DWORD MAC_ADDRESS_SIZE =6;
  140. cpp_quote("// Q: What is the maximum address size that we could have to copy?")
  141. cpp_quote("// A: IPX == DWORD + 6 bytes == 10")
  142. const DWORD MAX_ADDRESS_SIZE =10;
  143. const DWORD ADDRESS_TYPE_ETHERNET =0;
  144. const DWORD ADDRESS_TYPE_IP =1;
  145. const DWORD ADDRESS_TYPE_IPX =2;
  146. const DWORD ADDRESS_TYPE_TOKENRING =3;
  147. const DWORD ADDRESS_TYPE_FDDI =4;
  148. const DWORD ADDRESS_TYPE_XNS =5;
  149. const DWORD ADDRESS_TYPE_ANY =6;
  150. const DWORD ADDRESS_TYPE_ANY_GROUP =7;
  151. const DWORD ADDRESS_TYPE_FIND_HIGHEST =8;
  152. const DWORD ADDRESS_TYPE_VINES_IP =9;
  153. const DWORD ADDRESS_TYPE_LOCAL_ONLY =10;
  154. const DWORD ADDRESS_TYPE_ATM =11;
  155. const DWORD ADDRESS_TYPE_1394 =12;
  156. const DWORD ADDRESSTYPE_FLAGS_NORMALIZE =0x0001 ;
  157. const DWORD ADDRESSTYPE_FLAGS_BIT_REVERSE =0x0002 ;
  158. cpp_quote("// Vines IP Address Structure")
  159. typedef struct _VINES_IP_ADDRESS
  160. {
  161. DWORD NetID;
  162. WORD SubnetID;
  163. } VINES_IP_ADDRESS;
  164. typedef VINES_IP_ADDRESS *LPVINES_IP_ADDRESS;
  165. const DWORD VINES_IP_ADDRESS_SIZE =sizeof(VINES_IP_ADDRESS);
  166. cpp_quote("// IPX Address Structure")
  167. typedef struct _IPX_ADDR
  168. {
  169. BYTE Subnet[4];
  170. BYTE Address[6];
  171. } IPX_ADDR;
  172. typedef IPX_ADDR *LPIPX_ADDR;
  173. const DWORD IPX_ADDR_SIZE =sizeof(IPX_ADDR);
  174. cpp_quote("// XNS Address Structure")
  175. typedef IPX_ADDR XNS_ADDRESS;
  176. typedef IPX_ADDR *LPXNS_ADDRESS;
  177. // structure contains a bitfield, so must cpp_quote
  178. cpp_quote("// ETHERNET SOURCE ADDRESS")
  179. cpp_quote("typedef struct _ETHERNET_SRC_ADDRESS")
  180. cpp_quote("{")
  181. cpp_quote(" BYTE RoutingBit: 1;")
  182. cpp_quote(" BYTE LocalBit: 1;")
  183. cpp_quote(" BYTE Byte0: 6;")
  184. cpp_quote(" BYTE Reserved[5];")
  185. cpp_quote("")
  186. cpp_quote("} ETHERNET_SRC_ADDRESS;")
  187. cpp_quote("typedef ETHERNET_SRC_ADDRESS *LPETHERNET_SRC_ADDRESS;")
  188. // structure contains a bitfield, so must cpp_quote
  189. cpp_quote("// ETHERNET DESTINATION ADDRESS")
  190. cpp_quote("typedef struct _ETHERNET_DST_ADDRESS")
  191. cpp_quote("{")
  192. cpp_quote(" BYTE GroupBit: 1;")
  193. cpp_quote(" BYTE AdminBit: 1;")
  194. cpp_quote(" BYTE Byte0: 6;")
  195. cpp_quote(" BYTE Reserved[5];")
  196. cpp_quote("} ETHERNET_DST_ADDRESS;")
  197. cpp_quote("typedef ETHERNET_DST_ADDRESS *LPETHERNET_DST_ADDRESS;")
  198. cpp_quote("")
  199. cpp_quote("// FDDI addresses")
  200. cpp_quote("typedef ETHERNET_SRC_ADDRESS FDDI_SRC_ADDRESS;")
  201. cpp_quote("typedef ETHERNET_DST_ADDRESS FDDI_DST_ADDRESS;")
  202. cpp_quote("")
  203. cpp_quote("typedef FDDI_SRC_ADDRESS *LPFDDI_SRC_ADDRESS;")
  204. cpp_quote("typedef FDDI_DST_ADDRESS *LPFDDI_DST_ADDRESS;")
  205. cpp_quote("")
  206. // structure contains a bitfield, so must cpp_quote
  207. cpp_quote("// TOKENRING Source Address")
  208. cpp_quote("typedef struct _TOKENRING_SRC_ADDRESS")
  209. cpp_quote("{")
  210. cpp_quote(" BYTE Byte0: 6;")
  211. cpp_quote(" BYTE LocalBit: 1;")
  212. cpp_quote(" BYTE RoutingBit: 1;")
  213. cpp_quote(" BYTE Byte1;")
  214. cpp_quote(" BYTE Byte2: 7;")
  215. cpp_quote(" BYTE Functional: 1;")
  216. cpp_quote(" BYTE Reserved[3];")
  217. cpp_quote("} TOKENRING_SRC_ADDRESS;")
  218. cpp_quote("typedef TOKENRING_SRC_ADDRESS *LPTOKENRING_SRC_ADDRESS;")
  219. cpp_quote("")
  220. // structure contains a bitfield, so must cpp_quote
  221. cpp_quote("// TOKENRING Destination Address")
  222. cpp_quote("typedef struct _TOKENRING_DST_ADDRESS")
  223. cpp_quote("{")
  224. cpp_quote(" BYTE Byte0: 6;")
  225. cpp_quote(" BYTE AdminBit: 1;")
  226. cpp_quote(" BYTE GroupBit: 1;")
  227. cpp_quote(" BYTE Reserved[5];")
  228. cpp_quote("} TOKENRING_DST_ADDRESS;")
  229. cpp_quote("typedef TOKENRING_DST_ADDRESS *LPTOKENRING_DST_ADDRESS;")
  230. // structure contains structures with bitfields, so must cpp_quote
  231. cpp_quote("// Address Structure")
  232. cpp_quote("typedef struct _ADDRESS")
  233. cpp_quote("{")
  234. cpp_quote(" DWORD Type;")
  235. cpp_quote("")
  236. cpp_quote(" union")
  237. cpp_quote(" {")
  238. cpp_quote(" // ADDRESS_TYPE_ETHERNET")
  239. cpp_quote(" // ADDRESS_TYPE_TOKENRING")
  240. cpp_quote(" // ADDRESS_TYPE_FDDI")
  241. cpp_quote(" BYTE MACAddress[MAC_ADDRESS_SIZE];")
  242. cpp_quote("")
  243. cpp_quote(" // IP")
  244. cpp_quote(" BYTE IPAddress[IP_ADDRESS_SIZE];")
  245. cpp_quote("")
  246. cpp_quote(" // raw IPX")
  247. cpp_quote(" BYTE IPXRawAddress[IPX_ADDR_SIZE];")
  248. cpp_quote("")
  249. cpp_quote(" // real IPX")
  250. cpp_quote(" IPX_ADDR IPXAddress;")
  251. cpp_quote("")
  252. cpp_quote(" // raw Vines IP")
  253. cpp_quote(" BYTE VinesIPRawAddress[VINES_IP_ADDRESS_SIZE];")
  254. cpp_quote("")
  255. cpp_quote(" // real Vines IP")
  256. cpp_quote(" VINES_IP_ADDRESS VinesIPAddress;")
  257. cpp_quote("")
  258. cpp_quote(" // ethernet with bits defined")
  259. cpp_quote(" ETHERNET_SRC_ADDRESS EthernetSrcAddress;")
  260. cpp_quote("")
  261. cpp_quote(" // ethernet with bits defined")
  262. cpp_quote(" ETHERNET_DST_ADDRESS EthernetDstAddress;")
  263. cpp_quote("")
  264. cpp_quote(" // tokenring with bits defined")
  265. cpp_quote(" TOKENRING_SRC_ADDRESS TokenringSrcAddress;")
  266. cpp_quote("")
  267. cpp_quote(" // tokenring with bits defined")
  268. cpp_quote(" TOKENRING_DST_ADDRESS TokenringDstAddress;")
  269. cpp_quote("")
  270. cpp_quote(" // fddi with bits defined")
  271. cpp_quote(" FDDI_SRC_ADDRESS FddiSrcAddress;")
  272. cpp_quote("")
  273. cpp_quote(" // fddi with bits defined")
  274. cpp_quote(" FDDI_DST_ADDRESS FddiDstAddress;")
  275. cpp_quote(" };")
  276. cpp_quote(" ")
  277. cpp_quote(" WORD Flags;")
  278. cpp_quote("} ADDRESS;")
  279. cpp_quote("typedef ADDRESS *LPADDRESS;")
  280. cpp_quote("#define ADDRESS_SIZE sizeof(ADDRESS)")
  281. cpp_quote("")
  282. #pragma pack(pop)
  283. cpp_quote("//=============================================================================")
  284. cpp_quote("// Address Pair Structure")
  285. cpp_quote("//=============================================================================")
  286. const DWORD ADDRESS_FLAGS_MATCH_DST =0x0001;
  287. const DWORD ADDRESS_FLAGS_MATCH_SRC =0x0002;
  288. const DWORD ADDRESS_FLAGS_EXCLUDE =0x0004;
  289. const DWORD ADDRESS_FLAGS_DST_GROUP_ADDR =0x0008;
  290. const DWORD ADDRESS_FLAGS_MATCH_BOTH =0x0003;
  291. // structure contains structures with bitfields, so must cpp_quote
  292. cpp_quote("typedef struct _ADDRESSPAIR")
  293. cpp_quote("{")
  294. cpp_quote(" WORD AddressFlags;")
  295. cpp_quote(" WORD NalReserved;")
  296. cpp_quote(" ADDRESS DstAddress;")
  297. cpp_quote(" ADDRESS SrcAddress;")
  298. cpp_quote("")
  299. cpp_quote("} ADDRESSPAIR;")
  300. cpp_quote("typedef ADDRESSPAIR *LPADDRESSPAIR;")
  301. cpp_quote("#define ADDRESSPAIR_SIZE sizeof(ADDRESSPAIR)")
  302. cpp_quote("//=============================================================================")
  303. cpp_quote("// Address table.")
  304. cpp_quote("//=============================================================================")
  305. const DWORD MAX_ADDRESS_PAIRS =8;
  306. // structure contains structures with bitfields, so must cpp_quote
  307. cpp_quote("typedef struct _ADDRESSTABLE")
  308. cpp_quote("{")
  309. cpp_quote(" DWORD nAddressPairs;")
  310. cpp_quote(" DWORD nNonMacAddressPairs;")
  311. cpp_quote(" ADDRESSPAIR AddressPair[MAX_ADDRESS_PAIRS];")
  312. cpp_quote("")
  313. cpp_quote("} ADDRESSTABLE;")
  314. cpp_quote("")
  315. cpp_quote("typedef ADDRESSTABLE *LPADDRESSTABLE;")
  316. cpp_quote("#define ADDRESSTABLE_SIZE sizeof(ADDRESSTABLE)")
  317. cpp_quote("//=============================================================================")
  318. cpp_quote("// Network information.")
  319. cpp_quote("//=============================================================================")
  320. const DWORD NETWORKINFO_FLAGS_PMODE_NOT_SUPPORTED =0x00000001;
  321. const DWORD NETWORKINFO_FLAGS_REMOTE_NAL =0x00000004;
  322. const DWORD NETWORKINFO_FLAGS_REMOTE_NAL_CONNECTED =0x00000008;
  323. const DWORD NETWORKINFO_FLAGS_REMOTE_CARD =0x00000010;
  324. const DWORD NETWORKINFO_FLAGS_RAS =0x00000020;
  325. // structure contains structures with bitfields, so must cpp_quote
  326. cpp_quote("typedef struct _NETWORKINFO")
  327. cpp_quote("{")
  328. cpp_quote(" BYTE PermanentAddr[6]; //... Permanent MAC address")
  329. cpp_quote(" BYTE CurrentAddr[6]; //... Current MAC address")
  330. cpp_quote(" ADDRESS OtherAddress; //... Other address supported (IP, IPX, etc...)")
  331. cpp_quote(" DWORD LinkSpeed; //... Link speed in Mbits.")
  332. cpp_quote(" DWORD MacType; //... Media type.")
  333. cpp_quote(" DWORD MaxFrameSize; //... Max frame size allowed.")
  334. cpp_quote(" DWORD Flags; //... Informational flags.")
  335. cpp_quote(" DWORD TimestampScaleFactor; //... 1 = 1/1 ms, 10 = 1/10 ms, 100 = 1/100 ms, etc.")
  336. cpp_quote(" BYTE NodeName[32]; //... Name of remote workstation.")
  337. cpp_quote(" BOOL PModeSupported; //... Card claims to support P-Mode")
  338. cpp_quote(" BYTE Comment[ADAPTER_COMMENT_LENGTH]; // Adapter comment field.")
  339. cpp_quote("")
  340. cpp_quote("} NETWORKINFO;")
  341. cpp_quote("typedef NETWORKINFO *LPNETWORKINFO;")
  342. cpp_quote("#define NETWORKINFO_SIZE sizeof(NETWORKINFO)")
  343. const DWORD MINIMUM_FRAME_SIZE =32;
  344. cpp_quote("//=============================================================================")
  345. cpp_quote("// Pattern structure.")
  346. cpp_quote("//=============================================================================")
  347. const DWORD MAX_PATTERN_LENGTH =16 ;
  348. cpp_quote("// When set this flag will cause those frames which do NOT have the specified pattern")
  349. cpp_quote("// in the proper stop to be kept.")
  350. const DWORD PATTERN_MATCH_FLAGS_NOT =0x00000001;
  351. // This flag was used in previous versions of Network Monitor and its value is therefore
  352. // reserved for compatability reasons
  353. const DWORD PATTERN_MATCH_FLAGS_RESERVED_1 =0x00000002;
  354. cpp_quote("// When set this flag indicates that the user is not interested in a pattern match within ")
  355. cpp_quote("// IP or IPX, but in the protocol that follows. The driver will ensure that the protocol")
  356. cpp_quote("// given in OffsetBasis is there and then that the port in the fram matches the port given.")
  357. cpp_quote("// It will then calculate the offset from the beginning of the protocol that follows IP or IPX.")
  358. cpp_quote("// NOTE: This flag is ignored if it is used with any OffsetBasis other than ")
  359. cpp_quote("// OFFSET_BASIS_RELATIVE_TO_IPX or OFFSET_BASIS_RELATIVE_TO_IP")
  360. const DWORD PATTERN_MATCH_FLAGS_PORT_SPECIFIED =0x00000008;
  361. cpp_quote("// The offset given is relative to the beginning of the frame. The ")
  362. cpp_quote("// PATTERN_MATCH_FLAGS_PORT_SPECIFIED flag is ignored.")
  363. const DWORD OFFSET_BASIS_RELATIVE_TO_FRAME =0;
  364. cpp_quote("// The offset given is relative to the beginning of the Effective Protocol.")
  365. cpp_quote("// The Effective Protocol is defined as the protocol that follows")
  366. cpp_quote("// the last protocol that determines Etype/SAP. In normal terms this means ")
  367. cpp_quote("// that the Effective Protocol will be IP, IPX, XNS, or any of their ilk.")
  368. cpp_quote("// The PATTERN_MATCH_FLAGS_PORT_SPECIFIED flag is ignored.")
  369. const DWORD OFFSET_BASIS_RELATIVE_TO_EFFECTIVE_PROTOCOL =1;
  370. cpp_quote("// The offset given is relative to the beginning of IPX. If IPX is not present")
  371. cpp_quote("// then the frame does not match. If the PATTERN_MATCH_FLAGS_PORT_SPECIFIED")
  372. cpp_quote("// flag is set then the offset is relative to the beginning of the protocol")
  373. cpp_quote("// which follows IPX.")
  374. const DWORD OFFSET_BASIS_RELATIVE_TO_IPX =2;
  375. cpp_quote("// The offset given is relative to the beginning of IP. If IP is not present")
  376. cpp_quote("// then the frame does not match. If the PATTERN_MATCH_FLAGS_PORT_SPECIFIED")
  377. cpp_quote("// flag is set then the offset is relative to the beginning of the protocol")
  378. cpp_quote("// which follows IP.")
  379. const DWORD OFFSET_BASIS_RELATIVE_TO_IP =3;
  380. typedef union
  381. {
  382. BYTE IPPort;
  383. WORD ByteSwappedIPXPort;
  384. } GENERIC_PORT;
  385. typedef struct _PATTERNMATCH
  386. {
  387. DWORD Flags;
  388. BYTE OffsetBasis;
  389. GENERIC_PORT Port;
  390. WORD Offset;
  391. WORD Length;
  392. BYTE PatternToMatch[MAX_PATTERN_LENGTH];
  393. } PATTERNMATCH;
  394. typedef PATTERNMATCH *LPPATTERNMATCH;
  395. const DWORD PATTERNMATCH_SIZE =sizeof(PATTERNMATCH);
  396. cpp_quote("//=============================================================================")
  397. cpp_quote("// Expression structure.")
  398. cpp_quote("//=============================================================================")
  399. const DWORD MAX_PATTERNS =4;
  400. typedef struct _ANDEXP
  401. {
  402. DWORD nPatternMatches;
  403. PATTERNMATCH PatternMatch[MAX_PATTERNS];
  404. } ANDEXP;
  405. typedef ANDEXP *LPANDEXP;
  406. const DWORD ANDEXP_SIZE =sizeof(ANDEXP);
  407. typedef struct _EXPRESSION
  408. {
  409. DWORD nAndExps;
  410. ANDEXP AndExp[MAX_PATTERNS];
  411. } EXPRESSION;
  412. typedef EXPRESSION *LPEXPRESSION;
  413. const DWORD EXPRESSION_SIZE =sizeof(EXPRESSION);
  414. cpp_quote("//=============================================================================")
  415. cpp_quote("// Trigger.")
  416. cpp_quote("//=============================================================================")
  417. const BYTE TRIGGER_TYPE_PATTERN_MATCH =1;
  418. const BYTE TRIGGER_TYPE_BUFFER_CONTENT =2;
  419. const BYTE TRIGGER_TYPE_PATTERN_MATCH_THEN_BUFFER_CONTENT =3;
  420. const BYTE TRIGGER_TYPE_BUFFER_CONTENT_THEN_PATTERN_MATCH =4;
  421. const DWORD TRIGGER_FLAGS_FRAME_RELATIVE =0x00000000 ;
  422. const DWORD TRIGGER_FLAGS_DATA_RELATIVE =0x00000001 ;
  423. const BYTE TRIGGER_ACTION_NOTIFY =0x00 ;
  424. const BYTE TRIGGER_ACTION_STOP =0x02 ;
  425. const BYTE TRIGGER_ACTION_PAUSE =0x03 ;
  426. const DWORD TRIGGER_BUFFER_FULL_25_PERCENT =0 ;
  427. const DWORD TRIGGER_BUFFER_FULL_50_PERCENT =1 ;
  428. const DWORD TRIGGER_BUFFER_FULL_75_PERCENT =2 ;
  429. const DWORD TRIGGER_BUFFER_FULL_100_PERCENT =3 ;
  430. typedef struct _TRIGGER
  431. {
  432. BOOL TriggerActive; //... Whether trigger is running
  433. BYTE TriggerType; //... Opcode of trigger
  434. BYTE TriggerAction; //... Action to take when trigger occurs.
  435. DWORD TriggerFlags; //... Trigger flags.
  436. PATTERNMATCH TriggerPatternMatch; //... Trigger pattern match.
  437. DWORD TriggerBufferSize; //... Trigger buffer size.
  438. DWORD TriggerReserved; //... Set to all zeros - do not use
  439. char TriggerCommandLine[MAX_PATH];
  440. } TRIGGER;
  441. typedef TRIGGER *LPTRIGGER;
  442. const DWORD TRIGGER_SIZE =sizeof(TRIGGER);
  443. cpp_quote("//=============================================================================")
  444. cpp_quote("// Capture filter.")
  445. cpp_quote("//=============================================================================")
  446. cpp_quote("// Capture filter flags. By default all frames are rejected and")
  447. cpp_quote("// Network Monitor enables them based on the CAPTUREFILTER flags")
  448. cpp_quote("// defined below.")
  449. const DWORD CAPTUREFILTER_FLAGS_INCLUDE_ALL_SAPS =0x0001;
  450. const DWORD CAPTUREFILTER_FLAGS_INCLUDE_ALL_ETYPES =0x0002;
  451. const DWORD CAPTUREFILTER_FLAGS_TRIGGER =0x0004;
  452. const DWORD CAPTUREFILTER_FLAGS_LOCAL_ONLY =0x0008;
  453. cpp_quote("// throw away our internal comment frames")
  454. const DWORD CAPTUREFILTER_FLAGS_DISCARD_COMMENTS =0x0010;
  455. cpp_quote("// Keep SMT and Token Ring MAC frames")
  456. const DWORD CAPTUREFILTER_FLAGS_KEEP_RAW =0x0020;
  457. const DWORD CAPTUREFILTER_FLAGS_INCLUDE_ALL =0x0003;
  458. const DWORD BUFFER_FULL_25_PERCENT =0;
  459. const DWORD BUFFER_FULL_50_PERCENT =1;
  460. const DWORD BUFFER_FULL_75_PERCENT =2;
  461. const DWORD BUFFER_FULL_100_PERCENT =3;
  462. // structure contains structures with bitfields, so must cpp_quote
  463. cpp_quote("typedef struct _CAPTUREFILTER")
  464. cpp_quote("{")
  465. cpp_quote(" DWORD FilterFlags; ")
  466. cpp_quote(" LPBYTE lpSapTable; ")
  467. cpp_quote(" LPWORD lpEtypeTable; ")
  468. cpp_quote(" WORD nSaps; ")
  469. cpp_quote(" WORD nEtypes; ")
  470. cpp_quote(" LPADDRESSTABLE AddressTable; ")
  471. cpp_quote(" EXPRESSION FilterExpression; ")
  472. cpp_quote(" TRIGGER Trigger; ")
  473. cpp_quote(" DWORD nFrameBytesToCopy;")
  474. cpp_quote(" DWORD Reserved;")
  475. cpp_quote("")
  476. cpp_quote("} CAPTUREFILTER;")
  477. cpp_quote("typedef CAPTUREFILTER *LPCAPTUREFILTER;")
  478. cpp_quote("#define CAPTUREFILTER_SIZE sizeof(CAPTUREFILTER)")
  479. cpp_quote("//=============================================================================")
  480. cpp_quote("// Frame type.")
  481. cpp_quote("//=============================================================================")
  482. // this structure may not be cpp_quoted as it is used in itransmt.idl
  483. // (However its length used to be 0).
  484. cpp_quote("// TimeStamp is in 1/1,000,000th seconds.")
  485. typedef struct _FRAME
  486. {
  487. __int64 TimeStamp;
  488. DWORD FrameLength;
  489. DWORD nBytesAvail;
  490. [size_is(nBytesAvail)] BYTE MacFrame[*];
  491. } FRAME;
  492. typedef FRAME *LPFRAME;
  493. cpp_quote("typedef FRAME UNALIGNED *ULPFRAME;")
  494. const DWORD FRAME_SIZE =sizeof(FRAME);
  495. cpp_quote("//=============================================================================")
  496. cpp_quote("// Frame descriptor type.")
  497. cpp_quote("//=============================================================================")
  498. const BYTE LOW_PROTOCOL_IPX =OFFSET_BASIS_RELATIVE_TO_IPX;
  499. const BYTE LOW_PROTOCOL_IP =OFFSET_BASIS_RELATIVE_TO_IP;
  500. const BYTE LOW_PROTOCOL_UNKNOWN =((BYTE)-1);
  501. typedef struct _FRAME_DESCRIPTOR
  502. {
  503. [size_is(FrameLength)] LPBYTE FramePointer;
  504. __int64 TimeStamp;
  505. DWORD FrameLength;
  506. DWORD nBytesAvail;
  507. WORD Etype;
  508. BYTE Sap;
  509. BYTE LowProtocol;
  510. WORD LowProtocolOffset;
  511. [switch_is(LowProtocol)] union
  512. {
  513. [default]
  514. WORD Reserved;
  515. [case(LOW_PROTOCOL_IP)]
  516. BYTE IPPort;
  517. [case(LOW_PROTOCOL_IPX)]
  518. WORD ByteSwappedIPXPort;
  519. } HighPort;
  520. WORD HighProtocolOffset;
  521. } FRAME_DESCRIPTOR;
  522. typedef FRAME_DESCRIPTOR *LPFRAME_DESCRIPTOR;
  523. const DWORD FRAME_DESCRIPTOR_SIZE =sizeof(FRAME_DESCRIPTOR);
  524. cpp_quote("//=============================================================================")
  525. cpp_quote("// Frame descriptor table.")
  526. cpp_quote("//=============================================================================")
  527. // this structure may not be cpp_quoted as it is used in UPDATE_EVENT
  528. // (Besides, the array's length has always been 1)
  529. typedef struct _FRAMETABLE
  530. {
  531. DWORD FrameTableLength;
  532. DWORD StartIndex;
  533. DWORD EndIndex;
  534. DWORD FrameCount;
  535. [size_is(FrameTableLength)] FRAME_DESCRIPTOR Frames[*];
  536. } FRAMETABLE;
  537. typedef FRAMETABLE *LPFRAMETABLE;
  538. cpp_quote("//=============================================================================")
  539. cpp_quote("// Station statistics.")
  540. cpp_quote("//=============================================================================")
  541. const WORD STATIONSTATS_FLAGS_INITIALIZED =0x0001;
  542. const WORD STATIONSTATS_FLAGS_EVENTPOSTED =0x0002;
  543. const DWORD STATIONSTATS_POOL_SIZE =100;
  544. typedef struct _STATIONSTATS
  545. {
  546. DWORD NextStationStats;
  547. DWORD SessionPartnerList;
  548. DWORD Flags;
  549. BYTE StationAddress[6];
  550. WORD Pad;
  551. DWORD TotalPacketsReceived;
  552. DWORD TotalDirectedPacketsSent;
  553. DWORD TotalBroadcastPacketsSent;
  554. DWORD TotalMulticastPacketsSent;
  555. DWORD TotalBytesReceived;
  556. DWORD TotalBytesSent;
  557. } STATIONSTATS;
  558. typedef STATIONSTATS * LPSTATIONSTATS;
  559. const DWORD STATIONSTATS_SIZE =sizeof(STATIONSTATS);
  560. cpp_quote("//=============================================================================")
  561. cpp_quote("// Session statistics.")
  562. cpp_quote("//=============================================================================")
  563. const WORD SESSION_FLAGS_INITIALIZED =0x0001;
  564. const WORD SESSION_FLAGS_EVENTPOSTED =0x0002;
  565. const DWORD SESSION_POOL_SIZE =100;
  566. typedef struct _SESSIONSTATS
  567. {
  568. DWORD NextSession;
  569. DWORD StationOwner;
  570. DWORD StationPartner;
  571. DWORD Flags;
  572. DWORD TotalPacketsSent;
  573. } SESSIONSTATS;
  574. typedef SESSIONSTATS * LPSESSIONSTATS;
  575. const DWORD SESSIONSTATS_SIZE =sizeof(SESSIONSTATS);
  576. cpp_quote("//=============================================================================")
  577. cpp_quote("// Station Query")
  578. cpp_quote("//=============================================================================")
  579. cpp_quote("")
  580. cpp_quote("// These structures are used to decode network data and so need to be packed")
  581. #pragma pack(push, 1)
  582. const DWORD STATIONQUERY_FLAGS_LOADED =0x0001;
  583. const DWORD STATIONQUERY_FLAGS_RUNNING =0x0002;
  584. const DWORD STATIONQUERY_FLAGS_CAPTURING =0x0004;
  585. const DWORD STATIONQUERY_FLAGS_TRANSMITTING =0x0008;
  586. const BYTE STATIONQUERY_VERSION_MINOR =0x01;
  587. const BYTE STATIONQUERY_VERSION_MAJOR =0x02;
  588. typedef struct _OLDSTATIONQUERY
  589. {
  590. DWORD Flags;
  591. BYTE BCDVerMinor;
  592. BYTE BCDVerMajor;
  593. DWORD LicenseNumber;
  594. BYTE MachineName[MACHINE_NAME_LENGTH];
  595. BYTE UserName[USER_NAME_LENGTH];
  596. BYTE Reserved[32];
  597. BYTE AdapterAddress[6];
  598. } OLDSTATIONQUERY;
  599. typedef OLDSTATIONQUERY *LPOLDSTATIONQUERY;
  600. const DWORD OLDSTATIONQUERY_SIZE =sizeof(OLDSTATIONQUERY);
  601. typedef struct _STATIONQUERY
  602. {
  603. DWORD Flags;
  604. BYTE BCDVerMinor;
  605. BYTE BCDVerMajor;
  606. DWORD LicenseNumber;
  607. BYTE MachineName[MACHINE_NAME_LENGTH];
  608. BYTE UserName[USER_NAME_LENGTH];
  609. BYTE Reserved[32];
  610. BYTE AdapterAddress[6];
  611. WCHAR WMachineName[MACHINE_NAME_LENGTH];
  612. WCHAR WUserName[USER_NAME_LENGTH];
  613. } STATIONQUERY;
  614. typedef STATIONQUERY *LPSTATIONQUERY;
  615. const DWORD STATIONQUERY_SIZE =sizeof(STATIONQUERY);
  616. #pragma pack(pop)
  617. cpp_quote("//=============================================================================")
  618. cpp_quote("// structure.")
  619. cpp_quote("//=============================================================================")
  620. // this structure may not be cpp_quoted as it is used in the QueryStations methods in
  621. // each interface below.
  622. // (Besides, the array's length has always been 1)
  623. typedef struct _QUERYTABLE
  624. {
  625. DWORD nStationQueries;
  626. [size_is(nStationQueries)] STATIONQUERY StationQuery[*];
  627. } QUERYTABLE;
  628. typedef QUERYTABLE *LPQUERYTABLE;
  629. const DWORD QUERYTABLE_SIZE =sizeof(QUERYTABLE);
  630. cpp_quote("//=============================================================================")
  631. cpp_quote("// The LINK structure is used to chain structures together into a list.")
  632. cpp_quote("//=============================================================================")
  633. #ifndef _LINK_
  634. #define _LINK_
  635. typedef struct _LINK *LPLINK;
  636. typedef struct _LINK
  637. {
  638. LPLINK PrevLink;
  639. LPLINK NextLink;
  640. } LINK;
  641. #endif //_LINK_
  642. cpp_quote("//=============================================================================")
  643. cpp_quote("// Security Request packet")
  644. cpp_quote("//=============================================================================")
  645. cpp_quote("")
  646. cpp_quote("// This structure is used to decode network data and so needs to be packed")
  647. #pragma pack(push, 1)
  648. typedef struct _SECURITY_PERMISSION_CHECK
  649. {
  650. UINT Version;
  651. DWORD RandomNumber;
  652. BYTE MachineName[MACHINE_NAME_LENGTH];
  653. BYTE UserName[USER_NAME_LENGTH];
  654. UINT MacType;
  655. BYTE PermanentAdapterAddress[MAC_ADDRESS_SIZE];
  656. BYTE CurrentAdapterAddress[MAC_ADDRESS_SIZE];
  657. WCHAR WMachineName[MACHINE_NAME_LENGTH];
  658. WCHAR WUserName[USER_NAME_LENGTH];
  659. } SECURITY_PERMISSION_CHECK;
  660. typedef SECURITY_PERMISSION_CHECK * LPSECURITY_PERMISSION_CHECK;
  661. cpp_quote("typedef SECURITY_PERMISSION_CHECK UNALIGNED * ULPSECURITY_PERMISSION_CHECK;")
  662. const DWORD SECURITY_PERMISSION_CHECK_SIZE =sizeof(SECURITY_PERMISSION_CHECK);
  663. #pragma pack(pop)
  664. cpp_quote("//=============================================================================")
  665. cpp_quote("// Security Response packet")
  666. cpp_quote("//=============================================================================")
  667. cpp_quote("")
  668. cpp_quote("// This structure is used to decode network data and so needs to be packed")
  669. #pragma pack(push, 1)
  670. const DWORD MAX_SECURITY_BREACH_REASON_SIZE =100;
  671. const DWORD MAX_SIGNATURE_LENGTH =128;
  672. const DWORD MAX_USER_NAME_LENGTH =256;
  673. typedef struct _SECURITY_PERMISSION_RESPONSE
  674. {
  675. UINT Version;
  676. DWORD RandomNumber;
  677. BYTE MachineName[MACHINE_NAME_LENGTH];
  678. BYTE Address[MAC_ADDRESS_SIZE];
  679. BYTE UserName[MAX_USER_NAME_LENGTH];
  680. BYTE Reason[MAX_SECURITY_BREACH_REASON_SIZE];
  681. DWORD SignatureLength;
  682. BYTE Signature[MAX_SIGNATURE_LENGTH];
  683. } SECURITY_PERMISSION_RESPONSE;
  684. typedef SECURITY_PERMISSION_RESPONSE * LPSECURITY_PERMISSION_RESPONSE;
  685. cpp_quote("typedef SECURITY_PERMISSION_RESPONSE UNALIGNED * ULPSECURITY_PERMISSION_RESPONSE;")
  686. const DWORD SECURITY_PERMISSION_RESPONSE_SIZE =sizeof(SECURITY_PERMISSION_RESPONSE);
  687. #pragma pack(pop)
  688. cpp_quote("//=============================================================================")
  689. cpp_quote("// Callback type")
  690. cpp_quote("//=============================================================================")
  691. cpp_quote("// generic events")
  692. const DWORD UPDATE_EVENT_TERMINATE_THREAD =0x00000000;
  693. const DWORD UPDATE_EVENT_NETWORK_STATUS =0x00000001;
  694. cpp_quote("// rtc events")
  695. const DWORD UPDATE_EVENT_RTC_INTERVAL_ELAPSED =0x00000002;
  696. const DWORD UPDATE_EVENT_RTC_FRAME_TABLE_FULL =0x00000003;
  697. const DWORD UPDATE_EVENT_RTC_BUFFER_FULL =0x00000004;
  698. cpp_quote("// delayed events")
  699. const DWORD UPDATE_EVENT_TRIGGER_BUFFER_CONTENT =0x00000005;
  700. const DWORD UPDATE_EVENT_TRIGGER_PATTERN_MATCH =0x00000006;
  701. const DWORD UPDATE_EVENT_TRIGGER_BUFFER_PATTERN =0x00000007;
  702. const DWORD UPDATE_EVENT_TRIGGER_PATTERN_BUFFER =0x00000008;
  703. cpp_quote("// transmit events")
  704. const DWORD UPDATE_EVENT_TRANSMIT_STATUS =0x00000009;
  705. cpp_quote("// Security events")
  706. const DWORD UPDATE_EVENT_SECURITY_BREACH =0x0000000A;
  707. cpp_quote("// Remote failure event")
  708. const DWORD UPDATE_EVENT_REMOTE_FAILURE =0x0000000B;
  709. cpp_quote("// actions")
  710. const DWORD UPDATE_ACTION_TERMINATE_THREAD =0x00000000;
  711. const DWORD UPDATE_ACTION_NOTIFY =0x00000001;
  712. const DWORD UPDATE_ACTION_STOP_CAPTURE =0x00000002;
  713. const DWORD UPDATE_ACTION_PAUSE_CAPTURE =0x00000003;
  714. const DWORD UPDATE_ACTION_RTC_BUFFER_SWITCH =0x00000004;
  715. typedef struct _UPDATE_EVENT
  716. {
  717. USHORT Event;
  718. DWORD Action;
  719. DWORD Status;
  720. DWORD Value;
  721. __int64 TimeStamp;
  722. DWORD_PTR lpUserContext;
  723. DWORD_PTR lpReserved;
  724. UINT FramesDropped;
  725. [switch_is(Event)] union
  726. {
  727. [default]
  728. DWORD Reserved;
  729. [case(2,3,4)]
  730. LPFRAMETABLE lpFrameTable;
  731. [case(9)]
  732. DWORD_PTR lpPacketQueue;
  733. [case(10)]
  734. SECURITY_PERMISSION_RESPONSE SecurityResponse;
  735. };
  736. LPSTATISTICS lpFinalStats;
  737. } UPDATE_EVENT;
  738. typedef UPDATE_EVENT *PUPDATE_EVENT;
  739. cpp_quote("// note for c++ users:")
  740. cpp_quote("// the declaration for this callback should be in the public part of the header file:")
  741. cpp_quote("// static WINAPI DWORD NetworkCallback( UPDATE_EVENT events);")
  742. cpp_quote("// and the implementation should be, in the protected section of the cpp file:")
  743. cpp_quote("// DWORD WINAPI ClassName::NetworkCallback( UPDATE_EVENT events) {};")
  744. cpp_quote("//typedef DWORD (WINAPI *LPNETWORKCALLBACKPROC)( UPDATE_EVENT);")
  745. cpp_quote("typedef DWORD (WINAPI *LPNETWORKCALLBACKPROC)( UPDATE_EVENT);")
  746. cpp_quote("//=============================================================================")
  747. cpp_quote("// NETWORKSTATUS data structure.")
  748. cpp_quote("//=============================================================================")
  749. typedef struct _NETWORKSTATUS
  750. {
  751. DWORD State;
  752. DWORD Flags;
  753. } NETWORKSTATUS;
  754. typedef NETWORKSTATUS *LPNETWORKSTATUS;
  755. const DWORD NETWORKSTATUS_SIZE =sizeof(NETWORKSTATUS);
  756. const DWORD NETWORKSTATUS_STATE_VOID =0;
  757. const DWORD NETWORKSTATUS_STATE_INIT =1;
  758. const DWORD NETWORKSTATUS_STATE_CAPTURING =2;
  759. const DWORD NETWORKSTATUS_STATE_PAUSED =3;
  760. const DWORD NETWORKSTATUS_FLAGS_TRIGGER_PENDING =0x00000001;
  761. cpp_quote("//=============================================================================")
  762. cpp_quote("// BONEPACKET structure.")
  763. cpp_quote("//=============================================================================")
  764. cpp_quote("")
  765. cpp_quote("// This structure is used to decode network data and so needs to be packed")
  766. #pragma pack(push, 1)
  767. const BYTE BONE_COMMAND_STATION_QUERY_REQUEST =0;
  768. const BYTE BONE_COMMAND_STATION_QUERY_RESPONSE =1;
  769. const BYTE BONE_COMMAND_ALERT =2;
  770. const BYTE BONE_COMMAND_PERMISSION_CHECK =3;
  771. const BYTE BONE_COMMAND_PERMISSION_RESPONSE =4;
  772. const BYTE BONE_COMMAND_SECURITY_MONITOR_EVENT =5;
  773. typedef struct _BONEPACKET
  774. {
  775. DWORD Signature;
  776. BYTE Command;
  777. BYTE Flags;
  778. DWORD Reserved;
  779. WORD Length;
  780. } BONEPACKET;
  781. typedef BONEPACKET *LPBONEPACKET;
  782. cpp_quote("typedef BONEPACKET UNALIGNED* ULPBONEPACKET;")
  783. const DWORD BONEPACKET_SIZE =sizeof(BONEPACKET);
  784. #pragma pack(pop)
  785. cpp_quote("//=============================================================================")
  786. cpp_quote("// BONE alert packet.")
  787. cpp_quote("//=============================================================================")
  788. cpp_quote("")
  789. cpp_quote("// This structure is used to decode network data and so needs to be packed")
  790. #pragma pack(push, 1)
  791. const DWORD ALERT_CODE_BEGIN_TRANSMIT =0;
  792. typedef struct _ALERT
  793. {
  794. DWORD AlertCode;
  795. WCHAR WMachineName[MACHINE_NAME_LENGTH];
  796. WCHAR WUserName[USER_NAME_LENGTH];
  797. union
  798. {
  799. BYTE Pad[32];
  800. DWORD nFramesToSend;
  801. };
  802. } ALERT;
  803. typedef ALERT *LPALERT;
  804. const DWORD ALERT_SIZE =sizeof(ALERT);
  805. #pragma pack(pop)
  806. cpp_quote("//=============================================================================")
  807. cpp_quote("// BONEPACKET signature.")
  808. cpp_quote("//=============================================================================")
  809. cpp_quote("#define MAKE_WORD(l, h) (((WORD) (l)) | (((WORD) (h)) << 8))")
  810. cpp_quote("#define MAKE_LONG(l, h) (((DWORD) (l)) | (((DWORD) (h)) << 16L))")
  811. cpp_quote("#define MAKE_SIG(a, b, c, d) MAKE_LONG(MAKE_WORD(a, b), MAKE_WORD(c, d))")
  812. cpp_quote("#define BONE_PACKET_SIGNATURE MAKE_SIG('R', 'T', 'S', 'S')")
  813. cpp_quote("//=============================================================================")
  814. cpp_quote("// STATISTICS parameter structure.")
  815. cpp_quote("//=============================================================================")
  816. const DWORD MAX_SESSIONS =100;
  817. const DWORD MAX_STATIONS =100;
  818. typedef struct _STATISTICSPARAM
  819. {
  820. DWORD StatisticsSize;
  821. STATISTICS Statistics;
  822. DWORD StatisticsTableEntries;
  823. STATIONSTATS StatisticsTable[MAX_STATIONS];
  824. DWORD SessionTableEntries;
  825. SESSIONSTATS SessionTable[MAX_SESSIONS];
  826. } STATISTICSPARAM;
  827. typedef STATISTICSPARAM *LPSTATISTICSPARAM;
  828. const DWORD STATISTICSPARAM_SIZE =sizeof(STATISTICSPARAM);
  829. cpp_quote("//=============================================================================")
  830. cpp_quote("// Capture file header.")
  831. cpp_quote("//=============================================================================")
  832. cpp_quote("")
  833. cpp_quote("// This structure is used to decode file data and so needs to be packed")
  834. #pragma pack(push, 1)
  835. const DWORD CAPTUREFILE_VERSION_MAJOR =2;
  836. const DWORD CAPTUREFILE_VERSION_MINOR =0;
  837. cpp_quote("#define MakeVersion(Major, Minor) ((DWORD) MAKEWORD(Minor, Major))")
  838. cpp_quote("#define GetCurrentVersion() MakeVersion(CAPTUREFILE_VERSION_MAJOR, CAPTUREFILE_VERSION_MINOR)")
  839. cpp_quote("#define NETMON_1_0_CAPTUREFILE_SIGNATURE MAKE_IDENTIFIER('R', 'T', 'S', 'S')")
  840. cpp_quote("#define NETMON_2_0_CAPTUREFILE_SIGNATURE MAKE_IDENTIFIER('G', 'M', 'B', 'U')")
  841. typedef struct _CAPTUREFILE_HEADER_VALUES
  842. {
  843. DWORD Signature; //... Unique identifier: 'RTSS'.
  844. BYTE BCDVerMinor; //... Binary coded decimal (minor).
  845. BYTE BCDVerMajor; //... Binary coded decimal (major).
  846. WORD MacType; //... Topology type.
  847. SYSTEMTIME TimeStamp; //... time of capture.
  848. DWORD FrameTableOffset; //... Frame index table.
  849. DWORD FrameTableLength; //... Frame index table size.
  850. DWORD UserDataOffset; //... User data offset.
  851. DWORD UserDataLength; //... User data length.
  852. DWORD CommentDataOffset; //... Comment Data offset
  853. DWORD CommentDataLength; //... Length of comment data.
  854. DWORD StatisticsOffset; //....offset to STATISTICS STRUCTURE
  855. DWORD StatisticsLength; //....length of stats struct
  856. DWORD NetworkInfoOffset; //....offset to network info structure
  857. DWORD NetworkInfoLength; //....length of network info structure
  858. DWORD ConversationStatsOffset; //....offset of conv stats structure
  859. DWORD ConversationStatsLength; //....length of conv stats structure
  860. } CAPTUREFILE_HEADER_VALUES;
  861. typedef CAPTUREFILE_HEADER_VALUES *LPCAPTUREFILE_HEADER_VALUES;
  862. const DWORD CAPTUREFILE_HEADER_VALUES_SIZE =sizeof(CAPTUREFILE_HEADER_VALUES);
  863. #pragma pack(pop)
  864. cpp_quote("//=============================================================================")
  865. cpp_quote("// Capture file.")
  866. cpp_quote("//=============================================================================")
  867. cpp_quote("")
  868. cpp_quote("// This structure is used to decode file data and so needs to be packed")
  869. #pragma pack(push, 1)
  870. typedef struct _CAPTUREFILE_HEADER
  871. {
  872. union
  873. {
  874. CAPTUREFILE_HEADER_VALUES ActualHeader;
  875. BYTE Buffer[CAPTUREFILE_HEADER_VALUES_SIZE];
  876. };
  877. BYTE Reserved[128 - CAPTUREFILE_HEADER_VALUES_SIZE];
  878. } CAPTUREFILE_HEADER;
  879. typedef CAPTUREFILE_HEADER *LPCAPTUREFILE_HEADER;
  880. const DWORD CAPTUREFILE_HEADER_SIZE =sizeof(CAPTUREFILE_HEADER);
  881. #pragma pack(pop)
  882. cpp_quote("//=============================================================================")
  883. cpp_quote("// Stats Frame definitions.")
  884. cpp_quote("//=============================================================================")
  885. cpp_quote("")
  886. cpp_quote("// These structures are used to create network data and so need to be packed")
  887. #pragma pack(push, 1)
  888. typedef struct _EFRAMEHDR
  889. {
  890. BYTE SrcAddress[6];
  891. BYTE DstAddress[6];
  892. WORD Length;
  893. BYTE DSAP;
  894. BYTE SSAP;
  895. BYTE Control;
  896. BYTE ProtocolID[3];
  897. WORD EtherType;
  898. } EFRAMEHDR;
  899. typedef struct _TRFRAMEHDR
  900. {
  901. BYTE AC;
  902. BYTE FC;
  903. BYTE SrcAddress[6];
  904. BYTE DstAddress[6];
  905. BYTE DSAP;
  906. BYTE SSAP;
  907. BYTE Control;
  908. BYTE ProtocolID[3];
  909. WORD EtherType;
  910. } TRFRAMEHDR;
  911. const BYTE DEFAULT_TR_AC =0x00;
  912. const BYTE DEFAULT_TR_FC =0x40;
  913. const BYTE DEFAULT_SAP =0xAA;
  914. const BYTE DEFAULT_CONTROL =0x03;
  915. const WORD DEFAULT_ETHERTYPE =0x8419;
  916. typedef struct _FDDIFRAMEHDR
  917. {
  918. BYTE FC;
  919. BYTE SrcAddress[6];
  920. BYTE DstAddress[6];
  921. BYTE DSAP;
  922. BYTE SSAP;
  923. BYTE Control;
  924. BYTE ProtocolID[3];
  925. WORD EtherType;
  926. } FDDIFRAMEHDR;
  927. const BYTE DEFAULT_FDDI_FC =0x10;
  928. typedef struct _FDDISTATFRAME
  929. {
  930. __int64 TimeStamp;
  931. DWORD FrameLength;
  932. DWORD nBytesAvail;
  933. FDDIFRAMEHDR FrameHeader;
  934. BYTE FrameID[4];
  935. DWORD Flags;
  936. DWORD FrameType;
  937. WORD StatsDataLen;
  938. DWORD StatsVersion;
  939. STATISTICS Statistics;
  940. } FDDISTATFRAME;
  941. typedef FDDISTATFRAME *LPFDDISTATFRAME;
  942. cpp_quote("typedef FDDISTATFRAME UNALIGNED *ULPFDDISTATFRAME;")
  943. const DWORD FDDISTATFRAME_SIZE =sizeof(FDDISTATFRAME);
  944. typedef struct _ATMFRAMEHDR
  945. {
  946. BYTE SrcAddress[6];
  947. BYTE DstAddress[6];
  948. WORD Vpi;
  949. WORD Vci;
  950. } ATMFRAMEHDR;
  951. typedef struct _ATMSTATFRAME
  952. {
  953. __int64 TimeStamp;
  954. DWORD FrameLength;
  955. DWORD nBytesAvail;
  956. ATMFRAMEHDR FrameHeader;
  957. BYTE FrameID[4];
  958. DWORD Flags;
  959. DWORD FrameType;
  960. WORD StatsDataLen;
  961. DWORD StatsVersion;
  962. STATISTICS Statistics;
  963. } ATMSTATFRAME;
  964. typedef ATMSTATFRAME *LPATMSTATFRAME;
  965. cpp_quote("typedef ATMSTATFRAME UNALIGNED *ULPATMSTATFRAME;")
  966. const DWORD ATMSTATFRAME_SIZE =sizeof(ATMSTATFRAME);
  967. typedef struct _TRSTATFRAME
  968. {
  969. __int64 TimeStamp;
  970. DWORD FrameLength;
  971. DWORD nBytesAvail;
  972. TRFRAMEHDR FrameHeader;
  973. BYTE FrameID[4];
  974. DWORD Flags;
  975. DWORD FrameType;
  976. WORD StatsDataLen;
  977. DWORD StatsVersion;
  978. STATISTICS Statistics;
  979. } TRSTATFRAME;
  980. typedef TRSTATFRAME *LPTRSTATFRAME;
  981. cpp_quote("typedef TRSTATFRAME UNALIGNED *ULPTRSTATFRAME;")
  982. const DWORD TRSTATFRAME_SIZE =sizeof(TRSTATFRAME);
  983. typedef struct _ESTATFRAME
  984. {
  985. __int64 TimeStamp;
  986. DWORD FrameLength;
  987. DWORD nBytesAvail;
  988. EFRAMEHDR FrameHeader;
  989. BYTE FrameID[4];
  990. DWORD Flags;
  991. DWORD FrameType;
  992. WORD StatsDataLen;
  993. DWORD StatsVersion;
  994. STATISTICS Statistics;
  995. } ESTATFRAME;
  996. typedef ESTATFRAME *LPESTATFRAME;
  997. cpp_quote("typedef ESTATFRAME UNALIGNED *ULPESTATFRAME;")
  998. const DWORD ESTATFRAME_SIZE =sizeof(ESTATFRAME);
  999. const DWORD STATISTICS_VERSION_1_0 =0x00000000;
  1000. const DWORD STATISTICS_VERSION_2_0 =0x00000020;
  1001. // this variable could change if any of the above sizes changed
  1002. const DWORD MAX_STATSFRAME_SIZE =sizeof(TRSTATFRAME);
  1003. const DWORD STATS_FRAME_TYPE =103;
  1004. #pragma pack(pop)
  1005. cpp_quote("//=============================================================================")
  1006. cpp_quote("//=============================================================================")
  1007. cpp_quote("// (NMEvent.h)")
  1008. cpp_quote("//=============================================================================")
  1009. cpp_quote("//=============================================================================")
  1010. cpp_quote("// NMCOLUMNTYPE")
  1011. typedef enum
  1012. {
  1013. NMCOLUMNTYPE_UINT8 = 0,
  1014. NMCOLUMNTYPE_SINT8,
  1015. NMCOLUMNTYPE_UINT16,
  1016. NMCOLUMNTYPE_SINT16,
  1017. NMCOLUMNTYPE_UINT32,
  1018. NMCOLUMNTYPE_SINT32,
  1019. NMCOLUMNTYPE_FLOAT64,
  1020. NMCOLUMNTYPE_FRAME,
  1021. NMCOLUMNTYPE_YESNO,
  1022. NMCOLUMNTYPE_ONOFF,
  1023. NMCOLUMNTYPE_TRUEFALSE,
  1024. NMCOLUMNTYPE_MACADDR,
  1025. NMCOLUMNTYPE_IPXADDR,
  1026. NMCOLUMNTYPE_IPADDR,
  1027. NMCOLUMNTYPE_VARTIME,
  1028. NMCOLUMNTYPE_STRING
  1029. } NMCOLUMNTYPE;
  1030. cpp_quote("// NMCOLUMNVARIANT")
  1031. typedef struct _NMCOLUMNVARIANT
  1032. {
  1033. NMCOLUMNTYPE Type;
  1034. union
  1035. {
  1036. BYTE Uint8Val; // 8 bit unsigned value
  1037. char Sint8Val; // 8 bit signed value
  1038. WORD Uint16Val; // 16 bit unsigned value
  1039. short Sint16Val; // 16 bit signed value
  1040. DWORD Uint32Val; // 32 bit unsigned value
  1041. long Sint32Val; // 32 bit signed value
  1042. DOUBLE Float64Val; // 64 bit floating point value
  1043. DWORD FrameVal; // 32 bit unsigned frame value
  1044. BOOL YesNoVal; // 32 bit boolean: zero maps to 'NO', nonzero maps to 'YES'
  1045. BOOL OnOffVal; // 32 bit boolean: zero maps to 'OFF', nonzero maps to 'ON'
  1046. BOOL TrueFalseVal;// 32 bit boolean: zero maps to 'False', nonzero maps to 'True'
  1047. BYTE MACAddrVal[MAC_ADDRESS_SIZE];// 48 bit MAC address (6 bytes)
  1048. IPX_ADDR IPXAddrVal;// 10 byte ipx address (4 byte subnet. 6 byte address)
  1049. DWORD IPAddrVal; // 32 bit IP Address: ddd.ddd.ddd.ddd
  1050. DOUBLE VarTimeVal; // Double representation of time value (use VariantTimeToSystemTime to convert)
  1051. LPCSTR pStringVal; // pointer to a string value
  1052. } Value;
  1053. } NMCOLUMNVARIANT;
  1054. cpp_quote("// COLUMNINFO")
  1055. typedef struct _NMCOLUMNINFO
  1056. {
  1057. LPSTR szColumnName;// Name of column
  1058. NMCOLUMNVARIANT VariantData; // Value for column
  1059. } NMCOLUMNINFO;
  1060. typedef NMCOLUMNINFO* PNMCOLUMNINFO;
  1061. cpp_quote("// JTYPE")
  1062. typedef LPSTR JTYPE; // (structure placeholder)
  1063. // this structure contains may not be cpp_quoted as it is used in IEventq.idl
  1064. // (However, the array's length used to be 0)
  1065. cpp_quote("// EVENTDATA")
  1066. typedef struct _NMEVENTDATA
  1067. {
  1068. LPSTR pszReserved; // Reserved
  1069. BYTE Version; // Version for this structure (must be 0)
  1070. DWORD EventIdent; // ID for this event
  1071. DWORD Flags; // Flags for Expert generated or Monitor generated and others
  1072. DWORD Severity; // Severity level
  1073. BYTE NumColumns; // Number of optional columns for this event
  1074. LPSTR szSourceName; // Name of Monitor or Expert
  1075. LPSTR szEventName; // Name of event
  1076. LPSTR szDescription;// Description of event
  1077. LPSTR szMachine; // Name (or IPADDRESS?) of the machine supplying the event (NULL for Experts usually)
  1078. JTYPE Justification;// Justification pane info (currently a string, but possible structure)
  1079. LPSTR szUrl; // URL to Book of Knowledge (NULL for default for ID?)
  1080. SYSTEMTIME SysTime; // Systemtime of the event
  1081. [size_is(NumColumns)] NMCOLUMNINFO Column[*];
  1082. } NMEVENTDATA;
  1083. typedef NMEVENTDATA* PNMEVENTDATA;
  1084. cpp_quote("// EVENT FLAGS")
  1085. const DWORD NMEVENTFLAG_MONITOR =0x00000000;
  1086. const DWORD NMEVENTFLAG_EXPERT =0x00000001;
  1087. const DWORD NMEVENTFLAG_DO_NOT_DISPLAY_SEVERITY =0x80000000;
  1088. const DWORD NMEVENTFLAG_DO_NOT_DISPLAY_SOURCE =0x40000000;
  1089. const DWORD NMEVENTFLAG_DO_NOT_DISPLAY_EVENT_NAME =0x20000000;
  1090. const DWORD NMEVENTFLAG_DO_NOT_DISPLAY_DESCRIPTION =0x10000000;
  1091. const DWORD NMEVENTFLAG_DO_NOT_DISPLAY_MACHINE =0x08000000;
  1092. const DWORD NMEVENTFLAG_DO_NOT_DISPLAY_TIME =0x04000000;
  1093. const DWORD NMEVENTFLAG_DO_NOT_DISPLAY_DATE =0x02000000;
  1094. cpp_quote("//#define NMEVENTFLAG_DO_NOT_DISPLAY_FIXED_COLUMNS (NMEVENTFLAG_DO_NOT_DISPLAY_SEVERITY | \\")
  1095. cpp_quote("// NMEVENTFLAG_DO_NOT_DISPLAY_SOURCE | \\")
  1096. cpp_quote("// NMEVENTFLAG_DO_NOT_DISPLAY_EVENT_NAME | \\")
  1097. cpp_quote("// NMEVENTFLAG_DO_NOT_DISPLAY_DESCRIPTION| \\")
  1098. cpp_quote("// NMEVENTFLAG_DO_NOT_DISPLAY_MACHINE | \\")
  1099. cpp_quote("// NMEVENTFLAG_DO_NOT_DISPLAY_TIME | \\")
  1100. cpp_quote("// NMEVENTFLAG_DO_NOT_DISPLAY_DATE )")
  1101. const DWORD NMEVENTFLAG_DO_NOT_DISPLAY_FIXED_COLUMNS =0xFE000000;
  1102. enum _NMEVENT_SEVERITIES
  1103. {
  1104. NMEVENT_SEVERITY_INFORMATIONAL = 0,
  1105. NMEVENT_SEVERITY_WARNING,
  1106. NMEVENT_SEVERITY_STRONG_WARNING,
  1107. NMEVENT_SEVERITY_ERROR,
  1108. NMEVENT_SEVERITY_SEVERE_ERROR,
  1109. NMEVENT_SEVERITY_CRITICAL_ERROR
  1110. };
  1111. cpp_quote("//=============================================================================")
  1112. cpp_quote("//=============================================================================")
  1113. cpp_quote("// (NMmcs.h)")
  1114. cpp_quote("//=============================================================================")
  1115. cpp_quote("//=============================================================================")
  1116. cpp_quote("//=============================================================================")
  1117. cpp_quote("// Monitor status values returned from call to GetMonitorStatus")
  1118. cpp_quote("//=============================================================================")
  1119. const DWORD MONITOR_STATUS_ERROR =-1;
  1120. const DWORD MONITOR_STATUS_ENABLED =4;
  1121. const DWORD MONITOR_STATUS_CONFIGURED =5;
  1122. const DWORD MONITOR_STATUS_RUNNING =6;
  1123. const DWORD MONITOR_STATUS_RUNNING_FAULTED =9;
  1124. const DWORD MONITOR_STATUS_DELETED =10;
  1125. const DWORD MCS_COMMAND_ENABLE =13;
  1126. const DWORD MCS_COMMAND_DISABLE =14;
  1127. const DWORD MCS_COMMAND_SET_CONFIG =15;
  1128. const DWORD MCS_COMMAND_GET_CONFIG =16;
  1129. const DWORD MCS_COMMAND_START =17;
  1130. const DWORD MCS_COMMAND_STOP =18;
  1131. const DWORD MCS_COMMAND_CONNECT =19;
  1132. const DWORD MCS_COMMAND_RENAME =20;
  1133. const DWORD MCS_COMMAND_REFRESH_STATUS =21;
  1134. cpp_quote("//=============================================================================")
  1135. cpp_quote("// Monitor Creation Flags")
  1136. cpp_quote("//=============================================================================")
  1137. const DWORD MCS_CREATE_ONE_PER_NETCARD =0x00000001;
  1138. const DWORD MCS_CREATE_CONFIGS_BY_DEFAULT =0x00000010;
  1139. const DWORD MCS_CREATE_PMODE_NOT_REQUIRED =0x00000100;
  1140. typedef __int64 HNMMONITOR;
  1141. cpp_quote("//=============================================================================")
  1142. cpp_quote("// NPP_INFO")
  1143. cpp_quote("//=============================================================================")
  1144. typedef struct
  1145. {
  1146. DWORD ListIndex;
  1147. [string] char* ShortName;
  1148. [string] char* LongName;
  1149. } NPP_INFO;
  1150. typedef NPP_INFO* PNPP_INFO;
  1151. cpp_quote("//=============================================================================")
  1152. cpp_quote("// MONITOR_INFO")
  1153. cpp_quote("//=============================================================================")
  1154. typedef struct _MONITOR_INFO
  1155. {
  1156. // Our opaque pointer
  1157. HNMMONITOR MonitorInstance;
  1158. HNMMONITOR MonitorClass;
  1159. DWORD CreateFlags;
  1160. DWORD Status;
  1161. DWORD ListIndex;
  1162. [string] char* pDescription;
  1163. [string] char* pScript;
  1164. [string] char* pConfiguration;
  1165. [string] char* pName;
  1166. } MONITOR_INFO;
  1167. typedef MONITOR_INFO* PMONITOR_INFO;
  1168. cpp_quote("//=============================================================================")
  1169. cpp_quote("// MONITOR_MESSAGE")
  1170. cpp_quote("//=============================================================================")
  1171. typedef struct
  1172. {
  1173. HNMMONITOR Monitor;
  1174. DWORD ListIndex;
  1175. [string] char* pszMessage;
  1176. } MONITOR_MESSAGE;
  1177. typedef MONITOR_MESSAGE* PMONITOR_MESSAGE;
  1178. cpp_quote("//=============================================================================")
  1179. cpp_quote("// COMMAND_FAILED_EVENT")
  1180. cpp_quote("//=============================================================================")
  1181. typedef struct
  1182. {
  1183. HNMMONITOR Monitor;
  1184. DWORD Command;
  1185. DWORD FailureCode;
  1186. DWORD ListIndex;
  1187. DWORD Status;
  1188. } COMMAND_FAILED_EVENT;
  1189. typedef COMMAND_FAILED_EVENT* PCOMMAND_FAILED_EVENT;
  1190. cpp_quote("//=============================================================================")
  1191. cpp_quote("// MONITOR_STATUS_EVENT")
  1192. cpp_quote("//=============================================================================")
  1193. typedef struct
  1194. {
  1195. HNMMONITOR Monitor;
  1196. DWORD LastCommand;
  1197. DWORD ListIndex;
  1198. DWORD Status;
  1199. DWORD FramesProcessed;
  1200. } MONITOR_STATUS_EVENT;
  1201. typedef MONITOR_STATUS_EVENT* PMONITOR_STATUS_EVENT;
  1202. cpp_quote("//=============================================================================")
  1203. cpp_quote("// MCS_CLIENT")
  1204. cpp_quote("//=============================================================================")
  1205. typedef struct
  1206. {
  1207. [string] OLECHAR* pwszName;
  1208. FILETIME FileTime;
  1209. DWORD pXMCS;
  1210. BOOL bCurrent;
  1211. } MCS_CLIENT;
  1212. typedef MCS_CLIENT* PMCS_CLIENT;
  1213. cpp_quote("//=============================================================================")
  1214. cpp_quote("//=============================================================================")
  1215. cpp_quote("// (Finder.h)")
  1216. cpp_quote("//=============================================================================")
  1217. cpp_quote("//=============================================================================")
  1218. cpp_quote("//=============================================================================")
  1219. cpp_quote("// Structures use by NPPs, the Finder, and monitors")
  1220. cpp_quote("//=============================================================================")
  1221. // these structures may not be cpp_quoted as they are used in IRemoteagent.idl
  1222. // (However, the array's length used to be 0)
  1223. typedef struct
  1224. {
  1225. DWORD dwNumBlobs;
  1226. [size_is(dwNumBlobs)] HBLOB hBlobs[*];
  1227. } BLOB_TABLE;
  1228. typedef BLOB_TABLE* PBLOB_TABLE;
  1229. typedef struct
  1230. {
  1231. DWORD size;
  1232. [size_is(size)] BYTE* pBytes;
  1233. } MBLOB;
  1234. typedef struct
  1235. {
  1236. DWORD dwNumBlobs;
  1237. [size_is(dwNumBlobs)] MBLOB mBlobs[*];
  1238. } MBLOB_TABLE;
  1239. typedef MBLOB_TABLE* PMBLOB_TABLE;
  1240. cpp_quote("//=============================================================================")
  1241. cpp_quote("// Functions called by monitors, tools, netmon")
  1242. cpp_quote("//=============================================================================")
  1243. cpp_quote("DWORD _cdecl GetNPPBlobTable(HBLOB hFilterBlob, ")
  1244. cpp_quote(" PBLOB_TABLE* ppBlobTable);")
  1245. cpp_quote("")
  1246. cpp_quote("DWORD _cdecl GetNPPBlobFromUI(HWND hwnd,")
  1247. cpp_quote(" HBLOB hFilterBlob,")
  1248. cpp_quote(" HBLOB* phBlob); ")
  1249. cpp_quote("")
  1250. cpp_quote("DWORD _cdecl GetNPPBlobFromUIExU(HWND hwnd,")
  1251. cpp_quote(" HBLOB hFilterBlob,")
  1252. cpp_quote(" HBLOB* phBlob,")
  1253. cpp_quote(" char* szHelpFileName); ")
  1254. cpp_quote("")
  1255. cpp_quote("DWORD _cdecl SelectNPPBlobFromTable( HWND hwnd,")
  1256. cpp_quote(" PBLOB_TABLE pBlobTable,")
  1257. cpp_quote(" HBLOB* hBlob);")
  1258. cpp_quote("")
  1259. cpp_quote("DWORD _cdecl SelectNPPBlobFromTableExU( HWND hwnd,")
  1260. cpp_quote(" PBLOB_TABLE pBlobTable,")
  1261. cpp_quote(" HBLOB* hBlob,")
  1262. cpp_quote(" char* szHelpFileName);")
  1263. cpp_quote("")
  1264. cpp_quote("//=============================================================================")
  1265. cpp_quote("// Helper functions provided by the Finder")
  1266. cpp_quote("//=============================================================================")
  1267. cpp_quote("")
  1268. cpp_quote("__inline DWORD BLOB_TABLE_SIZE(DWORD dwNumBlobs)")
  1269. cpp_quote("{")
  1270. cpp_quote(" return (DWORD) (sizeof(BLOB_TABLE)+dwNumBlobs*sizeof(HBLOB));")
  1271. cpp_quote("}")
  1272. cpp_quote("")
  1273. cpp_quote("__inline PBLOB_TABLE AllocBlobTable(DWORD dwNumBlobs)")
  1274. cpp_quote("{")
  1275. cpp_quote(" DWORD size = BLOB_TABLE_SIZE(dwNumBlobs);")
  1276. cpp_quote("")
  1277. cpp_quote(" return (PBLOB_TABLE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);")
  1278. cpp_quote("}")
  1279. cpp_quote("")
  1280. cpp_quote("__inline DWORD MBLOB_TABLE_SIZE(DWORD dwNumBlobs)")
  1281. cpp_quote("{")
  1282. cpp_quote(" return (DWORD) (sizeof(MBLOB_TABLE)+dwNumBlobs*sizeof(MBLOB));")
  1283. cpp_quote("}")
  1284. cpp_quote("")
  1285. cpp_quote("__inline PMBLOB_TABLE AllocMBlobTable(DWORD dwNumBlobs)")
  1286. cpp_quote("{")
  1287. cpp_quote(" DWORD size = MBLOB_TABLE_SIZE(dwNumBlobs);")
  1288. cpp_quote("")
  1289. cpp_quote(" return (PMBLOB_TABLE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);")
  1290. cpp_quote("}")
  1291. cpp_quote("")
  1292. cpp_quote("//=============================================================================")
  1293. cpp_quote("// Functions provided by NPPs, called by the Finder")
  1294. cpp_quote("//=============================================================================")
  1295. cpp_quote("")
  1296. cpp_quote("// For NPP's that can return a Blob table without additional configuration.")
  1297. cpp_quote("DWORD _cdecl GetNPPBlobs(PBLOB_TABLE* ppBlobTable);")
  1298. cpp_quote("typedef DWORD (_cdecl FAR* BLOBSPROC) (PBLOB_TABLE* ppBlobTable);")
  1299. cpp_quote("")
  1300. cpp_quote("// For NPP's that need additional information to return a Blob table.")
  1301. cpp_quote("DWORD _cdecl GetConfigBlob(HBLOB* phBlob);")
  1302. cpp_quote("typedef DWORD (_cdecl FAR* GETCFGBLOB) (HBLOB, HBLOB*);")
  1303. cpp_quote("typedef DWORD (_cdecl FAR* CFGPROC) (HWND hwnd,")
  1304. cpp_quote(" HBLOB SpecialBlob,")
  1305. cpp_quote(" PBLOB_TABLE* ppBlobTable);")
  1306. cpp_quote("")
  1307. cpp_quote("//=============================================================================")
  1308. cpp_quote("// Handy functions")
  1309. cpp_quote("//=============================================================================")
  1310. cpp_quote("BOOL _cdecl FilterNPPBlob(HBLOB hBlob, HBLOB FilterBlob);")
  1311. cpp_quote("")
  1312. cpp_quote("BOOL _cdecl RaiseNMEvent(HINSTANCE hInstance,")
  1313. cpp_quote(" WORD EventType, ")
  1314. cpp_quote(" DWORD EventID,")
  1315. cpp_quote(" WORD nStrings, ")
  1316. cpp_quote(" const char** aInsertStrs,")
  1317. cpp_quote(" LPVOID lpvData,")
  1318. cpp_quote(" DWORD dwDataSize);")
  1319. cpp_quote("")
  1320. cpp_quote("//=============================================================================")
  1321. cpp_quote("//=============================================================================")
  1322. cpp_quote("// (NMmonitor.h)")
  1323. cpp_quote("//=============================================================================")
  1324. cpp_quote("//=============================================================================")
  1325. cpp_quote("#ifdef __cplusplus")
  1326. // Forward reference
  1327. cpp_quote("struct MONITOR;")
  1328. cpp_quote("typedef MONITOR* PMONITOR;")
  1329. cpp_quote("")
  1330. cpp_quote("typedef void (WINAPI* MCSALERTPROC) (PMONITOR pMonitor, TCHAR* alert);")
  1331. cpp_quote("")
  1332. cpp_quote("//****************************************************************************")
  1333. cpp_quote("// Our exported Monitor functions, that must be supported by ALL monitors ")
  1334. cpp_quote("//****************************************************************************")
  1335. cpp_quote("// Create the Monitor, function called \"CreateMonitor\". The")
  1336. cpp_quote("// argument is a potential configuration structure")
  1337. cpp_quote("typedef DWORD (WINAPI* CREATEMONITOR)(PMONITOR* ppMonitor, ")
  1338. cpp_quote(" HBLOB hInputNPPBlob,")
  1339. cpp_quote(" char* pConfiguration,")
  1340. cpp_quote(" MCSALERTPROC McsAlertProc);")
  1341. cpp_quote("")
  1342. cpp_quote("// Destroy the Monitor, function called \"DestroyMonitor\"")
  1343. cpp_quote("typedef DWORD (WINAPI* DESTROYMONITOR)(PMONITOR);")
  1344. cpp_quote("")
  1345. cpp_quote("// We need the monitor's NPP filter blob: \"GetMonitorFilter\"")
  1346. cpp_quote("typedef DWORD (WINAPI* GETMONITORFILTER) (HBLOB* pFilterBlob);")
  1347. cpp_quote("")
  1348. cpp_quote("// Get the monitor configuration \"GetMonitorConfig\"")
  1349. cpp_quote("// The pMonitor argument can not be null")
  1350. cpp_quote("typedef DWORD (WINAPI* GETMONITORCONFIG) (PMONITOR pMonitor,")
  1351. cpp_quote(" char** ppScript,")
  1352. cpp_quote(" char** ppConfiguration);")
  1353. cpp_quote("")
  1354. cpp_quote("// Set the monitor configuration \"SetMonitorConfig\"")
  1355. cpp_quote("// The pMonitor argument can not be null")
  1356. cpp_quote("typedef DWORD (WINAPI* SETMONITORCONFIG) (PMONITOR pMonitor, ")
  1357. cpp_quote(" char* pConfiguration);")
  1358. cpp_quote("")
  1359. cpp_quote("// The monitor's connect function: \"ConnectMonitor\"")
  1360. cpp_quote("typedef DWORD (WINAPI* CONNECTMONITOR) (PMONITOR pMonitor);")
  1361. cpp_quote("")
  1362. cpp_quote("// The monitor's start function: \"StartMonitor\"")
  1363. cpp_quote("typedef DWORD (WINAPI* STARTMONITOR) (PMONITOR pMonitor, char** ppResponse);")
  1364. cpp_quote("")
  1365. cpp_quote("// The monitor's stop function: \"StopMonitor\"")
  1366. cpp_quote("typedef DWORD (WINAPI* STOPMONITOR) (PMONITOR pMonitor);")
  1367. cpp_quote("")
  1368. cpp_quote("// Get the monitor status: \"GetMonitorStatus\"")
  1369. cpp_quote("typedef DWORD (WINAPI* GETMONITORSTATUS) (PMONITOR pMonitor, DWORD* pStatus);")
  1370. cpp_quote("")
  1371. cpp_quote("//****************************************************************************")
  1372. cpp_quote("// Optional function that allows the monitor dll to do specific functions")
  1373. cpp_quote("// prior to the creation of any monitors. \"OneTimeSetup\"")
  1374. cpp_quote("typedef DWORD (WINAPI* ONETIMESETUP) (void);")
  1375. cpp_quote("//****************************************************************************")
  1376. cpp_quote("")
  1377. cpp_quote("//****************************************************************************")
  1378. cpp_quote("// Optional function that provides a description of the monitor")
  1379. cpp_quote("//****************************************************************************")
  1380. cpp_quote("// For current display porpoises, we could use this: \"DescribeSelf\"")
  1381. cpp_quote("typedef DWORD (WINAPI* DESCRIBESELF) (const char** ppName,")
  1382. cpp_quote(" const char** ppDescription);")
  1383. cpp_quote("")
  1384. cpp_quote("#endif // __cplusplus")
  1385. cpp_quote("//=============================================================================")
  1386. cpp_quote("//=============================================================================")
  1387. cpp_quote("// (NMSupp.h)")
  1388. cpp_quote("//=============================================================================")
  1389. cpp_quote("//=============================================================================")
  1390. cpp_quote("")
  1391. cpp_quote("#ifndef __cplusplus")
  1392. cpp_quote("#ifndef try")
  1393. cpp_quote("#define try __try")
  1394. cpp_quote("#endif // try")
  1395. cpp_quote("")
  1396. cpp_quote("#ifndef except")
  1397. cpp_quote("#define except __except")
  1398. cpp_quote("#endif // except")
  1399. cpp_quote("#endif // __cplusplus")
  1400. cpp_quote("//=============================================================================")
  1401. cpp_quote("// Windows version constants.")
  1402. cpp_quote("//=============================================================================")
  1403. const DWORD WINDOWS_VERSION_UNKNOWN =0;
  1404. const DWORD WINDOWS_VERSION_WIN32S =1;
  1405. const DWORD WINDOWS_VERSION_WIN32C =2;
  1406. const DWORD WINDOWS_VERSION_WIN32 =3;
  1407. cpp_quote("//=============================================================================")
  1408. cpp_quote("// Frame masks.")
  1409. cpp_quote("//=============================================================================")
  1410. const BYTE FRAME_MASK_ETHERNET =((BYTE) ~0x01);
  1411. const BYTE FRAME_MASK_TOKENRING =((BYTE) ~0x80);
  1412. const BYTE FRAME_MASK_FDDI =((BYTE) ~0x01);
  1413. cpp_quote("//=============================================================================")
  1414. cpp_quote("// ACCESSRIGHTS")
  1415. cpp_quote("//=============================================================================")
  1416. typedef enum _ACCESSRIGHTS
  1417. {
  1418. AccessRightsNoAccess, //... Access denied, invalid password.
  1419. AccessRightsMonitoring, //... Monitoring mode only.
  1420. AccessRightsUserAccess, //... User-level access rights.
  1421. AccessRightsAllAccess //... All access.
  1422. } ACCESSRIGHTS;
  1423. typedef ACCESSRIGHTS *PACCESSRIGHTS;
  1424. typedef LPVOID HPASSWORD;
  1425. cpp_quote("#define HANDLE_TYPE_PASSWORD MAKE_IDENTIFIER('P', 'W', 'D', '$')")
  1426. cpp_quote("//=============================================================================")
  1427. cpp_quote("// Object heap type.")
  1428. cpp_quote("//=============================================================================")
  1429. typedef LPVOID HOBJECTHEAP;
  1430. cpp_quote("//=============================================================================")
  1431. cpp_quote("// Object cleanup procedure.")
  1432. cpp_quote("//=============================================================================")
  1433. cpp_quote("")
  1434. cpp_quote("typedef VOID (WINAPI *OBJECTPROC)(HOBJECTHEAP, LPVOID);")
  1435. cpp_quote("")
  1436. cpp_quote("//=============================================================================")
  1437. cpp_quote("// Network Monitor timers.")
  1438. cpp_quote("//=============================================================================")
  1439. typedef struct _TIMER *HTIMER;
  1440. cpp_quote("typedef VOID (WINAPI *BHTIMERPROC)(LPVOID);")
  1441. cpp_quote("")
  1442. cpp_quote("HTIMER WINAPI BhSetTimer(BHTIMERPROC TimerProc, LPVOID InstData, DWORD TimeOut);")
  1443. cpp_quote("")
  1444. cpp_quote("VOID WINAPI BhKillTimer(HTIMER hTimer);")
  1445. cpp_quote("")
  1446. cpp_quote("//=============================================================================")
  1447. cpp_quote("// Network Monitor global error API.")
  1448. cpp_quote("//=============================================================================")
  1449. cpp_quote("")
  1450. cpp_quote("DWORD WINAPI BhGetLastError(VOID);")
  1451. cpp_quote("")
  1452. cpp_quote("DWORD WINAPI BhSetLastError(DWORD Error);")
  1453. cpp_quote("")
  1454. cpp_quote("//=============================================================================")
  1455. cpp_quote("// Object manager function prototypes.")
  1456. cpp_quote("//=============================================================================")
  1457. cpp_quote("")
  1458. cpp_quote("HOBJECTHEAP WINAPI CreateObjectHeap(DWORD ObjectSize, OBJECTPROC ObjectProc);")
  1459. cpp_quote("")
  1460. cpp_quote("HOBJECTHEAP WINAPI DestroyObjectHeap(HOBJECTHEAP hObjectHeap);")
  1461. cpp_quote("")
  1462. cpp_quote("LPVOID WINAPI AllocObject(HOBJECTHEAP hObjectHeap);")
  1463. cpp_quote("")
  1464. cpp_quote("LPVOID WINAPI FreeObject(HOBJECTHEAP hObjectHeap, LPVOID ObjectMemory);")
  1465. cpp_quote("")
  1466. cpp_quote("DWORD WINAPI GrowObjectHeap(HOBJECTHEAP hObjectHeap, DWORD nObjects);")
  1467. cpp_quote("")
  1468. cpp_quote("DWORD WINAPI GetObjectHeapSize(HOBJECTHEAP hObjectHeap);")
  1469. cpp_quote("")
  1470. cpp_quote("VOID WINAPI PurgeObjectHeap(HOBJECTHEAP hObjectHeap);")
  1471. cpp_quote("")
  1472. cpp_quote("//=============================================================================")
  1473. cpp_quote("// Memory functions.")
  1474. cpp_quote("//=============================================================================")
  1475. cpp_quote("")
  1476. cpp_quote("LPVOID WINAPI AllocMemory(SIZE_T size);")
  1477. cpp_quote("")
  1478. cpp_quote("LPVOID WINAPI ReallocMemory(LPVOID ptr, SIZE_T NewSize);")
  1479. cpp_quote("")
  1480. cpp_quote("VOID WINAPI FreeMemory(LPVOID ptr);")
  1481. cpp_quote("")
  1482. cpp_quote("VOID WINAPI TestMemory(LPVOID ptr);")
  1483. cpp_quote("")
  1484. cpp_quote("SIZE_T WINAPI MemorySize(LPVOID ptr);")
  1485. cpp_quote("")
  1486. cpp_quote("HANDLE WINAPI MemoryHandle(LPBYTE ptr);")
  1487. cpp_quote("")
  1488. cpp_quote("//=============================================================================")
  1489. cpp_quote("// Password API's.")
  1490. cpp_quote("//=============================================================================")
  1491. cpp_quote("")
  1492. cpp_quote("HPASSWORD WINAPI CreatePassword(LPSTR password);")
  1493. cpp_quote("")
  1494. cpp_quote("VOID WINAPI DestroyPassword(HPASSWORD hPassword);")
  1495. cpp_quote("")
  1496. cpp_quote("ACCESSRIGHTS WINAPI ValidatePassword(HPASSWORD hPassword);")
  1497. cpp_quote("")
  1498. cpp_quote("//=============================================================================")
  1499. cpp_quote("// EXPRESSION API's")
  1500. cpp_quote("//=============================================================================")
  1501. cpp_quote("")
  1502. cpp_quote("LPEXPRESSION WINAPI InitializeExpression(LPEXPRESSION Expression);")
  1503. cpp_quote("")
  1504. cpp_quote("LPPATTERNMATCH WINAPI InitializePattern(LPPATTERNMATCH Pattern, LPVOID ptr, DWORD offset, DWORD length);")
  1505. cpp_quote("")
  1506. cpp_quote("LPEXPRESSION WINAPI AndExpression(LPEXPRESSION Expression, LPPATTERNMATCH Pattern);")
  1507. cpp_quote("")
  1508. cpp_quote("LPEXPRESSION WINAPI OrExpression(LPEXPRESSION Expression, LPPATTERNMATCH Pattern);")
  1509. cpp_quote("")
  1510. cpp_quote("LPPATTERNMATCH WINAPI NegatePattern(LPPATTERNMATCH Pattern);")
  1511. cpp_quote("")
  1512. cpp_quote("LPADDRESSTABLE WINAPI AdjustOperatorPrecedence(LPADDRESSTABLE AddressTable);")
  1513. cpp_quote("")
  1514. cpp_quote("LPADDRESS WINAPI NormalizeAddress(LPADDRESS Address);")
  1515. cpp_quote("")
  1516. cpp_quote("LPADDRESSTABLE WINAPI NormalizeAddressTable(LPADDRESSTABLE AddressTable);")
  1517. cpp_quote("")
  1518. cpp_quote("//=============================================================================")
  1519. cpp_quote("// MISC. API's")
  1520. cpp_quote("//=============================================================================")
  1521. cpp_quote("")
  1522. cpp_quote("DWORD WINAPI BhGetWindowsVersion(VOID);")
  1523. cpp_quote("")
  1524. cpp_quote("BOOL WINAPI IsDaytona(VOID);")
  1525. cpp_quote("")
  1526. cpp_quote("VOID _cdecl dprintf(LPSTR format, ...);")
  1527. cpp_quote("")
  1528. cpp_quote("//=============================================================================")
  1529. cpp_quote("//=============================================================================")
  1530. cpp_quote("// (BHTypes.h)")
  1531. cpp_quote("//=============================================================================")
  1532. cpp_quote("//=============================================================================")
  1533. cpp_quote("//=============================================================================")
  1534. cpp_quote("// Unaligned base type definitions.")
  1535. cpp_quote("//=============================================================================")
  1536. cpp_quote("typedef VOID UNALIGNED *ULPVOID;")
  1537. cpp_quote("typedef BYTE UNALIGNED *ULPBYTE;")
  1538. cpp_quote("typedef WORD UNALIGNED *ULPWORD;")
  1539. cpp_quote("typedef DWORD UNALIGNED *ULPDWORD;")
  1540. cpp_quote("typedef CHAR UNALIGNED *ULPSTR;")
  1541. cpp_quote("typedef SYSTEMTIME UNALIGNED *ULPSYSTEMTIME;")
  1542. cpp_quote("//=============================================================================")
  1543. cpp_quote("// Handle definitions.")
  1544. cpp_quote("//=============================================================================")
  1545. typedef struct _PARSER *HPARSER;
  1546. typedef struct _CAPFRAMEDESC *HFRAME;
  1547. typedef struct _CAPTURE *HCAPTURE;
  1548. typedef struct _FILTER *HFILTER;
  1549. typedef struct _ADDRESSDB *HADDRESSDB;
  1550. typedef struct _PROTOCOL *HPROTOCOL;
  1551. typedef DWORD_PTR HPROPERTY;
  1552. typedef HPROTOCOL *LPHPROTOCOL;
  1553. cpp_quote("//=============================================================================")
  1554. cpp_quote("// GetTableSize() -- The following macro is used to calculate the actual")
  1555. cpp_quote("// length of Network Monitor variable-length table structures.")
  1556. cpp_quote("//")
  1557. cpp_quote("// EXAMPLE:")
  1558. cpp_quote("//")
  1559. cpp_quote("// GetTableSize(PROTOCOLTABLESIZE, ")
  1560. cpp_quote("// ProtocolTable->nProtocols, ")
  1561. cpp_quote("// sizeof(HPROTOCOL))")
  1562. cpp_quote("//=============================================================================")
  1563. cpp_quote("#define GetTableSize(TableBaseSize, nElements, ElementSize) ((TableBaseSize) + ((nElements) * (ElementSize)))")
  1564. cpp_quote("//=============================================================================")
  1565. cpp_quote("// Object type identifiers.")
  1566. cpp_quote("//=============================================================================")
  1567. typedef DWORD OBJECTTYPE;
  1568. cpp_quote("#ifndef MAKE_IDENTIFIER")
  1569. cpp_quote("#define MAKE_IDENTIFIER(a, b, c, d) ((DWORD) MAKELONG(MAKEWORD(a, b), MAKEWORD(c, d)))")
  1570. cpp_quote("#endif // MAKE_IDENTIFIER")
  1571. cpp_quote("#define HANDLE_TYPE_INVALID MAKE_IDENTIFIER(-1, -1, -1, -1)")
  1572. cpp_quote("#define HANDLE_TYPE_CAPTURE MAKE_IDENTIFIER('C', 'A', 'P', '$')")
  1573. cpp_quote("#define HANDLE_TYPE_PARSER MAKE_IDENTIFIER('P', 'S', 'R', '$')")
  1574. cpp_quote("#define HANDLE_TYPE_ADDRESSDB MAKE_IDENTIFIER('A', 'D', 'R', '$')")
  1575. cpp_quote("#define HANDLE_TYPE_PROTOCOL MAKE_IDENTIFIER('P', 'R', 'T', '$')")
  1576. cpp_quote("#define HANDLE_TYPE_BUFFER MAKE_IDENTIFIER('B', 'U', 'F', '$')")
  1577. cpp_quote("//=============================================================================")
  1578. cpp_quote("// Network Monitor constant definitions.")
  1579. cpp_quote("//=============================================================================")
  1580. cpp_quote("#define INLINE __inline")
  1581. cpp_quote("#define BHAPI WINAPI")
  1582. const DWORD MAX_NAME_LENGTH =16;
  1583. const DWORD MAX_ADDR_LENGTH =6;
  1584. cpp_quote("//=============================================================================")
  1585. cpp_quote("// Ethernet type (ETYPE) constant definitions.")
  1586. cpp_quote("//=============================================================================")
  1587. const WORD ETYPE_LOOP =0x9000;
  1588. const WORD ETYPE_3COM_NETMAP1 =0x9001;
  1589. const WORD ETYPE_3COM_NETMAP2 =0x9002;
  1590. const WORD ETYPE_IBM_RT =0x80D5;
  1591. const WORD ETYPE_NETWARE =0x8137;
  1592. const WORD ETYPE_XNS1 =0x0600;
  1593. const WORD ETYPE_XNS2 =0x0807;
  1594. const WORD ETYPE_3COM_NBP0 =0x3C00;
  1595. const WORD ETYPE_3COM_NBP1 =0x3C01;
  1596. const WORD ETYPE_3COM_NBP2 =0x3C02;
  1597. const WORD ETYPE_3COM_NBP3 =0x3C03;
  1598. const WORD ETYPE_3COM_NBP4 =0x3C04;
  1599. const WORD ETYPE_3COM_NBP5 =0x3C05;
  1600. const WORD ETYPE_3COM_NBP6 =0x3C06;
  1601. const WORD ETYPE_3COM_NBP7 =0x3C07;
  1602. const WORD ETYPE_3COM_NBP8 =0x3C08;
  1603. const WORD ETYPE_3COM_NBP9 =0x3C09;
  1604. const WORD ETYPE_3COM_NBP10 =0x3C0A;
  1605. const WORD ETYPE_IP =0x0800;
  1606. const WORD ETYPE_ARP1 =0x0806;
  1607. const WORD ETYPE_ARP2 =0x0807;
  1608. const WORD ETYPE_RARP =0x8035;
  1609. const WORD ETYPE_TRLR0 =0x1000;
  1610. const WORD ETYPE_TRLR1 =0x1001;
  1611. const WORD ETYPE_TRLR2 =0x1002;
  1612. const WORD ETYPE_TRLR3 =0x1003;
  1613. const WORD ETYPE_TRLR4 =0x1004;
  1614. const WORD ETYPE_TRLR5 =0x1005;
  1615. const WORD ETYPE_PUP =0x0200;
  1616. const WORD ETYPE_PUP_ARP =0x0201;
  1617. const WORD ETYPE_APPLETALK_ARP =0x80F3;
  1618. const WORD ETYPE_APPLETALK_LAP =0x809B;
  1619. const WORD ETYPE_SNMP =0x814C;
  1620. cpp_quote("//=============================================================================")
  1621. cpp_quote("// LLC (802.2) SAP constant definitions.")
  1622. cpp_quote("//=============================================================================")
  1623. const BYTE SAP_SNAP = 0xAA;
  1624. const BYTE SAP_BPDU = 0x42;
  1625. const BYTE SAP_IBM_NM = 0xF4;
  1626. const BYTE SAP_IBM_NETBIOS = 0xF0;
  1627. const BYTE SAP_SNA1 = 0x04;
  1628. const BYTE SAP_SNA2 = 0x05;
  1629. const BYTE SAP_SNA3 = 0x08;
  1630. const BYTE SAP_SNA4 = 0x0C;
  1631. const BYTE SAP_NETWARE1 = 0x10;
  1632. const BYTE SAP_NETWARE2 = 0xE0;
  1633. const BYTE SAP_NETWARE3 = 0xFE;
  1634. const BYTE SAP_IP = 0x06;
  1635. const BYTE SAP_X25 = 0x7E;
  1636. const BYTE SAP_RPL1 = 0xF8;
  1637. const BYTE SAP_RPL2 = 0xFC;
  1638. const BYTE SAP_UB = 0xFA;
  1639. const BYTE SAP_XNS = 0x80;
  1640. cpp_quote("//=============================================================================")
  1641. cpp_quote("// Property constants")
  1642. cpp_quote("//=============================================================================")
  1643. cpp_quote("// data types")
  1644. const BYTE PROP_TYPE_VOID =0x00;
  1645. const BYTE PROP_TYPE_SUMMARY =0x01;
  1646. const BYTE PROP_TYPE_BYTE =0x02;
  1647. const BYTE PROP_TYPE_WORD =0x03;
  1648. const BYTE PROP_TYPE_DWORD =0x04;
  1649. const BYTE PROP_TYPE_LARGEINT =0x05;
  1650. const BYTE PROP_TYPE_ADDR =0x06;
  1651. const BYTE PROP_TYPE_TIME =0x07;
  1652. const BYTE PROP_TYPE_STRING =0x08;
  1653. const BYTE PROP_TYPE_IP_ADDRESS =0x09;
  1654. const BYTE PROP_TYPE_IPX_ADDRESS =0x0A;
  1655. const BYTE PROP_TYPE_BYTESWAPPED_WORD =0x0B;
  1656. const BYTE PROP_TYPE_BYTESWAPPED_DWORD =0x0C;
  1657. const BYTE PROP_TYPE_TYPED_STRING =0x0D;
  1658. const BYTE PROP_TYPE_RAW_DATA =0x0E;
  1659. const BYTE PROP_TYPE_COMMENT =0x0F;
  1660. const BYTE PROP_TYPE_SRCFRIENDLYNAME =0x10;
  1661. const BYTE PROP_TYPE_DSTFRIENDLYNAME =0x11;
  1662. const BYTE PROP_TYPE_TOKENRING_ADDRESS =0x12;
  1663. const BYTE PROP_TYPE_FDDI_ADDRESS =0x13;
  1664. const BYTE PROP_TYPE_ETHERNET_ADDRESS =0x14;
  1665. const BYTE PROP_TYPE_OBJECT_IDENTIFIER =0x15;
  1666. const BYTE PROP_TYPE_VINES_IP_ADDRESS =0x16;
  1667. const BYTE PROP_TYPE_VAR_LEN_SMALL_INT =0x17;
  1668. const BYTE PROP_TYPE_ATM_ADDRESS =0x18;
  1669. const BYTE PROP_TYPE_1394_ADDRESS =0x19;
  1670. cpp_quote("// data qualifiers")
  1671. const BYTE PROP_QUAL_NONE =0x00;
  1672. const BYTE PROP_QUAL_RANGE =0x01;
  1673. const BYTE PROP_QUAL_SET =0x02;
  1674. const BYTE PROP_QUAL_BITFIELD =0x03;
  1675. const BYTE PROP_QUAL_LABELED_SET =0x04;
  1676. const BYTE PROP_QUAL_LABELED_BITFIELD =0x08;
  1677. const BYTE PROP_QUAL_CONST =0x09;
  1678. const BYTE PROP_QUAL_FLAGS =0x0A;
  1679. const BYTE PROP_QUAL_ARRAY =0x0B;
  1680. cpp_quote("//=============================================================================")
  1681. cpp_quote("// LARGEINT structure defined in winnt.h")
  1682. cpp_quote("//=============================================================================")
  1683. typedef LARGE_INTEGER *LPLARGEINT;
  1684. cpp_quote("typedef LARGE_INTEGER UNALIGNED *ULPLARGEINT;")
  1685. cpp_quote("//=============================================================================")
  1686. cpp_quote("// Range structure.")
  1687. cpp_quote("//=============================================================================")
  1688. typedef struct _RANGE
  1689. {
  1690. DWORD MinValue;
  1691. DWORD MaxValue;
  1692. } RANGE;
  1693. typedef RANGE *LPRANGE;
  1694. cpp_quote("//=============================================================================")
  1695. cpp_quote("// LABELED_BYTE structure")
  1696. cpp_quote("//=============================================================================")
  1697. typedef struct _LABELED_BYTE
  1698. {
  1699. BYTE Value;
  1700. LPSTR Label;
  1701. } LABELED_BYTE;
  1702. typedef LABELED_BYTE *LPLABELED_BYTE;
  1703. cpp_quote("//=============================================================================")
  1704. cpp_quote("// LABELED_WORD structure")
  1705. cpp_quote("//=============================================================================")
  1706. typedef struct _LABELED_WORD
  1707. {
  1708. WORD Value;
  1709. LPSTR Label;
  1710. } LABELED_WORD;
  1711. typedef LABELED_WORD *LPLABELED_WORD;
  1712. cpp_quote("//=============================================================================")
  1713. cpp_quote("// LABELED_DWORD structure")
  1714. cpp_quote("//=============================================================================")
  1715. typedef struct _LABELED_DWORD
  1716. {
  1717. DWORD Value;
  1718. LPSTR Label;
  1719. } LABELED_DWORD;
  1720. typedef LABELED_DWORD *LPLABELED_DWORD;
  1721. cpp_quote("//=============================================================================")
  1722. cpp_quote("// LABELED_LARGEINT structure")
  1723. cpp_quote("//=============================================================================")
  1724. typedef struct _LABELED_LARGEINT
  1725. {
  1726. LARGE_INTEGER Value;
  1727. LPSTR Label;
  1728. } LABELED_LARGEINT;
  1729. typedef LABELED_LARGEINT *LPLABELED_LARGEINT;
  1730. cpp_quote("//=============================================================================")
  1731. cpp_quote("// LABELED_SYSTEMTIME structure")
  1732. cpp_quote("//=============================================================================")
  1733. typedef struct _LABELED_SYSTEMTIME
  1734. {
  1735. SYSTEMTIME Value;
  1736. LPSTR Label;
  1737. } LABELED_SYSTEMTIME;
  1738. typedef LABELED_SYSTEMTIME *LPLABELED_SYSTEMTIME;
  1739. cpp_quote("//=============================================================================")
  1740. cpp_quote("// LABELED_BIT structure")
  1741. cpp_quote("//=============================================================================")
  1742. cpp_quote("// BitNumber starts at 0, up to 256 bits.")
  1743. typedef struct _LABELED_BIT
  1744. {
  1745. BYTE BitNumber;
  1746. LPSTR LabelOff;
  1747. LPSTR LabelOn;
  1748. } LABELED_BIT;
  1749. typedef LABELED_BIT *LPLABELED_BIT;
  1750. cpp_quote("//=============================================================================")
  1751. cpp_quote("// TYPED_STRING structure")
  1752. cpp_quote("//=============================================================================")
  1753. const DWORD TYPED_STRING_NORMAL = 1;
  1754. const DWORD TYPED_STRING_UNICODE = 2;
  1755. const DWORD TYPED_STRING_EXFLAG = 1;
  1756. // structure contains bitfields, so must cpp_quote
  1757. cpp_quote("// Typed Strings are always Ex, so to actually Ex we set fStringEx and put the Ex data in Byte")
  1758. cpp_quote("typedef struct _TYPED_STRING")
  1759. cpp_quote("{")
  1760. cpp_quote(" BYTE StringType:7;")
  1761. cpp_quote(" BYTE fStringEx:1;")
  1762. cpp_quote(" LPSTR lpString;")
  1763. cpp_quote(" BYTE Byte[0];")
  1764. cpp_quote("} TYPED_STRING;")
  1765. cpp_quote("")
  1766. cpp_quote("typedef TYPED_STRING *LPTYPED_STRING;")
  1767. cpp_quote("//=============================================================================")
  1768. cpp_quote("// OBJECT_IDENTIFIER structure")
  1769. cpp_quote("//=============================================================================")
  1770. typedef struct _OBJECT_IDENTIFIER
  1771. {
  1772. DWORD Length;
  1773. LPDWORD lpIdentifier;
  1774. } OBJECT_IDENTIFIER;
  1775. typedef OBJECT_IDENTIFIER *LPOBJECT_IDENTIFIER;
  1776. cpp_quote("//=============================================================================")
  1777. cpp_quote("// Set structure.")
  1778. cpp_quote("//=============================================================================")
  1779. typedef struct _SET
  1780. {
  1781. DWORD nEntries;
  1782. union
  1783. {
  1784. //... set of values
  1785. LPVOID lpVoidTable; // set of anything.
  1786. LPBYTE lpByteTable; // set of bytes
  1787. LPWORD lpWordTable; // set of words
  1788. LPDWORD lpDwordTable; // set of dwords
  1789. LPLARGEINT lpLargeIntTable; // set of LARGEINT structures
  1790. LPSYSTEMTIME lpSystemTimeTable; // set of SYSTEMTIME structures
  1791. //... set of labeled values
  1792. LPLABELED_BYTE lpLabeledByteTable; // set of labeled_byte structs
  1793. LPLABELED_WORD lpLabeledWordTable; // set of labeled_word structs
  1794. LPLABELED_DWORD lpLabeledDwordTable; // set of labeled_dword structs
  1795. LPLABELED_LARGEINT lpLabeledLargeIntTable; // set of Labeled_LARGEINT structs
  1796. LPLABELED_SYSTEMTIME lpLabeledSystemTimeTable; // set of labeled_systemtime structs
  1797. LPLABELED_BIT lpLabeledBit; // set of labeled_bit structs.
  1798. };
  1799. } SET;
  1800. typedef SET *LPSET;
  1801. cpp_quote("//=============================================================================")
  1802. cpp_quote("// String table.")
  1803. cpp_quote("//=============================================================================")
  1804. // needs to be cpp_quoted because of the zero length array
  1805. cpp_quote("typedef struct _STRINGTABLE")
  1806. cpp_quote("{")
  1807. cpp_quote(" DWORD nStrings;")
  1808. cpp_quote(" LPSTR String[0];")
  1809. cpp_quote("")
  1810. cpp_quote("} STRINGTABLE;")
  1811. cpp_quote("")
  1812. cpp_quote("typedef STRINGTABLE *LPSTRINGTABLE;")
  1813. cpp_quote("#define STRINGTABLE_SIZE sizeof(STRINGTABLE)")
  1814. cpp_quote("")
  1815. cpp_quote("//=============================================================================")
  1816. cpp_quote("// RECOGNIZEDATA structure.")
  1817. cpp_quote("//")
  1818. cpp_quote("// This structure to keep track of the start of each recognized protocol.")
  1819. cpp_quote("//=============================================================================")
  1820. typedef struct _RECOGNIZEDATA
  1821. {
  1822. WORD ProtocolID; //... Protocol which was recognized
  1823. WORD nProtocolOffset; //... Offset from the start of the frame of the start of this protocol.
  1824. LPVOID InstData; //... Opaque, for protocol only.
  1825. } RECOGNIZEDATA;
  1826. typedef RECOGNIZEDATA * LPRECOGNIZEDATA;
  1827. cpp_quote("//=============================================================================")
  1828. cpp_quote("// RECOGNIZEDATATABLE structure.")
  1829. cpp_quote("//")
  1830. cpp_quote("// This structure to keep track of the start of each RECOGNIZEDATA structure")
  1831. cpp_quote("//=============================================================================")
  1832. // needs to be cpp_quoted because of the zero length array
  1833. cpp_quote("typedef struct _RECOGNIZEDATATABLE")
  1834. cpp_quote("{")
  1835. cpp_quote(" WORD nRecognizeDatas; //... number of RECOGNIZEDATA structures")
  1836. cpp_quote(" RECOGNIZEDATA RecognizeData[0]; //... array of RECOGNIZEDATA structures follows")
  1837. cpp_quote("")
  1838. cpp_quote("} RECOGNIZEDATATABLE;")
  1839. cpp_quote("")
  1840. cpp_quote("typedef RECOGNIZEDATATABLE * LPRECOGNIZEDATATABLE;")
  1841. cpp_quote("")
  1842. cpp_quote("//=============================================================================")
  1843. cpp_quote("// Property information structure.")
  1844. cpp_quote("//=============================================================================")
  1845. typedef struct _PROPERTYINFO
  1846. {
  1847. HPROPERTY hProperty; //... Handle to the property.
  1848. DWORD Version; //... Version of property.
  1849. LPSTR Label; //... name of property
  1850. LPSTR Comment; //... description of property
  1851. BYTE DataType; //... data type of property
  1852. BYTE DataQualifier; //... data qualifier of property
  1853. union
  1854. {
  1855. LPVOID lpExtendedInfo; //... generic pointer.
  1856. LPRANGE lpRange; //... pointer to range
  1857. LPSET lpSet; //... pointer to set
  1858. DWORD Bitmask; //... bitmask to apply
  1859. DWORD Value; //... constant value.
  1860. };
  1861. WORD FormatStringSize; //... max size to reserve for text description
  1862. LPVOID InstanceData; //... property-specific instance data.
  1863. } PROPERTYINFO;
  1864. typedef PROPERTYINFO *LPPROPERTYINFO;
  1865. const DWORD PROPERTYINFO_SIZE =sizeof(PROPERTYINFO);
  1866. cpp_quote("//=============================================================================")
  1867. cpp_quote("// Property instance Extended structure.")
  1868. cpp_quote("//=============================================================================")
  1869. // contains unaligned pointer, so must cpp_quote
  1870. cpp_quote("typedef struct _PROPERTYINSTEX")
  1871. cpp_quote("{")
  1872. cpp_quote(" WORD Length; //... length of raw data in frame")
  1873. cpp_quote(" WORD LengthEx; //... number of bytes following")
  1874. cpp_quote(" ULPVOID lpData; //... pointer to raw data in frame")
  1875. cpp_quote("")
  1876. cpp_quote(" union")
  1877. cpp_quote(" {")
  1878. cpp_quote(" BYTE Byte[]; //... table of bytes follows")
  1879. cpp_quote(" WORD Word[]; //... table of words follows")
  1880. cpp_quote(" DWORD Dword[]; //... table of Dwords follows")
  1881. cpp_quote(" LARGE_INTEGER LargeInt[]; //... table of LARGEINT structures to follow")
  1882. cpp_quote(" SYSTEMTIME SysTime[]; //... table of SYSTEMTIME structures follows")
  1883. cpp_quote(" TYPED_STRING TypedString;//... a typed_string that may have extended data")
  1884. cpp_quote(" };")
  1885. cpp_quote("} PROPERTYINSTEX;")
  1886. cpp_quote("typedef PROPERTYINSTEX *LPPROPERTYINSTEX;")
  1887. cpp_quote("typedef PROPERTYINSTEX UNALIGNED *ULPPROPERTYINSTEX;")
  1888. cpp_quote("#define PROPERTYINSTEX_SIZE sizeof(PROPERTYINSTEX)")
  1889. cpp_quote("//=============================================================================")
  1890. cpp_quote("// Property instance structure.")
  1891. cpp_quote("//=============================================================================")
  1892. // contains unaligned pointer, so must cpp_quote
  1893. cpp_quote("typedef struct _PROPERTYINST")
  1894. cpp_quote("{")
  1895. cpp_quote(" LPPROPERTYINFO lpPropertyInfo; // pointer to property info")
  1896. cpp_quote(" LPSTR szPropertyText; // pointer to string description")
  1897. cpp_quote("")
  1898. cpp_quote(" union")
  1899. cpp_quote(" {")
  1900. cpp_quote(" LPVOID lpData; // pointer to data")
  1901. cpp_quote(" ULPBYTE lpByte; // bytes")
  1902. cpp_quote(" ULPWORD lpWord; // words")
  1903. cpp_quote(" ULPDWORD lpDword; // dwords")
  1904. cpp_quote("")
  1905. cpp_quote(" ULPLARGEINT lpLargeInt; // LargeInt")
  1906. cpp_quote(" ULPSYSTEMTIME lpSysTime; // pointer to SYSTEMTIME structures")
  1907. cpp_quote(" LPPROPERTYINSTEX lpPropertyInstEx; // pointer to propertyinstex (if DataLength = -1)")
  1908. cpp_quote(" };")
  1909. cpp_quote("")
  1910. cpp_quote(" WORD DataLength; // length of data, or flag for propertyinstex struct")
  1911. cpp_quote(" WORD Level : 4 ; // level information ............1111")
  1912. cpp_quote(" WORD HelpID : 12 ; // context ID for helpfile 111111111111....")
  1913. cpp_quote(" // ---------------")
  1914. cpp_quote(" // total of 16 bits == 1 WORD == DWORD ALIGNED structure")
  1915. cpp_quote(" // Interpretation Flags: Flags that define attach time information to the")
  1916. cpp_quote(" // interpretation of the property. For example, in RPC, the client can be")
  1917. cpp_quote(" // Intel format and the server can be non-Intel format... thus the property")
  1918. cpp_quote(" // database cannot describe the property at database creation time.")
  1919. cpp_quote(" DWORD IFlags;")
  1920. cpp_quote("")
  1921. cpp_quote("} PROPERTYINST;")
  1922. cpp_quote("typedef PROPERTYINST *LPPROPERTYINST;")
  1923. cpp_quote("#define PROPERTYINST_SIZE sizeof(PROPERTYINST)")
  1924. cpp_quote("")
  1925. cpp_quote("// Flags passed at AttachPropertyInstance and AttachPropertyInstanceEx time in the IFlags field:")
  1926. cpp_quote("// flag for error condition ...............1")
  1927. const DWORD IFLAG_ERROR =0x00000001;
  1928. cpp_quote("// is the WORD or DWORD byte non-Intel format at attach time?")
  1929. const DWORD IFLAG_SWAPPED =0x00000002;
  1930. cpp_quote("// is the STRING UNICODE at attach time?")
  1931. const DWORD IFLAG_UNICODE =0x00000004;
  1932. cpp_quote("//=============================================================================")
  1933. cpp_quote("// Property instance table structure.")
  1934. cpp_quote("//=============================================================================")
  1935. typedef struct _PROPERTYINSTTABLE
  1936. {
  1937. WORD nPropertyInsts; //... number of items
  1938. WORD nPropertyInstIndex; //... index to first item
  1939. } PROPERTYINSTTABLE;
  1940. typedef PROPERTYINSTTABLE *LPPROPERTYINSTTABLE;
  1941. const DWORD PROPERTYINSTTABLE_SIZE =sizeof(PROPERTYINSTTABLE);
  1942. cpp_quote("//=============================================================================")
  1943. cpp_quote("// Property table structure.")
  1944. cpp_quote("//=============================================================================")
  1945. // contains a structure that contains an unaligned pointer, so must cpp_quote
  1946. cpp_quote("typedef struct _PROPERTYTABLE")
  1947. cpp_quote("{")
  1948. cpp_quote(" LPVOID lpFormatBuffer; //... Opaque. (PRIVATE)")
  1949. cpp_quote(" DWORD FormatBufferLength; //... Opaque. (PRIVATE)")
  1950. cpp_quote(" DWORD nTotalPropertyInsts; //... total number of propertyinstances in array")
  1951. cpp_quote(" LPPROPERTYINST lpFirstPropertyInst; //... array of property instances")
  1952. cpp_quote(" BYTE nPropertyInstTables; //... total PropertyIndexTables following")
  1953. cpp_quote(" PROPERTYINSTTABLE PropertyInstTable[0]; //... array of propertyinstance index table structures")
  1954. cpp_quote("")
  1955. cpp_quote("} PROPERTYTABLE;")
  1956. cpp_quote("")
  1957. cpp_quote("typedef PROPERTYTABLE *LPPROPERTYTABLE;")
  1958. cpp_quote("")
  1959. cpp_quote("#define PROPERTYTABLE_SIZE sizeof(PROPERTYTABLE)")
  1960. cpp_quote("//=============================================================================")
  1961. cpp_quote("// Protocol entry points.")
  1962. cpp_quote("//=============================================================================")
  1963. cpp_quote("")
  1964. cpp_quote("typedef VOID (WINAPI *REGISTER)(HPROTOCOL);")
  1965. cpp_quote("")
  1966. cpp_quote("typedef VOID (WINAPI *DEREGISTER)(HPROTOCOL);")
  1967. cpp_quote("")
  1968. cpp_quote("typedef LPBYTE (WINAPI *RECOGNIZEFRAME)(HFRAME, ULPBYTE, ULPBYTE, DWORD, DWORD, HPROTOCOL, DWORD, LPDWORD, LPHPROTOCOL, PDWORD_PTR);")
  1969. cpp_quote("")
  1970. cpp_quote("typedef LPBYTE (WINAPI *ATTACHPROPERTIES)(HFRAME, ULPBYTE, ULPBYTE, DWORD, DWORD, HPROTOCOL, DWORD, DWORD_PTR);")
  1971. cpp_quote("")
  1972. cpp_quote("typedef DWORD (WINAPI *FORMATPROPERTIES)(HFRAME, ULPBYTE, ULPBYTE, DWORD, LPPROPERTYINST);")
  1973. cpp_quote("")
  1974. cpp_quote("//=============================================================================")
  1975. cpp_quote("// Protocol entry point structure.")
  1976. cpp_quote("//=============================================================================")
  1977. cpp_quote("")
  1978. cpp_quote("typedef struct _ENTRYPOINTS")
  1979. cpp_quote("{")
  1980. cpp_quote(" REGISTER Register; //... Protocol Register() entry point.")
  1981. cpp_quote(" DEREGISTER Deregister; //... Protocol Deregister() entry point.")
  1982. cpp_quote(" RECOGNIZEFRAME RecognizeFrame; //... Protocol RecognizeFrame() entry point.")
  1983. cpp_quote(" ATTACHPROPERTIES AttachProperties; //... Protocol AttachProperties() entry point.")
  1984. cpp_quote(" FORMATPROPERTIES FormatProperties; //... Protocol FormatProperties() entry point.")
  1985. cpp_quote("")
  1986. cpp_quote("} ENTRYPOINTS;")
  1987. cpp_quote("")
  1988. cpp_quote("typedef ENTRYPOINTS *LPENTRYPOINTS;")
  1989. cpp_quote("")
  1990. cpp_quote("#define ENTRYPOINTS_SIZE sizeof(ENTRYPOINTS)")
  1991. cpp_quote("")
  1992. cpp_quote("//=============================================================================")
  1993. cpp_quote("// Property database structure.")
  1994. cpp_quote("//=============================================================================")
  1995. // structure contains zero length array, must cpp_quote
  1996. cpp_quote("typedef struct _PROPERTYDATABASE")
  1997. cpp_quote("{")
  1998. cpp_quote(" DWORD nProperties; //... Number of properties in database.")
  1999. cpp_quote(" LPPROPERTYINFO PropertyInfo[0]; //... Array of property info pointers.")
  2000. cpp_quote("")
  2001. cpp_quote("} PROPERTYDATABASE;")
  2002. cpp_quote("#define PROPERTYDATABASE_SIZE sizeof(PROPERTYDATABASE)")
  2003. cpp_quote("typedef PROPERTYDATABASE *LPPROPERTYDATABASE;")
  2004. cpp_quote("")
  2005. cpp_quote("//=============================================================================")
  2006. cpp_quote("// Protocol info structure (PUBLIC portion of HPROTOCOL).")
  2007. cpp_quote("//=============================================================================")
  2008. // structure contains a structure with a zero length array, must cpp_quote
  2009. cpp_quote("typedef struct _PROTOCOLINFO")
  2010. cpp_quote("{")
  2011. cpp_quote(" DWORD ProtocolID; //... Prootocol ID of owning protocol.")
  2012. cpp_quote(" LPPROPERTYDATABASE PropertyDatabase; //... Property database.")
  2013. cpp_quote(" BYTE ProtocolName[16]; //... Protocol name.")
  2014. cpp_quote(" BYTE HelpFile[16]; //... Optional helpfile name.")
  2015. cpp_quote(" BYTE Comment[128]; //... Comment describing protocol.")
  2016. cpp_quote("} PROTOCOLINFO;")
  2017. cpp_quote("typedef PROTOCOLINFO *LPPROTOCOLINFO;")
  2018. cpp_quote("#define PROTOCOLINFO_SIZE sizeof(PROTOCOLINFO)")
  2019. cpp_quote("")
  2020. cpp_quote("//=============================================================================")
  2021. cpp_quote("// Protocol Table.")
  2022. cpp_quote("//=============================================================================")
  2023. typedef struct _PROTOCOLTABLE
  2024. {
  2025. DWORD nProtocols;
  2026. HPROTOCOL hProtocol[1]; //... This must be the last member.
  2027. } PROTOCOLTABLE;
  2028. typedef PROTOCOLTABLE *LPPROTOCOLTABLE;
  2029. const DWORD PROTOCOLTABLE_SIZE =(sizeof(PROTOCOLTABLE) - sizeof(HPROTOCOL));
  2030. cpp_quote("#define PROTOCOLTABLE_ACTUAL_SIZE(p) GetTableSize(PROTOCOLTABLE_SIZE, (p)->nProtocols, sizeof(HPROTOCOL))")
  2031. cpp_quote("//=============================================================================")
  2032. cpp_quote("// AddressInfo structure")
  2033. cpp_quote("//=============================================================================")
  2034. const DWORD SORT_BYADDRESS =0;
  2035. const DWORD SORT_BYNAME =1;
  2036. const DWORD PERMANENT_NAME =0x00000100;
  2037. // structure contains structures with bitfields, so must cpp_quote
  2038. cpp_quote("typedef struct _ADDRESSINFO")
  2039. cpp_quote("{")
  2040. cpp_quote(" ADDRESS Address;")
  2041. cpp_quote(" WCHAR Name[MAX_NAME_SIZE];")
  2042. cpp_quote(" DWORD Flags;")
  2043. cpp_quote(" LPVOID lpAddressInstData;")
  2044. cpp_quote("")
  2045. cpp_quote("} ADDRESSINFO;")
  2046. cpp_quote("typedef struct _ADDRESSINFO *LPADDRESSINFO;")
  2047. cpp_quote("#define ADDRESSINFO_SIZE sizeof(ADDRESSINFO)")
  2048. cpp_quote("//=============================================================================")
  2049. cpp_quote("// AddressInfoTable")
  2050. cpp_quote("//=============================================================================")
  2051. // structure contains structures with bitfields, so must cpp_quote
  2052. // also contains zero length array, so must cpp_quote
  2053. cpp_quote("typedef struct _ADDRESSINFOTABLE")
  2054. cpp_quote("{")
  2055. cpp_quote(" DWORD nAddressInfos;")
  2056. cpp_quote(" LPADDRESSINFO lpAddressInfo[0];")
  2057. cpp_quote("")
  2058. cpp_quote("} ADDRESSINFOTABLE;")
  2059. cpp_quote("typedef ADDRESSINFOTABLE *LPADDRESSINFOTABLE;")
  2060. cpp_quote("#define ADDRESSINFOTABLE_SIZE sizeof(ADDRESSINFOTABLE)")
  2061. cpp_quote("//=============================================================================")
  2062. cpp_quote("// callback procedures.")
  2063. cpp_quote("//=============================================================================")
  2064. cpp_quote("")
  2065. cpp_quote("typedef DWORD (WINAPI *FILTERPROC)(HCAPTURE, HFRAME, LPVOID);")
  2066. cpp_quote("")
  2067. cpp_quote("//=============================================================================")
  2068. cpp_quote("//=============================================================================")
  2069. cpp_quote("// (NMErr.h)")
  2070. cpp_quote("//=============================================================================")
  2071. cpp_quote("//=============================================================================")
  2072. cpp_quote("// The operation succeeded.")
  2073. const DWORD NMERR_SUCCESS = 0;
  2074. cpp_quote("// An error occured creating a memory-mapped file.")
  2075. const DWORD NMERR_MEMORY_MAPPED_FILE_ERROR = 1;
  2076. cpp_quote("// The handle to a filter is invalid.")
  2077. const DWORD NMERR_INVALID_HFILTER = 2;
  2078. cpp_quote("// Capturing has already been started.")
  2079. const DWORD NMERR_CAPTURING = 3;
  2080. cpp_quote("// Capturing has not been started.")
  2081. const DWORD NMERR_NOT_CAPTURING = 4;
  2082. cpp_quote("// The are no frames available.")
  2083. const DWORD NMERR_NO_MORE_FRAMES = 5;
  2084. cpp_quote("// The buffer is too small to complete the operation.")
  2085. const DWORD NMERR_BUFFER_TOO_SMALL = 6;
  2086. cpp_quote("// No protocol was able to recognize the frame.")
  2087. const DWORD NMERR_FRAME_NOT_RECOGNIZED = 7;
  2088. cpp_quote("// The file already exists.")
  2089. const DWORD NMERR_FILE_ALREADY_EXISTS = 8;
  2090. cpp_quote("// A needed device driver was not found or is not loaded.")
  2091. const DWORD NMERR_DRIVER_NOT_FOUND = 9;
  2092. cpp_quote("// This address aready exists in the database.")
  2093. const DWORD NMERR_ADDRESS_ALREADY_EXISTS = 10;
  2094. cpp_quote("// The frame handle is invalid.")
  2095. const DWORD NMERR_INVALID_HFRAME = 11;
  2096. cpp_quote("// The protocol handle is invalid.")
  2097. const DWORD NMERR_INVALID_HPROTOCOL = 12;
  2098. cpp_quote("// The property handle is invalid.")
  2099. const DWORD NMERR_INVALID_HPROPERTY = 13;
  2100. cpp_quote("// The the object has been locked. ")
  2101. const DWORD NMERR_LOCKED = 14;
  2102. cpp_quote("// A pop operation was attempted on an empty stack.")
  2103. const DWORD NMERR_STACK_EMPTY = 15;
  2104. cpp_quote("// A push operation was attempted on an full stack.")
  2105. const DWORD NMERR_STACK_OVERFLOW = 16;
  2106. cpp_quote("// There are too many protocols active.")
  2107. const DWORD NMERR_TOO_MANY_PROTOCOLS = 17;
  2108. cpp_quote("// The file was not found.")
  2109. const DWORD NMERR_FILE_NOT_FOUND = 18;
  2110. cpp_quote("// No memory was available. Shut down windows to free up resources.")
  2111. const DWORD NMERR_OUT_OF_MEMORY = 19;
  2112. cpp_quote("// The capture is already in the paused state.")
  2113. const DWORD NMERR_CAPTURE_PAUSED = 20;
  2114. cpp_quote("// There are no buffers available or present.")
  2115. const DWORD NMERR_NO_BUFFERS = 21;
  2116. cpp_quote("// There are already buffers present.")
  2117. const DWORD NMERR_BUFFERS_ALREADY_EXIST = 22;
  2118. cpp_quote("// The object is not locked.")
  2119. const DWORD NMERR_NOT_LOCKED = 23;
  2120. cpp_quote("// A integer type was out of range.")
  2121. const DWORD NMERR_OUT_OF_RANGE = 24;
  2122. cpp_quote("// An object was locked too many times.")
  2123. const DWORD NMERR_LOCK_NESTING_TOO_DEEP = 25;
  2124. cpp_quote("// A parser failed to load.")
  2125. const DWORD NMERR_LOAD_PARSER_FAILED = 26;
  2126. cpp_quote("// A parser failed to unload.")
  2127. const DWORD NMERR_UNLOAD_PARSER_FAILED = 27;
  2128. cpp_quote("// The address database handle is invalid.")
  2129. const DWORD NMERR_INVALID_HADDRESSDB = 28;
  2130. cpp_quote("// The MAC address was not found in the database.")
  2131. const DWORD NMERR_ADDRESS_NOT_FOUND = 29;
  2132. cpp_quote("// The network software was not found in the system.")
  2133. const DWORD NMERR_NETWORK_NOT_PRESENT = 30;
  2134. cpp_quote("// There is no property database for a protocol.")
  2135. const DWORD NMERR_NO_PROPERTY_DATABASE = 31;
  2136. cpp_quote("// A property was not found in the database.")
  2137. const DWORD NMERR_PROPERTY_NOT_FOUND = 32;
  2138. cpp_quote("// The property database handle is in valid.")
  2139. const DWORD NMERR_INVALID_HPROPERTYDB = 33;
  2140. cpp_quote("// The protocol has not been enabled.")
  2141. const DWORD NMERR_PROTOCOL_NOT_ENABLED = 34;
  2142. cpp_quote("// The protocol DLL could not be found.")
  2143. const DWORD NMERR_PROTOCOL_NOT_FOUND = 35;
  2144. cpp_quote("// The parser DLL is not valid.")
  2145. const DWORD NMERR_INVALID_PARSER_DLL = 36;
  2146. cpp_quote("// There are no properties attached.")
  2147. const DWORD NMERR_NO_ATTACHED_PROPERTIES = 37;
  2148. cpp_quote("// There are no frames in the buffer.")
  2149. const DWORD NMERR_NO_FRAMES = 38;
  2150. cpp_quote("// The capture file format is not valid.")
  2151. const DWORD NMERR_INVALID_FILE_FORMAT = 39;
  2152. cpp_quote("// The OS could not create a temporary file.")
  2153. const DWORD NMERR_COULD_NOT_CREATE_TEMPFILE = 40;
  2154. cpp_quote("// There is not enough MS-DOS memory available.")
  2155. const DWORD NMERR_OUT_OF_DOS_MEMORY = 41;
  2156. cpp_quote("// There are no protocols enabled.")
  2157. const DWORD NMERR_NO_PROTOCOLS_ENABLED = 42;
  2158. cpp_quote("// The MAC type is invalid or unsupported.")
  2159. const DWORD NMERR_UNKNOWN_MACTYPE = 46;
  2160. cpp_quote("// There is no routing information present in the MAC frame.")
  2161. const DWORD NMERR_ROUTING_INFO_NOT_PRESENT = 47;
  2162. cpp_quote("// The network handle is invalid.")
  2163. const DWORD NMERR_INVALID_HNETWORK = 48;
  2164. cpp_quote("// The network is already open.")
  2165. const DWORD NMERR_NETWORK_ALREADY_OPENED = 49;
  2166. cpp_quote("// The network is not open.")
  2167. const DWORD NMERR_NETWORK_NOT_OPENED = 50;
  2168. cpp_quote("// The frame was not found in the buffer.")
  2169. const DWORD NMERR_FRAME_NOT_FOUND = 51;
  2170. cpp_quote("// There are no handles available.")
  2171. const DWORD NMERR_NO_HANDLES = 53;
  2172. cpp_quote("// The network ID is invalid.")
  2173. const DWORD NMERR_INVALID_NETWORK_ID = 54;
  2174. cpp_quote("// The capture handle is invalid.")
  2175. const DWORD NMERR_INVALID_HCAPTURE = 55;
  2176. cpp_quote("// The protocol has already been enabled.")
  2177. const DWORD NMERR_PROTOCOL_ALREADY_ENABLED = 56;
  2178. cpp_quote("// The filter expression is invalid.")
  2179. const DWORD NMERR_FILTER_INVALID_EXPRESSION = 57;
  2180. cpp_quote("// A transmit error occured.")
  2181. const DWORD NMERR_TRANSMIT_ERROR = 58;
  2182. cpp_quote("// The buffer handle is invalid.")
  2183. const DWORD NMERR_INVALID_HBUFFER = 59;
  2184. cpp_quote("// The specified data is unknown or invalid.")
  2185. const DWORD NMERR_INVALID_DATA = 60;
  2186. cpp_quote("// The MS-DOS/NDIS 2.0 network driver is not loaded.")
  2187. const DWORD NMERR_MSDOS_DRIVER_NOT_LOADED = 61;
  2188. cpp_quote("// The Windows VxD/NDIS 3.0 network driver is not loaded.")
  2189. const DWORD NMERR_WINDOWS_DRIVER_NOT_LOADED = 62;
  2190. cpp_quote("// The MS-DOS/NDIS 2.0 driver had an init-time failure.")
  2191. const DWORD NMERR_MSDOS_DRIVER_INIT_FAILURE = 63;
  2192. cpp_quote("// The Windows/NDIS 3.0 driver had an init-time failure.")
  2193. const DWORD NMERR_WINDOWS_DRIVER_INIT_FAILURE = 64;
  2194. cpp_quote("// The network driver is busy and cannot handle requests.")
  2195. const DWORD NMERR_NETWORK_BUSY = 65;
  2196. cpp_quote("// The capture is not paused.")
  2197. const DWORD NMERR_CAPTURE_NOT_PAUSED = 66;
  2198. cpp_quote("// The frame/packet length is not valid.")
  2199. const DWORD NMERR_INVALID_PACKET_LENGTH = 67;
  2200. cpp_quote("// An internal exception occured.")
  2201. const DWORD NMERR_INTERNAL_EXCEPTION = 69;
  2202. cpp_quote("// The MAC driver does not support promiscious mode.")
  2203. const DWORD NMERR_PROMISCUOUS_MODE_NOT_SUPPORTED= 70;
  2204. cpp_quote("// The MAC driver failed to open.")
  2205. const DWORD NMERR_MAC_DRIVER_OPEN_FAILURE = 71;
  2206. cpp_quote("// The protocol went off the end of the frame.")
  2207. const DWORD NMERR_RUNAWAY_PROTOCOL = 72;
  2208. cpp_quote("// An asynchronous operation is still pending.")
  2209. const DWORD NMERR_PENDING = 73;
  2210. cpp_quote("// Access is denied.")
  2211. const DWORD NMERR_ACCESS_DENIED = 74;
  2212. cpp_quote("// The password handle is invalid.")
  2213. const DWORD NMERR_INVALID_HPASSWORD = 75;
  2214. cpp_quote("// A bad parameter was detected.")
  2215. const DWORD NMERR_INVALID_PARAMETER = 76;
  2216. cpp_quote("// An error occured reading the file.")
  2217. const DWORD NMERR_FILE_READ_ERROR = 77;
  2218. cpp_quote("// An error occured writing to the file.")
  2219. const DWORD NMERR_FILE_WRITE_ERROR = 78;
  2220. cpp_quote("// The protocol has not been registered")
  2221. const DWORD NMERR_PROTOCOL_NOT_REGISTERED = 79;
  2222. cpp_quote("// The frame does not contain an IP address.")
  2223. const DWORD NMERR_IP_ADDRESS_NOT_FOUND = 80;
  2224. cpp_quote("// The transmit request was cancelled.")
  2225. const DWORD NMERR_TRANSMIT_CANCELLED = 81;
  2226. cpp_quote("// The operation cannot be performed on a capture with 1 or more locked frames.")
  2227. const DWORD NMERR_LOCKED_FRAMES = 82;
  2228. cpp_quote("// A cancel transmit request was submitted but there were no transmits pending.")
  2229. const DWORD NMERR_NO_TRANSMITS_PENDING = 83;
  2230. cpp_quote("// Path not found.")
  2231. const DWORD NMERR_PATH_NOT_FOUND = 84;
  2232. cpp_quote("// A windows error has occured.")
  2233. const DWORD NMERR_WINDOWS_ERROR = 85;
  2234. cpp_quote("// The handle to the frame has no frame number.")
  2235. const DWORD NMERR_NO_FRAME_NUMBER = 86;
  2236. cpp_quote("// The frame is not associated with any capture.")
  2237. const DWORD NMERR_FRAME_HAS_NO_CAPTURE = 87;
  2238. cpp_quote("// The frame is already associated with a capture.")
  2239. const DWORD NMERR_FRAME_ALREADY_HAS_CAPTURE = 88;
  2240. cpp_quote("// The NAL is not remotable.")
  2241. const DWORD NMERR_NAL_IS_NOT_REMOTE = 89;
  2242. cpp_quote("// The API is not supported")
  2243. const DWORD NMERR_NOT_SUPPORTED = 90;
  2244. cpp_quote("// Network Monitor should discard the current frame. ")
  2245. cpp_quote("// This error code is only used during a filtered SaveCapture() API call.")
  2246. const DWORD NMERR_DISCARD_FRAME = 91;
  2247. cpp_quote("// Network Monitor should cancel the current save. ")
  2248. cpp_quote("// This error code is only used during a filtered SaveCapture() API call.")
  2249. const DWORD NMERR_CANCEL_SAVE_CAPTURE = 92;
  2250. cpp_quote("// The connection to the remote machine has been lost")
  2251. const DWORD NMERR_LOST_CONNECTION = 93;
  2252. cpp_quote("// The media/mac type is not valid.")
  2253. const DWORD NMERR_INVALID_MEDIA_TYPE = 94;
  2254. cpp_quote("// The Remote Agent is currently in use")
  2255. const DWORD NMERR_AGENT_IN_USE = 95;
  2256. cpp_quote("// The request has timed out")
  2257. const DWORD NMERR_TIMEOUT = 96;
  2258. cpp_quote("// The remote agent has been disconnected")
  2259. const DWORD NMERR_DISCONNECTED = 97;
  2260. cpp_quote("// A timer required for operation failed creation")
  2261. const DWORD NMERR_SETTIMER_FAILED = 98;
  2262. cpp_quote("// A network error occured.")
  2263. const DWORD NMERR_NETWORK_ERROR = 99;
  2264. cpp_quote("// Frame callback procedure is not valid")
  2265. const DWORD NMERR_INVALID_FRAMESPROC = 100;
  2266. cpp_quote("// Capture type specified is unknown")
  2267. const DWORD NMERR_UNKNOWN_CAPTURETYPE = 101;
  2268. cpp_quote("// The NPP is not connected to a network.")
  2269. const DWORD NMERR_NOT_CONNECTED = 102;
  2270. cpp_quote("// The NPP is already connected to a network.")
  2271. const DWORD NMERR_ALREADY_CONNECTED = 103;
  2272. cpp_quote("// The registry tag does not indicate a known configuration.")
  2273. const DWORD NMERR_INVALID_REGISTRY_CONFIGURATION= 104;
  2274. cpp_quote("// The NPP is currently configured for delayed capturing.")
  2275. const DWORD NMERR_DELAYED = 105;
  2276. cpp_quote("// The NPP is not currently configured for delayed capturing.")
  2277. const DWORD NMERR_NOT_DELAYED = 106;
  2278. cpp_quote("// The NPP is currently configured for real time capturing.")
  2279. const DWORD NMERR_REALTIME = 107;
  2280. cpp_quote("// The NPP is not currently configured for real time capturing.")
  2281. const DWORD NMERR_NOT_REALTIME = 108;
  2282. cpp_quote("// The NPP is currently configured for stats only capturing.")
  2283. const DWORD NMERR_STATS_ONLY = 109;
  2284. cpp_quote("// The NPP is not currently configured for stats only capturing.")
  2285. const DWORD NMERR_NOT_STATS_ONLY = 110;
  2286. cpp_quote("// The NPP is currently configured for transmitting.")
  2287. const DWORD NMERR_TRANSMIT = 111;
  2288. cpp_quote("// The NPP is not currently configured for transmitting.")
  2289. const DWORD NMERR_NOT_TRANSMIT = 112;
  2290. cpp_quote("// The NPP is currently transmitting")
  2291. const DWORD NMERR_TRANSMITTING = 113;
  2292. cpp_quote("// The specified capture file hard disk is not local")
  2293. const DWORD NMERR_DISK_NOT_LOCAL_FIXED = 114;
  2294. cpp_quote("// Could not create the default capture directory on the given disk")
  2295. const DWORD NMERR_COULD_NOT_CREATE_DIRECTORY = 115;
  2296. cpp_quote("// The default capture directory was not set in the registry:")
  2297. cpp_quote("// HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\nm\\Parameters\\CapturePath")
  2298. const DWORD NMERR_NO_DEFAULT_CAPTURE_DIRECTORY = 116;
  2299. cpp_quote("// The capture file is an uplevel version that this netmon does not understand")
  2300. const DWORD NMERR_UPLEVEL_CAPTURE_FILE = 117;
  2301. cpp_quote("// An expert failed to load.")
  2302. const DWORD NMERR_LOAD_EXPERT_FAILED = 118;
  2303. cpp_quote("// An expert failed to report its EXPERT_INFO structs.")
  2304. const DWORD NMERR_EXPERT_REPORT_FAILED = 119;
  2305. cpp_quote("// Registry API call failed.")
  2306. const DWORD NMERR_REG_OPERATION_FAILED = 120;
  2307. cpp_quote("// Registry API call failed.")
  2308. const DWORD NMERR_NO_DLLS_FOUND = 121;
  2309. cpp_quote("// There are no conversation stats, they were not asked for.")
  2310. const DWORD NMERR_NO_CONVERSATION_STATS = 122;
  2311. cpp_quote("// We have received a security response packet from a security monitor.")
  2312. const DWORD NMERR_SECURITY_BREACH_CAPTURE_DELETED = 123;
  2313. cpp_quote("// The given frame failed the display filter.")
  2314. const DWORD NMERR_FRAME_FAILED_FILTER = 124;
  2315. cpp_quote("// Netmon wants the Expert to stop running.")
  2316. const DWORD NMERR_EXPERT_TERMINATE = 125;
  2317. cpp_quote("// Netmon needs the remote machine to be a server.")
  2318. const DWORD NMERR_REMOTE_NOT_A_SERVER = 126;
  2319. cpp_quote("// Netmon needs the remote machine to be a server.")
  2320. const DWORD NMERR_REMOTE_VERSION_OUTOFSYNC = 127;
  2321. cpp_quote("// The supplied group is an invalid handle")
  2322. const DWORD NMERR_INVALID_EXPERT_GROUP = 128;
  2323. cpp_quote("// The supplied expert name cannot be found")
  2324. const DWORD NMERR_INVALID_EXPERT_NAME = 129;
  2325. cpp_quote("// The supplied expert name cannot be found")
  2326. const DWORD NMERR_INVALID_EXPERT_HANDLE= 130;
  2327. cpp_quote("// The supplied group name already exists")
  2328. const DWORD NMERR_GROUP_NAME_ALREADY_EXISTS = 131;
  2329. cpp_quote("// The supplied group name is invalid")
  2330. const DWORD NMERR_INVALID_GROUP_NAME = 132;
  2331. cpp_quote("// The supplied Expert is already in the group. ")
  2332. const DWORD NMERR_EXPERT_ALREADY_IN_GROUP = 133;
  2333. cpp_quote("// The Expert cannot be deleted from the group because it is not in the group")
  2334. const DWORD NMERR_EXPERT_NOT_IN_GROUP = 134;
  2335. cpp_quote("// The COM object has not been initialized")
  2336. const DWORD NMERR_NOT_INITIALIZED = 135;
  2337. cpp_quote("// Cannot perform function to Root group")
  2338. const DWORD NMERR_INVALID_GROUP_ROOT = 136;
  2339. cpp_quote("// Potential data structure mismatch between NdisNpp and Driver.")
  2340. const DWORD NMERR_BAD_VERSION = 137;
  2341. cpp_quote("// The NPP is currently configured for ESP capturing.")
  2342. const DWORD NMERR_ESP = 138;
  2343. cpp_quote("// The NPP is not currently configured for ESP capturing.")
  2344. const DWORD NMERR_NOT_ESP = 139;
  2345. cpp_quote("//=============================================================================")
  2346. cpp_quote("// Blob Errors")
  2347. cpp_quote("//=============================================================================")
  2348. const DWORD NMERR_BLOB_NOT_INITIALIZED =1000;
  2349. const DWORD NMERR_INVALID_BLOB =1001;
  2350. const DWORD NMERR_UPLEVEL_BLOB =1002;
  2351. const DWORD NMERR_BLOB_ENTRY_ALREADY_EXISTS =1003;
  2352. const DWORD NMERR_BLOB_ENTRY_DOES_NOT_EXIST =1004;
  2353. const DWORD NMERR_AMBIGUOUS_SPECIFIER =1005;
  2354. const DWORD NMERR_BLOB_OWNER_NOT_FOUND =1006;
  2355. const DWORD NMERR_BLOB_CATEGORY_NOT_FOUND =1007;
  2356. const DWORD NMERR_UNKNOWN_CATEGORY =1008;
  2357. const DWORD NMERR_UNKNOWN_TAG =1009;
  2358. const DWORD NMERR_BLOB_CONVERSION_ERROR =1010;
  2359. const DWORD NMERR_ILLEGAL_TRIGGER =1011;
  2360. const DWORD NMERR_BLOB_STRING_INVALID =1012;
  2361. cpp_quote("//=============================================================================")
  2362. cpp_quote("// FINDER errors")
  2363. cpp_quote("//=============================================================================")
  2364. const DWORD NMERR_UNABLE_TO_LOAD_LIBRARY =1013;
  2365. const DWORD NMERR_UNABLE_TO_GET_PROCADDR =1014;
  2366. const DWORD NMERR_CLASS_NOT_REGISTERED =1015;
  2367. const DWORD NMERR_INVALID_REMOTE_COMPUTERNAME =1016;
  2368. const DWORD NMERR_RPC_REMOTE_FAILURE =1017;
  2369. const DWORD NMERR_NO_NPPS =3016;
  2370. const DWORD NMERR_NO_MATCHING_NPPS =3017;
  2371. const DWORD NMERR_NO_NPP_SELECTED =3018;
  2372. const DWORD NMERR_NO_INPUT_BLOBS =3019;
  2373. const DWORD NMERR_NO_NPP_DLLS =3020;
  2374. const DWORD NMERR_NO_VALID_NPP_DLLS =3021;
  2375. cpp_quote("//=============================================================================")
  2376. cpp_quote("// Monitor errors")
  2377. cpp_quote("//=============================================================================")
  2378. const DWORD NMERR_INVALID_LIST_INDEX =2000;
  2379. const DWORD NMERR_INVALID_MONITOR =2001;
  2380. const DWORD NMERR_INVALID_MONITOR_DLL =2002;
  2381. const DWORD NMERR_UNABLE_TO_CREATE_MONITOR =2003;
  2382. const DWORD NMERR_INVALID_MONITOR_CONFIG =2005;
  2383. const DWORD NMERR_INVALID_INDEX =2006;
  2384. const DWORD NMERR_MONITOR_ENABLED =2007;
  2385. const DWORD NMERR_MONITOR_NOT_RUNNING =2008;
  2386. const DWORD NMERR_MONITOR_IS_BUSY =2009;
  2387. const DWORD NMERR_MCS_IS_BUSY =2010;
  2388. const DWORD NMERR_NO_MONITORS =2011;
  2389. const DWORD NMERR_ONE_MONITOR_PER_NETCARD =2012;
  2390. const DWORD NMERR_CONFIGURATION_REQUIRED =2013;
  2391. const DWORD NMERR_MONITOR_NOT_CONNECTED =2014;
  2392. const DWORD NMERR_MONITOR_NOT_CONFIGURED =2015;
  2393. const DWORD NMERR_MONITOR_CONFIG_FAILED =2016;
  2394. const DWORD NMERR_MONITOR_INIT_FAILED =2017;
  2395. const DWORD NMERR_MONITOR_FAULTED =2018;
  2396. const DWORD NMERR_SAVE_ALL_FAILED =2019;
  2397. const DWORD NMERR_SAVE_MONITOR_FAILED =2029;
  2398. const DWORD NMERR_MONITOR_CONNECT_FAILED =2021;
  2399. const DWORD NMERR_MONITOR_START_FAILED =2022;
  2400. const DWORD NMERR_MONITOR_STOP_FAILED =2023;
  2401. cpp_quote("//=============================================================================")
  2402. cpp_quote("// Error Macros")
  2403. cpp_quote("//=============================================================================")
  2404. cpp_quote("#ifndef INLINE")
  2405. cpp_quote("#define INLINE __inline")
  2406. cpp_quote("#endif // INLINE")
  2407. #ifndef HRESULT
  2408. typedef LONG HRESULT; // From wtypes.h
  2409. #endif // HRESULT
  2410. cpp_quote("// normal Network Monitor errors will be put into the code portion of an hresult")
  2411. cpp_quote("// for return from OLE objects:")
  2412. cpp_quote("// these two macros will help to create and crack the scode")
  2413. cpp_quote("INLINE HRESULT NMERR_TO_HRESULT( DWORD nmerror )")
  2414. cpp_quote("{")
  2415. cpp_quote(" HRESULT hResult;")
  2416. cpp_quote(" if (nmerror == NMERR_SUCCESS)")
  2417. cpp_quote(" hResult = NOERROR;")
  2418. cpp_quote(" else")
  2419. cpp_quote(" hResult = MAKE_HRESULT( SEVERITY_ERROR,FACILITY_ITF, (WORD)nmerror) ;")
  2420. cpp_quote("")
  2421. cpp_quote(" return hResult;")
  2422. cpp_quote("}")
  2423. cpp_quote("//We use to decide whether the first bit was set to 1 or 0, not regarding ")
  2424. cpp_quote("//whether the result passed with a warning set in the low word. Now we ")
  2425. cpp_quote("//disregard the first bit and pass back the warning.")
  2426. cpp_quote("INLINE DWORD HRESULT_TO_NMERR( HRESULT hResult )")
  2427. cpp_quote("{")
  2428. cpp_quote(" return HRESULT_CODE(hResult);")
  2429. cpp_quote("}")
  2430. cpp_quote("//=============================================================================")
  2431. cpp_quote("//=============================================================================")
  2432. cpp_quote("// (BHFilter.h)")
  2433. cpp_quote("//=============================================================================")
  2434. cpp_quote("//=============================================================================")
  2435. cpp_quote("//============================================================================")
  2436. cpp_quote("// types")
  2437. cpp_quote("//============================================================================")
  2438. typedef HFILTER * LPHFILTER;
  2439. typedef DWORD FILTERACTIONTYPE;
  2440. typedef DWORD VALUETYPE;
  2441. cpp_quote("// check for protocols existing in the frame.")
  2442. cpp_quote("")
  2443. cpp_quote("// ProtocolPart")
  2444. cpp_quote("// this is the raw data for a Protocol based expression")
  2445. cpp_quote("//")
  2446. cpp_quote("// WHAT FIELD DESCRIPTION EXAMPLE")
  2447. cpp_quote("// ---- ----- ----------- -------")
  2448. cpp_quote("// Count of Protocol(nPropertyDBs) Number of protocols to pass 5")
  2449. cpp_quote("// PropertyDB Table (PropertyDB) Table of HPROTOCOL SMB, LLC, MAC")
  2450. cpp_quote("//")
  2451. cpp_quote("// NOTE: the nPropertyDBs field may also be the following, which implies that")
  2452. cpp_quote("// all are selected but that none have actually been put into the structure")
  2453. const DWORD PROTOCOL_NUM_ANY =(-1);
  2454. typedef PROTOCOLTABLE PROTOCOLTABLETYPE;
  2455. typedef PROTOCOLTABLETYPE *LPPROTOCOLTABLETYPE;
  2456. cpp_quote("// filter bits stores who passed what filter per frame to speed up")
  2457. cpp_quote("// the filter process... This is actually an array.")
  2458. typedef DWORD FILTERBITS;
  2459. typedef FILTERBITS *LPFILTERBITS;
  2460. typedef SYSTEMTIME *LPTIME;
  2461. cpp_quote("typedef SYSTEMTIME UNALIGNED * ULPTIME;")
  2462. cpp_quote("// The Filter Object is the basic unit of the postfix stack.")
  2463. cpp_quote("// I need to restart the convert property to value if the comparison does not match.")
  2464. cpp_quote("// To do this, I need the original pointer to the property. Pull the hProperty out of")
  2465. cpp_quote("// the union so that the pointer to the property is saved.")
  2466. // contains an unaligned pointer, so must cpp_quote
  2467. cpp_quote("typedef struct _FILTEROBJECT")
  2468. cpp_quote("{")
  2469. cpp_quote(" FILTERACTIONTYPE Action; // Object action, see codes below")
  2470. cpp_quote(" HPROPERTY hProperty; // property key")
  2471. cpp_quote(" union")
  2472. cpp_quote(" {")
  2473. cpp_quote(" VALUETYPE Value; // value of the object.")
  2474. cpp_quote(" HPROTOCOL hProtocol; // protocol key.")
  2475. cpp_quote(" LPVOID lpArray; // if array, length is ItemCount below.")
  2476. cpp_quote(" LPPROTOCOLTABLETYPE lpProtocolTable; // list of protocols to see if exist in frame.")
  2477. cpp_quote(" LPADDRESS lpAddress; // kernel type address, mac or ip")
  2478. cpp_quote(" ULPLARGEINT lpLargeInt; // Double DWORD used by NT")
  2479. cpp_quote(" ULPTIME lpTime; // pointer to SYSTEMTIME")
  2480. cpp_quote(" LPOBJECT_IDENTIFIER lpOID; // pointer to OBJECT_IDENTIFIER")
  2481. cpp_quote("")
  2482. cpp_quote(" };")
  2483. cpp_quote(" union")
  2484. cpp_quote(" {")
  2485. cpp_quote(" WORD ByteCount; // Number of BYTES!")
  2486. cpp_quote(" WORD ByteOffset; // offset for array compare")
  2487. cpp_quote(" };")
  2488. cpp_quote("")
  2489. cpp_quote(" struct _FILTEROBJECT * pNext; // reserved")
  2490. cpp_quote("")
  2491. cpp_quote("} FILTEROBJECT;")
  2492. cpp_quote("")
  2493. cpp_quote("typedef FILTEROBJECT * LPFILTEROBJECT;")
  2494. cpp_quote("")
  2495. cpp_quote("#define FILTERINFO_SIZE (sizeof(FILTEROBJECT) )")
  2496. cpp_quote("")
  2497. cpp_quote("")
  2498. cpp_quote("")
  2499. cpp_quote("typedef struct _FILTERDESC")
  2500. cpp_quote("{")
  2501. cpp_quote(" WORD NumEntries;")
  2502. cpp_quote(" WORD Flags; // private")
  2503. cpp_quote(" LPFILTEROBJECT lpStack;")
  2504. cpp_quote(" LPFILTEROBJECT lpKeepLast;")
  2505. cpp_quote(" LPVOID UIInstanceData; // UI specific information.")
  2506. cpp_quote(" LPFILTERBITS lpFilterBits; // cache who passed")
  2507. cpp_quote(" LPFILTERBITS lpCheckBits; // have we looked at it yet?")
  2508. cpp_quote(" ")
  2509. cpp_quote("} FILTERDESC;")
  2510. cpp_quote("")
  2511. cpp_quote("typedef FILTERDESC * LPFILTERDESC;")
  2512. cpp_quote("")
  2513. cpp_quote("#define FILTERDESC_SIZE sizeof(FILTERDESC)")
  2514. cpp_quote("//============================================================================")
  2515. cpp_quote("// Macros.")
  2516. cpp_quote("//============================================================================")
  2517. cpp_quote("#define FilterGetUIInstanceData(hfilt) (((LPFILTERDESC)hfilt)->UIInstanceData)")
  2518. cpp_quote("#define FilterSetUIInstanceData(hfilt,inst) (((LPFILTERDESC)hfilt)->UIInstanceData = (LPVOID)inst)")
  2519. cpp_quote("//============================================================================")
  2520. cpp_quote("// defines")
  2521. cpp_quote("//============================================================================")
  2522. const DWORD FILTERFREEPOOLSTART =20;
  2523. const DWORD INVALIDELEMENT =-1;
  2524. const DWORD INVALIDVALUE =((VALUETYPE) -9999);
  2525. cpp_quote("// use filter failed to check the return code on FilterFrame.")
  2526. const DWORD FILTER_FAIL_WITH_ERROR =-1;
  2527. const DWORD FILTER_PASSED =TRUE;
  2528. const DWORD FILTER_FAILED =FALSE;
  2529. // NOTE NOTE NOTE If you change the values of the following constants, you
  2530. // MUST modify the TableEval table in filtloc.h.
  2531. const DWORD FILTERACTION_INVALID = 0;
  2532. const DWORD FILTERACTION_PROPERTY = 1;
  2533. const DWORD FILTERACTION_VALUE = 2;
  2534. const DWORD FILTERACTION_STRING = 3;
  2535. const DWORD FILTERACTION_ARRAY = 4;
  2536. const DWORD FILTERACTION_AND = 5;
  2537. const DWORD FILTERACTION_OR = 6;
  2538. const DWORD FILTERACTION_XOR = 7;
  2539. const DWORD FILTERACTION_PROPERTYEXIST = 8;
  2540. const DWORD FILTERACTION_CONTAINSNC = 9;
  2541. const DWORD FILTERACTION_CONTAINS =10;
  2542. const DWORD FILTERACTION_NOT =11;
  2543. const DWORD FILTERACTION_EQUALNC =12;
  2544. const DWORD FILTERACTION_EQUAL =13;
  2545. const DWORD FILTERACTION_NOTEQUALNC =14;
  2546. const DWORD FILTERACTION_NOTEQUAL =15;
  2547. const DWORD FILTERACTION_GREATERNC =16;
  2548. const DWORD FILTERACTION_GREATER =17;
  2549. const DWORD FILTERACTION_LESSNC =18;
  2550. const DWORD FILTERACTION_LESS =19;
  2551. const DWORD FILTERACTION_GREATEREQUALNC =20;
  2552. const DWORD FILTERACTION_GREATEREQUAL =21;
  2553. const DWORD FILTERACTION_LESSEQUALNC =22;
  2554. const DWORD FILTERACTION_LESSEQUAL =23;
  2555. const DWORD FILTERACTION_PLUS =24;
  2556. const DWORD FILTERACTION_MINUS =25;
  2557. const DWORD FILTERACTION_ADDRESS =26;
  2558. const DWORD FILTERACTION_ADDRESSANY =27;
  2559. const DWORD FILTERACTION_FROM =28;
  2560. const DWORD FILTERACTION_TO =29;
  2561. const DWORD FILTERACTION_FROMTO =30;
  2562. const DWORD FILTERACTION_AREBITSON =31;
  2563. const DWORD FILTERACTION_AREBITSOFF =32;
  2564. const DWORD FILTERACTION_PROTOCOLSEXIST =33;
  2565. const DWORD FILTERACTION_PROTOCOLEXIST =34;
  2566. const DWORD FILTERACTION_ARRAYEQUAL =35;
  2567. const DWORD FILTERACTION_DEREFPROPERTY =36;
  2568. const DWORD FILTERACTION_LARGEINT =37;
  2569. const DWORD FILTERACTION_TIME =38;
  2570. const DWORD FILTERACTION_ADDR_ETHER =39;
  2571. const DWORD FILTERACTION_ADDR_TOKEN =40;
  2572. const DWORD FILTERACTION_ADDR_FDDI =41;
  2573. const DWORD FILTERACTION_ADDR_IPX =42;
  2574. const DWORD FILTERACTION_ADDR_IP =43;
  2575. const DWORD FILTERACTION_OID =44;
  2576. const DWORD FILTERACTION_OID_CONTAINS =45;
  2577. const DWORD FILTERACTION_OID_BEGINS_WITH =46;
  2578. const DWORD FILTERACTION_OID_ENDS_WITH =47;
  2579. const DWORD FILTERACTION_ADDR_VINES =48;
  2580. const DWORD FILTERACTION_EXPRESSION =97;
  2581. const DWORD FILTERACTION_BOOL =98;
  2582. const DWORD FILTERACTION_NOEVAL =99;
  2583. const DWORD FILTER_NO_MORE_FRAMES =0xFFFFFFFF;
  2584. const DWORD FILTER_CANCELED =0xFFFFFFFE;
  2585. const DWORD FILTER_DIRECTION_NEXT =TRUE;
  2586. const DWORD FILTER_DIRECTION_PREV =FALSE;
  2587. cpp_quote("//============================================================================")
  2588. cpp_quote("// Helper functions.")
  2589. cpp_quote("//============================================================================")
  2590. cpp_quote("typedef BOOL (WINAPI *STATUSPROC)(DWORD, HCAPTURE, HFILTER, LPVOID);")
  2591. // callback to show filter status:
  2592. // DWORD nFrame
  2593. // HCAPTURE
  2594. // HFILTER
  2595. // LPVOID UI Instance data (hwnd)
  2596. cpp_quote("//=============================================================================")
  2597. cpp_quote("// FILTER API's.")
  2598. cpp_quote("//=============================================================================")
  2599. cpp_quote("")
  2600. cpp_quote("HFILTER WINAPI CreateFilter(VOID);")
  2601. cpp_quote("")
  2602. cpp_quote("DWORD WINAPI DestroyFilter(HFILTER hFilter);")
  2603. cpp_quote("")
  2604. cpp_quote("HFILTER WINAPI FilterDuplicate(HFILTER hFilter);")
  2605. cpp_quote("")
  2606. cpp_quote("DWORD WINAPI DisableParserFilter(HFILTER hFilter, HPARSER hParser);")
  2607. cpp_quote("")
  2608. cpp_quote("DWORD WINAPI EnableParserFilter(HFILTER hFilter, HPARSER hParser);")
  2609. cpp_quote("")
  2610. cpp_quote("DWORD WINAPI FilterAddObject(HFILTER hFilter, LPFILTEROBJECT lpFilterObject );")
  2611. cpp_quote("")
  2612. cpp_quote("VOID WINAPI FilterFlushBits(HFILTER hFilter);")
  2613. cpp_quote("")
  2614. cpp_quote("DWORD WINAPI FilterFrame(HFRAME hFrame, HFILTER hFilter, HCAPTURE hCapture);")
  2615. cpp_quote(" // returns -1 == check BH set last error")
  2616. cpp_quote(" // 0 == FALSE")
  2617. cpp_quote(" // 1 == TRUE")
  2618. cpp_quote("")
  2619. cpp_quote("BOOL WINAPI FilterAttachesProperties(HFILTER hFilter);")
  2620. cpp_quote("")
  2621. cpp_quote("DWORD WINAPI FilterFindFrame ( HFILTER hFilter,")
  2622. cpp_quote(" HCAPTURE hCapture,")
  2623. cpp_quote(" DWORD nFrame,")
  2624. cpp_quote(" STATUSPROC StatusProc,")
  2625. cpp_quote(" LPVOID UIInstance,")
  2626. cpp_quote(" DWORD TimeDelta,")
  2627. cpp_quote(" BOOL FilterDirection );")
  2628. cpp_quote("")
  2629. cpp_quote("HFRAME FilterFindPropertyInstance ( HFRAME hFrame, ")
  2630. cpp_quote(" HFILTER hMasterFilter, ")
  2631. cpp_quote(" HCAPTURE hCapture,")
  2632. cpp_quote(" HFILTER hInstanceFilter,")
  2633. cpp_quote(" LPPROPERTYINST *lpPropRestartKey,")
  2634. cpp_quote(" STATUSPROC StatusProc,")
  2635. cpp_quote(" LPVOID UIInstance,")
  2636. cpp_quote(" DWORD TimeDelta,")
  2637. cpp_quote(" BOOL FilterForward );")
  2638. cpp_quote("")
  2639. cpp_quote("")
  2640. cpp_quote("VOID WINAPI SetCurrentFilter(HFILTER);")
  2641. cpp_quote("HFILTER WINAPI GetCurrentFilter(VOID);")
  2642. cpp_quote("")
  2643. cpp_quote("//=============================================================================")
  2644. cpp_quote("//=============================================================================")
  2645. cpp_quote("// (Frame.h)")
  2646. cpp_quote("//=============================================================================")
  2647. cpp_quote("//=============================================================================")
  2648. cpp_quote("//=============================================================================")
  2649. cpp_quote("// 802.3 and ETHERNET MAC structure.")
  2650. cpp_quote("//=============================================================================")
  2651. // structure contains zero length array, must cpp_quote
  2652. cpp_quote("typedef struct _ETHERNET")
  2653. cpp_quote("{")
  2654. cpp_quote(" BYTE DstAddr[MAX_ADDR_LENGTH]; //... destination address.")
  2655. cpp_quote(" BYTE SrcAddr[MAX_ADDR_LENGTH]; //... source address.")
  2656. cpp_quote(" union")
  2657. cpp_quote(" {")
  2658. cpp_quote(" WORD Length; //... 802.3 length field.")
  2659. cpp_quote(" WORD Type; //... Ethernet type field.")
  2660. cpp_quote(" };")
  2661. cpp_quote(" BYTE Info[0]; //... information field.")
  2662. cpp_quote("")
  2663. cpp_quote("} ETHERNET;")
  2664. cpp_quote("typedef ETHERNET *LPETHERNET;")
  2665. cpp_quote("typedef ETHERNET UNALIGNED *ULPETHERNET;")
  2666. cpp_quote("#define ETHERNET_SIZE sizeof(ETHERNET)")
  2667. const DWORD ETHERNET_HEADER_LENGTH =14;
  2668. const DWORD ETHERNET_DATA_LENGTH =0x05DC;
  2669. const DWORD ETHERNET_FRAME_LENGTH =0x05EA;
  2670. const DWORD ETHERNET_FRAME_TYPE =0x0600;
  2671. cpp_quote("//=============================================================================")
  2672. cpp_quote("// Header for NM_ATM Packets.")
  2673. cpp_quote("//=============================================================================")
  2674. cpp_quote("")
  2675. //=============================================================================
  2676. // Header for NM_ATM Packets. -- change this & you must change netmon.idl
  2677. //=============================================================================
  2678. typedef struct _NM_ATM
  2679. {
  2680. UCHAR DstAddr[6];
  2681. UCHAR SrcAddr[6];
  2682. ULONG Vpi; // Network order
  2683. ULONG Vci; // Network order
  2684. } NM_ATM;
  2685. typedef NM_ATM* PNM_ATM;
  2686. typedef NM_ATM* UPNM_ATM;
  2687. cpp_quote("#define NM_ATM_HEADER_LENGTH sizeof(NM_ATM)")
  2688. //=============================================================================
  2689. // Header for NM_1394 Packets. -- change this & you must change netmon.idl
  2690. //=============================================================================
  2691. typedef struct _NM_1394
  2692. {
  2693. UCHAR DstAddr[6];
  2694. UCHAR SrcAddr[6];
  2695. ULONGLONG VcId;
  2696. } NM_1394;
  2697. typedef NM_1394* PNM_1394;
  2698. typedef NM_1394* UPNM_1394;
  2699. cpp_quote("#define NM_1394_HEADER_LENGTH sizeof(NM_1394)")
  2700. cpp_quote("//=============================================================================")
  2701. cpp_quote("// 802.5 (TOKENRING) MAC structure.")
  2702. cpp_quote("//=============================================================================")
  2703. cpp_quote("")
  2704. cpp_quote("// This structure is used to decode network data and so needs to be packed")
  2705. #pragma pack(push, 1)
  2706. // structure contains bitfields, so must cpp_quote
  2707. // also contains zero length array, so must cpp_quote
  2708. cpp_quote("typedef struct _TOKENRING")
  2709. cpp_quote("{")
  2710. cpp_quote(" BYTE AccessCtrl; //... access control field.")
  2711. cpp_quote(" BYTE FrameCtrl; //... frame control field.")
  2712. cpp_quote(" BYTE DstAddr[MAX_ADDR_LENGTH]; //... destination address.")
  2713. cpp_quote(" BYTE SrcAddr[MAX_ADDR_LENGTH]; //... source address.")
  2714. cpp_quote(" union")
  2715. cpp_quote(" {")
  2716. cpp_quote(" BYTE Info[0]; //... information field.")
  2717. cpp_quote(" WORD RoutingInfo[0]; //... routing information field.")
  2718. cpp_quote(" };")
  2719. cpp_quote("} TOKENRING;")
  2720. cpp_quote("")
  2721. cpp_quote("typedef TOKENRING *LPTOKENRING;")
  2722. cpp_quote("typedef TOKENRING UNALIGNED *ULPTOKENRING;")
  2723. cpp_quote("#define TOKENRING_SIZE sizeof(TOKENRING)")
  2724. const DWORD TOKENRING_HEADER_LENGTH =14;
  2725. const WORD TOKENRING_SA_ROUTING_INFO =0x0080;
  2726. const WORD TOKENRING_SA_LOCAL =0x0040;
  2727. const WORD TOKENRING_DA_LOCAL =0x0040;
  2728. const WORD TOKENRING_DA_GROUP =0x0080;
  2729. const WORD TOKENRING_RC_LENGTHMASK =0x001F;
  2730. const WORD TOKENRING_BC_MASK =0x00E0;
  2731. const WORD TOKENRING_TYPE_MAC =0x0000;
  2732. const WORD TOKENRING_TYPE_LLC =0x0040;
  2733. #pragma pack(pop)
  2734. cpp_quote("//=============================================================================")
  2735. cpp_quote("// FDDI MAC structure.")
  2736. cpp_quote("//=============================================================================")
  2737. cpp_quote("")
  2738. cpp_quote("// This structure is used to decode network data and so needs to be packed")
  2739. #pragma pack(push, 1)
  2740. // This structure contains a zero length array, must be cpp_quoted
  2741. cpp_quote("typedef struct _FDDI")
  2742. cpp_quote("{")
  2743. cpp_quote(" BYTE FrameCtrl; //... frame control field.")
  2744. cpp_quote(" BYTE DstAddr[MAX_ADDR_LENGTH]; //... destination address.")
  2745. cpp_quote(" BYTE SrcAddr[MAX_ADDR_LENGTH]; //... source address.")
  2746. cpp_quote(" BYTE Info[0]; //... information field.")
  2747. cpp_quote("")
  2748. cpp_quote("} FDDI;")
  2749. cpp_quote("#define FDDI_SIZE sizeof(FDDI)")
  2750. cpp_quote("typedef FDDI *LPFDDI;")
  2751. cpp_quote("typedef FDDI UNALIGNED *ULPFDDI;")
  2752. const DWORD FDDI_HEADER_LENGTH =13;
  2753. const DWORD FDDI_TYPE_MAC =0x00;
  2754. const DWORD FDDI_TYPE_LLC =0x10;
  2755. const DWORD FDDI_TYPE_LONG_ADDRESS =0x40;
  2756. #pragma pack(pop)
  2757. cpp_quote("//=============================================================================")
  2758. cpp_quote("// LLC (802.2)")
  2759. cpp_quote("//=============================================================================")
  2760. cpp_quote("")
  2761. cpp_quote("// This structure is used to decode network data and so needs to be packed")
  2762. #pragma pack(push, 1)
  2763. typedef struct _LLC
  2764. {
  2765. BYTE dsap;
  2766. BYTE ssap;
  2767. struct
  2768. {
  2769. union
  2770. {
  2771. BYTE Command;
  2772. BYTE NextSend;
  2773. };
  2774. union
  2775. {
  2776. BYTE NextRecv;
  2777. BYTE Data[1];
  2778. };
  2779. } ControlField;
  2780. } LLC;
  2781. typedef LLC *LPLLC;
  2782. cpp_quote("typedef LLC UNALIGNED *ULPLLC;")
  2783. const DWORD LLC_SIZE =sizeof(LLC);
  2784. #pragma pack(pop)
  2785. cpp_quote("//=============================================================================")
  2786. cpp_quote("// Helper macros.")
  2787. cpp_quote("//=============================================================================")
  2788. cpp_quote("")
  2789. cpp_quote("#define IsRoutingInfoPresent(f) ((((ULPTOKENRING) (f))->SrcAddr[0] & TOKENRING_SA_ROUTING_INFO) ? TRUE : FALSE)")
  2790. cpp_quote("")
  2791. cpp_quote("#define GetRoutingInfoLength(f) (IsRoutingInfoPresent(f) \\")
  2792. cpp_quote(" ? (((ULPTOKENRING) (f))->RoutingInfo[0] & TOKENRING_RC_LENGTHMASK) : 0)")
  2793. cpp_quote("")
  2794. cpp_quote("//=============================================================================")
  2795. cpp_quote("//=============================================================================")
  2796. cpp_quote("// (Parser.h)")
  2797. cpp_quote("//=============================================================================")
  2798. cpp_quote("//=============================================================================")
  2799. cpp_quote("")
  2800. cpp_quote("//=============================================================================")
  2801. cpp_quote("// Format Procedure Type.")
  2802. cpp_quote("//")
  2803. cpp_quote("// NOTE: All format functions *must* be declared as WINAPIV not WINAPI!")
  2804. cpp_quote("//=============================================================================")
  2805. cpp_quote("")
  2806. cpp_quote("typedef VOID (WINAPIV *FORMAT)(LPPROPERTYINST, ...);")
  2807. cpp_quote("")
  2808. cpp_quote("// The protocol recognized the frame and moved the pointer to end of its")
  2809. cpp_quote("// protocol header. Network Monitor uses the protocols follow set to continue")
  2810. cpp_quote("// parsing.")
  2811. const DWORD PROTOCOL_STATUS_RECOGNIZED = 0;
  2812. cpp_quote("// The protocol did not recognized the frame and did not move the pointer")
  2813. cpp_quote("// (i.e. the start data pointer which was passed in). Network Monitor uses the")
  2814. cpp_quote("// protocols follow set to continue parsing.")
  2815. const DWORD PROTOCOL_STATUS_NOT_RECOGNIZED = 1;
  2816. cpp_quote("// The protocol recognized the frame and claimed it all for itself,")
  2817. cpp_quote("// and parsing terminates.")
  2818. const DWORD PROTOCOL_STATUS_CLAIMED = 2;
  2819. cpp_quote("// The protocol recognized the frame and moved the pointer to end of its")
  2820. cpp_quote("// protocol header. The current protocol requests that Network Monitor ")
  2821. cpp_quote("// continue parsing at a known next protocol by returning the next protocols")
  2822. cpp_quote("// handle back to Network Monitor. In this case, the follow of the current ")
  2823. cpp_quote("// protocol, if any, is not used.")
  2824. const DWORD PROTOCOL_STATUS_NEXT_PROTOCOL = 3;
  2825. cpp_quote("//=============================================================================")
  2826. cpp_quote("// Macros.")
  2827. cpp_quote("//=============================================================================")
  2828. cpp_quote("")
  2829. cpp_quote("extern BYTE HexTable[];")
  2830. cpp_quote("")
  2831. cpp_quote("#define XCHG(x) MAKEWORD( HIBYTE(x), LOBYTE(x) )")
  2832. cpp_quote("")
  2833. cpp_quote("#define DXCHG(x) MAKELONG( XCHG(HIWORD(x)), XCHG(LOWORD(x)) )")
  2834. cpp_quote("")
  2835. cpp_quote("#define LONIBBLE(b) ((BYTE) ((b) & 0x0F))")
  2836. cpp_quote("")
  2837. cpp_quote("#define HINIBBLE(b) ((BYTE) ((b) >> 4))")
  2838. cpp_quote("")
  2839. cpp_quote("#define HEX(b) (HexTable[LONIBBLE(b)])")
  2840. cpp_quote("")
  2841. cpp_quote("#define SWAPBYTES(w) ((w) = XCHG(w))")
  2842. cpp_quote("")
  2843. cpp_quote("#define SWAPWORDS(d) ((d) = DXCHG(d))")
  2844. cpp_quote("")
  2845. cpp_quote("//=============================================================================")
  2846. cpp_quote("// All the MAC frame types combined.")
  2847. cpp_quote("//=============================================================================")
  2848. // structure contains structures with bitfields, so must cpp_quote
  2849. cpp_quote("typedef union _MACFRAME")
  2850. cpp_quote("{")
  2851. cpp_quote(" LPBYTE MacHeader; //... generic pointer.")
  2852. cpp_quote(" LPETHERNET Ethernet; //... ethernet pointer.")
  2853. cpp_quote(" LPTOKENRING Tokenring; //... tokenring pointer.")
  2854. cpp_quote(" LPFDDI Fddi; //... FDDI pointer.")
  2855. cpp_quote("")
  2856. cpp_quote("} MACFRAME;")
  2857. cpp_quote("typedef MACFRAME *LPMACFRAME;")
  2858. cpp_quote("")
  2859. cpp_quote("#define HOT_SIGNATURE MAKE_IDENTIFIER('H', 'O', 'T', '$')")
  2860. cpp_quote("#define HOE_SIGNATURE MAKE_IDENTIFIER('H', 'O', 'E', '$')")
  2861. typedef struct _HANDOFFENTRY
  2862. {
  2863. DWORD hoe_sig; //... 'HOE$'
  2864. DWORD hoe_ProtIdentNumber; //Port/Socket number used to determine who to handoff to
  2865. HPROTOCOL hoe_ProtocolHandle; //Handle of Protocol to hand off to
  2866. DWORD hoe_ProtocolData; //Additional Data to pass to protocol when handed off
  2867. } HANDOFFENTRY;
  2868. typedef HANDOFFENTRY * LPHANDOFFENTRY;
  2869. typedef struct _HANDOFFTABLE
  2870. {
  2871. DWORD hot_sig; //... 'HOT$'
  2872. DWORD hot_NumEntries;
  2873. LPHANDOFFENTRY hot_Entries;
  2874. } HANDOFFTABLE, *LPHANDOFFTABLE;
  2875. cpp_quote("//=============================================================================")
  2876. cpp_quote("// Parser helper macros.")
  2877. cpp_quote("//=============================================================================")
  2878. cpp_quote("")
  2879. cpp_quote("INLINE LPVOID GetPropertyInstanceData(LPPROPERTYINST PropertyInst)")
  2880. cpp_quote("{")
  2881. cpp_quote(" if ( PropertyInst->DataLength != (WORD) -1 )")
  2882. cpp_quote(" {")
  2883. cpp_quote(" return PropertyInst->lpData;")
  2884. cpp_quote(" }")
  2885. cpp_quote("")
  2886. cpp_quote(" return (LPVOID) PropertyInst->lpPropertyInstEx->Byte;")
  2887. cpp_quote("}")
  2888. cpp_quote("")
  2889. cpp_quote("#define GetPropertyInstanceDataValue(p, type) ((type *) GetPropertyInstanceData(p))[0]")
  2890. cpp_quote("")
  2891. cpp_quote("INLINE DWORD GetPropertyInstanceFrameDataLength(LPPROPERTYINST PropertyInst)")
  2892. cpp_quote("{")
  2893. cpp_quote(" if ( PropertyInst->DataLength != (WORD) -1 )")
  2894. cpp_quote(" {")
  2895. cpp_quote(" return PropertyInst->DataLength;")
  2896. cpp_quote(" }")
  2897. cpp_quote("")
  2898. cpp_quote(" return PropertyInst->lpPropertyInstEx->Length;")
  2899. cpp_quote("}")
  2900. cpp_quote("")
  2901. cpp_quote("INLINE DWORD GetPropertyInstanceExDataLength(LPPROPERTYINST PropertyInst)")
  2902. cpp_quote("{")
  2903. cpp_quote(" if ( PropertyInst->DataLength == (WORD) -1 )")
  2904. cpp_quote(" {")
  2905. cpp_quote(" PropertyInst->lpPropertyInstEx->Length;")
  2906. cpp_quote(" }")
  2907. cpp_quote("")
  2908. cpp_quote(" return (WORD) -1;")
  2909. cpp_quote("}")
  2910. cpp_quote("")
  2911. cpp_quote("//=============================================================================")
  2912. cpp_quote("// Parser helper functions.")
  2913. cpp_quote("//=============================================================================")
  2914. cpp_quote("")
  2915. cpp_quote("LPLABELED_WORD WINAPI GetProtocolDescriptionTable(LPDWORD TableSize);")
  2916. cpp_quote("")
  2917. cpp_quote("LPLABELED_WORD WINAPI GetProtocolDescription(DWORD ProtocolID);")
  2918. cpp_quote("")
  2919. cpp_quote("DWORD WINAPI GetMacHeaderLength(LPVOID MacHeader, DWORD MacType);")
  2920. cpp_quote("")
  2921. cpp_quote("DWORD WINAPI GetLLCHeaderLength(LPLLC Frame);")
  2922. cpp_quote("")
  2923. cpp_quote("DWORD WINAPI GetEtype(LPVOID MacHeader, DWORD MacType);")
  2924. cpp_quote("")
  2925. cpp_quote("DWORD WINAPI GetSaps(LPVOID MacHeader, DWORD MacType);")
  2926. cpp_quote("")
  2927. cpp_quote("BOOL WINAPI IsLLCPresent(LPVOID MacHeader, DWORD MacType);")
  2928. cpp_quote("")
  2929. cpp_quote("VOID WINAPI CanonicalizeHexString(LPSTR hex, LPSTR dest, DWORD len);")
  2930. cpp_quote("")
  2931. cpp_quote("void WINAPI CanonHex(UCHAR * pDest, UCHAR * pSource, int iLen, BOOL fOx );")
  2932. cpp_quote("")
  2933. cpp_quote("DWORD WINAPI ByteToBinary(LPSTR string, DWORD ByteValue);")
  2934. cpp_quote("")
  2935. cpp_quote("DWORD WINAPI WordToBinary(LPSTR string, DWORD WordValue);")
  2936. cpp_quote("")
  2937. cpp_quote("DWORD WINAPI DwordToBinary(LPSTR string, DWORD DwordValue);")
  2938. cpp_quote("")
  2939. cpp_quote("LPSTR WINAPI AddressToString(LPSTR string, BYTE *lpAddress);")
  2940. cpp_quote("")
  2941. cpp_quote("LPBYTE WINAPI StringToAddress(BYTE *lpAddress, LPSTR string);")
  2942. cpp_quote("")
  2943. cpp_quote("LPDWORD WINAPI VarLenSmallIntToDword( LPBYTE pValue, ")
  2944. cpp_quote(" WORD ValueLen, ")
  2945. cpp_quote(" BOOL fIsByteswapped,")
  2946. cpp_quote(" LPDWORD lpDword );")
  2947. cpp_quote("")
  2948. cpp_quote("LPBYTE WINAPI LookupByteSetString (LPSET lpSet, BYTE Value);")
  2949. cpp_quote("")
  2950. cpp_quote("LPBYTE WINAPI LookupWordSetString (LPSET lpSet, WORD Value);")
  2951. cpp_quote("")
  2952. cpp_quote("LPBYTE WINAPI LookupDwordSetString (LPSET lpSet, DWORD Value);")
  2953. cpp_quote("")
  2954. cpp_quote("DWORD WINAPIV FormatByteFlags(LPSTR string, DWORD ByteValue, DWORD BitMask);")
  2955. cpp_quote("")
  2956. cpp_quote("DWORD WINAPIV FormatWordFlags(LPSTR string, DWORD WordValue, DWORD BitMask);")
  2957. cpp_quote("")
  2958. cpp_quote("DWORD WINAPIV FormatDwordFlags(LPSTR string, DWORD DwordValue, DWORD BitMask);")
  2959. cpp_quote("")
  2960. cpp_quote("LPSTR WINAPIV FormatTimeAsString(SYSTEMTIME *time, LPSTR string);")
  2961. cpp_quote("")
  2962. cpp_quote("VOID WINAPIV FormatLabeledByteSetAsFlags(LPPROPERTYINST lpPropertyInst);")
  2963. cpp_quote("")
  2964. cpp_quote("VOID WINAPIV FormatLabeledWordSetAsFlags(LPPROPERTYINST lpPropertyInst);")
  2965. cpp_quote("")
  2966. cpp_quote("VOID WINAPIV FormatLabeledDwordSetAsFlags(LPPROPERTYINST lpPropertyInst);")
  2967. cpp_quote("")
  2968. cpp_quote("VOID WINAPIV FormatPropertyDataAsByte(LPPROPERTYINST lpPropertyInst, DWORD Base);")
  2969. cpp_quote("")
  2970. cpp_quote("VOID WINAPIV FormatPropertyDataAsWord(LPPROPERTYINST lpPropertyInst, DWORD Base);")
  2971. cpp_quote("")
  2972. cpp_quote("VOID WINAPIV FormatPropertyDataAsDword(LPPROPERTYINST lpPropertyInst, DWORD Base);")
  2973. cpp_quote("")
  2974. cpp_quote("VOID WINAPIV FormatLabeledByteSet(LPPROPERTYINST lpPropertyInst);")
  2975. cpp_quote("")
  2976. cpp_quote("VOID WINAPIV FormatLabeledWordSet(LPPROPERTYINST lpPropertyInst);")
  2977. cpp_quote("")
  2978. cpp_quote("VOID WINAPIV FormatLabeledDwordSet(LPPROPERTYINST lpPropertyInst);")
  2979. cpp_quote("")
  2980. cpp_quote("VOID WINAPIV FormatPropertyDataAsInt64(LPPROPERTYINST lpPropertyInst, DWORD Base);")
  2981. cpp_quote("")
  2982. cpp_quote("VOID WINAPIV FormatPropertyDataAsTime(LPPROPERTYINST lpPropertyInst);")
  2983. cpp_quote("")
  2984. cpp_quote("VOID WINAPIV FormatPropertyDataAsString(LPPROPERTYINST lpPropertyInst);")
  2985. cpp_quote("")
  2986. cpp_quote("VOID WINAPIV FormatPropertyDataAsHexString(LPPROPERTYINST lpPropertyInst);")
  2987. cpp_quote("")
  2988. cpp_quote("// Parsers should NOT call LockFrame(). If a parser takes a lock and then gets")
  2989. cpp_quote("// faulted or returns without unlocking, it leaves the system in a state where")
  2990. cpp_quote("// it cannot change protocols or cut/copy frames. Parsers should use ParserTemporaryLockFrame")
  2991. cpp_quote("// which grants a lock ONLY during the context of the api entry into the parser. The ")
  2992. cpp_quote("// lock is released on exit from the parser for that frame.")
  2993. cpp_quote("ULPBYTE WINAPI ParserTemporaryLockFrame(HFRAME hFrame);")
  2994. cpp_quote("")
  2995. cpp_quote("LPVOID WINAPI GetCCInstPtr(VOID);")
  2996. cpp_quote("VOID WINAPI SetCCInstPtr(LPVOID lpCurCaptureInst);")
  2997. cpp_quote("LPVOID WINAPI CCHeapAlloc(DWORD dwBytes, BOOL bZeroInit);")
  2998. cpp_quote("LPVOID WINAPI CCHeapReAlloc(LPVOID lpMem, DWORD dwBytes, BOOL bZeroInit);")
  2999. cpp_quote("BOOL WINAPI CCHeapFree(LPVOID lpMem);")
  3000. cpp_quote("SIZE_T WINAPI CCHeapSize(LPVOID lpMem);")
  3001. cpp_quote("")
  3002. cpp_quote("BOOL _cdecl BERGetInteger( ULPBYTE pCurrentPointer,")
  3003. cpp_quote(" ULPBYTE *ppValuePointer,")
  3004. cpp_quote(" LPDWORD pHeaderLength,")
  3005. cpp_quote(" LPDWORD pDataLength,")
  3006. cpp_quote(" ULPBYTE *ppNext);")
  3007. cpp_quote("BOOL _cdecl BERGetString( ULPBYTE pCurrentPointer,")
  3008. cpp_quote(" ULPBYTE *ppValuePointer,")
  3009. cpp_quote(" LPDWORD pHeaderLength,")
  3010. cpp_quote(" LPDWORD pDataLength,")
  3011. cpp_quote(" ULPBYTE *ppNext);")
  3012. cpp_quote("BOOL _cdecl BERGetHeader( ULPBYTE pCurrentPointer,")
  3013. cpp_quote(" ULPBYTE pTag,")
  3014. cpp_quote(" LPDWORD pHeaderLength,")
  3015. cpp_quote(" LPDWORD pDataLength,")
  3016. cpp_quote(" ULPBYTE *ppNext);")
  3017. cpp_quote("")
  3018. cpp_quote("//=============================================================================")
  3019. cpp_quote("// Parser Finder Structures.")
  3020. cpp_quote("//=============================================================================")
  3021. const DWORD MAX_PROTOCOL_COMMENT_LEN =256;
  3022. const DWORD NETMON_MAX_PROTOCOL_NAME_LEN =16;
  3023. cpp_quote("// the constant MAX_PROTOCOL_NAME_LEN conflicts with one of the same name")
  3024. cpp_quote("// but different size in rtutils.h.")
  3025. cpp_quote("// So if both headers are included, we do not define MAX_PROTOCOL_NAME_LEN.")
  3026. cpp_quote("#ifndef MAX_PROTOCOL_NAME_LEN")
  3027. const DWORD MAX_PROTOCOL_NAME_LEN =NETMON_MAX_PROTOCOL_NAME_LEN;
  3028. cpp_quote("#else")
  3029. cpp_quote("#undef MAX_PROTOCOL_NAME_LEN")
  3030. cpp_quote("#endif")
  3031. cpp_quote("// Handoff Value Format Base")
  3032. typedef enum
  3033. {
  3034. HANDOFF_VALUE_FORMAT_BASE_UNKNOWN = 0,
  3035. HANDOFF_VALUE_FORMAT_BASE_DECIMAL = 10,
  3036. HANDOFF_VALUE_FORMAT_BASE_HEX = 16
  3037. } PF_HANDOFFVALUEFORMATBASE;
  3038. cpp_quote("// PF_HANDOFFENTRY")
  3039. typedef struct _PF_HANDOFFENTRY
  3040. {
  3041. char szIniFile[MAX_PATH];
  3042. char szIniSection[MAX_PATH];
  3043. char szProtocol[NETMON_MAX_PROTOCOL_NAME_LEN];
  3044. DWORD dwHandOffValue;
  3045. PF_HANDOFFVALUEFORMATBASE ValueFormatBase;
  3046. } PF_HANDOFFENTRY;
  3047. typedef PF_HANDOFFENTRY* PPF_HANDOFFENTRY;
  3048. cpp_quote("// PF_HANDOFFSET")
  3049. // Structure contains zero length array, must cpp_quote
  3050. cpp_quote("typedef struct _PF_HANDOFFSET")
  3051. cpp_quote("{")
  3052. cpp_quote(" DWORD nEntries;")
  3053. cpp_quote(" PF_HANDOFFENTRY Entry[0];")
  3054. cpp_quote("")
  3055. cpp_quote("} PF_HANDOFFSET;")
  3056. cpp_quote("typedef PF_HANDOFFSET* PPF_HANDOFFSET;")
  3057. cpp_quote("// FOLLOWENTRY")
  3058. typedef struct _PF_FOLLOWENTRY
  3059. {
  3060. char szProtocol[NETMON_MAX_PROTOCOL_NAME_LEN];
  3061. } PF_FOLLOWENTRY;
  3062. typedef PF_FOLLOWENTRY* PPF_FOLLOWENTRY;
  3063. cpp_quote("// PF_FOLLOWSET")
  3064. // Structure contains zero length array, must cpp_quote
  3065. cpp_quote("typedef struct _PF_FOLLOWSET")
  3066. cpp_quote("{")
  3067. cpp_quote(" DWORD nEntries;")
  3068. cpp_quote(" PF_FOLLOWENTRY Entry[0];")
  3069. cpp_quote("")
  3070. cpp_quote("} PF_FOLLOWSET;")
  3071. cpp_quote("typedef PF_FOLLOWSET* PPF_FOLLOWSET;")
  3072. cpp_quote("")
  3073. cpp_quote("// PARSERINFO - contains information about a single parser")
  3074. // Structure contains structures with zero length arrays, must cpp_quote
  3075. cpp_quote("typedef struct _PF_PARSERINFO")
  3076. cpp_quote("{")
  3077. cpp_quote(" char szProtocolName[NETMON_MAX_PROTOCOL_NAME_LEN];")
  3078. cpp_quote(" char szComment[MAX_PROTOCOL_COMMENT_LEN];")
  3079. cpp_quote(" char szHelpFile[MAX_PATH];")
  3080. cpp_quote("")
  3081. cpp_quote(" PPF_FOLLOWSET pWhoCanPrecedeMe;")
  3082. cpp_quote(" PPF_FOLLOWSET pWhoCanFollowMe;")
  3083. cpp_quote("")
  3084. cpp_quote(" PPF_HANDOFFSET pWhoHandsOffToMe;")
  3085. cpp_quote(" PPF_HANDOFFSET pWhoDoIHandOffTo;")
  3086. cpp_quote("")
  3087. cpp_quote("} PF_PARSERINFO;")
  3088. cpp_quote("typedef PF_PARSERINFO* PPF_PARSERINFO;")
  3089. cpp_quote("")
  3090. cpp_quote("// PF_PARSERDLLINFO - contains information about a single parser DLL")
  3091. // Structure contains zero length array, must cpp_quote
  3092. cpp_quote("typedef struct _PF_PARSERDLLINFO")
  3093. cpp_quote("{ ")
  3094. cpp_quote("// char szDLLName[MAX_PATH];")
  3095. cpp_quote(" DWORD nParsers;")
  3096. cpp_quote(" PF_PARSERINFO ParserInfo[0];")
  3097. cpp_quote("")
  3098. cpp_quote("} PF_PARSERDLLINFO;")
  3099. cpp_quote("typedef PF_PARSERDLLINFO* PPF_PARSERDLLINFO;")
  3100. cpp_quote("//=============================================================================")
  3101. cpp_quote("//=============================================================================")
  3102. cpp_quote("// (IniLib.h)")
  3103. cpp_quote("//=============================================================================")
  3104. cpp_quote("//=============================================================================")
  3105. const DWORD INI_PATH_LENGTH =256;
  3106. const DWORD MAX_HANDOFF_ENTRY_LENGTH =80;
  3107. const DWORD MAX_PROTOCOL_NAME =40;
  3108. const DWORD NUMALLOCENTRIES =10;
  3109. const DWORD RAW_INI_STR_LEN =200;
  3110. cpp_quote("#define PARSERS_SUBDIR \"PARSERS\"")
  3111. cpp_quote("#define INI_EXTENSION \"INI\"")
  3112. cpp_quote("#define BASE10_FORMAT_STR \"%ld=%s %ld\"")
  3113. cpp_quote("#define BASE16_FORMAT_STR \"%lx=%s %lx\"")
  3114. cpp_quote("// Given \"XNS\" or \"TCP\" or whatever BuildINIPath will return fully qual. path to \"XNS.INI\" or \"TCP.INI\"")
  3115. cpp_quote("LPSTR _cdecl BuildINIPath( char *FullPath,")
  3116. cpp_quote(" char *IniFileName );")
  3117. cpp_quote("")
  3118. cpp_quote("// Builds Handoff Set")
  3119. cpp_quote("DWORD WINAPI CreateHandoffTable(LPSTR secName,")
  3120. cpp_quote(" LPSTR iniFile,")
  3121. cpp_quote(" LPHANDOFFTABLE * hTable,")
  3122. cpp_quote(" DWORD nMaxProtocolEntries,")
  3123. cpp_quote(" DWORD base);")
  3124. cpp_quote("")
  3125. cpp_quote("HPROTOCOL WINAPI GetProtocolFromTable(LPHANDOFFTABLE hTable, // lp to Handoff Table...")
  3126. cpp_quote(" DWORD ItemToFind, // port number etc...")
  3127. cpp_quote(" PDWORD_PTR lpInstData ); // inst data to give to next protocol")
  3128. cpp_quote("")
  3129. cpp_quote("VOID WINAPI DestroyHandoffTable( LPHANDOFFTABLE hTable );")
  3130. cpp_quote("")
  3131. cpp_quote("BOOLEAN WINAPI IsRawIPXEnabled(LPSTR secName,")
  3132. cpp_quote(" LPSTR iniFile,")
  3133. cpp_quote(" LPSTR CurProtocol );")
  3134. cpp_quote("")
  3135. cpp_quote("//=============================================================================")
  3136. cpp_quote("//=============================================================================")
  3137. cpp_quote("// (NMExpert.h)")
  3138. cpp_quote("//=============================================================================")
  3139. cpp_quote("//=============================================================================")
  3140. const DWORD EXPERTSTRINGLENGTH =MAX_PATH;
  3141. const DWORD EXPERTGROUPNAMELENGTH =25;
  3142. cpp_quote("// HEXPERTKEY tracks running experts. It is only used by experts for ")
  3143. cpp_quote("// self reference. It refers to a RUNNINGEXPERT (an internal only structure)..")
  3144. typedef LPVOID HEXPERTKEY;
  3145. typedef HEXPERTKEY * PHEXPERTKEY;
  3146. cpp_quote("// HEXPERT tracks loaded experts. It refers to an EXPERTENUMINFO.")
  3147. typedef LPVOID HEXPERT;
  3148. typedef HEXPERT * PHEXPERT;
  3149. cpp_quote("// HRUNNINGEXPERT tracks a currently running expert.")
  3150. cpp_quote("// It refers to a RUNNINGEXPERT (an internal only structure).")
  3151. typedef LPVOID HRUNNINGEXPERT;
  3152. typedef HRUNNINGEXPERT * PHRUNNINGEXPERT;
  3153. // forward ref
  3154. cpp_quote("typedef struct _EXPERTENUMINFO * PEXPERTENUMINFO;")
  3155. cpp_quote("typedef struct _EXPERTCONFIG * PEXPERTCONFIG;")
  3156. cpp_quote("typedef struct _EXPERTSTARTUPINFO * PEXPERTSTARTUPINFO;")
  3157. cpp_quote("// Definitions needed to call experts")
  3158. cpp_quote("#define EXPERTENTRY_REGISTER \"Register\"")
  3159. cpp_quote("#define EXPERTENTRY_CONFIGURE \"Configure\"")
  3160. cpp_quote("#define EXPERTENTRY_RUN \"Run\"")
  3161. cpp_quote("typedef BOOL (WINAPI * PEXPERTREGISTERPROC)( PEXPERTENUMINFO );")
  3162. cpp_quote("typedef BOOL (WINAPI * PEXPERTCONFIGPROC) ( HEXPERTKEY, PEXPERTCONFIG*, PEXPERTSTARTUPINFO, DWORD, HWND );")
  3163. cpp_quote("typedef BOOL (WINAPI * PEXPERTRUNPROC) ( HEXPERTKEY, PEXPERTCONFIG, PEXPERTSTARTUPINFO, DWORD, HWND);")
  3164. cpp_quote("// EXPERTENUMINFO describes an expert that NetMon has loaded from disk. ")
  3165. cpp_quote("// It does not include any configuration or runtime information.")
  3166. cpp_quote("typedef struct _EXPERTENUMINFO")
  3167. cpp_quote("{")
  3168. cpp_quote(" char szName[EXPERTSTRINGLENGTH];")
  3169. cpp_quote(" char szVendor[EXPERTSTRINGLENGTH];")
  3170. cpp_quote(" char szDescription[EXPERTSTRINGLENGTH];")
  3171. cpp_quote(" DWORD Version; ")
  3172. cpp_quote(" DWORD Flags;")
  3173. cpp_quote(" char szDllName[MAX_PATH]; // private, dont' touch")
  3174. cpp_quote(" HEXPERT hExpert; // private, don't touch")
  3175. cpp_quote(" HINSTANCE hModule; // private, don't touch")
  3176. cpp_quote(" PEXPERTREGISTERPROC pRegisterProc; // private, don't touch")
  3177. cpp_quote(" PEXPERTCONFIGPROC pConfigProc; // private, don't touch")
  3178. cpp_quote(" PEXPERTRUNPROC pRunProc; // private, don't touch")
  3179. cpp_quote("")
  3180. cpp_quote("} EXPERTENUMINFO;")
  3181. cpp_quote("typedef EXPERTENUMINFO * PEXPERTENUMINFO;")
  3182. const DWORD EXPERT_ENUM_FLAG_CONFIGURABLE =0x0001;
  3183. const DWORD EXPERT_ENUM_FLAG_VIEWER_PRIVATE =0x0002;
  3184. const DWORD EXPERT_ENUM_FLAG_NO_VIEWER =0x0004;
  3185. const DWORD EXPERT_ENUM_FLAG_ADD_ME_TO_RMC_IN_SUMMARY =0x0010;
  3186. const DWORD EXPERT_ENUM_FLAG_ADD_ME_TO_RMC_IN_DETAIL =0x0020;
  3187. // contains a structure that contains an unaligned pointer, so must cpp_quote
  3188. cpp_quote("// EXPERTSTARTUPINFO")
  3189. cpp_quote("// This gives the Expert an indication of where he came from.")
  3190. cpp_quote("// Note: if the lpPropertyInst->PropertyInfo->DataQualifier == PROP_QUAL_FLAGS")
  3191. cpp_quote("// then the sBitField structure is filled in")
  3192. cpp_quote("typedef struct _EXPERTSTARTUPINFO")
  3193. cpp_quote("{")
  3194. cpp_quote(" DWORD Flags;")
  3195. cpp_quote(" HCAPTURE hCapture;")
  3196. cpp_quote(" char szCaptureFile[MAX_PATH];")
  3197. cpp_quote(" DWORD dwFrameNumber;")
  3198. cpp_quote(" HPROTOCOL hProtocol;")
  3199. cpp_quote("")
  3200. cpp_quote(" LPPROPERTYINST lpPropertyInst;")
  3201. cpp_quote("")
  3202. cpp_quote(" struct")
  3203. cpp_quote(" {")
  3204. cpp_quote(" BYTE BitNumber;")
  3205. cpp_quote(" BOOL bOn;")
  3206. cpp_quote(" } sBitfield;")
  3207. cpp_quote("")
  3208. cpp_quote("} EXPERTSTARTUPINFO;")
  3209. cpp_quote("// EXPERTCONFIG")
  3210. cpp_quote("// This is a generic holder for an Expert's config data.")
  3211. // structure contains a zero length array, must be cpp_quoted
  3212. cpp_quote("typedef struct _EXPERTCONFIG")
  3213. cpp_quote("{")
  3214. cpp_quote(" DWORD RawConfigLength;")
  3215. cpp_quote(" BYTE RawConfigData[0];")
  3216. cpp_quote("")
  3217. cpp_quote("} EXPERTCONFIG;")
  3218. cpp_quote("typedef EXPERTCONFIG * PEXPERTCONFIG;")
  3219. cpp_quote("// CONFIGUREDEXPERT")
  3220. cpp_quote("// This structure associates a loaded expert with its configuration data.")
  3221. // structure contains a zero length array, must be cpp_quoted
  3222. cpp_quote("typedef struct")
  3223. cpp_quote("{")
  3224. cpp_quote(" HEXPERT hExpert;")
  3225. cpp_quote(" DWORD StartupFlags;")
  3226. cpp_quote(" PEXPERTCONFIG pConfig;")
  3227. cpp_quote("} CONFIGUREDEXPERT;")
  3228. cpp_quote("typedef CONFIGUREDEXPERT * PCONFIGUREDEXPERT;")
  3229. cpp_quote("// EXPERTFRAMEDESCRIPTOR - passed back to the expert to fulfil the request for a frame")
  3230. // contains an unaligned pointer, so must cpp_quote
  3231. cpp_quote("typedef struct")
  3232. cpp_quote("{")
  3233. cpp_quote(" DWORD FrameNumber; // Frame Number.")
  3234. cpp_quote(" HFRAME hFrame; // Handle to the frame.")
  3235. cpp_quote(" ULPFRAME pFrame; // pointer to frame.")
  3236. cpp_quote(" LPRECOGNIZEDATATABLE lpRecognizeDataTable;// pointer to table of RECOGNIZEDATA structures.")
  3237. cpp_quote(" LPPROPERTYTABLE lpPropertyTable; // pointer to property table.")
  3238. cpp_quote("")
  3239. cpp_quote("} EXPERTFRAMEDESCRIPTOR;")
  3240. cpp_quote("typedef EXPERTFRAMEDESCRIPTOR * LPEXPERTFRAMEDESCRIPTOR;")
  3241. // other definitions
  3242. const DWORD GET_SPECIFIED_FRAME = 0;
  3243. const DWORD GET_FRAME_NEXT_FORWARD = 1;
  3244. const DWORD GET_FRAME_NEXT_BACKWARD = 2;
  3245. const DWORD FLAGS_DEFER_TO_UI_FILTER =0x1;
  3246. const DWORD FLAGS_ATTACH_PROPERTIES =0x2;
  3247. cpp_quote("// EXPERTSTATUSENUM")
  3248. cpp_quote("// gives the possible values for the status field in the EXPERTSTATUS structure")
  3249. typedef enum
  3250. {
  3251. EXPERTSTATUS_INACTIVE = 0,
  3252. EXPERTSTATUS_STARTING,
  3253. EXPERTSTATUS_RUNNING,
  3254. EXPERTSTATUS_PROBLEM,
  3255. EXPERTSTATUS_ABORTED,
  3256. EXPERTSTATUS_DONE,
  3257. } EXPERTSTATUSENUMERATION;
  3258. cpp_quote("// EXPERTSUBSTATUS bitfield ")
  3259. cpp_quote("// gives the possible values for the substatus field in the EXPERTSTATUS structure")
  3260. const WORD EXPERTSUBSTATUS_ABORTED_USER =0x0001;
  3261. const WORD EXPERTSUBSTATUS_ABORTED_LOAD_FAIL =0x0002;
  3262. const WORD EXPERTSUBSTATUS_ABORTED_THREAD_FAIL =0x0004;
  3263. const WORD EXPERTSUBSTATUS_ABORTED_BAD_ENTRY =0x0008;
  3264. cpp_quote("// EXPERTSTATUS")
  3265. cpp_quote("// Indicates the current status of a running expert.")
  3266. typedef struct
  3267. {
  3268. EXPERTSTATUSENUMERATION Status;
  3269. DWORD SubStatus;
  3270. DWORD PercentDone;
  3271. DWORD Frame;
  3272. char szStatusText[EXPERTSTRINGLENGTH];
  3273. } EXPERTSTATUS;
  3274. typedef EXPERTSTATUS * PEXPERTSTATUS;
  3275. cpp_quote("// EXPERT STARTUP FLAGS")
  3276. const DWORD EXPERT_STARTUP_FLAG_USE_STARTUP_DATA_OVER_CONFIG_DATA =0x00000001;
  3277. cpp_quote("//=============================================================================")
  3278. cpp_quote("//=============================================================================")
  3279. cpp_quote("// (NetMon.h)")
  3280. cpp_quote("//=============================================================================")
  3281. cpp_quote("//=============================================================================")
  3282. cpp_quote("// A frame with no number contains this value as its frame number.")
  3283. const DWORD INVALID_FRAME_NUMBER =((DWORD) -1);
  3284. cpp_quote("//=============================================================================")
  3285. cpp_quote("// Capture file flags.")
  3286. cpp_quote("//=============================================================================")
  3287. cpp_quote("#define CAPTUREFILE_OPEN OPEN_EXISTING")
  3288. cpp_quote("#define CAPTUREFILE_CREATE CREATE_NEW")
  3289. cpp_quote("//=============================================================================")
  3290. cpp_quote("// CAPTURE CONTEXT API's.")
  3291. cpp_quote("//=============================================================================")
  3292. cpp_quote("")
  3293. cpp_quote("LPSYSTEMTIME WINAPI GetCaptureTimeStamp(HCAPTURE hCapture);")
  3294. cpp_quote("")
  3295. cpp_quote("DWORD WINAPI GetCaptureMacType(HCAPTURE hCapture);")
  3296. cpp_quote("")
  3297. cpp_quote("DWORD WINAPI GetCaptureTotalFrames(HCAPTURE hCapture);")
  3298. cpp_quote("")
  3299. cpp_quote("LPSTR WINAPI GetCaptureComment(HCAPTURE hCapture);")
  3300. cpp_quote("")
  3301. cpp_quote("//=============================================================================")
  3302. cpp_quote("// FRAME HELP API's.")
  3303. cpp_quote("//=============================================================================")
  3304. cpp_quote("")
  3305. cpp_quote("DWORD WINAPI MacTypeToAddressType(DWORD MacType);")
  3306. cpp_quote("")
  3307. cpp_quote("DWORD WINAPI AddressTypeToMacType(DWORD AddressType);")
  3308. cpp_quote("")
  3309. cpp_quote("DWORD WINAPI GetFrameDstAddressOffset(HFRAME hFrame, DWORD AddressType, LPDWORD AddressLength);")
  3310. cpp_quote("")
  3311. cpp_quote("DWORD WINAPI GetFrameSrcAddressOffset(HFRAME hFrame, DWORD AddressType, LPDWORD AddressLength);")
  3312. cpp_quote("")
  3313. cpp_quote("HCAPTURE WINAPI GetFrameCaptureHandle(HFRAME hFrame);")
  3314. cpp_quote("")
  3315. cpp_quote("")
  3316. cpp_quote("DWORD WINAPI GetFrameDestAddress(HFRAME hFrame,")
  3317. cpp_quote(" LPADDRESS lpAddress,")
  3318. cpp_quote(" DWORD AddressType,")
  3319. cpp_quote(" DWORD Flags);")
  3320. cpp_quote("")
  3321. cpp_quote("DWORD WINAPI GetFrameSourceAddress(HFRAME hFrame,")
  3322. cpp_quote(" LPADDRESS lpAddress,")
  3323. cpp_quote(" DWORD AddressType,")
  3324. cpp_quote(" DWORD Flags);")
  3325. cpp_quote("")
  3326. cpp_quote("DWORD WINAPI GetFrameMacHeaderLength(HFRAME hFrame);")
  3327. cpp_quote("")
  3328. cpp_quote("BOOL WINAPI CompareFrameDestAddress(HFRAME hFrame, LPADDRESS lpAddress);")
  3329. cpp_quote("")
  3330. cpp_quote("BOOL WINAPI CompareFrameSourceAddress(HFRAME hFrame, LPADDRESS lpAddress);")
  3331. cpp_quote("")
  3332. cpp_quote("DWORD WINAPI GetFrameLength(HFRAME hFrame);")
  3333. cpp_quote("")
  3334. cpp_quote("DWORD WINAPI GetFrameStoredLength(HFRAME hFrame);")
  3335. cpp_quote("")
  3336. cpp_quote("DWORD WINAPI GetFrameMacType(HFRAME hFrame);")
  3337. cpp_quote("")
  3338. cpp_quote("DWORD WINAPI GetFrameMacHeaderLength(HFRAME hFrame);")
  3339. cpp_quote("")
  3340. cpp_quote("DWORD WINAPI GetFrameNumber(HFRAME hFrame);")
  3341. cpp_quote("")
  3342. cpp_quote("__int64 WINAPI GetFrameTimeStamp(HFRAME hFrame);")
  3343. cpp_quote("")
  3344. cpp_quote("ULPFRAME WINAPI GetFrameFromFrameHandle(HFRAME hFrame);")
  3345. cpp_quote("")
  3346. cpp_quote("//=============================================================================")
  3347. cpp_quote("// FRAME API's.")
  3348. cpp_quote("//=============================================================================")
  3349. cpp_quote("")
  3350. cpp_quote("HFRAME WINAPI ModifyFrame(HCAPTURE hCapture,")
  3351. cpp_quote(" DWORD FrameNumber,")
  3352. cpp_quote(" LPBYTE FrameData,")
  3353. cpp_quote(" DWORD FrameLength,")
  3354. cpp_quote(" __int64 TimeStamp);")
  3355. cpp_quote("")
  3356. cpp_quote("HFRAME WINAPI FindNextFrame(HFRAME hCurrentFrame,")
  3357. cpp_quote(" LPSTR ProtocolName,")
  3358. cpp_quote(" LPADDRESS lpDesstAddress,")
  3359. cpp_quote(" LPADDRESS lpSrcAddress,")
  3360. cpp_quote(" LPWORD ProtocolOffset,")
  3361. cpp_quote(" DWORD OriginalFrameNumber,")
  3362. cpp_quote(" DWORD nHighestFrame);")
  3363. cpp_quote("")
  3364. cpp_quote("HFRAME WINAPI FindPreviousFrame(HFRAME hCurrentFrame,")
  3365. cpp_quote(" LPSTR ProtocolName,")
  3366. cpp_quote(" LPADDRESS lpDstAddress,")
  3367. cpp_quote(" LPADDRESS lpSrcAddress,")
  3368. cpp_quote(" LPWORD ProtocolOffset,")
  3369. cpp_quote(" DWORD OriginalFrameNumber,")
  3370. cpp_quote(" DWORD nLowestFrame );")
  3371. cpp_quote("")
  3372. cpp_quote("HCAPTURE WINAPI GetFrameCaptureHandle(HFRAME);")
  3373. cpp_quote("")
  3374. cpp_quote("HFRAME WINAPI GetFrame(HCAPTURE hCapture, DWORD FrameNumber);")
  3375. cpp_quote("")
  3376. cpp_quote("LPRECOGNIZEDATATABLE WINAPI GetFrameRecognizeData(HFRAME hFrame);")
  3377. cpp_quote("")
  3378. cpp_quote("//=============================================================================")
  3379. cpp_quote("// Protocol API's.")
  3380. cpp_quote("//=============================================================================")
  3381. cpp_quote("")
  3382. cpp_quote("HPROTOCOL WINAPI CreateProtocol(LPSTR ProtocolName,")
  3383. cpp_quote(" LPENTRYPOINTS lpEntryPoints,")
  3384. cpp_quote(" DWORD cbEntryPoints);")
  3385. cpp_quote("")
  3386. cpp_quote("VOID WINAPI DestroyProtocol(HPROTOCOL hProtocol);")
  3387. cpp_quote("")
  3388. cpp_quote("LPPROTOCOLINFO WINAPI GetProtocolInfo(HPROTOCOL hProtocol);")
  3389. cpp_quote("")
  3390. cpp_quote("HPROPERTY WINAPI GetProperty(HPROTOCOL hProtocol, LPSTR PropertyName);")
  3391. cpp_quote("")
  3392. cpp_quote("HPROTOCOL WINAPI GetProtocolFromName(LPSTR ProtocolName);")
  3393. cpp_quote("")
  3394. cpp_quote("DWORD WINAPI GetProtocolStartOffset(HFRAME hFrame, LPSTR ProtocolName);")
  3395. cpp_quote("")
  3396. cpp_quote("DWORD WINAPI GetProtocolStartOffsetHandle(HFRAME hFrame, HPROTOCOL hProtocol);")
  3397. cpp_quote("")
  3398. cpp_quote("DWORD WINAPI GetPreviousProtocolOffsetByName(HFRAME hFrame,")
  3399. cpp_quote(" DWORD dwStartOffset,")
  3400. cpp_quote(" LPSTR szProtocolName,")
  3401. cpp_quote(" DWORD* pdwPreviousOffset);")
  3402. cpp_quote("")
  3403. cpp_quote("LPPROTOCOLTABLE WINAPI GetEnabledProtocols(HCAPTURE hCapture);")
  3404. cpp_quote("")
  3405. cpp_quote("//=============================================================================")
  3406. cpp_quote("// Property API's.")
  3407. cpp_quote("//=============================================================================")
  3408. cpp_quote("")
  3409. cpp_quote("DWORD WINAPI CreatePropertyDatabase(HPROTOCOL hProtocol, DWORD nProperties);")
  3410. cpp_quote("")
  3411. cpp_quote("DWORD WINAPI DestroyPropertyDatabase(HPROTOCOL hProtocol);")
  3412. cpp_quote("")
  3413. cpp_quote("HPROPERTY WINAPI AddProperty(HPROTOCOL hProtocol, LPPROPERTYINFO PropertyInfo);")
  3414. cpp_quote("")
  3415. cpp_quote("BOOL WINAPI AttachPropertyInstance(HFRAME hFrame,")
  3416. cpp_quote(" HPROPERTY hProperty,")
  3417. cpp_quote(" DWORD Length,")
  3418. cpp_quote(" ULPVOID lpData,")
  3419. cpp_quote(" DWORD HelpID,")
  3420. cpp_quote(" DWORD Level,")
  3421. cpp_quote(" DWORD IFlags);")
  3422. cpp_quote("")
  3423. cpp_quote("BOOL WINAPI AttachPropertyInstanceEx(HFRAME hFrame,")
  3424. cpp_quote(" HPROPERTY hProperty,")
  3425. cpp_quote(" DWORD Length,")
  3426. cpp_quote(" ULPVOID lpData,")
  3427. cpp_quote(" DWORD ExLength,")
  3428. cpp_quote(" ULPVOID lpExData,")
  3429. cpp_quote(" DWORD HelpID,")
  3430. cpp_quote(" DWORD Level,")
  3431. cpp_quote(" DWORD IFlags);")
  3432. cpp_quote("")
  3433. cpp_quote("LPPROPERTYINST WINAPI FindPropertyInstance(HFRAME hFrame, HPROPERTY hProperty);")
  3434. cpp_quote("")
  3435. cpp_quote("LPPROPERTYINST WINAPI FindPropertyInstanceRestart (HFRAME hFrame, ")
  3436. cpp_quote(" HPROPERTY hProperty, ")
  3437. cpp_quote(" LPPROPERTYINST *lpRestartKey, ")
  3438. cpp_quote(" BOOL DirForward );")
  3439. cpp_quote("")
  3440. cpp_quote("LPPROPERTYINFO WINAPI GetPropertyInfo(HPROPERTY hProperty);")
  3441. cpp_quote("")
  3442. cpp_quote("LPSTR WINAPI GetPropertyText(HFRAME hFrame, LPPROPERTYINST lpPI, LPSTR szBuffer, DWORD BufferSize);")
  3443. cpp_quote("")
  3444. cpp_quote("DWORD WINAPI ResetPropertyInstanceLength( LPPROPERTYINST lpProp, ")
  3445. cpp_quote(" WORD nOrgLen, ")
  3446. cpp_quote(" WORD nNewLen );")
  3447. cpp_quote("//=============================================================================")
  3448. cpp_quote("// MISC. API's.")
  3449. cpp_quote("//=============================================================================")
  3450. cpp_quote("")
  3451. cpp_quote("DWORD WINAPI GetCaptureCommentFromFilename(LPSTR lpFilename, LPSTR lpComment, DWORD BufferSize);")
  3452. cpp_quote("")
  3453. cpp_quote("int WINAPI CompareAddresses(LPADDRESS lpAddress1, LPADDRESS lpAddress2);")
  3454. cpp_quote("")
  3455. cpp_quote("DWORD WINAPIV FormatPropertyInstance(LPPROPERTYINST lpPropertyInst, ...);")
  3456. cpp_quote("")
  3457. cpp_quote("SYSTEMTIME * WINAPI AdjustSystemTime(SYSTEMTIME *SystemTime, __int64 TimeDelta);")
  3458. cpp_quote("")
  3459. cpp_quote("//=============================================================================")
  3460. cpp_quote("// EXPERT API's for use by Experts")
  3461. cpp_quote("//=============================================================================")
  3462. cpp_quote("")
  3463. cpp_quote("DWORD WINAPI ExpertGetFrame( IN HEXPERTKEY hExpertKey,")
  3464. cpp_quote(" IN DWORD Direction,")
  3465. cpp_quote(" IN DWORD RequestFlags,")
  3466. cpp_quote(" IN DWORD RequestedFrameNumber,")
  3467. cpp_quote(" IN HFILTER hFilter,")
  3468. cpp_quote(" OUT LPEXPERTFRAMEDESCRIPTOR pEFrameDescriptor);")
  3469. cpp_quote("")
  3470. cpp_quote("LPVOID WINAPI ExpertAllocMemory( IN HEXPERTKEY hExpertKey,")
  3471. cpp_quote(" IN SIZE_T nBytes,")
  3472. cpp_quote(" OUT DWORD* pError);")
  3473. cpp_quote("")
  3474. cpp_quote("LPVOID WINAPI ExpertReallocMemory( IN HEXPERTKEY hExpertKey,")
  3475. cpp_quote(" IN LPVOID pOriginalMemory,")
  3476. cpp_quote(" IN SIZE_T nBytes,")
  3477. cpp_quote(" OUT DWORD* pError);")
  3478. cpp_quote("")
  3479. cpp_quote("DWORD WINAPI ExpertFreeMemory( IN HEXPERTKEY hExpertKey,")
  3480. cpp_quote(" IN LPVOID pOriginalMemory);")
  3481. cpp_quote("")
  3482. cpp_quote("SIZE_T WINAPI ExpertMemorySize( IN HEXPERTKEY hExpertKey,")
  3483. cpp_quote(" IN LPVOID pOriginalMemory);")
  3484. cpp_quote("")
  3485. cpp_quote("DWORD WINAPI ExpertIndicateStatus( IN HEXPERTKEY hExpertKey, ")
  3486. cpp_quote(" IN EXPERTSTATUSENUMERATION Status,")
  3487. cpp_quote(" IN DWORD SubStatus,")
  3488. cpp_quote(" IN const char * szText,")
  3489. cpp_quote(" IN LONG PercentDone);")
  3490. cpp_quote("")
  3491. cpp_quote("DWORD WINAPI ExpertSubmitEvent( IN HEXPERTKEY hExpertKey,")
  3492. cpp_quote(" IN PNMEVENTDATA pExpertEvent);")
  3493. cpp_quote("")
  3494. cpp_quote("DWORD WINAPI ExpertGetStartupInfo( IN HEXPERTKEY hExpertKey,")
  3495. cpp_quote(" OUT PEXPERTSTARTUPINFO pExpertStartupInfo);")
  3496. cpp_quote("")
  3497. cpp_quote("//=============================================================================")
  3498. cpp_quote("// DEBUG API's.")
  3499. cpp_quote("//=============================================================================")
  3500. cpp_quote("#ifdef DEBUG")
  3501. cpp_quote("")
  3502. cpp_quote("//=============================================================================")
  3503. cpp_quote("// BreakPoint() macro.")
  3504. cpp_quote("//=============================================================================")
  3505. cpp_quote("// We do not want breakpoints in our code any more...")
  3506. cpp_quote("// so we are defining DebugBreak(), usually a system call, to be")
  3507. cpp_quote("// just a dprintf. BreakPoint() is still defined as DebugBreak().")
  3508. cpp_quote("")
  3509. cpp_quote("#ifdef DebugBreak")
  3510. cpp_quote("#undef DebugBreak")
  3511. cpp_quote("#endif // DebugBreak")
  3512. cpp_quote("")
  3513. cpp_quote("#define DebugBreak() dprintf(\"DebugBreak Called at %s:%s\", __FILE__, __LINE__);")
  3514. cpp_quote("#define BreakPoint() DebugBreak()")
  3515. cpp_quote("")
  3516. cpp_quote("#endif // DEBUG")
  3517. cpp_quote("//=============================================================================")
  3518. cpp_quote("//=============================================================================")
  3519. cpp_quote("// (NMBlob.h)")
  3520. cpp_quote("//=============================================================================")
  3521. cpp_quote("//=============================================================================")
  3522. cpp_quote("//=============================================================================")
  3523. cpp_quote("// Blob Constants")
  3524. cpp_quote("//=============================================================================")
  3525. const DWORD INITIAL_RESTART_KEY =0xFFFFFFFF;
  3526. cpp_quote("//=============================================================================")
  3527. cpp_quote("// Blob Core Helper Routines ")
  3528. cpp_quote("//=============================================================================")
  3529. cpp_quote("DWORD _cdecl CreateBlob(HBLOB * phBlob);")
  3530. cpp_quote("")
  3531. cpp_quote("DWORD _cdecl DestroyBlob(HBLOB hBlob);")
  3532. cpp_quote("")
  3533. cpp_quote("DWORD _cdecl SetStringInBlob(HBLOB hBlob, ")
  3534. cpp_quote(" const char * pOwnerName, ")
  3535. cpp_quote(" const char * pCategoryName, ")
  3536. cpp_quote(" const char * pTagName, ")
  3537. cpp_quote(" const char * pString); ")
  3538. cpp_quote("")
  3539. cpp_quote("DWORD _cdecl GetStringFromBlob(HBLOB hBlob,")
  3540. cpp_quote(" const char * pOwnerName,")
  3541. cpp_quote(" const char * pCategoryName,")
  3542. cpp_quote(" const char * pTagName,")
  3543. cpp_quote(" const char ** ppString);")
  3544. cpp_quote("")
  3545. cpp_quote("DWORD _cdecl GetStringsFromBlob(HBLOB hBlob,")
  3546. cpp_quote(" const char * pRequestedOwnerName,")
  3547. cpp_quote(" const char * pRequestedCategoryName,")
  3548. cpp_quote(" const char * pRequestedTagName,")
  3549. cpp_quote(" const char ** ppReturnedOwnerName,")
  3550. cpp_quote(" const char ** ppReturnedCategoryName,")
  3551. cpp_quote(" const char ** ppReturnedTagName,")
  3552. cpp_quote(" const char ** ppReturnedString,")
  3553. cpp_quote(" DWORD * pRestartKey);")
  3554. cpp_quote("")
  3555. cpp_quote("DWORD _cdecl RemoveFromBlob(HBLOB hBlob,")
  3556. cpp_quote(" const char * pOwnerName,")
  3557. cpp_quote(" const char * pCategoryName,")
  3558. cpp_quote(" const char * pTagName);")
  3559. cpp_quote("")
  3560. cpp_quote("DWORD _cdecl LockBlob(HBLOB hBlob);")
  3561. cpp_quote("")
  3562. cpp_quote("DWORD _cdecl UnlockBlob(HBLOB hBlob);")
  3563. cpp_quote("")
  3564. cpp_quote("DWORD _cdecl FindUnknownBlobCategories( HBLOB hBlob,")
  3565. cpp_quote(" const char * pOwnerName,")
  3566. cpp_quote(" const char * pKnownCategoriesTable[],")
  3567. cpp_quote(" HBLOB hUnknownCategoriesBlob);")
  3568. cpp_quote("")
  3569. cpp_quote("//=============================================================================")
  3570. cpp_quote("// Blob Helper Routines ")
  3571. cpp_quote("//=============================================================================")
  3572. cpp_quote("DWORD _cdecl MergeBlob(HBLOB hDstBlob,")
  3573. cpp_quote(" HBLOB hSrcBlob); ")
  3574. cpp_quote("")
  3575. cpp_quote("DWORD _cdecl DuplicateBlob (HBLOB hSrcBlob,")
  3576. cpp_quote(" HBLOB *hBlobThatWillBeCreated ); ")
  3577. cpp_quote("")
  3578. cpp_quote("DWORD _cdecl WriteBlobToFile(HBLOB hBlob,")
  3579. cpp_quote(" const char * pFileName);")
  3580. cpp_quote("")
  3581. cpp_quote("DWORD _cdecl ReadBlobFromFile(HBLOB* phBlob,")
  3582. cpp_quote(" const char * pFileName);")
  3583. cpp_quote("")
  3584. cpp_quote("DWORD _cdecl RegCreateBlobKey(HKEY hkey, const char* szBlobName, HBLOB hBlob);")
  3585. cpp_quote("")
  3586. cpp_quote("DWORD _cdecl RegOpenBlobKey(HKEY hkey, const char* szBlobName, HBLOB* phBlob);")
  3587. cpp_quote("")
  3588. cpp_quote("DWORD _cdecl MarshalBlob(HBLOB hBlob, DWORD* pSize, BYTE** ppBytes);")
  3589. cpp_quote("")
  3590. cpp_quote("DWORD _cdecl UnMarshalBlob(HBLOB* phBlob, DWORD Size, BYTE* pBytes);")
  3591. cpp_quote("")
  3592. cpp_quote("DWORD _cdecl SetDwordInBlob(HBLOB hBlob,")
  3593. cpp_quote(" const char * pOwnerName,")
  3594. cpp_quote(" const char * pCategoryName,")
  3595. cpp_quote(" const char * pTagName,")
  3596. cpp_quote(" DWORD Dword);")
  3597. cpp_quote("")
  3598. cpp_quote("DWORD _cdecl GetDwordFromBlob(HBLOB hBlob,")
  3599. cpp_quote(" const char * pOwnerName,")
  3600. cpp_quote(" const char * pCategoryName,")
  3601. cpp_quote(" const char * pTagName,")
  3602. cpp_quote(" DWORD * pDword);")
  3603. cpp_quote("")
  3604. cpp_quote("DWORD _cdecl SetBoolInBlob(HBLOB hBlob,")
  3605. cpp_quote(" const char * pOwnerName,")
  3606. cpp_quote(" const char * pCategoryName,")
  3607. cpp_quote(" const char * pTagName,")
  3608. cpp_quote(" BOOL Bool);")
  3609. cpp_quote("")
  3610. cpp_quote("DWORD _cdecl GetBoolFromBlob(HBLOB hBlob,")
  3611. cpp_quote(" const char * pOwnerName,")
  3612. cpp_quote(" const char * pCategoryName,")
  3613. cpp_quote(" const char * pTagName,")
  3614. cpp_quote(" BOOL * pBool);")
  3615. cpp_quote("")
  3616. cpp_quote("DWORD _cdecl GetMacAddressFromBlob(HBLOB hBlob,")
  3617. cpp_quote(" const char * pOwnerName,")
  3618. cpp_quote(" const char * pCategoryName,")
  3619. cpp_quote(" const char * pTagName,")
  3620. cpp_quote(" BYTE * pMacAddress);")
  3621. cpp_quote("")
  3622. cpp_quote("DWORD _cdecl SetMacAddressInBlob(HBLOB hBlob,")
  3623. cpp_quote(" const char * pOwnerName,")
  3624. cpp_quote(" const char * pCategoryName,")
  3625. cpp_quote(" const char * pTagName,")
  3626. cpp_quote(" const BYTE * pMacAddress);")
  3627. cpp_quote("")
  3628. cpp_quote("DWORD _cdecl FindUnknownBlobTags( HBLOB hBlob,")
  3629. cpp_quote(" const char * pOwnerName,")
  3630. cpp_quote(" const char * pCategoryName,")
  3631. cpp_quote(" const char * pKnownTagsTable[],")
  3632. cpp_quote(" HBLOB hUnknownTagsBlob);")
  3633. cpp_quote("")
  3634. cpp_quote("//=============================================================================")
  3635. cpp_quote("// Blob NPP Helper Routines")
  3636. cpp_quote("//=============================================================================")
  3637. cpp_quote("DWORD _cdecl SetNetworkInfoInBlob(HBLOB hBlob, ")
  3638. cpp_quote(" LPNETWORKINFO lpNetworkInfo);")
  3639. cpp_quote("")
  3640. cpp_quote("DWORD _cdecl GetNetworkInfoFromBlob(HBLOB hBlob, ")
  3641. cpp_quote(" LPNETWORKINFO lpNetworkInfo);")
  3642. cpp_quote("")
  3643. cpp_quote("DWORD _cdecl CreateNPPInterface ( HBLOB hBlob,")
  3644. cpp_quote(" REFIID iid,")
  3645. cpp_quote(" void ** ppvObject);")
  3646. cpp_quote("")
  3647. cpp_quote("DWORD _cdecl SetClassIDInBlob(HBLOB hBlob,")
  3648. cpp_quote(" const char* pOwnerName,")
  3649. cpp_quote(" const char* pCategoryName,")
  3650. cpp_quote(" const char* pTagName,")
  3651. cpp_quote(" const CLSID* pClsID);")
  3652. cpp_quote("")
  3653. cpp_quote("DWORD _cdecl GetClassIDFromBlob(HBLOB hBlob,")
  3654. cpp_quote(" const char* pOwnerName,")
  3655. cpp_quote(" const char* pCategoryName,")
  3656. cpp_quote(" const char* pTagName,")
  3657. cpp_quote(" CLSID * pClsID);")
  3658. cpp_quote("")
  3659. cpp_quote("DWORD _cdecl SetNPPPatternFilterInBlob( HBLOB hBlob,")
  3660. cpp_quote(" LPEXPRESSION pExpression,")
  3661. cpp_quote(" HBLOB hErrorBlob);")
  3662. cpp_quote("")
  3663. cpp_quote("DWORD _cdecl GetNPPPatternFilterFromBlob( HBLOB hBlob,")
  3664. cpp_quote(" LPEXPRESSION pExpression,")
  3665. cpp_quote(" HBLOB hErrorBlob);")
  3666. cpp_quote("")
  3667. cpp_quote("DWORD _cdecl SetNPPAddressFilterInBlob( HBLOB hBlob,")
  3668. cpp_quote(" LPADDRESSTABLE pAddressTable);")
  3669. cpp_quote("")
  3670. cpp_quote("DWORD _cdecl GetNPPAddressFilterFromBlob( HBLOB hBlob,")
  3671. cpp_quote(" LPADDRESSTABLE pAddressTable,")
  3672. cpp_quote(" HBLOB hErrorBlob);")
  3673. cpp_quote("")
  3674. cpp_quote("DWORD _cdecl SetNPPTriggerInBlob( HBLOB hBlob,")
  3675. cpp_quote(" LPTRIGGER pTrigger,")
  3676. cpp_quote(" HBLOB hErrorBlob);")
  3677. cpp_quote("")
  3678. cpp_quote("DWORD _cdecl GetNPPTriggerFromBlob( HBLOB hBlob,")
  3679. cpp_quote(" LPTRIGGER pTrigger,")
  3680. cpp_quote(" HBLOB hErrorBlob);")
  3681. cpp_quote("")
  3682. cpp_quote("DWORD _cdecl SetNPPEtypeSapFilter(HBLOB hBlob, ")
  3683. cpp_quote(" WORD nSaps,")
  3684. cpp_quote(" WORD nEtypes,")
  3685. cpp_quote(" LPBYTE lpSapTable,")
  3686. cpp_quote(" LPWORD lpEtypeTable,")
  3687. cpp_quote(" DWORD FilterFlags,")
  3688. cpp_quote(" HBLOB hErrorBlob);")
  3689. cpp_quote("")
  3690. cpp_quote("DWORD _cdecl GetNPPEtypeSapFilter(HBLOB hBlob, ")
  3691. cpp_quote(" WORD *pnSaps,")
  3692. cpp_quote(" WORD *pnEtypes,")
  3693. cpp_quote(" LPBYTE *ppSapTable,")
  3694. cpp_quote(" LPWORD *ppEtypeTable,")
  3695. cpp_quote(" DWORD *pFilterFlags,")
  3696. cpp_quote(" HBLOB hErrorBlob);")
  3697. cpp_quote("")
  3698. cpp_quote("// GetNPPMacTypeAsNumber maps the tag NPP:NetworkInfo:MacType to the MAC_TYPE_*")
  3699. cpp_quote("// defined in the NPPTYPES.h. If the tag is unavailable, the API returns MAC_TYPE_UNKNOWN.")
  3700. cpp_quote("DWORD _cdecl GetNPPMacTypeAsNumber(HBLOB hBlob, ")
  3701. cpp_quote(" LPDWORD lpMacType);")
  3702. cpp_quote("")
  3703. cpp_quote("// See if a remote catagory exists... and make sure that the remote computername")
  3704. cpp_quote("// isn't the same as the local computername.")
  3705. cpp_quote("BOOL _cdecl IsRemoteNPP ( HBLOB hBLOB);")
  3706. cpp_quote("")
  3707. cpp_quote("//=============================================================================")
  3708. cpp_quote("// npp tag definitions")
  3709. cpp_quote("//=============================================================================")
  3710. cpp_quote("#define OWNER_NPP \"NPP\"")
  3711. cpp_quote("")
  3712. cpp_quote("#define CATEGORY_NETWORKINFO \"NetworkInfo\"")
  3713. cpp_quote("#define TAG_MACTYPE \"MacType\"")
  3714. cpp_quote("#define TAG_CURRENTADDRESS \"CurrentAddress\"")
  3715. cpp_quote("#define TAG_LINKSPEED \"LinkSpeed\"")
  3716. cpp_quote("#define TAG_MAXFRAMESIZE \"MaxFrameSize\"")
  3717. cpp_quote("#define TAG_FLAGS \"Flags\"")
  3718. cpp_quote("#define TAG_TIMESTAMPSCALEFACTOR \"TimeStampScaleFactor\"")
  3719. cpp_quote("#define TAG_COMMENT \"Comment\"")
  3720. cpp_quote("#define TAG_NODENAME \"NodeName\"")
  3721. cpp_quote("#define TAG_NAME \"Name\"")
  3722. cpp_quote("#define TAG_FAKENPP \"Fake\"")
  3723. cpp_quote("#define TAG_PROMISCUOUS_MODE \"PMode\"")
  3724. cpp_quote("")
  3725. cpp_quote("#define CATEGORY_LOCATION \"Location\"")
  3726. cpp_quote("#define TAG_RAS \"Dial-up Connection\"")
  3727. cpp_quote("#define TAG_MACADDRESS \"MacAddress\"")
  3728. cpp_quote("#define TAG_CLASSID \"ClassID\"")
  3729. cpp_quote("#define TAG_NAME \"Name\"")
  3730. cpp_quote("")
  3731. cpp_quote("#define CATEGORY_CONFIG \"Config\"")
  3732. cpp_quote("#define TAG_FRAME_SIZE \"FrameSize\"")
  3733. cpp_quote("#define TAG_UPDATE_FREQUENCY \"UpdateFreq\"")
  3734. cpp_quote("#define TAG_BUFFER_SIZE \"BufferSize\"")
  3735. cpp_quote("#define TAG_DRIVE_LETTER \"DriveLetter\"")
  3736. cpp_quote("#define TAG_PATTERN_DESIGNATOR \"PatternMatch\"")
  3737. cpp_quote("#define TAG_PATTERN \"Pattern\"")
  3738. cpp_quote("#define TAG_ADDRESS_PAIR \"AddressPair\"")
  3739. cpp_quote("#define TAG_CONNECTIONFLAGS \"ConnectionFlags\"")
  3740. cpp_quote("#define TAG_ETYPES \"Etypes\"")
  3741. cpp_quote("#define TAG_SAPS \"Saps\"")
  3742. cpp_quote("#define TAG_NO_CONVERSATION_STATS \"NoConversationStats\"")
  3743. cpp_quote("#define TAG_NO_STATS_FRAME \"NoStatsFrame\"")
  3744. cpp_quote("#define TAG_DONT_DELETE_EMPTY_CAPTURE \"DontDeleteEmptyCapture\"")
  3745. cpp_quote("#define TAG_WANT_PROTOCOL_INFO \"WantProtocolInfo\"")
  3746. cpp_quote("#define TAG_INTERFACE_DELAYED_CAPTURE \"IDdC\"")
  3747. cpp_quote("#define TAG_INTERFACE_REALTIME_CAPTURE \"IRTC\"")
  3748. cpp_quote("#define TAG_INTERFACE_STATS \"ISts\"")
  3749. cpp_quote("#define TAG_INTERFACE_TRANSMIT \"IXmt\"")
  3750. cpp_quote("#define TAG_INTERFACE_EXPERT_STATS \"IESP\"")
  3751. cpp_quote("#define TAG_LOCAL_ONLY \"LocalOnly\"")
  3752. cpp_quote("// Is_Remote is set to TRUE by NPPs that go remote. Note that when you")
  3753. cpp_quote("// are looking for a remote NPP, you probably also need to ask for")
  3754. cpp_quote("// blobs that have the TAG_GET_SPECIAL_BLOBS bool set")
  3755. cpp_quote("#define TAG_IS_REMOTE \"IsRemote\"")
  3756. cpp_quote("")
  3757. cpp_quote("")
  3758. cpp_quote("#define CATEGORY_TRIGGER \"Trigger\"")
  3759. cpp_quote("#define TAG_TRIGGER \"Trigger\"")
  3760. cpp_quote("")
  3761. cpp_quote("#define CATEGORY_FINDER \"Finder\"")
  3762. cpp_quote("#define TAG_ROOT \"Root\"")
  3763. cpp_quote("#define TAG_PROCNAME \"ProcName\"")
  3764. cpp_quote("#define TAG_DISP_STRING \"Display\"")
  3765. cpp_quote("#define TAG_DLL_FILENAME \"DLLName\"")
  3766. cpp_quote("#define TAG_GET_SPECIAL_BLOBS \"Specials\"")
  3767. cpp_quote("")
  3768. cpp_quote("#define CATEGORY_REMOTE \"Remote\"")
  3769. cpp_quote("#define TAG_REMOTECOMPUTER \"RemoteComputer\"")
  3770. cpp_quote("#define TAG_REMOTECLASSID \"ClassID\"")
  3771. cpp_quote("")
  3772. cpp_quote("#define CATEGORY_ESP \"ESP\"")
  3773. cpp_quote("#define TAG_ESP_GENERAL_ACTIVE \"ESPGeneralActive\"")
  3774. cpp_quote("#define TAG_ESP_PROTOCOL_ACTIVE \"ESPProtocolActive\"")
  3775. cpp_quote("#define TAG_ESP_MAC_ACTIVE \"ESPMacActive\"")
  3776. cpp_quote("#define TAG_ESP_MAC2MAC_ACTIVE \"ESPMac2MacActive\"")
  3777. cpp_quote("#define TAG_ESP_IP_ACTIVE \"ESPIpActive\"")
  3778. cpp_quote("#define TAG_ESP_IP2IP_ACTIVE \"ESPIp2IpActive\"")
  3779. cpp_quote("#define TAG_ESP_IP_APP_ACTIVE \"ESPIpAppActive\"")
  3780. cpp_quote("#define TAG_ESP_IPX_ACTIVE \"ESPIpxActive\"")
  3781. cpp_quote("#define TAG_ESP_IPX2IPX_ACTIVE \"ESPIpx2IpxActive\"")
  3782. cpp_quote("#define TAG_ESP_IPX_APP_ACTIVE \"ESPIpxAppActive\"")
  3783. cpp_quote("#define TAG_ESP_DEC_ACTIVE \"ESPDecActive\"")
  3784. cpp_quote("#define TAG_ESP_DEC2DEC_ACTIVE \"ESPDec2DecActive\"")
  3785. cpp_quote("#define TAG_ESP_DEC_APP_ACTIVE \"ESPDecAppActive\"")
  3786. cpp_quote("#define TAG_ESP_APPLE_ACTIVE \"ESPAppleActive\"")
  3787. cpp_quote("#define TAG_ESP_APPLE2APPLE_ACTIVE \"ESPApple2AppleActive\"")
  3788. cpp_quote("#define TAG_ESP_APPLE_APP_ACTIVE \"ESPAppleAppActive\"")
  3789. cpp_quote("")
  3790. cpp_quote("#define TAG_ESP_UTIL_SIZE \"ESPUtilSize\"")
  3791. cpp_quote("#define TAG_ESP_TIME_SIZE \"ESPTimeSize\"")
  3792. cpp_quote("#define TAG_ESP_BPS_SIZE \"ESPBpsSize\"")
  3793. cpp_quote("#define TAG_ESP_BPS_THRESH \"ESPBpsThresh\"")
  3794. cpp_quote("#define TAG_ESP_FPS_THRESH \"ESPFpsThresh\"")
  3795. cpp_quote("")
  3796. cpp_quote("#define TAG_ESP_MAC \"ESPMac\"")
  3797. cpp_quote("#define TAG_ESP_IPX \"ESPIpx\"")
  3798. cpp_quote("#define TAG_ESP_IPXSPX \"ESPIpxSpx\"")
  3799. cpp_quote("#define TAG_ESP_NCP \"ESPNcp\"")
  3800. cpp_quote("#define TAG_ESP_IP \"ESPIp\"")
  3801. cpp_quote("#define TAG_ESP_UDP \"ESPUdp\"")
  3802. cpp_quote("#define TAG_ESP_TCP \"ESPTcp\"")
  3803. cpp_quote("#define TAG_ESP_ICMP \"ESPIcmp\"")
  3804. cpp_quote("#define TAG_ESP_ARP \"ESPArp\"")
  3805. cpp_quote("#define TAG_ESP_RARP \"ESPRarp\"")
  3806. cpp_quote("#define TAG_ESP_APPLE \"ESPApple\"")
  3807. cpp_quote("#define TAG_ESP_AARP \"ESPAarp\"")
  3808. cpp_quote("#define TAG_ESP_DEC \"ESPDec\"")
  3809. cpp_quote("#define TAG_ESP_NETBIOS \"ESPNetbios\"")
  3810. cpp_quote("#define TAG_ESP_SNA \"ESPSna\"")
  3811. cpp_quote("#define TAG_ESP_BPDU \"ESPBpdu\"")
  3812. cpp_quote("#define TAG_ESP_LLC \"ESPLlc\"")
  3813. cpp_quote("#define TAG_ESP_RPL \"ESPRpl\"")
  3814. cpp_quote("#define TAG_ESP_BANYAN \"ESPBanyan\"")
  3815. cpp_quote("#define TAG_ESP_LANMAN \"ESPLanMan\"")
  3816. cpp_quote("#define TAG_ESP_SNMP \"ESPSnmp\"")
  3817. cpp_quote("#define TAG_ESP_X25 \"ESPX25\"")
  3818. cpp_quote("#define TAG_ESP_XNS \"ESPXns\"")
  3819. cpp_quote("#define TAG_ESP_ISO \"ESPIso\"")
  3820. cpp_quote("#define TAG_ESP_UNKNOWN \"ESPUnknown\"")
  3821. cpp_quote("#define TAG_ESP_ATP \"ESPAtp\"")
  3822. cpp_quote("#define TAG_ESP_ADSP \"ESPAdsp\"")
  3823. cpp_quote("")
  3824. cpp_quote("//=============================================================================")
  3825. cpp_quote("// npp value definitions")
  3826. cpp_quote("//=============================================================================")
  3827. cpp_quote("// Mac types")
  3828. cpp_quote("#define PROTOCOL_STRING_ETHERNET_TXT \"ETHERNET\"")
  3829. cpp_quote("#define PROTOCOL_STRING_TOKENRING_TXT \"TOKENRING\"")
  3830. cpp_quote("#define PROTOCOL_STRING_FDDI_TXT \"FDDI\"")
  3831. cpp_quote("#define PROTOCOL_STRING_ATM_TXT \"ATM\"")
  3832. cpp_quote("#define PROTOCOL_STRING_1394_TXT \"IP/1394\"")
  3833. cpp_quote("")
  3834. cpp_quote("// lower protocols")
  3835. cpp_quote("#define PROTOCOL_STRING_IP_TXT \"IP\"")
  3836. cpp_quote("#define PROTOCOL_STRING_IPX_TXT \"IPX\"")
  3837. cpp_quote("#define PROTOCOL_STRING_XNS_TXT \"XNS\"")
  3838. cpp_quote("#define PROTOCOL_STRING_VINES_IP_TXT \"VINES IP\"")
  3839. cpp_quote("")
  3840. cpp_quote("// upper protocols")
  3841. cpp_quote("#define PROTOCOL_STRING_ICMP_TXT \"ICMP\"")
  3842. cpp_quote("#define PROTOCOL_STRING_TCP_TXT \"TCP\"")
  3843. cpp_quote("#define PROTOCOL_STRING_UDP_TXT \"UDP\"")
  3844. cpp_quote("#define PROTOCOL_STRING_SPX_TXT \"SPX\"")
  3845. cpp_quote("#define PROTOCOL_STRING_NCP_TXT \"NCP\"")
  3846. cpp_quote("")
  3847. cpp_quote("// pseudo protocols")
  3848. cpp_quote("#define PROTOCOL_STRING_ANY_TXT \"ANY\"")
  3849. cpp_quote("#define PROTOCOL_STRING_ANY_GROUP_TXT \"ANY GROUP\"")
  3850. cpp_quote("#define PROTOCOL_STRING_HIGHEST_TXT \"HIGHEST\"")
  3851. cpp_quote("#define PROTOCOL_STRING_LOCAL_ONLY_TXT \"LOCAL ONLY\"")
  3852. cpp_quote("#define PROTOCOL_STRING_UNKNOWN_TXT \"UNKNOWN\"")
  3853. cpp_quote("#define PROTOCOL_STRING_DATA_TXT \"DATA\"")
  3854. cpp_quote("#define PROTOCOL_STRING_FRAME_TXT \"FRAME\"")
  3855. cpp_quote("#define PROTOCOL_STRING_NONE_TXT \"NONE\"")
  3856. cpp_quote("#define PROTOCOL_STRING_EFFECTIVE_TXT \"EFFECTIVE\"")
  3857. cpp_quote("")
  3858. cpp_quote("#define ADDRESS_PAIR_INCLUDE_TXT \"INCLUDE\"")
  3859. cpp_quote("#define ADDRESS_PAIR_EXCLUDE_TXT \"EXCLUDE\"")
  3860. cpp_quote("")
  3861. cpp_quote("#define INCLUDE_ALL_EXCEPT_TXT \"INCLUDE ALL EXCEPT\"")
  3862. cpp_quote("#define EXCLUDE_ALL_EXCEPT_TXT \"EXCLUDE ALL EXCEPT\"")
  3863. cpp_quote("")
  3864. cpp_quote("#define PATTERN_MATCH_OR_TXT \"OR(\"")
  3865. cpp_quote("#define PATTERN_MATCH_AND_TXT \"AND(\"")
  3866. cpp_quote("")
  3867. cpp_quote("#define TRIGGER_PATTERN_TXT \"PATTERN MATCH\"")
  3868. cpp_quote("#define TRIGGER_BUFFER_TXT \"BUFFER CONTENT\"")
  3869. cpp_quote("")
  3870. cpp_quote("#define TRIGGER_NOTIFY_TXT \"NOTIFY\"")
  3871. cpp_quote("#define TRIGGER_STOP_TXT \"STOP\"")
  3872. cpp_quote("#define TRIGGER_PAUSE_TXT \"PAUSE\"")
  3873. cpp_quote("")
  3874. cpp_quote("#define TRIGGER_25_PERCENT_TXT \"25 PERCENT\"")
  3875. cpp_quote("#define TRIGGER_50_PERCENT_TXT \"50 PERCENT\"")
  3876. cpp_quote("#define TRIGGER_75_PERCENT_TXT \"75 PERCENT\"")
  3877. cpp_quote("#define TRIGGER_100_PERCENT_TXT \"100 PERCENT\"")
  3878. cpp_quote("")
  3879. cpp_quote("#define PATTERN_MATCH_NOT_TXT \"NOT\"")
  3880. cpp_quote("")
  3881. cpp_quote("//=============================================================================")
  3882. cpp_quote("//=============================================================================")
  3883. cpp_quote("// (NMRegHelp.h)")
  3884. cpp_quote("//=============================================================================")
  3885. cpp_quote("//=============================================================================")
  3886. cpp_quote("")
  3887. cpp_quote("// Registry helpers")
  3888. cpp_quote("LPCSTR _cdecl FindOneOf(LPCSTR p1, LPCSTR p2);")
  3889. cpp_quote("")
  3890. cpp_quote("LONG _cdecl recursiveDeleteKey(HKEY hKeyParent, // Parent of key to delete.")
  3891. cpp_quote(" const char* lpszKeyChild); // Key to delete.")
  3892. cpp_quote("")
  3893. cpp_quote("BOOL _cdecl SubkeyExists(const char* pszPath, // Path of key to check")
  3894. cpp_quote(" const char* szSubkey); // Key to check")
  3895. cpp_quote("")
  3896. cpp_quote("BOOL _cdecl setKeyAndValue(const char* szKey, ")
  3897. cpp_quote(" const char* szSubkey, ")
  3898. cpp_quote(" const char* szValue,")
  3899. cpp_quote(" const char* szName) ;")
  3900. cpp_quote("")
  3901. cpp_quote("//=============================================================================")
  3902. cpp_quote("//=============================================================================")
  3903. cpp_quote("// (NMIpStructs.h)")
  3904. cpp_quote("//=============================================================================")
  3905. cpp_quote("//=============================================================================")
  3906. cpp_quote("")
  3907. cpp_quote("// These structures are used to decode network data and so need to be packed")
  3908. #pragma pack(push, 1)
  3909. cpp_quote("//")
  3910. cpp_quote("// IP Packet Structure")
  3911. cpp_quote("//")
  3912. // contains a zero length array, so must cpp_quote
  3913. cpp_quote("typedef struct _IP ")
  3914. cpp_quote("{")
  3915. cpp_quote(" union ")
  3916. cpp_quote(" {")
  3917. cpp_quote(" BYTE Version;")
  3918. cpp_quote(" BYTE HdrLen;")
  3919. cpp_quote(" };")
  3920. cpp_quote(" BYTE ServiceType;")
  3921. cpp_quote(" WORD TotalLen;")
  3922. cpp_quote(" WORD ID;")
  3923. cpp_quote(" union ")
  3924. cpp_quote(" {")
  3925. cpp_quote(" WORD Flags;")
  3926. cpp_quote(" WORD FragOff;")
  3927. cpp_quote(" };")
  3928. cpp_quote(" BYTE TimeToLive;")
  3929. cpp_quote(" BYTE Protocol;")
  3930. cpp_quote(" WORD HdrChksum;")
  3931. cpp_quote(" DWORD SrcAddr;")
  3932. cpp_quote(" DWORD DstAddr;")
  3933. cpp_quote(" BYTE Options[0];")
  3934. cpp_quote("} IP;")
  3935. cpp_quote("")
  3936. cpp_quote("typedef IP * LPIP;")
  3937. cpp_quote("typedef IP UNALIGNED * ULPIP;")
  3938. cpp_quote("// Psuedo Header used for CheckSum Calculations")
  3939. typedef struct _PSUHDR
  3940. {
  3941. DWORD ph_SrcIP;
  3942. DWORD ph_DstIP;
  3943. UCHAR ph_Zero;
  3944. UCHAR ph_Proto;
  3945. WORD ph_ProtLen;
  3946. } PSUHDR;
  3947. cpp_quote("typedef PSUHDR UNALIGNED * LPPSUHDR;")
  3948. cpp_quote("//")
  3949. cpp_quote("// IP Bitmasks that are useful")
  3950. cpp_quote("// (and the appropriate bit shifts, as well)")
  3951. cpp_quote("//")
  3952. cpp_quote("")
  3953. cpp_quote("#define IP_VERSION_MASK ((BYTE) 0xf0)")
  3954. cpp_quote("#define IP_VERSION_SHIFT (4)")
  3955. cpp_quote("#define IP_HDRLEN_MASK ((BYTE) 0x0f)")
  3956. cpp_quote("#define IP_HDRLEN_SHIFT (0)")
  3957. cpp_quote("#define IP_PRECEDENCE_MASK ((BYTE) 0xE0)")
  3958. cpp_quote("#define IP_PRECEDENCE_SHIFT (5)")
  3959. cpp_quote("#define IP_TOS_MASK ((BYTE) 0x1E)")
  3960. cpp_quote("#define IP_TOS_SHIFT (1)")
  3961. cpp_quote("#define IP_DELAY_MASK ((BYTE) 0x10)")
  3962. cpp_quote("#define IP_THROUGHPUT_MASK ((BYTE) 0x08)")
  3963. cpp_quote("#define IP_RELIABILITY_MASK ((BYTE) 0x04)")
  3964. cpp_quote("#define IP_FLAGS_MASK ((BYTE) 0xE0)")
  3965. cpp_quote("#define IP_FLAGS_SHIFT (13)")
  3966. cpp_quote("#define IP_DF_MASK ((BYTE) 0x40)")
  3967. cpp_quote("#define IP_MF_MASK ((BYTE) 0x20)")
  3968. cpp_quote("#define IP_MF_SHIFT (5)")
  3969. cpp_quote("#define IP_FRAGOFF_MASK ((WORD) 0x1FFF)")
  3970. cpp_quote("#define IP_FRAGOFF_SHIFT (3)")
  3971. cpp_quote("#define IP_TCC_MASK ((DWORD) 0xFFFFFF00)")
  3972. cpp_quote("#define IP_TIME_OPTS_MASK ((BYTE) 0x0F)")
  3973. cpp_quote("#define IP_MISS_STNS_MASK ((BYTE) 0xF0)")
  3974. cpp_quote("")
  3975. cpp_quote("#define IP_TIME_OPTS_SHIFT (0)")
  3976. cpp_quote("#define IP_MISS_STNS_SHIFT (4)")
  3977. cpp_quote("")
  3978. cpp_quote("//")
  3979. cpp_quote("// Offset to checksum field in ip header")
  3980. cpp_quote("//")
  3981. cpp_quote("#define IP_CHKSUM_OFF 10")
  3982. cpp_quote("")
  3983. cpp_quote("INLINE BYTE IP_Version(ULPIP pIP)")
  3984. cpp_quote("{")
  3985. cpp_quote(" return (pIP->Version & IP_VERSION_MASK) >> IP_VERSION_SHIFT;")
  3986. cpp_quote("}")
  3987. cpp_quote("")
  3988. cpp_quote("INLINE DWORD IP_HdrLen(ULPIP pIP)")
  3989. cpp_quote("{")
  3990. cpp_quote(" return ((pIP->HdrLen & IP_HDRLEN_MASK) >> IP_HDRLEN_SHIFT) << 2;")
  3991. cpp_quote("}")
  3992. cpp_quote("")
  3993. cpp_quote("INLINE WORD IP_FragOff(ULPIP pIP)")
  3994. cpp_quote("{")
  3995. cpp_quote(" return (XCHG(pIP->FragOff) & IP_FRAGOFF_MASK) << IP_FRAGOFF_SHIFT;")
  3996. cpp_quote("}")
  3997. cpp_quote("")
  3998. cpp_quote("INLINE DWORD IP_TotalLen(ULPIP pIP)")
  3999. cpp_quote("{")
  4000. cpp_quote(" return XCHG(pIP->TotalLen);")
  4001. cpp_quote("}")
  4002. cpp_quote("")
  4003. cpp_quote("INLINE DWORD IP_MoreFragments(ULPIP pIP)")
  4004. cpp_quote("{")
  4005. cpp_quote(" return (pIP->Flags & IP_MF_MASK) >> IP_MF_SHIFT;")
  4006. cpp_quote("}")
  4007. cpp_quote("//")
  4008. cpp_quote("// Well known ports in the TCP/IP protocol (See RFC 1060)")
  4009. cpp_quote("//")
  4010. cpp_quote("#define PORT_TCPMUX 1 // TCP Port Service Multiplexer")
  4011. cpp_quote("#define PORT_RJE 5 // Remote Job Entry")
  4012. cpp_quote("#define PORT_ECHO 7 // Echo")
  4013. cpp_quote("#define PORT_DISCARD 9 // Discard")
  4014. cpp_quote("#define PORT_USERS 11 // Active users")
  4015. cpp_quote("#define PORT_DAYTIME 13 // Daytime")
  4016. cpp_quote("#define PORT_NETSTAT 15 // Netstat")
  4017. cpp_quote("#define PORT_QUOTE 17 // Quote of the day")
  4018. cpp_quote("#define PORT_CHARGEN 19 // Character Generator")
  4019. cpp_quote("#define PORT_FTPDATA 20 // File transfer [default data]")
  4020. cpp_quote("#define PORT_FTP 21 // File transfer [Control]")
  4021. cpp_quote("#define PORT_TELNET 23 // Telnet")
  4022. cpp_quote("#define PORT_SMTP 25 // Simple Mail Transfer")
  4023. cpp_quote("#define PORT_NSWFE 27 // NSW User System FE")
  4024. cpp_quote("#define PORT_MSGICP 29 // MSG ICP")
  4025. cpp_quote("#define PORT_MSGAUTH 31 // MSG Authentication")
  4026. cpp_quote("#define PORT_DSP 33 // Display Support")
  4027. cpp_quote("#define PORT_PRTSERVER 35 // any private printer server")
  4028. cpp_quote("#define PORT_TIME 37 // Time")
  4029. cpp_quote("#define PORT_RLP 39 // Resource Location Protocol")
  4030. cpp_quote("#define PORT_GRAPHICS 41 // Graphics")
  4031. cpp_quote("#define PORT_NAMESERVER 42 // Host Name Server")
  4032. cpp_quote("#define PORT_NICNAME 43 // Who is")
  4033. cpp_quote("#define PORT_MPMFLAGS 44 // MPM Flags ")
  4034. cpp_quote("#define PORT_MPM 45 // Message Processing Module [recv]")
  4035. cpp_quote("#define PORT_MPMSND 46 // MPM [default send]")
  4036. cpp_quote("#define PORT_NIFTP 47 // NI FTP")
  4037. cpp_quote("#define PORT_LOGIN 49 // Login Host Protocol")
  4038. cpp_quote("#define PORT_LAMAINT 51 // IMP Logical Address Maintenance")
  4039. cpp_quote("#define PORT_DOMAIN 53 // Domain Name Server")
  4040. cpp_quote("#define PORT_ISIGL 55 // ISI Graphics Language")
  4041. cpp_quote("#define PORT_ANYTERMACC 57 // any private terminal access")
  4042. cpp_quote("#define PORT_ANYFILESYS 59 // any private file service")
  4043. cpp_quote("#define PORT_NIMAIL 61 // NI Mail")
  4044. cpp_quote("#define PORT_VIAFTP 63 // VIA Systems - FTP")
  4045. cpp_quote("#define PORT_TACACSDS 65 // TACACS - Database Service")
  4046. cpp_quote("#define PORT_BOOTPS 67 // Bootstrap Protocol server")
  4047. cpp_quote("#define PORT_BOOTPC 68 // Bootstrap Protocol client")
  4048. cpp_quote("#define PORT_TFTP 69 // Trivial File Transfer")
  4049. cpp_quote("#define PORT_NETRJS1 71 // Remote Job service")
  4050. cpp_quote("#define PORT_NETRJS2 72 // Remote Job service")
  4051. cpp_quote("#define PORT_NETRJS3 73 // Remote Job service")
  4052. cpp_quote("#define PORT_NETRJS4 74 // Remote Job service")
  4053. cpp_quote("#define PORT_ANYDIALOUT 75 // any private dial out service")
  4054. cpp_quote("#define PORT_ANYRJE 77 // any private RJE service")
  4055. cpp_quote("#define PORT_FINGER 79 // Finger")
  4056. cpp_quote("#define PORT_HTTP 80 // HTTP (www)")
  4057. cpp_quote("#define PORT_HOSTS2NS 81 // Hosts2 Name Server")
  4058. cpp_quote("#define PORT_MITMLDEV1 83 // MIT ML Device")
  4059. cpp_quote("#define PORT_MITMLDEV2 85 // MIT ML Device")
  4060. cpp_quote("#define PORT_ANYTERMLINK 87 // any private terminal link")
  4061. cpp_quote("#define PORT_SUMITTG 89 // SU/MIT Telnet Gateway")
  4062. cpp_quote("#define PORT_MITDOV 91 // MIT Dover Spooler")
  4063. cpp_quote("#define PORT_DCP 93 // Device Control Protocol")
  4064. cpp_quote("#define PORT_SUPDUP 95 // SUPDUP")
  4065. cpp_quote("#define PORT_SWIFTRVF 97 // Swift Remote Vitural File Protocol")
  4066. cpp_quote("#define PORT_TACNEWS 98 // TAC News")
  4067. cpp_quote("#define PORT_METAGRAM 99 // Metagram Relay")
  4068. cpp_quote("#define PORT_NEWACCT 100 // [Unauthorized use]")
  4069. cpp_quote("#define PORT_HOSTNAME 101 // NIC Host Name Server")
  4070. cpp_quote("#define PORT_ISOTSAP 102 // ISO-TSAP")
  4071. cpp_quote("#define PORT_X400 103 // X400")
  4072. cpp_quote("#define PORT_X400SND 104 // X400 - SND")
  4073. cpp_quote("#define PORT_CSNETNS 105 // Mailbox Name Nameserver")
  4074. cpp_quote("#define PORT_RTELNET 107 // Remote Telnet Service")
  4075. cpp_quote("#define PORT_POP2 109 // Post Office Protocol - version 2")
  4076. cpp_quote("#define PORT_POP3 110 // Post Office Protocol - version 3")
  4077. cpp_quote("#define PORT_SUNRPC 111 // SUN Remote Procedure Call")
  4078. cpp_quote("#define PORT_AUTH 113 // Authentication")
  4079. cpp_quote("#define PORT_SFTP 115 // Simple File Transfer Protocol")
  4080. cpp_quote("#define PORT_UUCPPATH 117 // UUCP Path Service")
  4081. cpp_quote("#define PORT_NNTP 119 // Network News Transfer Protocol")
  4082. cpp_quote("#define PORT_ERPC 121 // Encore Expedited Remote Proc. Call")
  4083. cpp_quote("#define PORT_NTP 123 // Network Time Protocol")
  4084. cpp_quote("#define PORT_LOCUSMAP 125 // Locus PC-Interface Net Map Sesrver")
  4085. cpp_quote("#define PORT_LOCUSCON 127 // Locus PC-Interface Conn Server")
  4086. cpp_quote("#define PORT_PWDGEN 129 // Password Generator Protocol")
  4087. cpp_quote("#define PORT_CISCOFNA 130 // CISCO FNATIVE")
  4088. cpp_quote("#define PORT_CISCOTNA 131 // CISCO TNATIVE")
  4089. cpp_quote("#define PORT_CISCOSYS 132 // CISCO SYSMAINT")
  4090. cpp_quote("#define PORT_STATSRV 133 // Statistics Service")
  4091. cpp_quote("#define PORT_INGRESNET 134 // Ingres net service")
  4092. cpp_quote("#define PORT_LOCSRV 135 // Location Service")
  4093. cpp_quote("#define PORT_PROFILE 136 // PROFILE Naming System")
  4094. cpp_quote("#define PORT_NETBIOSNS 137 // NETBIOS Name Service")
  4095. cpp_quote("#define PORT_NETBIOSDGM 138 // NETBIOS Datagram Service")
  4096. cpp_quote("#define PORT_NETBIOSSSN 139 // NETBIOS Session Service")
  4097. cpp_quote("#define PORT_EMFISDATA 140 // EMFIS Data Service")
  4098. cpp_quote("#define PORT_EMFISCNTL 141 // EMFIS Control Service")
  4099. cpp_quote("#define PORT_BLIDM 142 // Britton-Lee IDM")
  4100. cpp_quote("#define PORT_IMAP2 143 // Interim Mail Access Protocol v2")
  4101. cpp_quote("#define PORT_NEWS 144 // NewS")
  4102. cpp_quote("#define PORT_UAAC 145 // UAAC protocol")
  4103. cpp_quote("#define PORT_ISOTP0 146 // ISO-IP0")
  4104. cpp_quote("#define PORT_ISOIP 147 // ISO-IP")
  4105. cpp_quote("#define PORT_CRONUS 148 // CRONUS-Support")
  4106. cpp_quote("#define PORT_AED512 149 // AED 512 Emulation Service")
  4107. cpp_quote("#define PORT_SQLNET 150 // SQL-NET")
  4108. cpp_quote("#define PORT_HEMS 151 // HEMS")
  4109. cpp_quote("#define PORT_BFTP 152 // Background File Transfer Protocol")
  4110. cpp_quote("#define PORT_SGMP 153 // SGMP")
  4111. cpp_quote("#define PORT_NETSCPROD 154 // NETSC")
  4112. cpp_quote("#define PORT_NETSCDEV 155 // NETSC")
  4113. cpp_quote("#define PORT_SQLSRV 156 // SQL service")
  4114. cpp_quote("#define PORT_KNETCMP 157 // KNET/VM Command/Message Protocol")
  4115. cpp_quote("#define PORT_PCMAILSRV 158 // PCMail server")
  4116. cpp_quote("#define PORT_NSSROUTING 159 // NSS routing")
  4117. cpp_quote("#define PORT_SGMPTRAPS 160 // SGMP-TRAPS")
  4118. cpp_quote("#define PORT_SNMP 161 // SNMP")
  4119. cpp_quote("#define PORT_SNMPTRAP 162 // SNMPTRAP")
  4120. cpp_quote("#define PORT_CMIPMANAGE 163 // CMIP/TCP Manager")
  4121. cpp_quote("#define PORT_CMIPAGENT 164 // CMIP/TCP Agent")
  4122. cpp_quote("#define PORT_XNSCOURIER 165 // Xerox")
  4123. cpp_quote("#define PORT_SNET 166 // Sirius Systems")
  4124. cpp_quote("#define PORT_NAMP 167 // NAMP")
  4125. cpp_quote("#define PORT_RSVD 168 // RSVC")
  4126. cpp_quote("#define PORT_SEND 169 // SEND")
  4127. cpp_quote("#define PORT_PRINTSRV 170 // Network Postscript")
  4128. cpp_quote("#define PORT_MULTIPLEX 171 // Network Innovations Multiples")
  4129. cpp_quote("#define PORT_CL1 172 // Network Innovations CL/1")
  4130. cpp_quote("#define PORT_XYPLEXMUX 173 // Xyplex")
  4131. cpp_quote("#define PORT_MAILQ 174 // MAILQ")
  4132. cpp_quote("#define PORT_VMNET 175 // VMNET")
  4133. cpp_quote("#define PORT_GENRADMUX 176 // GENRAD-MUX")
  4134. cpp_quote("#define PORT_XDMCP 177 // X Display Manager Control Protocol")
  4135. cpp_quote("#define PORT_NEXTSTEP 178 // NextStep Window Server")
  4136. cpp_quote("#define PORT_BGP 179 // Border Gateway Protocol")
  4137. cpp_quote("#define PORT_RIS 180 // Intergraph")
  4138. cpp_quote("#define PORT_UNIFY 181 // Unify")
  4139. cpp_quote("#define PORT_UNISYSCAM 182 // Unisys-Cam")
  4140. cpp_quote("#define PORT_OCBINDER 183 // OCBinder")
  4141. cpp_quote("#define PORT_OCSERVER 184 // OCServer")
  4142. cpp_quote("#define PORT_REMOTEKIS 185 // Remote-KIS")
  4143. cpp_quote("#define PORT_KIS 186 // KIS protocol")
  4144. cpp_quote("#define PORT_ACI 187 // Application Communication Interface")
  4145. cpp_quote("#define PORT_MUMPS 188 // MUMPS")
  4146. cpp_quote("#define PORT_QFT 189 // Queued File Transport")
  4147. cpp_quote("#define PORT_GACP 190 // Gateway Access Control Protocol")
  4148. cpp_quote("#define PORT_PROSPERO 191 // Prospero")
  4149. cpp_quote("#define PORT_OSUNMS 192 // OSU Network Monitoring System")
  4150. cpp_quote("#define PORT_SRMP 193 // Spider Remote Monitoring Protocol")
  4151. cpp_quote("#define PORT_IRC 194 // Internet Relay Chat Protocol")
  4152. cpp_quote("#define PORT_DN6NLMAUD 195 // DNSIX Network Level Module Audit")
  4153. cpp_quote("#define PORT_DN6SMMRED 196 // DSNIX Session Mgt Module Audit Redirector")
  4154. cpp_quote("#define PORT_DLS 197 // Directory Location Service")
  4155. cpp_quote("#define PORT_DLSMON 198 // Directory Location Service Monitor")
  4156. cpp_quote("#define PORT_ATRMTP 201 // AppleTalk Routing Maintenance")
  4157. cpp_quote("#define PORT_ATNBP 202 // AppleTalk Name Binding")
  4158. cpp_quote("#define PORT_AT3 203 // AppleTalk Unused")
  4159. cpp_quote("#define PORT_ATECHO 204 // AppleTalk Echo")
  4160. cpp_quote("#define PORT_AT5 205 // AppleTalk Unused")
  4161. cpp_quote("#define PORT_ATZIS 206 // AppleTalk Zone Information")
  4162. cpp_quote("#define PORT_AT7 207 // AppleTalk Unused")
  4163. cpp_quote("#define PORT_AT8 208 // AppleTalk Unused")
  4164. cpp_quote("#define PORT_SURMEAS 243 // Survey Measurement")
  4165. cpp_quote("#define PORT_LINK 245 // LINK")
  4166. cpp_quote("#define PORT_DSP3270 246 // Display Systems Protocol")
  4167. cpp_quote("#define PORT_LDAP1 389 // LDAP")
  4168. cpp_quote("#define PORT_ISAKMP 500 // ISAKMP")
  4169. cpp_quote("#define PORT_REXEC 512 // Remote Process Execution")
  4170. cpp_quote("#define PORT_RLOGIN 513 // Remote login a la telnet")
  4171. cpp_quote("#define PORT_RSH 514 // Remote command")
  4172. cpp_quote("#define PORT_LPD 515 // Line printer spooler - LPD")
  4173. cpp_quote("#define PORT_RIP 520 // TCP=? / UDP=RIP")
  4174. cpp_quote("#define PORT_TEMPO 526 // Newdate")
  4175. cpp_quote("#define PORT_COURIER 530 // rpc")
  4176. cpp_quote("#define PORT_NETNEWS 532 // READNEWS")
  4177. cpp_quote("#define PORT_UUCPD 540 // UUCPD")
  4178. cpp_quote("#define PORT_KLOGIN 543 //")
  4179. cpp_quote("#define PORT_KSHELL 544 // krcmd")
  4180. cpp_quote("#define PORT_DSF 555 //")
  4181. cpp_quote("#define PORT_REMOTEEFS 556 // RFS server")
  4182. cpp_quote("#define PORT_CHSHELL 562 // chmod")
  4183. cpp_quote("#define PORT_METER 570 // METER")
  4184. cpp_quote("#define PORT_PCSERVER 600 // SUN IPC Server")
  4185. cpp_quote("#define PORT_NQS 607 // NQS")
  4186. cpp_quote("#define PORT_HMMP_INDICATION 612 // ")
  4187. cpp_quote("#define PORT_HMMP_OPERATION 613 // ")
  4188. cpp_quote("#define PORT_MDQS 666 // MDQS")
  4189. cpp_quote("#define PORT_LPD721 721 // LPD Client (lpd client ports 721 - 731)")
  4190. cpp_quote("#define PORT_LPD722 722 // LPD Client (see RFC 1179)")
  4191. cpp_quote("#define PORT_LPD723 723 // LPD Client")
  4192. cpp_quote("#define PORT_LPD724 724 // LPD Client")
  4193. cpp_quote("#define PORT_LPD725 725 // LPD Client")
  4194. cpp_quote("#define PORT_LPD726 726 // LPD Client")
  4195. cpp_quote("#define PORT_LPD727 727 // LPD Client")
  4196. cpp_quote("#define PORT_LPD728 728 // LPD Client")
  4197. cpp_quote("#define PORT_LPD729 729 // LPD Client")
  4198. cpp_quote("#define PORT_LPD730 730 // LPD Client")
  4199. cpp_quote("#define PORT_LPD731 731 // LPD Client")
  4200. cpp_quote("#define PORT_RFILE 750 // RFILE")
  4201. cpp_quote("#define PORT_PUMP 751 // PUMP")
  4202. cpp_quote("#define PORT_QRH 752 // QRH")
  4203. cpp_quote("#define PORT_RRH 753 // RRH")
  4204. cpp_quote("#define PORT_TELL 754 // TELL")
  4205. cpp_quote("#define PORT_NLOGIN 758 // NLOGIN")
  4206. cpp_quote("#define PORT_CON 759 // CON")
  4207. cpp_quote("#define PORT_NS 760 // NS")
  4208. cpp_quote("#define PORT_RXE 761 // RXE")
  4209. cpp_quote("#define PORT_QUOTAD 762 // QUOTAD")
  4210. cpp_quote("#define PORT_CYCLESERV 763 // CYCLESERV")
  4211. cpp_quote("#define PORT_OMSERV 764 // OMSERV")
  4212. cpp_quote("#define PORT_WEBSTER 765 // WEBSTER")
  4213. cpp_quote("#define PORT_PHONEBOOK 767 // PHONE")
  4214. cpp_quote("#define PORT_VID 769 // VID")
  4215. cpp_quote("#define PORT_RTIP 771 // RTIP")
  4216. cpp_quote("#define PORT_CYCLESERV2 772 // CYCLESERV-2")
  4217. cpp_quote("#define PORT_SUBMIT 773 // submit")
  4218. cpp_quote("#define PORT_RPASSWD 774 // RPASSWD")
  4219. cpp_quote("#define PORT_ENTOMB 775 // ENTOMB")
  4220. cpp_quote("#define PORT_WPAGES 776 // WPAGES")
  4221. cpp_quote("#define PORT_WPGS 780 // wpgs")
  4222. cpp_quote("#define PORT_MDBSDAEMON 800 // MDBS DAEMON")
  4223. cpp_quote("#define PORT_DEVICE 801 // DEVICE")
  4224. cpp_quote("#define PORT_MAITRD 997 // MAITRD")
  4225. cpp_quote("#define PORT_BUSBOY 998 // BUSBOY")
  4226. cpp_quote("#define PORT_GARCON 999 // GARCON")
  4227. cpp_quote("#define PORT_NFS 2049 // NFS")
  4228. cpp_quote("#define PORT_LDAP2 3268 // LDAP")
  4229. cpp_quote("#define PORT_PPTP 5678 // PPTP")
  4230. cpp_quote("")
  4231. cpp_quote("//=============================================================================")
  4232. cpp_quote("//=============================================================================")
  4233. cpp_quote("// (NMIcmpStructs.h)")
  4234. cpp_quote("//=============================================================================")
  4235. cpp_quote("//=============================================================================")
  4236. cpp_quote("")
  4237. cpp_quote("//")
  4238. cpp_quote("// ICMP Frame Structure")
  4239. cpp_quote("//")
  4240. typedef struct _RequestReplyFields
  4241. {
  4242. WORD ID;
  4243. WORD SeqNo;
  4244. } ReqReply;
  4245. typedef struct _ParameterProblemFields
  4246. {
  4247. BYTE Pointer;
  4248. BYTE junk[3];
  4249. } ParmProb;
  4250. typedef struct _TimestampFields
  4251. {
  4252. DWORD tsOrig;
  4253. DWORD tsRecv;
  4254. DWORD tsXmit;
  4255. } TS;
  4256. typedef struct _RouterAnnounceHeaderFields
  4257. {
  4258. BYTE NumAddrs;
  4259. BYTE AddrEntrySize;
  4260. WORD Lifetime;
  4261. } RouterAH;
  4262. typedef struct _RouterAnnounceEntry
  4263. {
  4264. DWORD Address;
  4265. DWORD PreferenceLevel;
  4266. } RouterAE;
  4267. // contains a zero length array, so must cpp_quote
  4268. cpp_quote("typedef struct _ICMP ")
  4269. cpp_quote("{")
  4270. cpp_quote(" BYTE Type;")
  4271. cpp_quote(" BYTE Code;")
  4272. cpp_quote(" WORD Checksum;")
  4273. cpp_quote(" union")
  4274. cpp_quote(" {")
  4275. cpp_quote(" DWORD Unused;")
  4276. cpp_quote(" DWORD Address;")
  4277. cpp_quote(" ReqReply RR;")
  4278. cpp_quote(" ParmProb PP;")
  4279. cpp_quote(" RouterAH RAH; ")
  4280. cpp_quote(" };")
  4281. cpp_quote("")
  4282. cpp_quote(" union")
  4283. cpp_quote(" {")
  4284. cpp_quote(" TS Time;")
  4285. cpp_quote(" IP IP;")
  4286. cpp_quote(" RouterAE RAE[0];")
  4287. cpp_quote(" };")
  4288. cpp_quote("} ICMP;")
  4289. cpp_quote("")
  4290. cpp_quote("typedef ICMP * LPICMP;")
  4291. cpp_quote("typedef ICMP UNALIGNED * ULPICMP;")
  4292. const DWORD ICMP_HEADER_LENGTH =8;
  4293. cpp_quote("// # of *BYTES* of IP data to attach to")
  4294. cpp_quote("// datagram in addition to IP header")
  4295. const DWORD ICMP_IP_DATA_LENGTH =8;
  4296. cpp_quote("//")
  4297. cpp_quote("// ICMP Packet Types")
  4298. cpp_quote("//")
  4299. const BYTE ECHO_REPLY = 0;
  4300. const BYTE DESTINATION_UNREACHABLE = 3;
  4301. const BYTE SOURCE_QUENCH = 4;
  4302. const BYTE REDIRECT = 5;
  4303. const BYTE ECHO = 8;
  4304. const BYTE ROUTER_ADVERTISEMENT = 9;
  4305. const BYTE ROUTER_SOLICITATION =10;
  4306. const BYTE TIME_EXCEEDED =11;
  4307. const BYTE PARAMETER_PROBLEM =12;
  4308. const BYTE TIMESTAMP =13;
  4309. const BYTE TIMESTAMP_REPLY =14;
  4310. const BYTE INFORMATION_REQUEST =15;
  4311. const BYTE INFORMATION_REPLY =16;
  4312. const BYTE ADDRESS_MASK_REQUEST =17;
  4313. const BYTE ADDRESS_MASK_REPLY =18;
  4314. cpp_quote("//=============================================================================")
  4315. cpp_quote("//=============================================================================")
  4316. cpp_quote("// (NMIpxStructs.h)")
  4317. cpp_quote("//=============================================================================")
  4318. cpp_quote("//=============================================================================")
  4319. cpp_quote("// IPX")
  4320. typedef struct
  4321. {
  4322. UCHAR ha_address[6];
  4323. } HOST_ADDRESS;
  4324. typedef struct _IPXADDRESS
  4325. {
  4326. ULONG ipx_NetNumber;
  4327. HOST_ADDRESS ipx_HostAddr;
  4328. } IPXADDRESS;
  4329. cpp_quote("typedef IPXADDRESS UNALIGNED * PIPXADDRESS;")
  4330. typedef struct _NET_ADDRESS
  4331. {
  4332. IPXADDRESS na_IPXAddr;
  4333. USHORT na_socket;
  4334. } NET_ADDRESS;
  4335. cpp_quote("typedef NET_ADDRESS UNALIGNED * UPNET_ADDRESS;")
  4336. cpp_quote("// IPX Internetwork Packet eXchange Protocol Header.")
  4337. typedef struct
  4338. {
  4339. USHORT ipx_checksum;
  4340. USHORT ipx_length;
  4341. UCHAR ipx_xport_control; // nee ipx_hopcnt
  4342. UCHAR ipx_packet_type; // nee ipx_pkttyp
  4343. NET_ADDRESS ipx_dest;
  4344. NET_ADDRESS ipx_source;
  4345. } IPX_HDR;
  4346. cpp_quote("typedef IPX_HDR UNALIGNED * ULPIPX_HDR;")
  4347. cpp_quote("// SPX - Sequenced Packet Protocol")
  4348. typedef struct _SPX_HDR
  4349. {
  4350. IPX_HDR spx_idp_hdr;
  4351. UCHAR spx_conn_ctrl; // bits 0-3 defined (SPX_CTRL_xxx)
  4352. UCHAR spx_data_type; // 0 (defined to be used by higher layers)
  4353. USHORT spx_src_conn_id; // b.e.
  4354. USHORT spx_dest_conn_id; // b.e.
  4355. USHORT spx_sequence_num; // sequence number (b.e.).
  4356. USHORT spx_ack_num; // acknowledge number (b.e.)
  4357. USHORT spx_alloc_num; // allocation (b.e.)
  4358. } SPX_HDR;
  4359. cpp_quote("typedef SPX_HDR UNALIGNED *PSPX_HDR;")
  4360. cpp_quote("//=============================================================================")
  4361. cpp_quote("//=============================================================================")
  4362. cpp_quote("// (NMTcpStructs.h)")
  4363. cpp_quote("//=============================================================================")
  4364. cpp_quote("//=============================================================================")
  4365. cpp_quote("//")
  4366. cpp_quote("// TCP Packet Structure")
  4367. cpp_quote("//")
  4368. typedef struct _TCP
  4369. {
  4370. WORD SrcPort;
  4371. WORD DstPort;
  4372. DWORD SeqNum;
  4373. DWORD AckNum;
  4374. BYTE DataOff;
  4375. BYTE Flags;
  4376. WORD Window;
  4377. WORD Chksum;
  4378. WORD UrgPtr;
  4379. } TCP;
  4380. typedef TCP * LPTCP;
  4381. cpp_quote("typedef TCP UNALIGNED * ULPTCP;")
  4382. cpp_quote("INLINE DWORD TCP_HdrLen(ULPTCP pTCP)")
  4383. cpp_quote("{")
  4384. cpp_quote(" return (pTCP->DataOff & 0xf0) >> 2;")
  4385. cpp_quote("}")
  4386. cpp_quote("")
  4387. cpp_quote("INLINE DWORD TCP_SrcPort(ULPTCP pTCP)")
  4388. cpp_quote("{")
  4389. cpp_quote(" return XCHG(pTCP->SrcPort);")
  4390. cpp_quote("}")
  4391. cpp_quote("")
  4392. cpp_quote("INLINE DWORD TCP_DstPort(ULPTCP pTCP)")
  4393. cpp_quote("{")
  4394. cpp_quote(" return XCHG(pTCP->DstPort);")
  4395. cpp_quote("}")
  4396. cpp_quote("//")
  4397. cpp_quote("// TCP Option Opcodes")
  4398. cpp_quote("//")
  4399. const DWORD TCP_OPTION_ENDOFOPTIONS = 0;
  4400. const DWORD TCP_OPTION_NOP = 1;
  4401. const DWORD TCP_OPTION_MAXSEGSIZE = 2;
  4402. const DWORD TCP_OPTION_WSCALE = 3;
  4403. const DWORD TCP_OPTION_SACK_PERMITTED= 4;
  4404. const DWORD TCP_OPTION_SACK = 5;
  4405. const DWORD TCP_OPTION_TIMESTAMPS = 8;
  4406. cpp_quote("//")
  4407. cpp_quote("// TCP Flags")
  4408. cpp_quote("//")
  4409. const BYTE TCP_FLAG_URGENT =0x20;
  4410. const BYTE TCP_FLAG_ACK =0x10;
  4411. const BYTE TCP_FLAG_PUSH =0x08;
  4412. const BYTE TCP_FLAG_RESET =0x04;
  4413. const BYTE TCP_FLAG_SYN =0x02;
  4414. const BYTE TCP_FLAG_FIN =0x01;
  4415. cpp_quote("//")
  4416. cpp_quote("// TCP Field Masks")
  4417. cpp_quote("//")
  4418. const DWORD TCP_RESERVED_MASK =0x0FC0;
  4419. #pragma pack(pop)
  4420. cpp_quote("//****************************************************************************")
  4421. cpp_quote("//****************************************************************************")
  4422. cpp_quote("// IDelaydC - used by a consumer to get frames after a capture has completed.")
  4423. cpp_quote("//****************************************************************************")
  4424. cpp_quote("//****************************************************************************")
  4425. const DWORD DEFAULT_DELAYED_BUFFER_SIZE =1; // 1 meg
  4426. const char USE_DEFAULT_DRIVE_LETTER =0; // "read from registry"
  4427. const DWORD RTC_FRAME_SIZE_FULL =0; // keep all
  4428. // GUID association
  4429. [
  4430. object,
  4431. uuid(BFF9C030-B58F-11ce-B5B0-00AA006CB37D),
  4432. pointer_default(unique)
  4433. ]
  4434. // Interface Definition
  4435. [local]interface IDelaydC : IUnknown
  4436. {
  4437. import "unknwn.idl";
  4438. ///////////////////////////////////////////////
  4439. // Connection Methods
  4440. ///////////////////////////////////////////////
  4441. // Connect, this is where you actually connect to a network
  4442. HRESULT Connect( [in] HBLOB hInputBlob,
  4443. [in] LPVOID StatusCallbackProc,
  4444. [in] LPVOID UserContext,
  4445. [out] HBLOB hErrorBlob);
  4446. // Disconnect, Connect's logical opposite
  4447. HRESULT Disconnect( void );
  4448. // Get the status of the current capture
  4449. HRESULT QueryStatus( [out] NETWORKSTATUS *pNetworkStatus);
  4450. ///////////////////////////////////////////////
  4451. // Configuration Methods
  4452. ///////////////////////////////////////////////
  4453. HRESULT Configure( [in] HBLOB hConfigurationBlob,
  4454. [out] HBLOB hErrorBlob);
  4455. ///////////////////////////////////////////////
  4456. // Control Methods
  4457. ///////////////////////////////////////////////
  4458. // Start, begin capturing
  4459. HRESULT Start( [out] char *pFileName);
  4460. // Pause, take a break (out of p-mode we hope)
  4461. HRESULT Pause( void);
  4462. // Resume, sort of an 'un-pause'
  4463. HRESULT Resume( void);
  4464. // Stop, sort of an 'un-start'
  4465. HRESULT Stop( [out] LPSTATISTICS lpStats );
  4466. // Get two status flags:
  4467. // IsRunning, Are we capturing (regardless of paused state)
  4468. // IsPaused , Are we paused
  4469. HRESULT GetControlState( [out] BOOL * IsRunnning,
  4470. [out] BOOL * IsPaused );
  4471. ///////////////////////////////////////////////
  4472. // Statistics Methods
  4473. ///////////////////////////////////////////////
  4474. // GetTotalStatistics, fills in stats structure
  4475. HRESULT GetTotalStatistics([out] LPSTATISTICS lpStats,
  4476. [in] BOOL fClearAfterReading);
  4477. // GetSessionStatistics, fills in Session and Station structures
  4478. HRESULT GetConversationStatistics([out] DWORD *nSessions,
  4479. [out, size_is(100)] LPSESSIONSTATS lpSessionStats,
  4480. [out] DWORD *nStations,
  4481. [out, size_is(100)] LPSTATIONSTATS lpStationStats,
  4482. [in] BOOL fClearAfterReading);
  4483. ///////////////////////////////////////////////
  4484. // Special Methods
  4485. ///////////////////////////////////////////////
  4486. // add a comment frame to ALL current captures
  4487. HRESULT InsertSpecialFrame( [in] DWORD FrameType,
  4488. [in] DWORD Flags,
  4489. [in] BYTE* pUserData,
  4490. [in] DWORD UserDataLength);
  4491. // QueryStations, get a list of machines running Network Monitor
  4492. HRESULT QueryStations( [in, out] QUERYTABLE *lpQueryTable );
  4493. }
  4494. cpp_quote("//****************************************************************************")
  4495. cpp_quote("//****************************************************************************")
  4496. cpp_quote("// IESP - used by a consumer to get extended statistics, no frames.")
  4497. cpp_quote("//****************************************************************************")
  4498. cpp_quote("//****************************************************************************")
  4499. // GUID association
  4500. [
  4501. object,
  4502. uuid(E99A04AA-AB95-11d0-BE96-00A0C94989DE),
  4503. pointer_default(unique)
  4504. ]
  4505. // Interface Definition
  4506. [local]interface IESP : IUnknown
  4507. {
  4508. import "unknwn.idl";
  4509. ///////////////////////////////////////////////
  4510. // Connection Methods
  4511. ///////////////////////////////////////////////
  4512. // Connect, this is where you actually connect to a network
  4513. HRESULT Connect( [in] HBLOB hInputBlob,
  4514. [in] LPVOID StatusCallbackProc,
  4515. [in] LPVOID UserContext,
  4516. [out] HBLOB hErrorBlob);
  4517. // Disconnect, Connect's logical opposite
  4518. HRESULT Disconnect( void );
  4519. // Get the status of the current capture
  4520. HRESULT QueryStatus( [out] NETWORKSTATUS *pNetworkStatus);
  4521. ///////////////////////////////////////////////
  4522. // Configuration Methods
  4523. ///////////////////////////////////////////////
  4524. HRESULT Configure( [in] HBLOB hConfigurationBlob,
  4525. [out] HBLOB hErrorBlob);
  4526. ///////////////////////////////////////////////
  4527. // Control Methods
  4528. ///////////////////////////////////////////////
  4529. // Start, begin capturing
  4530. HRESULT Start( [string, out] char *pFileName);
  4531. // Pause, take a break (out of p-mode we hope)
  4532. HRESULT Pause( [out] LPSTATISTICS lpStats);
  4533. // Resume, sort of an 'un-pause'
  4534. HRESULT Resume( void);
  4535. // Stop, sort of an 'un-start'
  4536. HRESULT Stop( [out] LPSTATISTICS lpStats);
  4537. // Get two status flags:
  4538. // IsRunning, Are we capturing (regardless of paused state)
  4539. // IsPaused , Are we paused
  4540. HRESULT GetControlState( [out] BOOL * IsRunnning,
  4541. [out] BOOL * IsPaused );
  4542. // QueryStations, get a list of machines running Network Monitor
  4543. HRESULT QueryStations( [in, out] QUERYTABLE *lpQueryTable );
  4544. }
  4545. cpp_quote("//****************************************************************************")
  4546. cpp_quote("//****************************************************************************")
  4547. cpp_quote("// IRTC - used by a consumer to get an interface to local entry points")
  4548. cpp_quote("// necessary to do real time capture processing. It includes a method")
  4549. cpp_quote("// for handing a callback to the NPP.")
  4550. cpp_quote("//****************************************************************************")
  4551. cpp_quote("//****************************************************************************")
  4552. // Constants
  4553. const DWORD DEFAULT_RTC_BUFFER_SIZE =0x100000; /* 1 meg */
  4554. // GUID association
  4555. [
  4556. object,
  4557. uuid(4811EA40-B582-11ce-B5AF-00AA006CB37D),
  4558. pointer_default(unique)
  4559. ]
  4560. // Interface Definition
  4561. [local]interface IRTC : IUnknown
  4562. {
  4563. import "unknwn.idl";
  4564. ///////////////////////////////////////////////
  4565. // Connection Methods
  4566. ///////////////////////////////////////////////
  4567. // Connect, this is where you actually connect to a network
  4568. HRESULT Connect( [in] HBLOB hInputBlob,
  4569. [in] LPVOID StatusCallbackProc,
  4570. [in] LPVOID FramesCallbackProc,
  4571. [in] LPVOID UserContext,
  4572. [out] HBLOB hErrorBlob);
  4573. // Disconnect, Connect's logical opposite
  4574. HRESULT Disconnect( void );
  4575. // Get the status of the current capture
  4576. HRESULT QueryStatus( [out] NETWORKSTATUS *pNetworkStatus);
  4577. ///////////////////////////////////////////////
  4578. // Configuration Methods
  4579. ///////////////////////////////////////////////
  4580. HRESULT Configure( [in] HBLOB hConfigurationBlob,
  4581. [out] HBLOB hErrorBlob);
  4582. ///////////////////////////////////////////////
  4583. // Control Methods
  4584. ///////////////////////////////////////////////
  4585. // Start, begin capturing
  4586. HRESULT Start( void);
  4587. // Pause, take a break (out of p-mode we hope)
  4588. HRESULT Pause( void);
  4589. // Resume, sort of an 'un-pause'
  4590. HRESULT Resume( void);
  4591. // Stop, sort of an 'un-start'
  4592. HRESULT Stop( void);
  4593. // Get two status flags:
  4594. // IsRunning, Are we capturing (regardless of paused state)
  4595. // IsPaused , Are we paused
  4596. HRESULT GetControlState( [out] BOOL * IsRunnning,
  4597. [out] BOOL * IsPaused );
  4598. ///////////////////////////////////////////////
  4599. // Statistics Methods
  4600. ///////////////////////////////////////////////
  4601. // GetTotalStatistics, fills in stats structure
  4602. HRESULT GetTotalStatistics([out] LPSTATISTICS lpStats,
  4603. [in] BOOL fClearAfterReading);
  4604. // GetSessionStatistics, fills in Session and Station structures
  4605. HRESULT GetConversationStatistics([out] DWORD *nSessions,
  4606. [out, size_is(100)] LPSESSIONSTATS lpSessionStats,
  4607. [out] DWORD *nStations,
  4608. [out, size_is(100)] LPSTATIONSTATS lpStationStats,
  4609. [in] BOOL fClearAfterReading);
  4610. ///////////////////////////////////////////////
  4611. // Special Methods
  4612. ///////////////////////////////////////////////
  4613. // add a comment frame to ALL current captures
  4614. HRESULT InsertSpecialFrame( [in] DWORD FrameType,
  4615. [in] DWORD Flags,
  4616. [in] BYTE* pUserData,
  4617. [in] DWORD UserDataLength);
  4618. // QueryStations, get a list of machines running Network Monitor
  4619. HRESULT QueryStations( [in, out] QUERYTABLE *lpQueryTable );
  4620. }
  4621. cpp_quote("//****************************************************************************")
  4622. cpp_quote("//****************************************************************************")
  4623. cpp_quote("// IStats - used by a consumer to get just statistics, no frames.")
  4624. cpp_quote("//****************************************************************************")
  4625. cpp_quote("//****************************************************************************")
  4626. // GUID association
  4627. [
  4628. object,
  4629. uuid(944AD530-B09D-11ce-B59C-00AA006CB37D),
  4630. pointer_default(unique)
  4631. ]
  4632. // Interface Definition
  4633. [local]interface IStats : IUnknown
  4634. {
  4635. import "unknwn.idl";
  4636. ///////////////////////////////////////////////
  4637. // Connection Methods
  4638. ///////////////////////////////////////////////
  4639. // Connect, this is where you actually connect to a network
  4640. HRESULT Connect( [in] HBLOB hInputBlob,
  4641. [in] LPVOID StatusCallbackProc,
  4642. [in] LPVOID UserContext,
  4643. [out] HBLOB hErrorBlob);
  4644. // Disconnect, Connect's logical opposite
  4645. HRESULT Disconnect( void );
  4646. // Get the status of the current capture
  4647. HRESULT QueryStatus( [out] NETWORKSTATUS *pNetworkStatus);
  4648. ///////////////////////////////////////////////
  4649. // Configuration Methods
  4650. ///////////////////////////////////////////////
  4651. HRESULT Configure( [in] HBLOB hConfigurationBlob,
  4652. [out] HBLOB hErrorBlob);
  4653. ///////////////////////////////////////////////
  4654. // Control Methods
  4655. ///////////////////////////////////////////////
  4656. // Start, begin capturing
  4657. HRESULT Start( void);
  4658. // Pause, take a break (out of p-mode we hope)
  4659. HRESULT Pause( void);
  4660. // Resume, sort of an 'un-pause'
  4661. HRESULT Resume( void);
  4662. // Stop, sort of an 'un-start'
  4663. HRESULT Stop( void);
  4664. // Get two status flags:
  4665. // IsRunning, Are we capturing (regardless of paused state)
  4666. // IsPaused , Are we paused
  4667. HRESULT GetControlState( [out] BOOL * IsRunnning,
  4668. [out] BOOL * IsPaused );
  4669. ///////////////////////////////////////////////
  4670. // Statistics Methods
  4671. ///////////////////////////////////////////////
  4672. // GetTotalStatistics, fills in stats structure
  4673. HRESULT GetTotalStatistics([out] LPSTATISTICS lpStats,
  4674. [in] BOOL fClearAfterReading);
  4675. // GetSessionStatistics, fills in Session and Station structures
  4676. HRESULT GetConversationStatistics([out] DWORD *nSessions,
  4677. [out, size_is(100)] LPSESSIONSTATS lpSessionStats,
  4678. [out] DWORD *nStations,
  4679. [out, size_is(100)] LPSTATIONSTATS lpStationStats,
  4680. [in] BOOL fClearAfterReading);
  4681. ///////////////////////////////////////////////
  4682. // Special Methods
  4683. ///////////////////////////////////////////////
  4684. // add a comment frame to ALL current captures
  4685. HRESULT InsertSpecialFrame( [in] DWORD FrameType,
  4686. [in] DWORD Flags,
  4687. [in] BYTE* pUserData,
  4688. [in] DWORD UserDataLength);
  4689. // QueryStations, get a list of machines running Network Monitor
  4690. HRESULT QueryStations( [in, out] QUERYTABLE *lpQueryTable );
  4691. }
  4692. #pragma warning(default:4200)
  4693. #pragma pack()