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.

98 lines
2.6 KiB

  1. //
  2. // MODULE: SNIFFCONTROLLER.H
  3. //
  4. // PURPOSE: sniff controller 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 controls sniffing on per-node base
  13. //
  14. // Version Date By Comments
  15. //--------------------------------------------------------------------
  16. // V3.2 12-11-98 OK
  17. //
  18. #if !defined(AFX_SNIFFCONTROLLER_H__F16A9526_7105_11D3_8D3B_00C04F949D33__INCLUDED_)
  19. #define AFX_SNIFFCONTROLLER_H__F16A9526_7105_11D3_8D3B_00C04F949D33__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. #include "Stateless.h"
  24. #include "nodestate.h"
  25. #include "Sniff.h"
  26. class CTopic;
  27. ////////////////////////////////////////////////////////////////////////////////////
  28. // CSniffController
  29. // this class carries control information from registry and topic-specific HTI
  30. // file; this is ABSTRACT class.
  31. ////////////////////////////////////////////////////////////////////////////////////
  32. class CSniffController : public CStateless
  33. {
  34. friend void CSniff::SetAllowAutomaticSniffingPolicy(bool);
  35. friend void CSniff::SetAllowManualSniffingPolicy(bool);
  36. friend bool CSniff::GetAllowAutomaticSniffingPolicy();
  37. friend bool CSniff::GetAllowManualSniffingPolicy();
  38. bool m_bAllowAutomaticSniffingPolicy;
  39. bool m_bAllowManualSniffingPolicy;
  40. public:
  41. CSniffController() : CStateless(),
  42. m_bAllowAutomaticSniffingPolicy(false),
  43. m_bAllowManualSniffingPolicy(false)
  44. {}
  45. virtual ~CSniffController()
  46. {}
  47. public:
  48. virtual void SetTopic(CTopic* pTopic) =0;
  49. public:
  50. virtual bool AllowAutomaticOnStartSniffing(NID numNodeID) =0;
  51. virtual bool AllowAutomaticOnFlySniffing(NID numNodeID) =0;
  52. virtual bool AllowManualSniffing(NID numNodeID) =0;
  53. virtual bool AllowResniff(NID numNodeID) =0;
  54. private:
  55. // we NEED NOT access this functions other then from
  56. // appropriate CSniff::SetAllow...SniffingPolicy() functions
  57. void SetAllowAutomaticSniffingPolicy(bool);
  58. void SetAllowManualSniffingPolicy(bool);
  59. protected:
  60. bool GetAllowAutomaticSniffingPolicy();
  61. bool GetAllowManualSniffingPolicy();
  62. };
  63. inline void CSniffController::SetAllowAutomaticSniffingPolicy(bool set)
  64. {
  65. m_bAllowAutomaticSniffingPolicy = set;
  66. }
  67. inline void CSniffController::SetAllowManualSniffingPolicy(bool set)
  68. {
  69. m_bAllowManualSniffingPolicy = set;
  70. }
  71. inline bool CSniffController::GetAllowAutomaticSniffingPolicy()
  72. {
  73. return m_bAllowAutomaticSniffingPolicy;
  74. }
  75. inline bool CSniffController::GetAllowManualSniffingPolicy()
  76. {
  77. return m_bAllowManualSniffingPolicy;
  78. }
  79. #endif // !defined(AFX_SNIFFCONTROLLER_H__F16A9526_7105_11D3_8D3B_00C04F949D33__INCLUDED_)