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

6226 lines
204 KiB

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