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.

6753 lines
213 KiB

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