Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.8 KiB

  1. //
  2. // MODULE: SNIFF.H
  3. //
  4. // PURPOSE: sniffing class
  5. //
  6. // COMPANY: Saltmine Creative, Inc. (206)-284-7511 [email protected]
  7. //
  8. // AUTHOR: Oleg Kalosha
  9. //
  10. // ORIGINAL DATE: 12-11-98
  11. //
  12. // NOTES: This is base abstract class which performs sniffing
  13. //
  14. // Version Date By Comments
  15. //--------------------------------------------------------------------
  16. // V3.2 12-11-98 OK
  17. //
  18. #if !defined(AFX_SNIFF_H__13D744F6_7038_11D3_8D3A_00C04F949D33__INCLUDED_)
  19. #define AFX_SNIFF_H__13D744F6_7038_11D3_8D3A_00C04F949D33__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. #include "Stateless.h"
  24. #include "nodestate.h"
  25. #define SNIFF_FAILURE_RESULT 0xffffffff // as this is a state, and state (IST) is unsigned int
  26. class CSniffController;
  27. class CSniffConnector;
  28. class CTopic;
  29. typedef vector<CNodeStatePair> CSniffedArr;
  30. //////////////////////////////////////////////////////////////////////////////////////
  31. // CSniff declaration
  32. class CSniff : public CStateless
  33. {
  34. public:
  35. CSniff() {}
  36. virtual ~CSniff() {}
  37. public:
  38. virtual CSniffController* GetSniffController() =0;
  39. virtual CSniffConnector* GetSniffConnector() =0;
  40. virtual CTopic* GetTopic() =0;
  41. public:
  42. // we can not set CSniffController here, as CSniffController
  43. // is specific for CSniff... class, inherited from CSniff
  44. virtual void SetSniffConnector(CSniffConnector*) =0;
  45. virtual void SetTopic(CTopic*) =0;
  46. public:
  47. virtual bool Resniff(CSniffedArr& arrSniffed);
  48. virtual bool SniffAll(CSniffedArr& arrOut);
  49. virtual bool SniffNode(NID numNodeID, IST* pnumNodeState);
  50. public:
  51. void SetAllowAutomaticSniffingPolicy(bool);
  52. void SetAllowManualSniffingPolicy(bool);
  53. bool GetAllowAutomaticSniffingPolicy();
  54. bool GetAllowManualSniffingPolicy();
  55. protected:
  56. virtual bool SniffNodeInternal(NID numNodeID, IST* pnumNodeState);
  57. };
  58. #endif // !defined(AFX_SNIFF_H__13D744F6_7038_11D3_8D3A_00C04F949D33__INCLUDED_)