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.

115 lines
2.6 KiB

  1. //============================================================================
  2. // Copyright(c) 1996, Microsoft Corporation
  3. //
  4. // File: ipfltr.h
  5. //
  6. // History:
  7. // 08/30/96 Ram Cherala Created
  8. // 01/24/98 Kenn Takara Modified for new snapins.
  9. //
  10. // Class declarations for IP Filter code.
  11. //============================================================================
  12. #ifndef _IPFLTR_H_
  13. #define _IPFLTR_H_
  14. #ifndef _DIALOG_H_
  15. #include "dialog.h"
  16. #endif
  17. // number of columns in the IP list view control
  18. #define IP_NUM_COLUMNS 7
  19. struct FilterListEntry {
  20. DWORD dwSrcAddr;
  21. DWORD dwSrcMask;
  22. DWORD dwDstAddr;
  23. DWORD dwDstMask;
  24. DWORD dwProtocol;
  25. DWORD fLateBound;
  26. WORD wSrcPort;
  27. WORD wDstPort;
  28. POSITION pos;
  29. };
  30. typedef CList<FilterListEntry *, FilterListEntry *> FilterList;
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CIpFltr dialog
  33. class CIpFltr : public CBaseDialog {
  34. // Construction
  35. public:
  36. CIpFltr(CWnd * pParent,
  37. IInfoBase * pInfoBase,
  38. DWORD dwFilterType,
  39. UINT idDlg = CIpFltr::IDD);
  40. ~CIpFltr();
  41. VOID SetFilterActionButtonsAndText( DWORD dwFilterType,
  42. DWORD dwAction,
  43. BOOL bEnable = TRUE );
  44. CString GetProtocolString(DWORD dwProtocol, DWORD fFlags);
  45. // Dialog Data
  46. //{{AFX_DATA(CIpFltr)
  47. enum { IDD = IDD_IPFILTER };
  48. CListCtrl m_listCtrl;
  49. //}}AFX_DATA
  50. // Overrides
  51. // ClassWizard generated virtual function overrides
  52. //{{AFX_VIRTUAL(CIpFltr)
  53. protected:
  54. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  55. //}}AFX_VIRTUAL
  56. // Implementation
  57. protected:
  58. static DWORD m_dwHelpMap[];
  59. CWnd* m_pParent;
  60. SPIInfoBase m_spInfoBase;
  61. DWORD m_dwFilterType;
  62. FilterList m_filterList;
  63. // Stores temp string information for Other Protocol
  64. CString m_stTempOther;
  65. // Store the "Any" string here since it's used so many times
  66. CString m_stAny;
  67. CString m_stUserMask;
  68. CString m_stUserAddress;
  69. // Generated message map functions
  70. //{{AFX_MSG(CIpFltr)
  71. virtual BOOL OnInitDialog();
  72. afx_msg void OnIpFilterAdd();
  73. afx_msg void OnIpFilterDelete();
  74. afx_msg void OnIpFilterEdit();
  75. virtual void OnOK();
  76. virtual void OnCancel();
  77. afx_msg void OnGetdispinfo(NMHDR* pNMHDR, LRESULT* pResult);
  78. afx_msg void OnDblclkIpFilterList(NMHDR* pNMHDR, LRESULT* pResult);
  79. afx_msg void OnNotifyListItemChanged(NMHDR *, LRESULT *);
  80. //}}AFX_MSG
  81. DECLARE_MESSAGE_MAP()
  82. };
  83. class CIpFltrDD : public CIpFltr
  84. {
  85. public:
  86. CIpFltrDD(CWnd * pParent,
  87. IInfoBase *pInfoBase,
  88. DWORD dwFilterType);
  89. ~CIpFltrDD();
  90. enum { IDD = IDD_IPFILTER_DD };
  91. };
  92. #endif // _IPFLTR_H_