-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWinMTRDialog.h
More file actions
148 lines (123 loc) · 3.23 KB
/
Copy pathWinMTRDialog.h
File metadata and controls
148 lines (123 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
//*****************************************************************************
// FILE: WinMTRDialog.h
//
//
// DESCRIPTION:
//
//
// NOTES:
//
//
//*****************************************************************************
#ifndef WINMTRDIALOG_H_
#define WINMTRDIALOG_H_
#define WINMTR_DIALOG_TIMER 100
#include "WinMTRStatusBar.h"
#include "WinMTRDarkHeaderCtrl.h"
#include "WinMTRNet.h"
#include "afxlinkctrl.h"
#include <string>
//*****************************************************************************
// CLASS: WinMTRDialog
//
//
//*****************************************************************************
class WinMTRDialog : public CDialog
{
public:
WinMTRDialog(CWnd* pParent = NULL);
~WinMTRDialog();
enum { IDD = IDD_WINMTR_DIALOG };
afx_msg BOOL InitRegistry();
WinMTRStatusBar statusBar;
enum STATES {
IDLE,
TRACING,
STOPPING,
EXIT
};
enum STATE_TRANSITIONS {
IDLE_TO_IDLE,
IDLE_TO_TRACING,
IDLE_TO_EXIT,
TRACING_TO_TRACING,
TRACING_TO_STOPPING,
TRACING_TO_EXIT,
STOPPING_TO_IDLE,
STOPPING_TO_STOPPING,
STOPPING_TO_EXIT
};
CButton m_buttonOptions;
CButton m_buttonExit;
CButton m_buttonStart;
CComboBox m_comboHost;
CButton m_checkIPv6;
CListCtrl m_listMTR;
CMFCLinkCtrl m_buttonCredits;
CStatic m_staticS;
CStatic m_staticJ;
CButton m_buttonExpT;
CButton m_buttonExpH;
CButton m_buttonCopyText;
CButton m_buttonCopyHtml;
WinMTRDarkHeaderCtrl m_listHeader;
int InitMTRNet();
int ResolveTarget(const char* hostname, addrinfo** result, bool showErrors = true);
std::string BuildTextReport() const;
std::string BuildHtmlReport() const;
int RunCliTrace(const char* hostname, int cycles, int durationSeconds);
int DisplayRedraw();
void Transit(STATES new_state);
STATES state;
STATE_TRANSITIONS transition;
HANDLE traceThreadMutex;
double interval;
bool hasIntervalFromCmdLine;
WORD pingsize;
bool hasPingsizeFromCmdLine;
int maxLRU;
bool hasMaxLRUFromCmdLine;
int nrLRU;
BOOL useDNS;
bool hasUseDNSFromCmdLine;
unsigned char useIPv6;
bool hasUseIPv6FromCmdLine;
WinMTRNet* wmtrnet;
void SetHostName(const char* host);
void SetInterval(float i);
void SetPingSize(WORD ps);
void SetMaxLRU(int mlru);
void SetUseDNS(BOOL udns);
protected:
virtual void DoDataExchange(CDataExchange* pDX);
int m_autostart;
char msz_defaulthostname[1000];
HICON m_hIcon;
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg void OnSize(UINT, int, int);
afx_msg void OnSizing(UINT, LPRECT);
afx_msg HCURSOR OnQueryDragIcon();
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
afx_msg void OnRestart();
afx_msg void OnOptions();
virtual void OnCancel();
afx_msg void OnCTTC();
afx_msg void OnCHTC();
afx_msg void OnEXPT();
afx_msg void OnEXPH();
afx_msg void OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult);
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnCbnSelchangeComboHost();
afx_msg void OnCbnSelendokComboHost();
private:
void ClearHistory();
public:
afx_msg void OnCbnCloseupComboHost();
afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg void OnClose();
afx_msg void OnBnClickedCancel();
};
#endif // ifndef WINMTRDIALOG_H_