author | Michael Krelin <hacker@klever.net> | 2006-10-13 19:13:18 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2006-10-13 19:13:18 (UTC) |
commit | 325e7fc43721df3efaa8539190fada6e6e3aa8fa (patch) (unidiff) | |
tree | ec03bf74e17eb497e0fcd31b521192b0b14bd83e | |
parent | 577427e68ef10a4d2b75d28e42b22952ae3bcf23 (diff) | |
download | pumpkin-325e7fc43721df3efaa8539190fada6e6e3aa8fa.zip pumpkin-325e7fc43721df3efaa8539190fada6e6e3aa8fa.tar.gz pumpkin-325e7fc43721df3efaa8539190fada6e6e3aa8fa.tar.bz2 |
Enabled logging of outgoing errors, added reject with explicit error message
when file is too large for the block size set.
git-svn-id: http://svn.klever.net/kin/pumpkin/trunk@192 fe716a7a-6dde-0310-88d9-d003556173a8
-rw-r--r-- | PumpKINDlg.cpp | 7 | ||||
-rw-r--r-- | pumpkin.rc | 5 | ||||
-rw-r--r-- | resource.h | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/PumpKINDlg.cpp b/PumpKINDlg.cpp index 2a01918..bb15211 100644 --- a/PumpKINDlg.cpp +++ b/PumpKINDlg.cpp | |||
@@ -1,1909 +1,1912 @@ | |||
1 | // PumpKINDlg.cpp : implementation file | 1 | // PumpKINDlg.cpp : implementation file |
2 | // | 2 | // |
3 | 3 | ||
4 | #include "stdafx.h" | 4 | #include "stdafx.h" |
5 | #include "PumpKIN.h" | 5 | #include "PumpKIN.h" |
6 | #include "PumpKINDlg.h" | 6 | #include "PumpKINDlg.h" |
7 | 7 | ||
8 | #include "ACLTargetCombo.h" | 8 | #include "ACLTargetCombo.h" |
9 | #include "PropsServer.h" | 9 | #include "PropsServer.h" |
10 | #include "PropsNetwork.h" | 10 | #include "PropsNetwork.h" |
11 | #include "PropsSounds.h" | 11 | #include "PropsSounds.h" |
12 | #include "PropsACL.h" | 12 | #include "PropsACL.h" |
13 | #include "ConfirmRRQDlg.h" | 13 | #include "ConfirmRRQDlg.h" |
14 | #include "ConfirmWRQDlg.h" | 14 | #include "ConfirmWRQDlg.h" |
15 | #include "RequestDlg.h" | 15 | #include "RequestDlg.h" |
16 | #include "Resolver.h" | 16 | #include "Resolver.h" |
17 | #include "Retrier.h" | 17 | #include "Retrier.h" |
18 | #include "Trayer.h" | 18 | #include "Trayer.h" |
19 | 19 | ||
20 | #include <io.h> | 20 | #include <io.h> |
21 | 21 | ||
22 | #ifdef _DEBUG | 22 | #ifdef _DEBUG |
23 | #define new DEBUG_NEW | 23 | #define new DEBUG_NEW |
24 | #undef THIS_FILE | 24 | #undef THIS_FILE |
25 | static char THIS_FILE[] = __FILE__; | 25 | static char THIS_FILE[] = __FILE__; |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | IMPLEMENT_DYNAMIC(CXferSocket, CAsyncSocket) | 28 | IMPLEMENT_DYNAMIC(CXferSocket, CAsyncSocket) |
29 | IMPLEMENT_DYNAMIC(CWRQSocket, CXferSocket) | 29 | IMPLEMENT_DYNAMIC(CWRQSocket, CXferSocket) |
30 | IMPLEMENT_DYNAMIC(CRRQSocket, CXferSocket) | 30 | IMPLEMENT_DYNAMIC(CRRQSocket, CXferSocket) |
31 | 31 | ||
32 | ///////////////////////////////////////////////////////////////////////////// | 32 | ///////////////////////////////////////////////////////////////////////////// |
33 | // CAboutDlg dialog used for App About | 33 | // CAboutDlg dialog used for App About |
34 | 34 | ||
35 | class CAboutDlg : public CDialog | 35 | class CAboutDlg : public CDialog |
36 | { | 36 | { |
37 | public: | 37 | public: |
38 | CAboutDlg(); | 38 | CAboutDlg(); |
39 | 39 | ||
40 | // Dialog Data | 40 | // Dialog Data |
41 | //{{AFX_DATA(CAboutDlg) | 41 | //{{AFX_DATA(CAboutDlg) |
42 | enum { IDD = IDD_ABOUTBOX }; | 42 | enum { IDD = IDD_ABOUTBOX }; |
43 | //}}AFX_DATA | 43 | //}}AFX_DATA |
44 | 44 | ||
45 | // ClassWizard generated virtual function overrides | 45 | // ClassWizard generated virtual function overrides |
46 | //{{AFX_VIRTUAL(CAboutDlg) | 46 | //{{AFX_VIRTUAL(CAboutDlg) |
47 | protected: | 47 | protected: |
48 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support | 48 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support |
49 | //}}AFX_VIRTUAL | 49 | //}}AFX_VIRTUAL |
50 | 50 | ||
51 | // Implementation | 51 | // Implementation |
52 | protected: | 52 | protected: |
53 | //{{AFX_MSG(CAboutDlg) | 53 | //{{AFX_MSG(CAboutDlg) |
54 | afx_msg void OnKlevernet(); | 54 | afx_msg void OnKlevernet(); |
55 | //}}AFX_MSG | 55 | //}}AFX_MSG |
56 | DECLARE_MESSAGE_MAP() | 56 | DECLARE_MESSAGE_MAP() |
57 | }; | 57 | }; |
58 | 58 | ||
59 | CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) | 59 | CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) |
60 | { | 60 | { |
61 | //{{AFX_DATA_INIT(CAboutDlg) | 61 | //{{AFX_DATA_INIT(CAboutDlg) |
62 | //}}AFX_DATA_INIT | 62 | //}}AFX_DATA_INIT |
63 | } | 63 | } |
64 | 64 | ||
65 | void CAboutDlg::DoDataExchange(CDataExchange* pDX) | 65 | void CAboutDlg::DoDataExchange(CDataExchange* pDX) |
66 | { | 66 | { |
67 | CDialog::DoDataExchange(pDX); | 67 | CDialog::DoDataExchange(pDX); |
68 | //{{AFX_DATA_MAP(CAboutDlg) | 68 | //{{AFX_DATA_MAP(CAboutDlg) |
69 | //}}AFX_DATA_MAP | 69 | //}}AFX_DATA_MAP |
70 | } | 70 | } |
71 | 71 | ||
72 | BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) | 72 | BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) |
73 | //{{AFX_MSG_MAP(CAboutDlg) | 73 | //{{AFX_MSG_MAP(CAboutDlg) |
74 | ON_BN_CLICKED(IDC_KLEVERNET, OnKlevernet) | 74 | ON_BN_CLICKED(IDC_KLEVERNET, OnKlevernet) |
75 | //}}AFX_MSG_MAP | 75 | //}}AFX_MSG_MAP |
76 | END_MESSAGE_MAP() | 76 | END_MESSAGE_MAP() |
77 | 77 | ||
78 | ///////////////////////////////////////////////////////////////////////////// | 78 | ///////////////////////////////////////////////////////////////////////////// |
79 | // CPumpKINDlg dialog | 79 | // CPumpKINDlg dialog |
80 | 80 | ||
81 | CPumpKINDlg::CPumpKINDlg(CWnd* pParent /*=NULL*/) | 81 | CPumpKINDlg::CPumpKINDlg(CWnd* pParent /*=NULL*/) |
82 | : CDialog(CPumpKINDlg::IDD, pParent), m_MinSize(0,0) | 82 | : CDialog(CPumpKINDlg::IDD, pParent), m_MinSize(0,0) |
83 | { | 83 | { |
84 | m_Listener.m_Daddy = this; | 84 | m_Listener.m_Daddy = this; |
85 | 85 | ||
86 | m_bListen = TRUE; | 86 | m_bListen = TRUE; |
87 | 87 | ||
88 | m_ListenPort = 69; | 88 | m_ListenPort = 69; |
89 | m_bTFTPSubdirs = TRUE; | 89 | m_bTFTPSubdirs = TRUE; |
90 | m_RRQMode = rrqAlwaysConfirm; | 90 | m_RRQMode = rrqAlwaysConfirm; |
91 | m_WRQMode = wrqAlwaysConfirm; | 91 | m_WRQMode = wrqAlwaysConfirm; |
92 | m_TFTPTimeOut = CTimeSpan(0,0,0,30); | 92 | m_TFTPTimeOut = CTimeSpan(0,0,0,30); |
93 | m_RetryTimeOut = CTimeSpan(0,0,0,10); | 93 | m_RetryTimeOut = CTimeSpan(0,0,0,10); |
94 | m_LogLength = 100; | 94 | m_LogLength = 100; |
95 | m_SpeakPort = 69; | 95 | m_SpeakPort = 69; |
96 | m_PromptTimeOut=30; | 96 | m_PromptTimeOut=30; |
97 | m_bShown=TRUE; | 97 | m_bShown=TRUE; |
98 | m_bExiting=FALSE; | 98 | m_bExiting=FALSE; |
99 | m_BlockSize=1024; | 99 | m_BlockSize=1024; |
100 | m_bnw.AssignSound("(bang)",IDR_WAVE_RING,CBellsNWhistles::CBang::bangResource); | 100 | m_bnw.AssignSound("(bang)",IDR_WAVE_RING,CBellsNWhistles::CBang::bangResource); |
101 | m_bnw.AssignSound("(done)",IDR_WAVE_FINISHED,CBellsNWhistles::CBang::bangResource); | 101 | m_bnw.AssignSound("(done)",IDR_WAVE_FINISHED,CBellsNWhistles::CBang::bangResource); |
102 | m_bnw.AssignSound("(oops)",IDR_WAVE_ABORTED,CBellsNWhistles::CBang::bangResource); | 102 | m_bnw.AssignSound("(oops)",IDR_WAVE_ABORTED,CBellsNWhistles::CBang::bangResource); |
103 | m_bnw.AssignSound("(none)",(int)0,CBellsNWhistles::CBang::bangNone); | 103 | m_bnw.AssignSound("(none)",(int)0,CBellsNWhistles::CBang::bangNone); |
104 | m_bnwRequest="(bang)"; m_bnwSuccess="(done)"; | 104 | m_bnwRequest="(bang)"; m_bnwSuccess="(done)"; |
105 | m_bnwAbort="(oops)"; | 105 | m_bnwAbort="(oops)"; |
106 | //{{AFX_DATA_INIT(CPumpKINDlg) | 106 | //{{AFX_DATA_INIT(CPumpKINDlg) |
107 | //}}AFX_DATA_INIT | 107 | //}}AFX_DATA_INIT |
108 | // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 | 108 | // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 |
109 | m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); | 109 | m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); |
110 | m_bmpBack.LoadBitmap(IDB_BACKGROUND); | 110 | m_bmpBack.LoadBitmap(IDB_BACKGROUND); |
111 | m_bmpBack.GetBitmap(&m_bitmapBack); | 111 | m_bmpBack.GetBitmap(&m_bitmapBack); |
112 | m_Retrier = new CRetrier(this); | 112 | m_Retrier = new CRetrier(this); |
113 | ASSERT(m_Retrier); | 113 | ASSERT(m_Retrier); |
114 | m_Trayer = new CTrayer(this); | 114 | m_Trayer = new CTrayer(this); |
115 | ASSERT(m_Trayer); | 115 | ASSERT(m_Trayer); |
116 | /* Ensure we're backwards compatible */ | 116 | /* Ensure we're backwards compatible */ |
117 | ASSERT(CPumpKINDlg::rrqGiveAll==0); | 117 | ASSERT(CPumpKINDlg::rrqGiveAll==0); |
118 | ASSERT(CPumpKINDlg::rrqAlwaysConfirm==1); | 118 | ASSERT(CPumpKINDlg::rrqAlwaysConfirm==1); |
119 | ASSERT(CPumpKINDlg::rrqDenyAll==2); | 119 | ASSERT(CPumpKINDlg::rrqDenyAll==2); |
120 | ASSERT(CPumpKINDlg::wrqTakeAll==0); | 120 | ASSERT(CPumpKINDlg::wrqTakeAll==0); |
121 | ASSERT(CPumpKINDlg::wrqConfirmIfExists==1); | 121 | ASSERT(CPumpKINDlg::wrqConfirmIfExists==1); |
122 | ASSERT(CPumpKINDlg::wrqAlwaysConfirm==2); | 122 | ASSERT(CPumpKINDlg::wrqAlwaysConfirm==2); |
123 | ASSERT(CPumpKINDlg::wrqDenyAll==3); | 123 | ASSERT(CPumpKINDlg::wrqDenyAll==3); |
124 | /* -- */ | 124 | /* -- */ |
125 | LoadSettings(); | 125 | LoadSettings(); |
126 | } | 126 | } |
127 | 127 | ||
128 | void CPumpKINDlg::DoDataExchange(CDataExchange* pDX) | 128 | void CPumpKINDlg::DoDataExchange(CDataExchange* pDX) |
129 | { | 129 | { |
130 | CDialog::DoDataExchange(pDX); | 130 | CDialog::DoDataExchange(pDX); |
131 | //{{AFX_DATA_MAP(CPumpKINDlg) | 131 | //{{AFX_DATA_MAP(CPumpKINDlg) |
132 | DDX_Control(pDX, ID_HELP, m_HelpCtl); | 132 | DDX_Control(pDX, ID_HELP, m_HelpCtl); |
133 | DDX_Control(pDX, IDC_PUT, m_PutCtl); | 133 | DDX_Control(pDX, IDC_PUT, m_PutCtl); |
134 | DDX_Control(pDX, IDC_GET, m_GetCtl); | 134 | DDX_Control(pDX, IDC_GET, m_GetCtl); |
135 | DDX_Control(pDX, IDC_EXIT, m_ExitCtl); | 135 | DDX_Control(pDX, IDC_EXIT, m_ExitCtl); |
136 | DDX_Control(pDX, IDC_LISTENING, m_ListenCtl); | 136 | DDX_Control(pDX, IDC_LISTENING, m_ListenCtl); |
137 | DDX_Control(pDX, IDC_ABORT, m_AbortCtl); | 137 | DDX_Control(pDX, IDC_ABORT, m_AbortCtl); |
138 | DDX_Control(pDX, IDC_OPTIONS, m_OptionsCtl); | 138 | DDX_Control(pDX, IDC_OPTIONS, m_OptionsCtl); |
139 | DDX_Control(pDX, IDC_LOG, m_Log); | 139 | DDX_Control(pDX, IDC_LOG, m_Log); |
140 | DDX_Control(pDX, IDC_CONNECTIONS, m_List); | 140 | DDX_Control(pDX, IDC_CONNECTIONS, m_List); |
141 | //}}AFX_DATA_MAP | 141 | //}}AFX_DATA_MAP |
142 | } | 142 | } |
143 | 143 | ||
144 | BEGIN_MESSAGE_MAP(CPumpKINDlg, CDialog) | 144 | BEGIN_MESSAGE_MAP(CPumpKINDlg, CDialog) |
145 | //{{AFX_MSG_MAP(CPumpKINDlg) | 145 | //{{AFX_MSG_MAP(CPumpKINDlg) |
146 | ON_WM_SYSCOMMAND() | 146 | ON_WM_SYSCOMMAND() |
147 | ON_WM_DESTROY() | 147 | ON_WM_DESTROY() |
148 | ON_WM_PAINT() | 148 | ON_WM_PAINT() |
149 | ON_WM_QUERYDRAGICON() | 149 | ON_WM_QUERYDRAGICON() |
150 | ON_WM_CREATE() | 150 | ON_WM_CREATE() |
151 | ON_BN_CLICKED(IDC_OPTIONS, OnOptions) | 151 | ON_BN_CLICKED(IDC_OPTIONS, OnOptions) |
152 | ON_WM_TIMER() | 152 | ON_WM_TIMER() |
153 | ON_BN_CLICKED(IDC_EXIT, OnExit) | 153 | ON_BN_CLICKED(IDC_EXIT, OnExit) |
154 | ON_BN_CLICKED(IDC_PUT, OnPut) | 154 | ON_BN_CLICKED(IDC_PUT, OnPut) |
155 | ON_BN_CLICKED(IDC_GET, OnGet) | 155 | ON_BN_CLICKED(IDC_GET, OnGet) |
156 | ON_NOTIFY(LVN_DELETEALLITEMS, IDC_CONNECTIONS, OnDeleteallitemsConnections) | 156 | ON_NOTIFY(LVN_DELETEALLITEMS, IDC_CONNECTIONS, OnDeleteallitemsConnections) |
157 | ON_NOTIFY(LVN_DELETEITEM, IDC_CONNECTIONS, OnDeleteitemConnections) | 157 | ON_NOTIFY(LVN_DELETEITEM, IDC_CONNECTIONS, OnDeleteitemConnections) |
158 | ON_NOTIFY(LVN_INSERTITEM, IDC_CONNECTIONS, OnInsertitemConnections) | 158 | ON_NOTIFY(LVN_INSERTITEM, IDC_CONNECTIONS, OnInsertitemConnections) |
159 | ON_NOTIFY(LVN_ITEMCHANGED, IDC_CONNECTIONS, OnItemchangedConnections) | 159 | ON_NOTIFY(LVN_ITEMCHANGED, IDC_CONNECTIONS, OnItemchangedConnections) |
160 | ON_BN_CLICKED(IDC_ABORT, OnAbort) | 160 | ON_BN_CLICKED(IDC_ABORT, OnAbort) |
161 | ON_WM_CLOSE() | 161 | ON_WM_CLOSE() |
162 | ON_COMMAND(ID_TRAY_SHOWPUMPKINWINDOW, OnTrayShowpumpkinwindow) | 162 | ON_COMMAND(ID_TRAY_SHOWPUMPKINWINDOW, OnTrayShowpumpkinwindow) |
163 | ON_COMMAND(ID_TRAY_LISTEN, OnTrayListen) | 163 | ON_COMMAND(ID_TRAY_LISTEN, OnTrayListen) |
164 | ON_COMMAND(ID_TRAY_EXIT, OnTrayExit) | 164 | ON_COMMAND(ID_TRAY_EXIT, OnTrayExit) |
165 | ON_COMMAND(ID_TRAY_ABOUTPUMPKIN, OnTrayAboutpumpkin) | 165 | ON_COMMAND(ID_TRAY_ABOUTPUMPKIN, OnTrayAboutpumpkin) |
166 | ON_COMMAND(ID_TRAY_FETCHFILE, OnTrayFetchfile) | 166 | ON_COMMAND(ID_TRAY_FETCHFILE, OnTrayFetchfile) |
167 | ON_COMMAND(ID_TRAY_HELP, OnTrayHelp) | 167 | ON_COMMAND(ID_TRAY_HELP, OnTrayHelp) |
168 | ON_COMMAND(ID_TRAY_OPTIONS, OnTrayOptions) | 168 | ON_COMMAND(ID_TRAY_OPTIONS, OnTrayOptions) |
169 | ON_COMMAND(ID_TRAY_SENDFILE, OnTraySendfile) | 169 | ON_COMMAND(ID_TRAY_SENDFILE, OnTraySendfile) |
170 | ON_WM_WINDOWPOSCHANGING() | 170 | ON_WM_WINDOWPOSCHANGING() |
171 | ON_LBN_SELCHANGE(IDC_LOG, OnSelchangeLog) | 171 | ON_LBN_SELCHANGE(IDC_LOG, OnSelchangeLog) |
172 | ON_COMMAND(ID_TRAY_OPENFILESFOLDER, OnTrayOpenfilesfolder) | 172 | ON_COMMAND(ID_TRAY_OPENFILESFOLDER, OnTrayOpenfilesfolder) |
173 | ON_WM_DROPFILES() | 173 | ON_WM_DROPFILES() |
174 | ON_BN_CLICKED(ID_HELP, OnHelp) | 174 | ON_BN_CLICKED(ID_HELP, OnHelp) |
175 | ON_BN_CLICKED(IDC_LISTENING, OnListening) | 175 | ON_BN_CLICKED(IDC_LISTENING, OnListening) |
176 | ON_WM_GETMINMAXINFO() | 176 | ON_WM_GETMINMAXINFO() |
177 | ON_WM_SIZE() | 177 | ON_WM_SIZE() |
178 | //}}AFX_MSG_MAP | 178 | //}}AFX_MSG_MAP |
179 | END_MESSAGE_MAP() | 179 | END_MESSAGE_MAP() |
180 | 180 | ||
181 | ///////////////////////////////////////////////////////////////////////////// | 181 | ///////////////////////////////////////////////////////////////////////////// |
182 | // CPumpKINDlg message handlers | 182 | // CPumpKINDlg message handlers |
183 | 183 | ||
184 | BOOL CPumpKINDlg::OnInitDialog() | 184 | BOOL CPumpKINDlg::OnInitDialog() |
185 | { | 185 | { |
186 | CDialog::OnInitDialog(); | 186 | CDialog::OnInitDialog(); |
187 | 187 | ||
188 | // Add "About..." menu item to system menu. | 188 | // Add "About..." menu item to system menu. |
189 | 189 | ||
190 | // IDM_ABOUTBOX must be in the system command range. | 190 | // IDM_ABOUTBOX must be in the system command range. |
191 | ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); | 191 | ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); |
192 | ASSERT(IDM_ABOUTBOX < 0xF000); | 192 | ASSERT(IDM_ABOUTBOX < 0xF000); |
193 | 193 | ||
194 | CMenu* pSysMenu = GetSystemMenu(FALSE); | 194 | CMenu* pSysMenu = GetSystemMenu(FALSE); |
195 | CString strAboutMenu; | 195 | CString strAboutMenu; |
196 | strAboutMenu.LoadString(IDS_ABOUTBOX); | 196 | strAboutMenu.LoadString(IDS_ABOUTBOX); |
197 | if (!strAboutMenu.IsEmpty()) | 197 | if (!strAboutMenu.IsEmpty()) |
198 | { | 198 | { |
199 | pSysMenu->AppendMenu(MF_SEPARATOR); | 199 | pSysMenu->AppendMenu(MF_SEPARATOR); |
200 | pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); | 200 | pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); |
201 | } | 201 | } |
202 | 202 | ||
203 | // Set the icon for this dialog. The framework does this automatically | 203 | // Set the icon for this dialog. The framework does this automatically |
204 | // when the application's main window is not a dialog | 204 | // when the application's main window is not a dialog |
205 | SetIcon(m_hIcon, TRUE); // Set big icon | 205 | SetIcon(m_hIcon, TRUE); // Set big icon |
206 | SetIcon(m_hIcon, FALSE); // Set small icon | 206 | SetIcon(m_hIcon, FALSE); // Set small icon |
207 | 207 | ||
208 | VERIFY(m_Retrier->Create(NULL,"PumpKIN-Retrier",WS_CHILD,CRect(0,0,0,0),this,0)); | 208 | VERIFY(m_Retrier->Create(NULL,"PumpKIN-Retrier",WS_CHILD,CRect(0,0,0,0),this,0)); |
209 | 209 | ||
210 | m_Images.Create(16,16,TRUE,2,1); | 210 | m_Images.Create(16,16,TRUE,2,1); |
211 | m_iRRQ = m_Images.Add(AfxGetApp()->LoadIcon(IDI_RRQ)); | 211 | m_iRRQ = m_Images.Add(AfxGetApp()->LoadIcon(IDI_RRQ)); |
212 | m_iWRQ = m_Images.Add(AfxGetApp()->LoadIcon(IDI_WRQ)); | 212 | m_iWRQ = m_Images.Add(AfxGetApp()->LoadIcon(IDI_WRQ)); |
213 | ASSERT(m_iRRQ>=0); | 213 | ASSERT(m_iRRQ>=0); |
214 | ASSERT(m_iWRQ>=0); | 214 | ASSERT(m_iWRQ>=0); |
215 | m_List.SetImageList(&m_Images,LVSIL_NORMAL); | 215 | m_List.SetImageList(&m_Images,LVSIL_NORMAL); |
216 | m_List.SetImageList(&m_Images,LVSIL_SMALL); | 216 | m_List.SetImageList(&m_Images,LVSIL_SMALL); |
217 | m_List.SetImageList(&m_Images,LVSIL_STATE); | 217 | m_List.SetImageList(&m_Images,LVSIL_STATE); |
218 | m_List.SetTextColor(RGB(255,255,0));// Yellow | 218 | m_List.SetTextColor(RGB(255,255,0));// Yellow |
219 | m_List.SetTextBkColor(RGB(12,167,0));// Green | 219 | m_List.SetTextBkColor(RGB(12,167,0));// Green |
220 | m_List.SetBkColor(RGB(12,167,0));// Green | 220 | m_List.SetBkColor(RGB(12,167,0));// Green |
221 | CRect listrc; | 221 | CRect listrc; |
222 | m_List.GetClientRect(&listrc); | 222 | m_List.GetClientRect(&listrc); |
223 | m_List.InsertColumn(0,"File",LVCFMT_LEFT,listrc.Width()-((listrc.Width()/7)*3+listrc.Width()*2/7),subitemFile); | 223 | m_List.InsertColumn(0,"File",LVCFMT_LEFT,listrc.Width()-((listrc.Width()/7)*3+listrc.Width()*2/7),subitemFile); |
224 | m_List.InsertColumn(1,"type",LVCFMT_CENTER,listrc.Width()/7,subitemType); | 224 | m_List.InsertColumn(1,"type",LVCFMT_CENTER,listrc.Width()/7,subitemType); |
225 | m_List.InsertColumn(2,"peer",LVCFMT_LEFT,listrc.Width()*2/7,subitemPeer); | 225 | m_List.InsertColumn(2,"peer",LVCFMT_LEFT,listrc.Width()*2/7,subitemPeer); |
226 | m_List.InsertColumn(3,"ACK",LVCFMT_RIGHT,listrc.Width()/7,subitemBytes); | 226 | m_List.InsertColumn(3,"ACK",LVCFMT_RIGHT,listrc.Width()/7,subitemBytes); |
227 | m_List.InsertColumn(4,"tsize",LVCFMT_RIGHT,listrc.Width()/7,subitemTSize); | 227 | m_List.InsertColumn(4,"tsize",LVCFMT_RIGHT,listrc.Width()/7,subitemTSize); |
228 | 228 | ||
229 | LogLine(IDS_LOG_START); | 229 | LogLine(IDS_LOG_START); |
230 | 230 | ||
231 | SetupButtons(); | 231 | SetupButtons(); |
232 | 232 | ||
233 | CRect wrci, wrco; | 233 | CRect wrci, wrco; |
234 | GetWindowRect(&wrco); | 234 | GetWindowRect(&wrco); |
235 | GetClientRect(&wrci); | 235 | GetClientRect(&wrci); |
236 | CRect brc; | 236 | CRect brc; |
237 | m_GetCtl.GetWindowRect(&brc); ScreenToClient(&brc); | 237 | m_GetCtl.GetWindowRect(&brc); ScreenToClient(&brc); |
238 | m_rightGapButtons = wrci.right-brc.right; | 238 | m_rightGapButtons = wrci.right-brc.right; |
239 | m_List.GetWindowRect(&brc); ScreenToClient(&brc); | 239 | m_List.GetWindowRect(&brc); ScreenToClient(&brc); |
240 | m_rightGapList = wrci.right-brc.right; | 240 | m_rightGapList = wrci.right-brc.right; |
241 | m_ListenCtl.GetWindowRect(&brc); ScreenToClient(&brc); | 241 | m_ListenCtl.GetWindowRect(&brc); ScreenToClient(&brc); |
242 | m_bottomGapListen = wrci.bottom-brc.bottom; | 242 | m_bottomGapListen = wrci.bottom-brc.bottom; |
243 | m_Log.GetWindowRect(&brc);ScreenToClient(&brc); | 243 | m_Log.GetWindowRect(&brc);ScreenToClient(&brc); |
244 | m_bottomGapLog = wrci.bottom-brc.bottom; | 244 | m_bottomGapLog = wrci.bottom-brc.bottom; |
245 | m_MinSize.cx = wrco.Width(); m_MinSize.cy=wrco.Height(); | 245 | m_MinSize.cx = wrco.Width(); m_MinSize.cy=wrco.Height(); |
246 | 246 | ||
247 | CRect rc, drc; | 247 | CRect rc, drc; |
248 | GetWindowRect(rc); | 248 | GetWindowRect(rc); |
249 | GetDesktopWindow()->GetWindowRect(drc); | 249 | GetDesktopWindow()->GetWindowRect(drc); |
250 | SetWindowPos(NULL,drc.right-6-rc.Width(),6,0,0,SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER); | 250 | SetWindowPos(NULL,drc.right-6-rc.Width(),6,0,0,SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER); |
251 | 251 | ||
252 | if(m_bShown) | 252 | if(m_bShown) |
253 | ShowWindow(SW_SHOW); | 253 | ShowWindow(SW_SHOW); |
254 | else | 254 | else |
255 | ShowWindow(SW_HIDE); | 255 | ShowWindow(SW_HIDE); |
256 | 256 | ||
257 | m_ListenCtl.SetCheck(m_Listener.m_bListen?1:0); | 257 | m_ListenCtl.SetCheck(m_Listener.m_bListen?1:0); |
258 | 258 | ||
259 | // CG: The following block was added by the ToolTips component. | 259 | // CG: The following block was added by the ToolTips component. |
260 | { | 260 | { |
261 | // Create the ToolTip control. | 261 | // Create the ToolTip control. |
262 | m_tooltip.Create(this); | 262 | m_tooltip.Create(this); |
263 | m_tooltip.Activate(TRUE); | 263 | m_tooltip.Activate(TRUE); |
264 | 264 | ||
265 | m_tooltip.AddTool(&m_List,IDC_CONNECTIONS); | 265 | m_tooltip.AddTool(&m_List,IDC_CONNECTIONS); |
266 | m_tooltip.AddTool(GetDlgItem(IDC_PUT),IDC_PUT); | 266 | m_tooltip.AddTool(GetDlgItem(IDC_PUT),IDC_PUT); |
267 | m_tooltip.AddTool(GetDlgItem(IDC_GET),IDC_GET); | 267 | m_tooltip.AddTool(GetDlgItem(IDC_GET),IDC_GET); |
268 | m_tooltip.AddTool(&m_AbortCtl,IDC_ABORT); | 268 | m_tooltip.AddTool(&m_AbortCtl,IDC_ABORT); |
269 | m_tooltip.AddTool(GetDlgItem(IDC_OPTIONS),IDC_OPTIONS); | 269 | m_tooltip.AddTool(GetDlgItem(IDC_OPTIONS),IDC_OPTIONS); |
270 | m_tooltip.AddTool(GetDlgItem(IDC_EXIT),IDC_EXIT); | 270 | m_tooltip.AddTool(GetDlgItem(IDC_EXIT),IDC_EXIT); |
271 | m_tooltip.AddTool(GetDlgItem(ID_HELP),ID_HELP); | 271 | m_tooltip.AddTool(GetDlgItem(ID_HELP),ID_HELP); |
272 | m_tooltip.AddTool(GetDlgItem(IDC_LOG),IDC_LOG); | 272 | m_tooltip.AddTool(GetDlgItem(IDC_LOG),IDC_LOG); |
273 | } | 273 | } |
274 | return TRUE; // return TRUE unless you set the focus to a control | 274 | return TRUE; // return TRUE unless you set the focus to a control |
275 | } | 275 | } |
276 | 276 | ||
277 | void CPumpKINDlg::OnSysCommand(UINT nID, LPARAM lParam) | 277 | void CPumpKINDlg::OnSysCommand(UINT nID, LPARAM lParam) |
278 | { | 278 | { |
279 | if ((nID & 0xFFF0) == IDM_ABOUTBOX) | 279 | if ((nID & 0xFFF0) == IDM_ABOUTBOX) |
280 | { | 280 | { |
281 | CAboutDlg dlgAbout; | 281 | CAboutDlg dlgAbout; |
282 | dlgAbout.DoModal(); | 282 | dlgAbout.DoModal(); |
283 | } | 283 | } |
284 | else | 284 | else |
285 | { | 285 | { |
286 | CDialog::OnSysCommand(nID, lParam); | 286 | CDialog::OnSysCommand(nID, lParam); |
287 | } | 287 | } |
288 | } | 288 | } |
289 | 289 | ||
290 | void CPumpKINDlg::OnDestroy() | 290 | void CPumpKINDlg::OnDestroy() |
291 | { | 291 | { |
292 | SaveSettings(); | 292 | SaveSettings(); |
293 | 293 | ||
294 | NOTIFYICONDATA nid; | 294 | NOTIFYICONDATA nid; |
295 | memset(&nid,0,sizeof(nid)); | 295 | memset(&nid,0,sizeof(nid)); |
296 | nid.cbSize=sizeof(nid); | 296 | nid.cbSize=sizeof(nid); |
297 | nid.hWnd=m_Trayer->m_hWnd; | 297 | nid.hWnd=m_Trayer->m_hWnd; |
298 | nid.uID=IDC_TRAYICON; | 298 | nid.uID=IDC_TRAYICON; |
299 | nid.uFlags=0; | 299 | nid.uFlags=0; |
300 | VERIFY(Shell_NotifyIcon(NIM_DELETE,&nid)); | 300 | VERIFY(Shell_NotifyIcon(NIM_DELETE,&nid)); |
301 | 301 | ||
302 | WinHelp(0L, HELP_QUIT); | 302 | WinHelp(0L, HELP_QUIT); |
303 | CDialog::OnDestroy(); | 303 | CDialog::OnDestroy(); |
304 | POSITION p = m_LogTimes.GetStartPosition(); | 304 | POSITION p = m_LogTimes.GetStartPosition(); |
305 | while(p){ | 305 | while(p){ |
306 | CTime *t,*tt; | 306 | CTime *t,*tt; |
307 | m_LogTimes.GetNextAssoc(p,t,tt); | 307 | m_LogTimes.GetNextAssoc(p,t,tt); |
308 | ASSERT(t && tt && t==tt); | 308 | ASSERT(t && tt && t==tt); |
309 | delete t; | 309 | delete t; |
310 | } | 310 | } |
311 | // *** Abort and cleanup transfers | 311 | // *** Abort and cleanup transfers |
312 | m_LogTimes.RemoveAll(); | 312 | m_LogTimes.RemoveAll(); |
313 | } | 313 | } |
314 | 314 | ||
315 | // If you add a minimize button to your dialog, you will need the code below | 315 | // If you add a minimize button to your dialog, you will need the code below |
316 | // to draw the icon. For MFC applications using the document/view model, | 316 | // to draw the icon. For MFC applications using the document/view model, |
317 | // this is automatically done for you by the framework. | 317 | // this is automatically done for you by the framework. |
318 | 318 | ||
319 | void CPumpKINDlg::OnPaint() | 319 | void CPumpKINDlg::OnPaint() |
320 | { | 320 | { |
321 | if (IsIconic()) | 321 | if (IsIconic()) |
322 | { | 322 | { |
323 | CPaintDC dc(this); // device context for painting | 323 | CPaintDC dc(this); // device context for painting |
324 | 324 | ||
325 | SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); | 325 | SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); |
326 | 326 | ||
327 | // Center icon in client rectangle | 327 | // Center icon in client rectangle |
328 | int cxIcon = GetSystemMetrics(SM_CXICON); | 328 | int cxIcon = GetSystemMetrics(SM_CXICON); |
329 | int cyIcon = GetSystemMetrics(SM_CYICON); | 329 | int cyIcon = GetSystemMetrics(SM_CYICON); |
330 | CRect rect; | 330 | CRect rect; |
331 | GetClientRect(&rect); | 331 | GetClientRect(&rect); |
332 | int x = (rect.Width() - cxIcon + 1) / 2; | 332 | int x = (rect.Width() - cxIcon + 1) / 2; |
333 | int y = (rect.Height() - cyIcon + 1) / 2; | 333 | int y = (rect.Height() - cyIcon + 1) / 2; |
334 | 334 | ||
335 | // Draw the icon | 335 | // Draw the icon |
336 | dc.DrawIcon(x, y, m_hIcon); | 336 | dc.DrawIcon(x, y, m_hIcon); |
337 | } | 337 | } |
338 | else | 338 | else |
339 | { | 339 | { |
340 | CPaintDC pDC(this); | 340 | CPaintDC pDC(this); |
341 | CDC bmpDC; | 341 | CDC bmpDC; |
342 | bmpDC.CreateCompatibleDC(&pDC); | 342 | bmpDC.CreateCompatibleDC(&pDC); |
343 | bmpDC.SelectObject(&m_bmpBack); | 343 | bmpDC.SelectObject(&m_bmpBack); |
344 | CRect rc; | 344 | CRect rc; |
345 | GetClientRect(&rc); | 345 | GetClientRect(&rc); |
346 | for(int x=-m_bitmapBack.bmWidth*2/4;x<rc.Width();x+=m_bitmapBack.bmWidth) | 346 | for(int x=-m_bitmapBack.bmWidth*2/4;x<rc.Width();x+=m_bitmapBack.bmWidth) |
347 | for(int y=-m_bitmapBack.bmHeight*2/4;y<rc.Height();y+=m_bitmapBack.bmHeight) | 347 | for(int y=-m_bitmapBack.bmHeight*2/4;y<rc.Height();y+=m_bitmapBack.bmHeight) |
348 | pDC.BitBlt(x,y,m_bitmapBack.bmWidth,m_bitmapBack.bmHeight,&bmpDC,0,0,SRCCOPY); | 348 | pDC.BitBlt(x,y,m_bitmapBack.bmWidth,m_bitmapBack.bmHeight,&bmpDC,0,0,SRCCOPY); |
349 | bmpDC.DeleteDC(); | 349 | bmpDC.DeleteDC(); |
350 | CDialog::OnPaint(); | 350 | CDialog::OnPaint(); |
351 | } | 351 | } |
352 | } | 352 | } |
353 | 353 | ||
354 | // The system calls this to obtain the cursor to display while the user drags | 354 | // The system calls this to obtain the cursor to display while the user drags |
355 | // the minimized window. | 355 | // the minimized window. |
356 | HCURSOR CPumpKINDlg::OnQueryDragIcon() | 356 | HCURSOR CPumpKINDlg::OnQueryDragIcon() |
357 | { | 357 | { |
358 | return (HCURSOR) m_hIcon; | 358 | return (HCURSOR) m_hIcon; |
359 | } | 359 | } |
360 | 360 | ||
361 | int CPumpKINDlg::OnCreate(LPCREATESTRUCT lpCreateStruct) | 361 | int CPumpKINDlg::OnCreate(LPCREATESTRUCT lpCreateStruct) |
362 | { | 362 | { |
363 | if (CDialog::OnCreate(lpCreateStruct) == -1) | 363 | if (CDialog::OnCreate(lpCreateStruct) == -1) |
364 | return -1; | 364 | return -1; |
365 | 365 | ||
366 | if(!m_Listener.SetListen(m_bListen)) { | 366 | if(!m_Listener.SetListen(m_bListen)) { |
367 | m_bListen=FALSE; | 367 | m_bListen=FALSE; |
368 | TRACE0("Failed to create socket\n"); | 368 | TRACE0("Failed to create socket\n"); |
369 | AfxMessageBox(IDS_BOX_CANTBIND,MB_OK|MB_ICONEXCLAMATION); | 369 | AfxMessageBox(IDS_BOX_CANTBIND,MB_OK|MB_ICONEXCLAMATION); |
370 | } | 370 | } |
371 | 371 | ||
372 | if(!m_Trayer->Create(NULL,"PumpKIN TrayIcon",WS_CHILD,CRect(0,0,0,0),this,0)){ | 372 | if(!m_Trayer->Create(NULL,"PumpKIN TrayIcon",WS_CHILD,CRect(0,0,0,0),this,0)){ |
373 | TRACE0("Failed to create trayer\n"); | 373 | TRACE0("Failed to create trayer\n"); |
374 | return -1; | 374 | return -1; |
375 | } | 375 | } |
376 | 376 | ||
377 | NOTIFYICONDATA nid; | 377 | NOTIFYICONDATA nid; |
378 | memset(&nid,0,sizeof(nid)); | 378 | memset(&nid,0,sizeof(nid)); |
379 | nid.cbSize=sizeof(nid); | 379 | nid.cbSize=sizeof(nid); |
380 | nid.hWnd=m_Trayer->m_hWnd; | 380 | nid.hWnd=m_Trayer->m_hWnd; |
381 | nid.uID=IDC_TRAYICON; | 381 | nid.uID=IDC_TRAYICON; |
382 | nid.uFlags=NIF_MESSAGE|NIF_ICON|NIF_TIP; | 382 | nid.uFlags=NIF_MESSAGE|NIF_ICON|NIF_TIP; |
383 | nid.uCallbackMessage=WM_TRAYICON; | 383 | nid.uCallbackMessage=WM_TRAYICON; |
384 | nid.hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME); | 384 | nid.hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME); |
385 | // *** Load from resource | 385 | // *** Load from resource |
386 | strcpy(nid.szTip,"PumpKIN"); | 386 | strcpy(nid.szTip,"PumpKIN"); |
387 | VERIFY(Shell_NotifyIcon(NIM_ADD,&nid)); | 387 | VERIFY(Shell_NotifyIcon(NIM_ADD,&nid)); |
388 | 388 | ||
389 | return 0; | 389 | return 0; |
390 | } | 390 | } |
391 | 391 | ||
392 | void CListenSocket::OnReceive(int nErrorCode) | 392 | void CListenSocket::OnReceive(int nErrorCode) |
393 | { | 393 | { |
394 | ASSERT(m_Daddy); | 394 | ASSERT(m_Daddy); |
395 | if(nErrorCode){ | 395 | if(nErrorCode){ |
396 | m_Daddy->LogLine(IDS_LOG_LISTENRECEIVEERROR); | 396 | m_Daddy->LogLine(IDS_LOG_LISTENRECEIVEERROR); |
397 | return; | 397 | return; |
398 | } | 398 | } |
399 | DWORD fionread = 0; | 399 | DWORD fionread = 0; |
400 | VERIFY(IOCtl(FIONREAD,&fionread));// *** Do some checking on the value acquired | 400 | VERIFY(IOCtl(FIONREAD,&fionread));// *** Do some checking on the value acquired |
401 | tftp *tftpRQ = tftp::Allocate(fionread); | 401 | tftp *tftpRQ = tftp::Allocate(fionread); |
402 | ASSERT(tftpRQ); | 402 | ASSERT(tftpRQ); |
403 | SOCKADDR_IN sin; | 403 | SOCKADDR_IN sin; |
404 | if(!tftpRQ->Receive(this,fionread,&sin)){ | 404 | if(!tftpRQ->Receive(this,fionread,&sin)){ |
405 | m_Daddy->LogLine(IDS_LOG_LISTENACCEPTERROR); | 405 | m_Daddy->LogLine(IDS_LOG_LISTENACCEPTERROR); |
406 | delete tftpRQ; | 406 | delete tftpRQ; |
407 | return; | 407 | return; |
408 | } | 408 | } |
409 | #ifndefNDEBUG | 409 | #ifndefNDEBUG |
410 | CString tmp; | 410 | CString tmp; |
411 | tmp.Format("%u - %s - %u\n",tftpRQ->Opcode(),inet_ntoa(sin.sin_addr),sin.sin_port); | 411 | tmp.Format("%u - %s - %u\n",tftpRQ->Opcode(),inet_ntoa(sin.sin_addr),sin.sin_port); |
412 | TRACE0(tmp); | 412 | TRACE0(tmp); |
413 | #endif | 413 | #endif |
414 | POSITION p = m_Daddy->m_Xfers.GetStartPosition(); | 414 | POSITION p = m_Daddy->m_Xfers.GetStartPosition(); |
415 | while(p){ | 415 | while(p){ |
416 | SOCKET key; | 416 | SOCKET key; |
417 | CXferSocket *sock; | 417 | CXferSocket *sock; |
418 | m_Daddy->m_Xfers.GetNextAssoc(p,key,sock); | 418 | m_Daddy->m_Xfers.GetNextAssoc(p,key,sock); |
419 | ASSERT(sock); | 419 | ASSERT(sock); |
420 | if(sock->m_Peer.sin_addr.s_addr==sin.sin_addr.s_addr && sock->m_Peer.sin_port==sin.sin_port){ | 420 | if(sock->m_Peer.sin_addr.s_addr==sin.sin_addr.s_addr && sock->m_Peer.sin_port==sin.sin_port){ |
421 | TRACE0("Ignoring request which we are already processing\n"); | 421 | TRACE0("Ignoring request which we are already processing\n"); |
422 | delete tftpRQ; | 422 | delete tftpRQ; |
423 | return; | 423 | return; |
424 | } | 424 | } |
425 | } | 425 | } |
426 | switch(tftpRQ->Opcode()){ | 426 | switch(tftpRQ->Opcode()){ |
427 | case tftp::opRRQ: | 427 | case tftp::opRRQ: |
428 | // Read Request | 428 | // Read Request |
429 | { | 429 | { |
430 | CString tmp; | 430 | CString tmp; |
431 | tmp.Format(IDS_LOG_RRQSERVE,tftpRQ->rqFileName(),tftpRQ->rqType(),inet_ntoa(sin.sin_addr)); | 431 | tmp.Format(IDS_LOG_RRQSERVE,tftpRQ->rqFileName(),tftpRQ->rqType(),inet_ntoa(sin.sin_addr)); |
432 | m_Daddy->LogLine(tmp); | 432 | m_Daddy->LogLine(tmp); |
433 | CRRQSocket *s = new CRRQSocket(m_Daddy,tftpRQ->rqFileName(),tftpRQ->rqType(),&sin); | 433 | CRRQSocket *s = new CRRQSocket(m_Daddy,tftpRQ->rqFileName(),tftpRQ->rqType(),&sin); |
434 | ASSERT(s); | 434 | ASSERT(s); |
435 | tftpRQ->GetOptions(&s->m_Options); | 435 | tftpRQ->GetOptions(&s->m_Options); |
436 | if(!s->Create()) | 436 | if(!s->Create()) |
437 | s->Destroy(FALSE); | 437 | s->Destroy(FALSE); |
438 | } | 438 | } |
439 | break; | 439 | break; |
440 | case tftp::opWRQ: | 440 | case tftp::opWRQ: |
441 | // Write Request | 441 | // Write Request |
442 | { | 442 | { |
443 | CString tmp; | 443 | CString tmp; |
444 | tmp.Format(IDS_LOG_WRQSERVE,tftpRQ->rqFileName(),tftpRQ->rqType(),inet_ntoa(sin.sin_addr)); | 444 | tmp.Format(IDS_LOG_WRQSERVE,tftpRQ->rqFileName(),tftpRQ->rqType(),inet_ntoa(sin.sin_addr)); |
445 | m_Daddy->LogLine(tmp); | 445 | m_Daddy->LogLine(tmp); |
446 | CWRQSocket *s = new CWRQSocket(m_Daddy,tftpRQ->rqFileName(),tftpRQ->rqType(),&sin); | 446 | CWRQSocket *s = new CWRQSocket(m_Daddy,tftpRQ->rqFileName(),tftpRQ->rqType(),&sin); |
447 | ASSERT(s); | 447 | ASSERT(s); |
448 | tftpRQ->GetOptions(&s->m_Options); | 448 | tftpRQ->GetOptions(&s->m_Options); |
449 | if(!s->Create(NULL,NULL)) | 449 | if(!s->Create(NULL,NULL)) |
450 | s->Destroy(FALSE); | 450 | s->Destroy(FALSE); |
451 | } | 451 | } |
452 | break; | 452 | break; |
453 | default: | 453 | default: |
454 | m_Daddy->LogLine(IDS_LOG_LISTENOPCODE); | 454 | m_Daddy->LogLine(IDS_LOG_LISTENOPCODE); |
455 | delete tftpRQ; | 455 | delete tftpRQ; |
456 | return; | 456 | return; |
457 | } | 457 | } |
458 | delete tftpRQ; | 458 | delete tftpRQ; |
459 | } | 459 | } |
460 | 460 | ||
461 | BOOL tftp::Receive(CAsyncSocket* socket,UINT maxLength,SOCKADDR_IN *sin) | 461 | BOOL tftp::Receive(CAsyncSocket* socket,UINT maxLength,SOCKADDR_IN *sin) |
462 | { | 462 | { |
463 | ASSERT(socket); | 463 | ASSERT(socket); |
464 | int saddrLen = sizeof(SOCKADDR_IN); | 464 | int saddrLen = sizeof(SOCKADDR_IN); |
465 | length = sin ? | 465 | length = sin ? |
466 | socket->ReceiveFrom(udpBase(),maxLength,(SOCKADDR*)sin,&saddrLen) | 466 | socket->ReceiveFrom(udpBase(),maxLength,(SOCKADDR*)sin,&saddrLen) |
467 | : | 467 | : |
468 | socket->Receive(udpBase(),maxLength) | 468 | socket->Receive(udpBase(),maxLength) |
469 | ; | 469 | ; |
470 | if(!length) | 470 | if(!length) |
471 | return FALSE; | 471 | return FALSE; |
472 | if(length==(tftpLength)SOCKET_ERROR) | 472 | if(length==(tftpLength)SOCKET_ERROR) |
473 | return FALSE; | 473 | return FALSE; |
474 | return TRUE; | 474 | return TRUE; |
475 | } | 475 | } |
476 | 476 | ||
477 | UINT tftp::Opcode() | 477 | UINT tftp::Opcode() |
478 | { | 478 | { |
479 | return REVERSEBYTES(opcode); | 479 | return REVERSEBYTES(opcode); |
480 | } | 480 | } |
481 | 481 | ||
482 | CString tftp::rqFileName() | 482 | CString tftp::rqFileName() |
483 | { | 483 | { |
484 | ASSERT(length); | 484 | ASSERT(length); |
485 | ASSERT(Opcode()==opRRQ || Opcode()==opWRQ); | 485 | ASSERT(Opcode()==opRRQ || Opcode()==opWRQ); |
486 | CString rv; | 486 | CString rv; |
487 | if(memchr(&data.m_RQ.data,0,length-sizeof(opcode))) | 487 | if(memchr(&data.m_RQ.data,0,length-sizeof(opcode))) |
488 | rv = (LPCTSTR)data.m_RQ.data; | 488 | rv = (LPCTSTR)data.m_RQ.data; |
489 | return rv; | 489 | return rv; |
490 | } | 490 | } |
491 | 491 | ||
492 | CString tftp::rqType() | 492 | CString tftp::rqType() |
493 | { | 493 | { |
494 | ASSERT(length); | 494 | ASSERT(length); |
495 | ASSERT(Opcode()==opRRQ || Opcode()==opWRQ); | 495 | ASSERT(Opcode()==opRRQ || Opcode()==opWRQ); |
496 | CString rv; | 496 | CString rv; |
497 | char *tmp = (char*)memchr(&data.m_RQ.data,0,length-sizeof(opcode)); | 497 | char *tmp = (char*)memchr(&data.m_RQ.data,0,length-sizeof(opcode)); |
498 | if(tmp++) | 498 | if(tmp++) |
499 | rv = (LPCTSTR)tmp; | 499 | rv = (LPCTSTR)tmp; |
500 | return rv; | 500 | return rv; |
501 | } | 501 | } |
502 | 502 | ||
503 | UINT tftp::GetOptions(tftp::tftpOptions* ops) | 503 | UINT tftp::GetOptions(tftp::tftpOptions* ops) |
504 | { | 504 | { |
505 | ASSERT(length); | 505 | ASSERT(length); |
506 | ASSERT(Opcode()==opRRQ || Opcode()==opWRQ || Opcode()==opOACK); | 506 | ASSERT(Opcode()==opRRQ || Opcode()==opWRQ || Opcode()==opOACK); |
507 | ASSERT(ops); | 507 | ASSERT(ops); |
508 | tftpOptions& o = *ops; | 508 | tftpOptions& o = *ops; |
509 | LPSTR base = (LPSTR)&data.m_RQ.data; | 509 | LPSTR base = (LPSTR)&data.m_RQ.data; |
510 | UINT basePtr = 0; | 510 | UINT basePtr = 0; |
511 | if(Opcode()==opRRQ || Opcode()==opWRQ){ | 511 | if(Opcode()==opRRQ || Opcode()==opWRQ){ |
512 | base = (LPSTR)memchr(&data.m_RQ.data,0,length-sizeof(opcode)); | 512 | base = (LPSTR)memchr(&data.m_RQ.data,0,length-sizeof(opcode)); |
513 | if(!base) | 513 | if(!base) |
514 | return 0; | 514 | return 0; |
515 | base++; | 515 | base++; |
516 | basePtr = (base-(LPSTR)&data.m_RQ.data); | 516 | basePtr = (base-(LPSTR)&data.m_RQ.data); |
517 | base = (LPSTR)memchr(base,0,length-basePtr); | 517 | base = (LPSTR)memchr(base,0,length-basePtr); |
518 | if(!base) | 518 | if(!base) |
519 | return 0; | 519 | return 0; |
520 | base++; | 520 | base++; |
521 | basePtr = (base-(LPSTR)&data.m_RQ.data); | 521 | basePtr = (base-(LPSTR)&data.m_RQ.data); |
522 | } | 522 | } |
523 | ops->RemoveAll(); | 523 | ops->RemoveAll(); |
524 | UINT rv = 0; | 524 | UINT rv = 0; |
525 | while(basePtr<(length-sizeof(opcode))){ | 525 | while(basePtr<(length-sizeof(opcode))){ |
526 | CString onam = (LPSTR)&data.m_RQ.data[basePtr]; | 526 | CString onam = (LPSTR)&data.m_RQ.data[basePtr]; |
527 | basePtr+=onam.GetLength()+1; | 527 | basePtr+=onam.GetLength()+1; |
528 | CString oval = (LPSTR)&data.m_RQ.data[basePtr]; | 528 | CString oval = (LPSTR)&data.m_RQ.data[basePtr]; |
529 | basePtr+=oval.GetLength()+1; | 529 | basePtr+=oval.GetLength()+1; |
530 | onam.MakeLower(); | 530 | onam.MakeLower(); |
531 | o[onam]=oval; | 531 | o[onam]=oval; |
532 | rv++; | 532 | rv++; |
533 | } | 533 | } |
534 | return rv; | 534 | return rv; |
535 | } | 535 | } |
536 | 536 | ||
537 | tftp::tftp() | 537 | tftp::tftp() |
538 | { | 538 | { |
539 | length=0; | 539 | length=0; |
540 | } | 540 | } |
541 | 541 | ||
542 | 542 | ||
543 | void CXferSocket::OnSend(int nErrorCode) | 543 | void CXferSocket::OnSend(int nErrorCode) |
544 | { | 544 | { |
545 | if(nErrorCode){ | 545 | if(nErrorCode){ |
546 | ASSERT(m_Daddy); | 546 | ASSERT(m_Daddy); |
547 | m_Daddy->LogLine(IDS_LOG_XFERSEND); | 547 | m_Daddy->LogLine(IDS_LOG_XFERSEND); |
548 | return; | 548 | return; |
549 | } | 549 | } |
550 | if(!m_Queue.IsEmpty()){ | 550 | if(!m_Queue.IsEmpty()){ |
551 | tftp *p = m_Queue.GetHead(); | 551 | tftp *p = m_Queue.GetHead(); |
552 | ASSERT(p); | 552 | ASSERT(p); |
553 | m_Queue.RemoveHead(); | 553 | m_Queue.RemoveHead(); |
554 | if(!p->Send(this,&m_Peer)){ | 554 | if(!p->Send(this,&m_Peer)){ |
555 | ASSERT(m_Daddy); | 555 | ASSERT(m_Daddy); |
556 | m_Daddy->LogLine(IDS_LOG_XFERUDPSEND); | 556 | m_Daddy->LogLine(IDS_LOG_XFERUDPSEND); |
557 | } | 557 | } |
558 | delete p; | 558 | delete p; |
559 | } | 559 | } |
560 | DoSelect(); | 560 | DoSelect(); |
561 | if(m_Queue.IsEmpty()){ | 561 | if(m_Queue.IsEmpty()){ |
562 | switch(state){ | 562 | switch(state){ |
563 | case stateDeny: | 563 | case stateDeny: |
564 | Destroy(FALSE); | 564 | Destroy(FALSE); |
565 | break; | 565 | break; |
566 | case stateFinish: | 566 | case stateFinish: |
567 | Destroy(TRUE); | 567 | Destroy(TRUE); |
568 | break; | 568 | break; |
569 | } | 569 | } |
570 | } | 570 | } |
571 | } | 571 | } |
572 | 572 | ||
573 | BOOL tftp::Send(CAsyncSocket *socket,SOCKADDR_IN* saddr) | 573 | BOOL tftp::Send(CAsyncSocket *socket,SOCKADDR_IN* saddr) |
574 | { | 574 | { |
575 | ASSERT(socket); | 575 | ASSERT(socket); |
576 | int rv = socket->SendTo(udpBase(),length,(SOCKADDR*)saddr,sizeof(SOCKADDR_IN)); | 576 | int rv = socket->SendTo(udpBase(),length,(SOCKADDR*)saddr,sizeof(SOCKADDR_IN)); |
577 | if(rv!=length) | 577 | if(rv!=length) |
578 | return FALSE; | 578 | return FALSE; |
579 | return TRUE; | 579 | return TRUE; |
580 | } | 580 | } |
581 | 581 | ||
582 | void CXferSocket::DoSelect(BOOL do_select) | 582 | void CXferSocket::DoSelect(BOOL do_select) |
583 | { | 583 | { |
584 | if(m_Peer.sin_addr.s_addr!=INADDR_NONE) | 584 | if(m_Peer.sin_addr.s_addr!=INADDR_NONE) |
585 | AsyncSelect(FD_CLOSE|FD_READ|((m_Queue.IsEmpty()&&!do_select)?0:FD_WRITE)); | 585 | AsyncSelect(FD_CLOSE|FD_READ|((m_Queue.IsEmpty()&&!do_select)?0:FD_WRITE)); |
586 | } | 586 | } |
587 | 587 | ||
588 | void CXferSocket::OnReceive(int nErrorCode) | 588 | void CXferSocket::OnReceive(int nErrorCode) |
589 | { | 589 | { |
590 | if(nErrorCode){ | 590 | if(nErrorCode){ |
591 | ASSERT(m_Daddy); | 591 | ASSERT(m_Daddy); |
592 | m_Daddy->LogLine(IDS_LOG_XFERRECEIVE); | 592 | m_Daddy->LogLine(IDS_LOG_XFERRECEIVE); |
593 | return; | 593 | return; |
594 | } | 594 | } |
595 | ASSERT(m_Daddy); | 595 | ASSERT(m_Daddy); |
596 | DWORD fionread = 0; | 596 | DWORD fionread = 0; |
597 | VERIFY(IOCtl(FIONREAD,&fionread)); | 597 | VERIFY(IOCtl(FIONREAD,&fionread)); |
598 | tftp *p = tftp::Allocate(fionread); | 598 | tftp *p = tftp::Allocate(fionread); |
599 | ASSERT(p); | 599 | ASSERT(p); |
600 | SOCKADDR_IN sin; | 600 | SOCKADDR_IN sin; |
601 | if(!p->Receive(this,fionread,&sin)){ | 601 | if(!p->Receive(this,fionread,&sin)){ |
602 | m_Daddy->LogLine(IDS_LOG_XFERUDPRECEIVE); | 602 | m_Daddy->LogLine(IDS_LOG_XFERUDPRECEIVE); |
603 | delete p; | 603 | delete p; |
604 | }else | 604 | }else |
605 | if(m_Peer.sin_addr.s_addr==INADDR_NONE){ | 605 | if(m_Peer.sin_addr.s_addr==INADDR_NONE){ |
606 | m_Peer.sin_addr=sin.sin_addr; | 606 | m_Peer.sin_addr=sin.sin_addr; |
607 | m_Peer.sin_port=sin.sin_port; | 607 | m_Peer.sin_port=sin.sin_port; |
608 | } | 608 | } |
609 | BOOL alive = TRUE; | 609 | BOOL alive = TRUE; |
610 | if(state==stateInit){ | 610 | if(state==stateInit){ |
611 | state=stateXfer; | 611 | state=stateXfer; |
612 | m_Peer.sin_port=sin.sin_port; | 612 | m_Peer.sin_port=sin.sin_port; |
613 | UpdateList(); | 613 | UpdateList(); |
614 | } | 614 | } |
615 | if(sin.sin_addr.s_addr!=m_Peer.sin_addr.s_addr || sin.sin_port!=m_Peer.sin_port){ | 615 | if(sin.sin_addr.s_addr!=m_Peer.sin_addr.s_addr || sin.sin_port!=m_Peer.sin_port){ |
616 | m_Daddy->LogLine(IDS_LOG_XFERSOURCETID); | 616 | m_Daddy->LogLine(IDS_LOG_XFERSOURCETID); |
617 | // *** Bounce it! | 617 | // *** Bounce it! |
618 | }else{ | 618 | }else{ |
619 | alive = OnTFTP(p); | 619 | alive = OnTFTP(p); |
620 | } | 620 | } |
621 | delete p; | 621 | delete p; |
622 | if(alive){ | 622 | if(alive){ |
623 | DoSelect(); | 623 | DoSelect(); |
624 | ResetTimeout(); | 624 | ResetTimeout(); |
625 | } | 625 | } |
626 | } | 626 | } |
627 | 627 | ||
628 | void CXferSocket::SetPeer(SOCKADDR_IN *sin) | 628 | void CXferSocket::SetPeer(SOCKADDR_IN *sin) |
629 | { | 629 | { |
630 | ASSERT(sin); | 630 | ASSERT(sin); |
631 | memmove(&m_Peer,sin,sizeof(m_Peer)); | 631 | memmove(&m_Peer,sin,sizeof(m_Peer)); |
632 | } | 632 | } |
633 | 633 | ||
634 | void CXferSocket::UpdateList() | 634 | void CXferSocket::UpdateList() |
635 | { | 635 | { |
636 | ASSERT(m_Daddy); | 636 | ASSERT(m_Daddy); |
637 | LV_FINDINFO lvf; | 637 | LV_FINDINFO lvf; |
638 | memset(&lvf,0,sizeof(lvf)); | 638 | memset(&lvf,0,sizeof(lvf)); |
639 | lvf.flags=LVFI_PARAM; | 639 | lvf.flags=LVFI_PARAM; |
640 | lvf.lParam=(LPARAM)this; | 640 | lvf.lParam=(LPARAM)this; |
641 | int i = m_Daddy->m_List.FindItem(&lvf); | 641 | int i = m_Daddy->m_List.FindItem(&lvf); |
642 | if(i<0){ | 642 | if(i<0){ |
643 | ASSERT(IsKindOf(RUNTIME_CLASS(CRRQSocket)) || IsKindOf(RUNTIME_CLASS(CWRQSocket))); | 643 | ASSERT(IsKindOf(RUNTIME_CLASS(CRRQSocket)) || IsKindOf(RUNTIME_CLASS(CWRQSocket))); |
644 | i=m_Daddy->m_List.InsertItem(0,m_FileName,IsKindOf(RUNTIME_CLASS(CRRQSocket))?m_Daddy->m_iRRQ:m_Daddy->m_iWRQ); | 644 | i=m_Daddy->m_List.InsertItem(0,m_FileName,IsKindOf(RUNTIME_CLASS(CRRQSocket))?m_Daddy->m_iRRQ:m_Daddy->m_iWRQ); |
645 | ASSERT(!(i<0)); | 645 | ASSERT(!(i<0)); |
646 | m_Daddy->m_List.SetItemData(i,(DWORD)this); | 646 | m_Daddy->m_List.SetItemData(i,(DWORD)this); |
647 | } | 647 | } |
648 | m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemFile,m_FileName); | 648 | m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemFile,m_FileName); |
649 | m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemType,m_Type); | 649 | m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemType,m_Type); |
650 | m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemPeer,inet_ntoa(m_Peer.sin_addr)); | 650 | m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemPeer,inet_ntoa(m_Peer.sin_addr)); |
651 | CString tmp; | 651 | CString tmp; |
652 | tmp.Format(IDS_FMT_BYTES,GetACK()); | 652 | tmp.Format(IDS_FMT_BYTES,GetACK()); |
653 | m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemBytes,tmp); | 653 | m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemBytes,tmp); |
654 | if(m_xferSize>=0){ | 654 | if(m_xferSize>=0){ |
655 | tmp.Format(IDS_FMT_BYTES,m_xferSize); | 655 | tmp.Format(IDS_FMT_BYTES,m_xferSize); |
656 | m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemTSize,tmp); | 656 | m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemTSize,tmp); |
657 | } | 657 | } |
658 | } | 658 | } |
659 | 659 | ||
660 | CXferSocket::CXferSocket() | 660 | CXferSocket::CXferSocket() |
661 | : m_wndResolver(NULL), m_Retry(NULL), m_bRetry(FALSE), | 661 | : m_wndResolver(NULL), m_Retry(NULL), m_bRetry(FALSE), |
662 | m_blkSize(512), m_timeOut(30), m_xferSize(-1), | 662 | m_blkSize(512), m_timeOut(30), m_xferSize(-1), |
663 | m__blkSize(512), m__timeOut(30) | 663 | m__blkSize(512), m__timeOut(30) |
664 | { | 664 | { |
665 | m_Daddy=NULL; | 665 | m_Daddy=NULL; |
666 | m_Peer.sin_addr.s_addr=INADDR_NONE; | 666 | m_Peer.sin_addr.s_addr=INADDR_NONE; |
667 | m_Peer.sin_family=AF_INET; | 667 | m_Peer.sin_family=AF_INET; |
668 | state=stateNone; | 668 | state=stateNone; |
669 | } | 669 | } |
670 | 670 | ||
671 | ULONG CXferSocket::GetACK() | 671 | ULONG CXferSocket::GetACK() |
672 | { | 672 | { |
673 | return 0; | 673 | return 0; |
674 | } | 674 | } |
675 | 675 | ||
676 | CXferSocket::CXferSocket(CPumpKINDlg *daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN* sin) | 676 | CXferSocket::CXferSocket(CPumpKINDlg *daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN* sin) |
677 | : m_wndResolver(NULL), m_Retry(NULL), m_bRetry(FALSE), | 677 | : m_wndResolver(NULL), m_Retry(NULL), m_bRetry(FALSE), |
678 | m_blkSize(512), m_timeOut(30), m_xferSize(-1), | 678 | m_blkSize(512), m_timeOut(30), m_xferSize(-1), |
679 | m__blkSize(512), m__timeOut(30) | 679 | m__blkSize(512), m__timeOut(30) |
680 | { | 680 | { |
681 | m_Peer.sin_family=AF_INET; | 681 | m_Peer.sin_family=AF_INET; |
682 | state=stateNone; | 682 | state=stateNone; |
683 | ASSERT(daddy); | 683 | ASSERT(daddy); |
684 | m_Daddy=daddy; | 684 | m_Daddy=daddy; |
685 | m_timeOut=m__timeOut=m_Daddy->m_TFTPTimeOut.GetTotalSeconds(); | 685 | m_timeOut=m__timeOut=m_Daddy->m_TFTPTimeOut.GetTotalSeconds(); |
686 | if(sin){ | 686 | if(sin){ |
687 | m_Peer.sin_addr.s_addr=sin->sin_addr.s_addr; | 687 | m_Peer.sin_addr.s_addr=sin->sin_addr.s_addr; |
688 | m_Peer.sin_port=sin->sin_port; | 688 | m_Peer.sin_port=sin->sin_port; |
689 | }else | 689 | }else |
690 | m_Peer.sin_addr.s_addr=INADDR_NONE; | 690 | m_Peer.sin_addr.s_addr=INADDR_NONE; |
691 | m_FileName=fileName; | 691 | m_FileName=fileName; |
692 | m_Type=type; | 692 | m_Type=type; |
693 | } | 693 | } |
694 | 694 | ||
695 | BOOL CRRQSocket::Create(LPCTSTR localFile,LPCTSTR hostName) | 695 | BOOL CRRQSocket::Create(LPCTSTR localFile,LPCTSTR hostName) |
696 | { | 696 | { |
697 | if(!CAsyncSocket::Create(0,SOCK_DGRAM)) | 697 | if(!CAsyncSocket::Create(0,SOCK_DGRAM)) |
698 | return FALSE; | 698 | return FALSE; |
699 | ASSERT(m_Daddy); | 699 | ASSERT(m_Daddy); |
700 | ASSERT(m_Peer.sin_addr.s_addr!=INADDR_NONE || hostName); | 700 | ASSERT(m_Peer.sin_addr.s_addr!=INADDR_NONE || hostName); |
701 | m_Daddy->m_Xfers[m_hSocket]=this; | 701 | m_Daddy->m_Xfers[m_hSocket]=this; |
702 | CString lFile = localFile?localFile:m_FileName; | 702 | CString lFile = localFile?localFile:m_FileName; |
703 | TurnSlashes(lFile,TRUE); | 703 | TurnSlashes(lFile,TRUE); |
704 | UpdateList(); | 704 | UpdateList(); |
705 | if(!localFile){// Check only for incoming requests | 705 | if(!localFile){// Check only for incoming requests |
706 | if(CheckBadRelativeness(m_FileName)){ | 706 | if(CheckBadRelativeness(m_FileName)){ |
707 | Deny(tftp::errAccessViolation,IDS_TFTP_ERROR_ACCESS); | 707 | Deny(tftp::errAccessViolation,IDS_TFTP_ERROR_ACCESS); |
708 | return TRUE; | 708 | return TRUE; |
709 | } | 709 | } |
710 | int atar=m_Daddy->m_aclRules.FindTarget(acl_rule::opRRQ,m_Peer.sin_addr.s_addr); | 710 | int atar=m_Daddy->m_aclRules.FindTarget(acl_rule::opRRQ,m_Peer.sin_addr.s_addr); |
711 | if(atar<0) | 711 | if(atar<0) |
712 | atar = m_Daddy->m_RRQMode; | 712 | atar = m_Daddy->m_RRQMode; |
713 | switch(atar){ | 713 | switch(atar){ |
714 | case CPumpKINDlg::rrqGiveAll: | 714 | case CPumpKINDlg::rrqGiveAll: |
715 | break; | 715 | break; |
716 | case CPumpKINDlg::rrqAlwaysConfirm: | 716 | case CPumpKINDlg::rrqAlwaysConfirm: |
717 | if(ConfirmRequest()) | 717 | if(ConfirmRequest()) |
718 | break; | 718 | break; |
719 | default: | 719 | default: |
720 | TRACE1("Unexpected access target: %d\n",atar); | 720 | TRACE1("Unexpected access target: %d\n",atar); |
721 | case CPumpKINDlg::rrqDenyAll: | 721 | case CPumpKINDlg::rrqDenyAll: |
722 | Deny(tftp::errAccessViolation,IDS_TFTP_ERROR_ACCESS); | 722 | Deny(tftp::errAccessViolation,IDS_TFTP_ERROR_ACCESS); |
723 | return TRUE; | 723 | return TRUE; |
724 | } | 724 | } |
725 | } | 725 | } |
726 | CString fn = localFile?ApplyRootGently(lFile):ApplyRoot(lFile); | 726 | CString fn = localFile?ApplyRootGently(lFile):ApplyRoot(lFile); |
727 | CFileException e; | 727 | CFileException e; |
728 | if(!m_File.Open(fn,CFile::modeRead|CFile::shareDenyWrite,&e)){ | 728 | if(!m_File.Open(fn,CFile::modeRead|CFile::shareDenyWrite,&e)){ |
729 | if(localFile){ | 729 | if(localFile){ |
730 | CString tmp; | 730 | CString tmp; |
731 | tmp.Format(IDS_LOG_FAILEDLOCALFILE,fn); | 731 | tmp.Format(IDS_LOG_FAILEDLOCALFILE,fn); |
732 | m_Daddy->LogLine(tmp); | 732 | m_Daddy->LogLine(tmp); |
733 | return FALSE; | 733 | return FALSE; |
734 | } | 734 | } |
735 | Deny(&e); | 735 | Deny(&e); |
736 | return TRUE; | 736 | return TRUE; |
737 | } | 737 | } |
738 | m_xferSize=m_File.GetLength();// *** HANDLE EXCEPTION | 738 | m_xferSize=m_File.GetLength();// *** HANDLE EXCEPTION |
739 | if(hostName){ | 739 | if(hostName){ |
740 | m_HostName=hostName; | 740 | m_HostName=hostName; |
741 | 741 | ||
742 | CString tmp; | 742 | CString tmp; |
743 | tmp.Format(IDS_LOG_SENDING,m_FileName,m_HostName); | 743 | tmp.Format(IDS_LOG_SENDING,m_FileName,m_HostName); |
744 | m_Daddy->LogLine(tmp); | 744 | m_Daddy->LogLine(tmp); |
745 | 745 | ||
746 | CString inAddr = hostName; | 746 | CString inAddr = hostName; |
747 | int at = inAddr.Find('@'); | 747 | int at = inAddr.Find('@'); |
748 | if(at>=0) | 748 | if(at>=0) |
749 | inAddr=inAddr.Mid(at+1); | 749 | inAddr=inAddr.Mid(at+1); |
750 | if((m_Peer.sin_addr.s_addr=inet_addr((LPCTSTR)inAddr))==INADDR_NONE){ | 750 | if((m_Peer.sin_addr.s_addr=inet_addr((LPCTSTR)inAddr))==INADDR_NONE){ |
751 | ASSERT(!m_wndResolver); | 751 | ASSERT(!m_wndResolver); |
752 | m_wndResolver = new CResolver(this); | 752 | m_wndResolver = new CResolver(this); |
753 | ASSERT(m_wndResolver); | 753 | ASSERT(m_wndResolver); |
754 | return m_wndResolver->Resolve(); | 754 | return m_wndResolver->Resolve(); |
755 | } | 755 | } |
756 | else | 756 | else |
757 | OnHostKnown(); | 757 | OnHostKnown(); |
758 | }else{ | 758 | }else{ |
759 | tftp::tftpOptions o; | 759 | tftp::tftpOptions o; |
760 | CString v; | 760 | CString v; |
761 | if(m_Options.Lookup(tftpoBSize,v)){ | 761 | if(m_Options.Lookup(tftpoBSize,v)){ |
762 | m__blkSize=atoi(v); | 762 | m__blkSize=atoi(v); |
763 | if(m__blkSize){ | 763 | if(m__blkSize){ |
764 | m_blkSize=m__blkSize; | 764 | m_blkSize=m__blkSize; |
765 | v.Format("%u",m_blkSize); | 765 | v.Format("%u",m_blkSize); |
766 | o[tftpoBSize]=v; | 766 | o[tftpoBSize]=v; |
767 | } | 767 | } |
768 | } | 768 | } |
769 | if(m_Options.Lookup(tftpoTSize,v)){ | 769 | if(m_Options.Lookup(tftpoTSize,v)){ |
770 | v.Format("%lu",m_xferSize); | 770 | v.Format("%lu",m_xferSize); |
771 | o[tftpoTSize]=v; | 771 | o[tftpoTSize]=v; |
772 | } | 772 | } |
773 | if(m_Options.Lookup(tftpoTOut,v)){ | 773 | if(m_Options.Lookup(tftpoTOut,v)){ |
774 | m__timeOut=atoi(v); | 774 | m__timeOut=atoi(v); |
775 | if(m__timeOut){ | 775 | if(m__timeOut){ |
776 | m_timeOut=m__timeOut; | 776 | m_timeOut=m__timeOut; |
777 | v.Format("%u",m_timeOut); | 777 | v.Format("%u",m_timeOut); |
778 | o[tftpoTOut]=v; | 778 | o[tftpoTOut]=v; |
779 | } | 779 | } |
780 | } | 780 | } |
781 | // XXX: see if we can enforce our preference regarding block size here. | ||
782 | if(m_xferSize >= (m_blkSize<<16)) { | ||
783 | Deny(tftp::errUndefined,IDS_TFTP_ERROR_TOOBIG); | ||
784 | return TRUE; | ||
785 | } | ||
781 | state = stateXfer; | 786 | state = stateXfer; |
782 | m_ACK=0; | 787 | m_ACK=0; |
783 | if(o.GetCount()){ | 788 | if(o.GetCount()){ |
784 | tftp *p = tftp::Allocate(tftp::tftpOACK::tftpSize(&o)); | 789 | tftp *p = tftp::Allocate(tftp::tftpOACK::tftpSize(&o)); |
785 | ASSERT(p); | 790 | ASSERT(p); |
786 | p->SetOpcode(tftp::opOACK); | 791 | p->SetOpcode(tftp::opOACK); |
787 | p->data.m_OACK.Set(&o); | 792 | p->data.m_OACK.Set(&o); |
788 | PostTFTP(p,TRUE); | 793 | PostTFTP(p,TRUE); |
789 | }else | 794 | }else |
790 | DoXfer(); | 795 | DoXfer(); |
791 | } | 796 | } |
792 | return TRUE; | 797 | return TRUE; |
793 | } | 798 | } |
794 | 799 | ||
795 | CRRQSocket::CRRQSocket(CPumpKINDlg *daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN *sin) | 800 | CRRQSocket::CRRQSocket(CPumpKINDlg *daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN *sin) |
796 | : CXferSocket(daddy,fileName,type,sin) | 801 | : CXferSocket(daddy,fileName,type,sin) |
797 | { | 802 | { |
798 | m_ACK=0; | 803 | m_ACK=0; |
799 | m_LastSlack=0; | 804 | m_LastSlack=0; |
800 | } | 805 | } |
801 | 806 | ||
802 | UINT tftp::tftpERROR::tftpSize(LPCTSTR msg) | 807 | UINT tftp::tftpERROR::tftpSize(LPCTSTR msg) |
803 | { | 808 | { |
804 | return tftpHdrSize-tftpSlackSize+sizeof(tftp::tftpERROR::tftpErrorCode)+strlen(msg)+1; | 809 | return tftpHdrSize-tftpSlackSize+sizeof(tftp::tftpERROR::tftpErrorCode)+strlen(msg)+1; |
805 | } | 810 | } |
806 | 811 | ||
807 | tftp* tftp::Allocate(UINT tftpSize) | 812 | tftp* tftp::Allocate(UINT tftpSize) |
808 | { | 813 | { |
809 | ASSERT(tftpSize); | 814 | ASSERT(tftpSize); |
810 | tftp* rv = (tftp*) new BYTE[tftpSlackSize+tftpSize]; | 815 | tftp* rv = (tftp*) new BYTE[tftpSlackSize+tftpSize]; |
811 | ASSERT(rv); | 816 | ASSERT(rv); |
812 | rv->length=tftpSize; | 817 | rv->length=tftpSize; |
813 | return rv; | 818 | return rv; |
814 | } | 819 | } |
815 | 820 | ||
816 | void tftp::errSet(UINT code,LPCTSTR msg) | 821 | void tftp::errSet(UINT code,LPCTSTR msg) |
817 | { | 822 | { |
818 | ASSERT(this); | 823 | ASSERT(this); |
819 | ASSERT(length>=data.m_ERROR.tftpSize(msg)); | 824 | ASSERT(length>=data.m_ERROR.tftpSize(msg)); |
820 | strcpy((char*)data.m_ERROR.data,msg); | 825 | strcpy((char*)data.m_ERROR.data,msg); |
821 | data.m_ERROR.SetCode(code); | 826 | data.m_ERROR.SetCode(code); |
822 | } | 827 | } |
823 | 828 | ||
824 | void CXferSocket::PostTFTP(tftp* p,BOOL retryable) | 829 | void CXferSocket::PostTFTP(tftp* p,BOOL retryable) |
825 | { | 830 | { |
826 | ASSERT(p); | 831 | ASSERT(p); |
827 | m_Queue.AddTail(p); | 832 | m_Queue.AddTail(p); |
828 | DoSelect(); | 833 | DoSelect(); |
829 | if(!m_bRetry){ | 834 | if(!m_bRetry){ |
830 | if(retryable) | 835 | if(retryable) |
831 | SetTry(p); | 836 | SetTry(p); |
832 | else | 837 | else |
833 | SetTry(); | 838 | SetTry(); |
834 | } | 839 | } |
835 | ResetTimeout(); | 840 | ResetTimeout(); |
836 | } | 841 | } |
837 | 842 | ||
838 | void CXferSocket::Deny(UINT errCode,UINT errID) | 843 | void CXferSocket::Deny(UINT errCode,UINT errID) |
839 | { | 844 | { |
840 | PostError(errCode,errID); | 845 | PostError(errCode,errID); |
841 | state=stateDeny; | 846 | state=stateDeny; |
842 | } | 847 | } |
843 | 848 | ||
844 | void CRRQSocket::DoXfer() | 849 | void CRRQSocket::DoXfer() |
845 | { | 850 | { |
846 | tftp *p = tftp::Allocate(tftp::tftpDATA::tftpSize(m_blkSize)); | 851 | tftp *p = tftp::Allocate(tftp::tftpDATA::tftpSize(m_blkSize)); |
847 | ASSERT(p); | 852 | ASSERT(p); |
848 | p->SetOpcode(tftp::opDATA); | 853 | p->SetOpcode(tftp::opDATA); |
849 | TRY{ | 854 | TRY{ |
850 | m_File.Seek(m_ACK*m_blkSize,CFile::begin); | 855 | m_File.Seek(m_ACK*m_blkSize,CFile::begin); |
851 | int bytes = m_File.Read(p->data.m_DATA.data,m_blkSize); | 856 | int bytes = m_File.Read(p->data.m_DATA.data,m_blkSize); |
852 | p->data.m_DATA.SetBlock(m_ACK+1); | 857 | p->data.m_DATA.SetBlock(m_ACK+1); |
853 | p->length=p->length-m_blkSize+bytes; | 858 | p->length=p->length-m_blkSize+bytes; |
854 | m_LastSlack = m_blkSize-bytes; | 859 | m_LastSlack = m_blkSize-bytes; |
855 | PostTFTP(p); | 860 | PostTFTP(p); |
856 | if(bytes<m_blkSize){ | 861 | if(bytes<m_blkSize){ |
857 | state=stateClosing; m_ACKtoClose = m_ACK+1; | 862 | state=stateClosing; m_ACKtoClose = m_ACK+1; |
858 | } | 863 | } |
859 | }CATCH(CFileException,e){ | 864 | }CATCH(CFileException,e){ |
860 | Deny(e); | 865 | Deny(e); |
861 | }END_CATCH | 866 | }END_CATCH |
862 | } | 867 | } |
863 | 868 | ||
864 | UINT tftp::tftpDATA::tftpSize(UINT blkSize) | 869 | UINT tftp::tftpDATA::tftpSize(UINT blkSize) |
865 | { | 870 | { |
866 | return tftpHdrSize-tftpSlackSize+sizeof(tftp::tftpDATA) | 871 | return tftpHdrSize-tftpSlackSize+sizeof(tftp::tftpDATA) |
867 | -sizeof(BYTE)+blkSize; | 872 | -sizeof(BYTE)+blkSize; |
868 | } | 873 | } |
869 | 874 | ||
870 | void CXferSocket::Deny(CFileException* e) | 875 | void CXferSocket::Deny(CFileException* e) |
871 | { | 876 | { |
872 | PostError(e); | 877 | PostError(e); |
873 | state=stateDeny; | 878 | state=stateDeny; |
874 | } | 879 | } |
875 | 880 | ||
876 | void CXferSocket::PostError(UINT errCode,UINT errID) | 881 | void CXferSocket::PostError(UINT errCode,UINT errID) |
877 | { | 882 | { |
878 | CString msg; | 883 | CString msg; |
879 | msg.LoadString(errID); | 884 | msg.LoadString(errID); |
880 | ASSERT(m_Daddy); | 885 | ASSERT(m_Daddy); |
881 | /*// *** | ||
882 | CString tmp; | 886 | CString tmp; |
883 | tmp.Format(IDS_LOG_SENTTFTPERROR,errCode,(LPCTSTR)msg); | 887 | tmp.Format(IDS_LOG_SENTTFTPERROR,errCode,(LPCTSTR)msg); |
884 | m_Daddy->LogLine(tmp); | 888 | m_Daddy->LogLine(tmp); |
885 | */ | ||
886 | tftp* err = tftp::Allocate(tftp::tftpERROR::tftpSize(msg)); | 889 | tftp* err = tftp::Allocate(tftp::tftpERROR::tftpSize(msg)); |
887 | err->SetOpcode(tftp::opERROR); | 890 | err->SetOpcode(tftp::opERROR); |
888 | err->errSet(errCode,msg); | 891 | err->errSet(errCode,msg); |
889 | PostTFTP(err); | 892 | PostTFTP(err); |
890 | } | 893 | } |
891 | 894 | ||
892 | void CXferSocket::PostError(CFileException* e) | 895 | void CXferSocket::PostError(CFileException* e) |
893 | { | 896 | { |
894 | UINT eCode; | 897 | UINT eCode; |
895 | UINT eMsgID; | 898 | UINT eMsgID; |
896 | switch(e->m_cause){ | 899 | switch(e->m_cause){ |
897 | case CFileException::fileNotFound: | 900 | case CFileException::fileNotFound: |
898 | eCode=tftp::errNotFound; | 901 | eCode=tftp::errNotFound; |
899 | eMsgID=IDS_TFTP_ERROR_NOTFOUND; | 902 | eMsgID=IDS_TFTP_ERROR_NOTFOUND; |
900 | break; | 903 | break; |
901 | case CFileException::accessDenied: | 904 | case CFileException::accessDenied: |
902 | eCode=tftp::errAccessViolation; | 905 | eCode=tftp::errAccessViolation; |
903 | eMsgID=IDS_TFTP_ERROR_ACCESS; | 906 | eMsgID=IDS_TFTP_ERROR_ACCESS; |
904 | break; | 907 | break; |
905 | case CFileException::directoryFull: | 908 | case CFileException::directoryFull: |
906 | eCode=tftp::errDiskFull; | 909 | eCode=tftp::errDiskFull; |
907 | eMsgID=IDS_TFTP_ERROR_DIRFULL; | 910 | eMsgID=IDS_TFTP_ERROR_DIRFULL; |
908 | break; | 911 | break; |
909 | case CFileException::sharingViolation: | 912 | case CFileException::sharingViolation: |
910 | eCode=tftp::errAccessViolation; | 913 | eCode=tftp::errAccessViolation; |
911 | eMsgID=IDS_TFTP_ERROR_SHARING; | 914 | eMsgID=IDS_TFTP_ERROR_SHARING; |
912 | break; | 915 | break; |
913 | case CFileException::diskFull: | 916 | case CFileException::diskFull: |
914 | eCode=tftp::errDiskFull; | 917 | eCode=tftp::errDiskFull; |
915 | eMsgID=IDS_TFTP_ERROR_DISKFULL; | 918 | eMsgID=IDS_TFTP_ERROR_DISKFULL; |
916 | break; | 919 | break; |
917 | default: | 920 | default: |
918 | eCode=tftp::errUndefined; | 921 | eCode=tftp::errUndefined; |
919 | eMsgID=IDS_TFTP_ERROR_UNDEFINED; | 922 | eMsgID=IDS_TFTP_ERROR_UNDEFINED; |
920 | break; | 923 | break; |
921 | } | 924 | } |
922 | PostError(eCode,eMsgID); | 925 | PostError(eCode,eMsgID); |
923 | } | 926 | } |
924 | 927 | ||
925 | ULONG CRRQSocket::GetACK(void) | 928 | ULONG CRRQSocket::GetACK(void) |
926 | { | 929 | { |
927 | return (m_ACK*m_blkSize)-m_LastSlack; | 930 | return (m_ACK*m_blkSize)-m_LastSlack; |
928 | } | 931 | } |
929 | 932 | ||
930 | BOOL CRRQSocket::OnTFTP(tftp* p) | 933 | BOOL CRRQSocket::OnTFTP(tftp* p) |
931 | { | 934 | { |
932 | BOOL rv = TRUE; | 935 | BOOL rv = TRUE; |
933 | switch(p->Opcode()){ | 936 | switch(p->Opcode()){ |
934 | case tftp::opOACK: | 937 | case tftp::opOACK: |
935 | { | 938 | { |
936 | m_ACK=0; | 939 | m_ACK=0; |
937 | ASSERT(state!=stateFinish); | 940 | ASSERT(state!=stateFinish); |
938 | tftp::tftpOptions o; | 941 | tftp::tftpOptions o; |
939 | if(p->GetOptions(&o)){ | 942 | if(p->GetOptions(&o)){ |
940 | CString v; | 943 | CString v; |
941 | if(o.Lookup(tftpoBSize,v)){ | 944 | if(o.Lookup(tftpoBSize,v)){ |
942 | m_blkSize=atoi(v); | 945 | m_blkSize=atoi(v); |
943 | if(!m_blkSize){// *** More sanity checks | 946 | if(!m_blkSize){// *** More sanity checks |
944 | Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE); | 947 | Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE); |
945 | rv = TRUE; | 948 | rv = TRUE; |
946 | break; | 949 | break; |
947 | } | 950 | } |
948 | } | 951 | } |
949 | if(o.Lookup(tftpoTOut,v)){ | 952 | if(o.Lookup(tftpoTOut,v)){ |
950 | m_timeOut=atoi(v); | 953 | m_timeOut=atoi(v); |
951 | if(!m_timeOut){// *** More sanity checks | 954 | if(!m_timeOut){// *** More sanity checks |
952 | Deny(tftp::errOption,IDS_TFTP_ERROR_TOUT); | 955 | Deny(tftp::errOption,IDS_TFTP_ERROR_TOUT); |
953 | rv = TRUE; | 956 | rv = TRUE; |
954 | break; | 957 | break; |
955 | } | 958 | } |
956 | } | 959 | } |
957 | if(o.Lookup(tftpoXResume,v)){ | 960 | if(o.Lookup(tftpoXResume,v)){ |
958 | m_ACK=atoi(v); | 961 | m_ACK=atoi(v); |
959 | } | 962 | } |
960 | } | 963 | } |
961 | UpdateList(); | 964 | UpdateList(); |
962 | DoXfer(); | 965 | DoXfer(); |
963 | } | 966 | } |
964 | break; | 967 | break; |
965 | case tftp::opACK: | 968 | case tftp::opACK: |
966 | m_ACK=p->data.m_ACK.Block(); | 969 | m_ACK=p->data.m_ACK.Block(); |
967 | if(state==stateClosing && m_ACK==m_ACKtoClose) { | 970 | if(state==stateClosing && m_ACK==m_ACKtoClose) { |
968 | state = stateFinish; | 971 | state = stateFinish; |
969 | ASSERT(m_Daddy); | 972 | ASSERT(m_Daddy); |
970 | CString tmp; | 973 | CString tmp; |
971 | tmp.Format(IDS_LOG_XFERRRQFINISHED,(LPCTSTR)m_FileName); | 974 | tmp.Format(IDS_LOG_XFERRRQFINISHED,(LPCTSTR)m_FileName); |
972 | m_Daddy->LogLine(tmp); | 975 | m_Daddy->LogLine(tmp); |
973 | rv = FALSE; | 976 | rv = FALSE; |
974 | DoSelect(TRUE); | 977 | DoSelect(TRUE); |
975 | }else if(state!=stateFinish){ | 978 | }else if(state!=stateFinish){ |
976 | UpdateList(); | 979 | UpdateList(); |
977 | DoXfer(); | 980 | DoXfer(); |
978 | } | 981 | } |
979 | break; | 982 | break; |
980 | case tftp::opERROR: | 983 | case tftp::opERROR: |
981 | { | 984 | { |
982 | ASSERT(m_Daddy); | 985 | ASSERT(m_Daddy); |
983 | CString tmp; | 986 | CString tmp; |
984 | tmp.Format(IDS_LOG_GOTTFTPERROR,p->data.m_ERROR.Code(),(LPCTSTR)p->errMessage()); | 987 | tmp.Format(IDS_LOG_GOTTFTPERROR,p->data.m_ERROR.Code(),(LPCTSTR)p->errMessage()); |
985 | m_Daddy->LogLine(tmp); | 988 | m_Daddy->LogLine(tmp); |
986 | } | 989 | } |
987 | Destroy(FALSE); | 990 | Destroy(FALSE); |
988 | rv = FALSE; | 991 | rv = FALSE; |
989 | break; | 992 | break; |
990 | default: | 993 | default: |
991 | { | 994 | { |
992 | ASSERT(m_Daddy); | 995 | ASSERT(m_Daddy); |
993 | CString tmp; | 996 | CString tmp; |
994 | tmp.Format(IDS_LOG_XFEROPCODE,p->Opcode()); | 997 | tmp.Format(IDS_LOG_XFEROPCODE,p->Opcode()); |
995 | m_Daddy->LogLine(tmp); | 998 | m_Daddy->LogLine(tmp); |
996 | // *** Self destruct maybe?? | 999 | // *** Self destruct maybe?? |
997 | } | 1000 | } |
998 | break; | 1001 | break; |
999 | } | 1002 | } |
1000 | return rv; | 1003 | return rv; |
1001 | } | 1004 | } |
1002 | 1005 | ||
1003 | BOOL CWRQSocket::OnTFTP(tftp* p) | 1006 | BOOL CWRQSocket::OnTFTP(tftp* p) |
1004 | { | 1007 | { |
1005 | switch(p->Opcode()){ | 1008 | switch(p->Opcode()){ |
1006 | case tftp::opOACK: | 1009 | case tftp::opOACK: |
1007 | ASSERT(state!=stateFinish); | 1010 | ASSERT(state!=stateFinish); |
1008 | { | 1011 | { |
1009 | if(m_bResume) | 1012 | if(m_bResume) |
1010 | m_ACK=m_File.GetLength()/m_blkSize; | 1013 | m_ACK=m_File.GetLength()/m_blkSize; |
1011 | else | 1014 | else |
1012 | m_ACK=0; | 1015 | m_ACK=0; |
1013 | tftp::tftpOptions o; | 1016 | tftp::tftpOptions o; |
1014 | if(p->GetOptions(&o)){ | 1017 | if(p->GetOptions(&o)){ |
1015 | CString v; | 1018 | CString v; |
1016 | if(o.Lookup(tftpoBSize,v)){ | 1019 | if(o.Lookup(tftpoBSize,v)){ |
1017 | m_blkSize=atoi(v); | 1020 | m_blkSize=atoi(v); |
1018 | if(!m_blkSize){// *** More sanity checks | 1021 | if(!m_blkSize){// *** More sanity checks |
1019 | Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE); | 1022 | Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE); |
1020 | return TRUE; | 1023 | return TRUE; |
1021 | } | 1024 | } |
1022 | } | 1025 | } |
1023 | if(o.Lookup(tftpoTOut,v)){ | 1026 | if(o.Lookup(tftpoTOut,v)){ |
1024 | m_timeOut=atoi(v); | 1027 | m_timeOut=atoi(v); |
1025 | if(!m_timeOut){// *** More sanity checks | 1028 | if(!m_timeOut){// *** More sanity checks |
1026 | Deny(tftp::errOption,IDS_TFTP_ERROR_TOUT); | 1029 | Deny(tftp::errOption,IDS_TFTP_ERROR_TOUT); |
1027 | return TRUE; | 1030 | return TRUE; |
1028 | } | 1031 | } |
1029 | } | 1032 | } |
1030 | if(o.Lookup(tftpoTSize,v)){ | 1033 | if(o.Lookup(tftpoTSize,v)){ |
1031 | m_xferSize=atoi(v); | 1034 | m_xferSize=atoi(v); |
1032 | } | 1035 | } |
1033 | } | 1036 | } |
1034 | UpdateList(); | 1037 | UpdateList(); |
1035 | DoXfer(); | 1038 | DoXfer(); |
1036 | } | 1039 | } |
1037 | break; | 1040 | break; |
1038 | case tftp::opDATA: | 1041 | case tftp::opDATA: |
1039 | { | 1042 | { |
1040 | UINTblock = p->data.m_DATA.Block(); | 1043 | UINTblock = p->data.m_DATA.Block(); |
1041 | TRY{ | 1044 | TRY{ |
1042 | m_File.Seek((block-1)*m_blkSize,CFile::begin); | 1045 | m_File.Seek((block-1)*m_blkSize,CFile::begin); |
1043 | int bytes = p->length-sizeof(p->data.m_DATA.block)-(tftpHdrSize-tftpSlackSize); | 1046 | int bytes = p->length-sizeof(p->data.m_DATA.block)-(tftpHdrSize-tftpSlackSize); |
1044 | if(bytes){ | 1047 | if(bytes){ |
1045 | m_File.Write(p->data.m_DATA.data,bytes); | 1048 | m_File.Write(p->data.m_DATA.data,bytes); |
1046 | // *** Move to the other place where we can do it not that often | 1049 | // *** Move to the other place where we can do it not that often |
1047 | m_File.SetLength(m_File.GetPosition()); | 1050 | m_File.SetLength(m_File.GetPosition()); |
1048 | } | 1051 | } |
1049 | if(bytes<m_blkSize){ | 1052 | if(bytes<m_blkSize){ |
1050 | state=stateFinish; | 1053 | state=stateFinish; |
1051 | ASSERT(m_Daddy); | 1054 | ASSERT(m_Daddy); |
1052 | CString tmp; | 1055 | CString tmp; |
1053 | tmp.Format(IDS_LOG_XFERWRQFINISHED,(LPCTSTR)m_FileName); | 1056 | tmp.Format(IDS_LOG_XFERWRQFINISHED,(LPCTSTR)m_FileName); |
1054 | m_Daddy->LogLine(tmp); | 1057 | m_Daddy->LogLine(tmp); |
1055 | } | 1058 | } |
1056 | m_ACK=block; | 1059 | m_ACK=block; |
1057 | m_LastSlack=m_blkSize-bytes; | 1060 | m_LastSlack=m_blkSize-bytes; |
1058 | UpdateList(); | 1061 | UpdateList(); |
1059 | DoXfer(); | 1062 | DoXfer(); |
1060 | }CATCH(CFileException,e){ | 1063 | }CATCH(CFileException,e){ |
1061 | Deny(e); | 1064 | Deny(e); |
1062 | }END_CATCH | 1065 | }END_CATCH |
1063 | } | 1066 | } |
1064 | break; | 1067 | break; |
1065 | case tftp::opERROR: | 1068 | case tftp::opERROR: |
1066 | { | 1069 | { |
1067 | ASSERT(m_Daddy); | 1070 | ASSERT(m_Daddy); |
1068 | CString tmp; | 1071 | CString tmp; |
1069 | tmp.Format(IDS_LOG_GOTTFTPERROR,p->data.m_ERROR.Code(),(LPCTSTR)p->errMessage()); | 1072 | tmp.Format(IDS_LOG_GOTTFTPERROR,p->data.m_ERROR.Code(),(LPCTSTR)p->errMessage()); |
1070 | m_Daddy->LogLine(tmp); | 1073 | m_Daddy->LogLine(tmp); |
1071 | } | 1074 | } |
1072 | Destroy(FALSE); | 1075 | Destroy(FALSE); |
1073 | return FALSE; | 1076 | return FALSE; |
1074 | default: | 1077 | default: |
1075 | { | 1078 | { |
1076 | ASSERT(m_Daddy); | 1079 | ASSERT(m_Daddy); |
1077 | CString tmp; | 1080 | CString tmp; |
1078 | tmp.Format(IDS_LOG_XFEROPCODE,p->Opcode()); | 1081 | tmp.Format(IDS_LOG_XFEROPCODE,p->Opcode()); |
1079 | m_Daddy->LogLine(tmp); | 1082 | m_Daddy->LogLine(tmp); |
1080 | // *** Self destruct maybe?? | 1083 | // *** Self destruct maybe?? |
1081 | } | 1084 | } |
1082 | break; | 1085 | break; |
1083 | } | 1086 | } |
1084 | return TRUE; | 1087 | return TRUE; |
1085 | } | 1088 | } |
1086 | 1089 | ||
1087 | void tftp::SetOpcode(WORD op) | 1090 | void tftp::SetOpcode(WORD op) |
1088 | { | 1091 | { |
1089 | opcode = REVERSEBYTES(op); | 1092 | opcode = REVERSEBYTES(op); |
1090 | } | 1093 | } |
1091 | void tftp::tftpDATA::SetBlock(WORD b) | 1094 | void tftp::tftpDATA::SetBlock(WORD b) |
1092 | { | 1095 | { |
1093 | block=REVERSEBYTES(b); | 1096 | block=REVERSEBYTES(b); |
1094 | } | 1097 | } |
1095 | WORD tftp::tftpDATA::Block() | 1098 | WORD tftp::tftpDATA::Block() |
1096 | { | 1099 | { |
1097 | return REVERSEBYTES(block); | 1100 | return REVERSEBYTES(block); |
1098 | } | 1101 | } |
1099 | WORD tftp::tftpACK::Block() | 1102 | WORD tftp::tftpACK::Block() |
1100 | { | 1103 | { |
1101 | return REVERSEBYTES(block); | 1104 | return REVERSEBYTES(block); |
1102 | } | 1105 | } |
1103 | void tftp::tftpACK::SetBlock(WORD b) | 1106 | void tftp::tftpACK::SetBlock(WORD b) |
1104 | { | 1107 | { |
1105 | block = REVERSEBYTES(b); | 1108 | block = REVERSEBYTES(b); |
1106 | } | 1109 | } |
1107 | WORD tftp::tftpERROR::Code() | 1110 | WORD tftp::tftpERROR::Code() |
1108 | { | 1111 | { |
1109 | return REVERSEBYTES(code); | 1112 | return REVERSEBYTES(code); |
1110 | } | 1113 | } |
1111 | void tftp::tftpERROR::SetCode(WORD c) | 1114 | void tftp::tftpERROR::SetCode(WORD c) |
1112 | { | 1115 | { |
1113 | code = REVERSEBYTES(c); | 1116 | code = REVERSEBYTES(c); |
1114 | } | 1117 | } |
1115 | 1118 | ||
1116 | 1119 | ||
1117 | CString tftp::errMessage() | 1120 | CString tftp::errMessage() |
1118 | { | 1121 | { |
1119 | CString rv; | 1122 | CString rv; |
1120 | if(memchr(data.m_ERROR.data,0,length-(tftpHdrSize-tftpSlackSize)-sizeof(data.m_ERROR.code))) | 1123 | if(memchr(data.m_ERROR.data,0,length-(tftpHdrSize-tftpSlackSize)-sizeof(data.m_ERROR.code))) |
1121 | rv = (LPCTSTR)data.m_ERROR.data; | 1124 | rv = (LPCTSTR)data.m_ERROR.data; |
1122 | return rv; | 1125 | return rv; |
1123 | } | 1126 | } |
1124 | 1127 | ||
1125 | void CXferSocket::Destroy(BOOL success) | 1128 | void CXferSocket::Destroy(BOOL success) |
1126 | { | 1129 | { |
1127 | if(m_wndResolver){ | 1130 | if(m_wndResolver){ |
1128 | delete m_wndResolver; | 1131 | delete m_wndResolver; |
1129 | m_wndResolver=NULL; | 1132 | m_wndResolver=NULL; |
1130 | } | 1133 | } |
1131 | SetTry(); | 1134 | SetTry(); |
1132 | m_Daddy->m_bnw.StartSound( | 1135 | m_Daddy->m_bnw.StartSound( |
1133 | success | 1136 | success |
1134 | ? m_Daddy->m_bnwSuccess | 1137 | ? m_Daddy->m_bnwSuccess |
1135 | : m_Daddy->m_bnwAbort | 1138 | : m_Daddy->m_bnwAbort |
1136 | ); | 1139 | ); |
1137 | if(m_File.m_hFile!=CFile::hFileNull){ | 1140 | if(m_File.m_hFile!=CFile::hFileNull){ |
1138 | TRY{ | 1141 | TRY{ |
1139 | m_File.Close(); | 1142 | m_File.Close(); |
1140 | }CATCH(CFileException,e){ | 1143 | }CATCH(CFileException,e){ |
1141 | TRACE0("Error closing file\n"); | 1144 | TRACE0("Error closing file\n"); |
1142 | }END_CATCH | 1145 | }END_CATCH |
1143 | } | 1146 | } |
1144 | ASSERT(m_Daddy); | 1147 | ASSERT(m_Daddy); |
1145 | m_Daddy->KillTimer(m_hSocket); | 1148 | m_Daddy->KillTimer(m_hSocket); |
1146 | m_Daddy->m_Xfers.RemoveKey(m_hSocket); | 1149 | m_Daddy->m_Xfers.RemoveKey(m_hSocket); |
1147 | LV_FINDINFO lvf; | 1150 | LV_FINDINFO lvf; |
1148 | memset(&lvf,0,sizeof(lvf)); | 1151 | memset(&lvf,0,sizeof(lvf)); |
1149 | lvf.flags=LVFI_PARAM; | 1152 | lvf.flags=LVFI_PARAM; |
1150 | lvf.lParam=(LPARAM)this; | 1153 | lvf.lParam=(LPARAM)this; |
1151 | int i = m_Daddy->m_List.FindItem(&lvf); | 1154 | int i = m_Daddy->m_List.FindItem(&lvf); |
1152 | if(i>=0) | 1155 | if(i>=0) |
1153 | m_Daddy->m_List.DeleteItem(i); | 1156 | m_Daddy->m_List.DeleteItem(i); |
1154 | delete this; | 1157 | delete this; |
1155 | } | 1158 | } |
1156 | 1159 | ||
1157 | void CPumpKINDlg::LogLineToScreen(LPCTSTR str) | 1160 | void CPumpKINDlg::LogLineToScreen(LPCTSTR str) |
1158 | { | 1161 | { |
1159 | ASSERT(m_LogLength); | 1162 | ASSERT(m_LogLength); |
1160 | while(m_Log.GetCount()>m_LogLength && m_Log.GetCount()!=LB_ERR){ | 1163 | while(m_Log.GetCount()>m_LogLength && m_Log.GetCount()!=LB_ERR){ |
1161 | CTime *t = (CTime*)m_Log.GetItemData(0); | 1164 | CTime *t = (CTime*)m_Log.GetItemData(0); |
1162 | if(((DWORD)t)!=LB_ERR){ | 1165 | if(((DWORD)t)!=LB_ERR){ |
1163 | ASSERT(t); | 1166 | ASSERT(t); |
1164 | m_LogTimes.RemoveKey(t); | 1167 | m_LogTimes.RemoveKey(t); |
1165 | delete t; | 1168 | delete t; |
1166 | } | 1169 | } |
1167 | m_Log.DeleteString(0); | 1170 | m_Log.DeleteString(0); |
1168 | } | 1171 | } |
1169 | int i = m_Log.AddString(str); | 1172 | int i = m_Log.AddString(str); |
1170 | ASSERT(i!=LB_ERR); | 1173 | ASSERT(i!=LB_ERR); |
1171 | CTime *t = new CTime(CTime::GetCurrentTime()); | 1174 | CTime *t = new CTime(CTime::GetCurrentTime()); |
1172 | m_Log.SetItemData(i,(DWORD)(m_LogTimes[t]=t)); | 1175 | m_Log.SetItemData(i,(DWORD)(m_LogTimes[t]=t)); |
1173 | m_Log.SetCurSel(i); | 1176 | m_Log.SetCurSel(i); |
1174 | } | 1177 | } |
1175 | 1178 | ||
1176 | void CPumpKINDlg::LogLine(UINT msgID) | 1179 | void CPumpKINDlg::LogLine(UINT msgID) |
1177 | { | 1180 | { |
1178 | CString tmp; | 1181 | CString tmp; |
1179 | tmp.Format(msgID); | 1182 | tmp.Format(msgID); |
1180 | LogLine(tmp); | 1183 | LogLine(tmp); |
1181 | } | 1184 | } |
1182 | 1185 | ||
1183 | void CXferSocket::TurnSlashes(CString& fn,BOOL bBack) | 1186 | void CXferSocket::TurnSlashes(CString& fn,BOOL bBack) |
1184 | { | 1187 | { |
1185 | ints = fn.Find(bBack?'/':'\\'); | 1188 | ints = fn.Find(bBack?'/':'\\'); |
1186 | while(s>=0){ | 1189 | while(s>=0){ |
1187 | fn.SetAt(s,bBack?'\\':'/'); | 1190 | fn.SetAt(s,bBack?'\\':'/'); |
1188 | s = fn.Find(bBack?'/':'\\'); | 1191 | s = fn.Find(bBack?'/':'\\'); |
1189 | } | 1192 | } |
1190 | } | 1193 | } |
1191 | 1194 | ||
1192 | CString CXferSocket::ApplyRoot(LPCTSTR fileName) | 1195 | CString CXferSocket::ApplyRoot(LPCTSTR fileName) |
1193 | { | 1196 | { |
1194 | ASSERT(m_Daddy); | 1197 | ASSERT(m_Daddy); |
1195 | CString fn = fileName; | 1198 | CString fn = fileName; |
1196 | CString rv = m_Daddy->m_TFTPRoot; | 1199 | CString rv = m_Daddy->m_TFTPRoot; |
1197 | if(rv.IsEmpty()) | 1200 | if(rv.IsEmpty()) |
1198 | rv = "."; | 1201 | rv = "."; |
1199 | if(rv[rv.GetLength()-1]!='\\') | 1202 | if(rv[rv.GetLength()-1]!='\\') |
1200 | rv+="\\"; | 1203 | rv+="\\"; |
1201 | while((!fn.IsEmpty()) && fn[0]=='\\') | 1204 | while((!fn.IsEmpty()) && fn[0]=='\\') |
1202 | fn=fn.Mid(1); | 1205 | fn=fn.Mid(1); |
1203 | rv+=fn; | 1206 | rv+=fn; |
1204 | return rv; | 1207 | return rv; |
1205 | } | 1208 | } |
1206 | 1209 | ||
1207 | void CPumpKINDlg::OnOptions() | 1210 | void CPumpKINDlg::OnOptions() |
1208 | { | 1211 | { |
1209 | CPropertySheet cps(IDS_TITLE_OPTIONS,this); | 1212 | CPropertySheet cps(IDS_TITLE_OPTIONS,this); |
1210 | CPropsServer server; | 1213 | CPropsServer server; |
1211 | CPropsNetwork network; | 1214 | CPropsNetwork network; |
1212 | CPropsSounds sounds; | 1215 | CPropsSounds sounds; |
1213 | CPropsACL acl; | 1216 | CPropsACL acl; |
1214 | 1217 | ||
1215 | server.m_RRQMode=m_RRQMode; | 1218 | server.m_RRQMode=m_RRQMode; |
1216 | server.m_TFTPRoot=m_TFTPRoot; | 1219 | server.m_TFTPRoot=m_TFTPRoot; |
1217 | server.m_TFTPSubdirs=m_bTFTPSubdirs; | 1220 | server.m_TFTPSubdirs=m_bTFTPSubdirs; |
1218 | server.m_WRQMode=m_WRQMode; | 1221 | server.m_WRQMode=m_WRQMode; |
1219 | server.m_PromptTimeOut=m_PromptTimeOut; | 1222 | server.m_PromptTimeOut=m_PromptTimeOut; |
1220 | server.m_LogFile=m_LogFile; | 1223 | server.m_LogFile=m_LogFile; |
1221 | 1224 | ||
1222 | network.m_ListenPort=m_ListenPort; | 1225 | network.m_ListenPort=m_ListenPort; |
1223 | network.m_SpeakPort=m_SpeakPort; | 1226 | network.m_SpeakPort=m_SpeakPort; |
1224 | network.m_TimeOut=m_TFTPTimeOut.GetTotalSeconds(); | 1227 | network.m_TimeOut=m_TFTPTimeOut.GetTotalSeconds(); |
1225 | network.m_BlockSize=m_BlockSize; | 1228 | network.m_BlockSize=m_BlockSize; |
1226 | 1229 | ||
1227 | sounds.m_Request = m_bnwRequest; | 1230 | sounds.m_Request = m_bnwRequest; |
1228 | sounds.m_Success = m_bnwSuccess; | 1231 | sounds.m_Success = m_bnwSuccess; |
1229 | sounds.m_Abort = m_bnwAbort; | 1232 | sounds.m_Abort = m_bnwAbort; |
1230 | 1233 | ||
1231 | acl.m_rulist = m_aclRules; | 1234 | acl.m_rulist = m_aclRules; |
1232 | 1235 | ||
1233 | cps.AddPage(&server); | 1236 | cps.AddPage(&server); |
1234 | cps.AddPage(&network); | 1237 | cps.AddPage(&network); |
1235 | cps.AddPage(&sounds); | 1238 | cps.AddPage(&sounds); |
1236 | cps.AddPage(&acl); | 1239 | cps.AddPage(&acl); |
1237 | if(cps.DoModal()==IDOK){ | 1240 | if(cps.DoModal()==IDOK){ |
1238 | m_RRQMode=server.m_RRQMode; | 1241 | m_RRQMode=server.m_RRQMode; |
1239 | m_TFTPRoot=server.m_TFTPRoot; | 1242 | m_TFTPRoot=server.m_TFTPRoot; |
1240 | m_bTFTPSubdirs=server.m_TFTPSubdirs; | 1243 | m_bTFTPSubdirs=server.m_TFTPSubdirs; |
1241 | m_WRQMode=server.m_WRQMode; | 1244 | m_WRQMode=server.m_WRQMode; |
1242 | m_PromptTimeOut=server.m_PromptTimeOut; | 1245 | m_PromptTimeOut=server.m_PromptTimeOut; |
1243 | m_LogFile=server.m_LogFile; | 1246 | m_LogFile=server.m_LogFile; |
1244 | 1247 | ||
1245 | m_ListenPort=network.m_ListenPort; | 1248 | m_ListenPort=network.m_ListenPort; |
1246 | m_SpeakPort=network.m_SpeakPort; | 1249 | m_SpeakPort=network.m_SpeakPort; |
1247 | m_TFTPTimeOut=CTimeSpan(network.m_TimeOut); | 1250 | m_TFTPTimeOut=CTimeSpan(network.m_TimeOut); |
1248 | m_BlockSize=network.m_BlockSize; | 1251 | m_BlockSize=network.m_BlockSize; |
1249 | 1252 | ||
1250 | m_bnwRequest = sounds.m_Request; | 1253 | m_bnwRequest = sounds.m_Request; |
1251 | m_bnwSuccess = sounds.m_Success; | 1254 | m_bnwSuccess = sounds.m_Success; |
1252 | m_bnwAbort = sounds.m_Abort; | 1255 | m_bnwAbort = sounds.m_Abort; |
1253 | 1256 | ||
1254 | m_aclRules = acl.m_rulist; | 1257 | m_aclRules = acl.m_rulist; |
1255 | 1258 | ||
1256 | m_lastlogerr.Empty(); | 1259 | m_lastlogerr.Empty(); |
1257 | } | 1260 | } |
1258 | } | 1261 | } |
1259 | 1262 | ||
1260 | BOOL CRRQSocket::ConfirmRequest() | 1263 | BOOL CRRQSocket::ConfirmRequest() |
1261 | { | 1264 | { |
1262 | CConfirmRRQDlg cd(NULL); | 1265 | CConfirmRRQDlg cd(NULL); |
1263 | cd.m_Daddy=this; | 1266 | cd.m_Daddy=this; |
1264 | cd.m_File=m_FileName; | 1267 | cd.m_File=m_FileName; |
1265 | cd.m_Host=inet_ntoa(m_Peer.sin_addr); | 1268 | cd.m_Host=inet_ntoa(m_Peer.sin_addr); |
1266 | if(cd.DoModal()==IDOK) | 1269 | if(cd.DoModal()==IDOK) |
1267 | return TRUE; | 1270 | return TRUE; |
1268 | return FALSE; | 1271 | return FALSE; |
1269 | } | 1272 | } |
1270 | 1273 | ||
1271 | CWRQSocket::CWRQSocket(CPumpKINDlg* daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN *sin) | 1274 | CWRQSocket::CWRQSocket(CPumpKINDlg* daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN *sin) |
1272 | : CXferSocket(daddy,fileName,type,sin) | 1275 | : CXferSocket(daddy,fileName,type,sin) |
1273 | { | 1276 | { |
1274 | state=stateNone; | 1277 | state=stateNone; |
1275 | m_ACK=0; | 1278 | m_ACK=0; |
1276 | m_LastSlack=0; | 1279 | m_LastSlack=0; |
1277 | m_bResume=FALSE; | 1280 | m_bResume=FALSE; |
1278 | } | 1281 | } |
1279 | 1282 | ||
1280 | BOOL CWRQSocket::Create(LPCTSTR localFile,LPCTSTR hostName) | 1283 | BOOL CWRQSocket::Create(LPCTSTR localFile,LPCTSTR hostName) |
1281 | { | 1284 | { |
1282 | if(!CAsyncSocket::Create(0,SOCK_DGRAM)) | 1285 | if(!CAsyncSocket::Create(0,SOCK_DGRAM)) |
1283 | return FALSE; | 1286 | return FALSE; |
1284 | ASSERT(m_Daddy); | 1287 | ASSERT(m_Daddy); |
1285 | ASSERT(m_Peer.sin_addr.s_addr!=INADDR_NONE || hostName); | 1288 | ASSERT(m_Peer.sin_addr.s_addr!=INADDR_NONE || hostName); |
1286 | m_Daddy->m_Xfers[m_hSocket]=this; | 1289 | m_Daddy->m_Xfers[m_hSocket]=this; |
1287 | UpdateList(); | 1290 | UpdateList(); |
1288 | CString lf; | 1291 | CString lf; |
1289 | if(!localFile) { | 1292 | if(!localFile) { |
1290 | lf = m_FileName; | 1293 | lf = m_FileName; |
1291 | TurnSlashes(lf,TRUE); | 1294 | TurnSlashes(lf,TRUE); |
1292 | } | 1295 | } |
1293 | CString fn = localFile?ApplyRootGently(localFile):ApplyRoot(lf); | 1296 | CString fn = localFile?ApplyRootGently(localFile):ApplyRoot(lf); |
1294 | if(!localFile){// This is an incoming request.. | 1297 | if(!localFile){// This is an incoming request.. |
1295 | if(CheckBadRelativeness(m_FileName)){ | 1298 | if(CheckBadRelativeness(m_FileName)){ |
1296 | Deny(tftp::errAccessViolation,IDS_TFTP_ERROR_ACCESS); | 1299 | Deny(tftp::errAccessViolation,IDS_TFTP_ERROR_ACCESS); |
1297 | return TRUE; | 1300 | return TRUE; |
1298 | } | 1301 | } |
1299 | BOOL exists; | 1302 | BOOL exists; |
1300 | if(!_access((LPCTSTR)fn,0)) | 1303 | if(!_access((LPCTSTR)fn,0)) |
1301 | m_Rename=exists=TRUE; | 1304 | m_Rename=exists=TRUE; |
1302 | else | 1305 | else |
1303 | m_Rename=exists=FALSE; | 1306 | m_Rename=exists=FALSE; |
1304 | int atar=m_Daddy->m_aclRules.FindTarget(acl_rule::opWRQ,m_Peer.sin_addr.s_addr); | 1307 | int atar=m_Daddy->m_aclRules.FindTarget(acl_rule::opWRQ,m_Peer.sin_addr.s_addr); |
1305 | if(atar<0) | 1308 | if(atar<0) |
1306 | atar=m_Daddy->m_WRQMode; | 1309 | atar=m_Daddy->m_WRQMode; |
1307 | switch(atar){ | 1310 | switch(atar){ |
1308 | case CPumpKINDlg::wrqTakeAll: | 1311 | case CPumpKINDlg::wrqTakeAll: |
1309 | if(exists){ | 1312 | if(exists){ |
1310 | if(!RenameFile(fn)){ | 1313 | if(!RenameFile(fn)){ |
1311 | Deny(tftp::errDiskFull,IDS_TFTP_ERROR_FAILEDTORENAME); | 1314 | Deny(tftp::errDiskFull,IDS_TFTP_ERROR_FAILEDTORENAME); |
1312 | return TRUE; | 1315 | return TRUE; |
1313 | } | 1316 | } |
1314 | } | 1317 | } |
1315 | break; | 1318 | break; |
1316 | case CPumpKINDlg::wrqConfirmIfExists: | 1319 | case CPumpKINDlg::wrqConfirmIfExists: |
1317 | if(!exists) | 1320 | if(!exists) |
1318 | break; | 1321 | break; |
1319 | case CPumpKINDlg::wrqAlwaysConfirm: | 1322 | case CPumpKINDlg::wrqAlwaysConfirm: |
1320 | if(exists) | 1323 | if(exists) |
1321 | m_bResume=TRUE; | 1324 | m_bResume=TRUE; |
1322 | if(ConfirmRequest()){ | 1325 | if(ConfirmRequest()){ |
1323 | if(m_Rename){ | 1326 | if(m_Rename){ |
1324 | RenameFile(fn); | 1327 | RenameFile(fn); |
1325 | if(SaveAs(fn)) | 1328 | if(SaveAs(fn)) |
1326 | break; | 1329 | break; |
1327 | }else | 1330 | }else |
1328 | break; | 1331 | break; |
1329 | } | 1332 | } |
1330 | default: | 1333 | default: |
1331 | TRACE1("Unexpected access target: %d\n",atar); | 1334 | TRACE1("Unexpected access target: %d\n",atar); |
1332 | case CPumpKINDlg::wrqDenyAll: | 1335 | case CPumpKINDlg::wrqDenyAll: |
1333 | Deny(tftp::errAccessViolation,IDS_TFTP_ERROR_ACCESS); | 1336 | Deny(tftp::errAccessViolation,IDS_TFTP_ERROR_ACCESS); |
1334 | return TRUE; | 1337 | return TRUE; |
1335 | } | 1338 | } |
1336 | } | 1339 | } |
1337 | CFileException e; | 1340 | CFileException e; |
1338 | if(!m_File.Open( | 1341 | if(!m_File.Open( |
1339 | fn, | 1342 | fn, |
1340 | m_bResume | 1343 | m_bResume |
1341 | ?(CFile::modeWrite|CFile::shareDenyWrite) | 1344 | ?(CFile::modeWrite|CFile::shareDenyWrite) |
1342 | :(CFile::modeCreate|CFile::modeWrite|CFile::shareDenyWrite), | 1345 | :(CFile::modeCreate|CFile::modeWrite|CFile::shareDenyWrite), |
1343 | &e | 1346 | &e |
1344 | )){ | 1347 | )){ |
1345 | if(localFile){// Outgoing request | 1348 | if(localFile){// Outgoing request |
1346 | CString tmp; | 1349 | CString tmp; |
1347 | tmp.Format(IDS_LOG_FAILEDTOOPEN,fn); | 1350 | tmp.Format(IDS_LOG_FAILEDTOOPEN,fn); |
1348 | m_Daddy->LogLine(tmp); | 1351 | m_Daddy->LogLine(tmp); |
1349 | return FALSE; | 1352 | return FALSE; |
1350 | }else{ | 1353 | }else{ |
1351 | Deny(&e); | 1354 | Deny(&e); |
1352 | return TRUE; | 1355 | return TRUE; |
1353 | } | 1356 | } |
1354 | } | 1357 | } |
1355 | if(hostName){ | 1358 | if(hostName){ |
1356 | m_HostName=hostName; | 1359 | m_HostName=hostName; |
1357 | 1360 | ||
1358 | CString tmp; | 1361 | CString tmp; |
1359 | tmp.Format(IDS_LOG_REQUESTING,m_FileName,m_HostName); | 1362 | tmp.Format(IDS_LOG_REQUESTING,m_FileName,m_HostName); |
1360 | m_Daddy->LogLine(tmp); | 1363 | m_Daddy->LogLine(tmp); |
1361 | 1364 | ||
1362 | CString inAddr = hostName; | 1365 | CString inAddr = hostName; |
1363 | int at = inAddr.Find('@'); | 1366 | int at = inAddr.Find('@'); |
1364 | if(at>=0) | 1367 | if(at>=0) |
1365 | inAddr=inAddr.Mid(at+1); | 1368 | inAddr=inAddr.Mid(at+1); |
1366 | if((m_Peer.sin_addr.s_addr=inet_addr((LPCTSTR)inAddr))==INADDR_NONE){ | 1369 | if((m_Peer.sin_addr.s_addr=inet_addr((LPCTSTR)inAddr))==INADDR_NONE){ |
1367 | ASSERT(!m_wndResolver); | 1370 | ASSERT(!m_wndResolver); |
1368 | m_wndResolver = new CResolver(this); | 1371 | m_wndResolver = new CResolver(this); |
1369 | ASSERT(m_wndResolver); | 1372 | ASSERT(m_wndResolver); |
1370 | return m_wndResolver->Resolve(); | 1373 | return m_wndResolver->Resolve(); |
1371 | }else{ | 1374 | }else{ |
1372 | OnHostKnown(); | 1375 | OnHostKnown(); |
1373 | return TRUE; | 1376 | return TRUE; |
1374 | } | 1377 | } |
1375 | } | 1378 | } |
1376 | CString v; | 1379 | CString v; |
1377 | tftp::tftpOptions oack; | 1380 | tftp::tftpOptions oack; |
1378 | if(m_Options.Lookup(tftpoTSize,v)){ | 1381 | if(m_Options.Lookup(tftpoTSize,v)){ |
1379 | m_xferSize=atol(v); | 1382 | m_xferSize=atol(v); |
1380 | if(!m_xferSize){ | 1383 | if(!m_xferSize){ |
1381 | Deny(tftp::errOption,IDS_TFTP_ERROR_TSIZE); | 1384 | Deny(tftp::errOption,IDS_TFTP_ERROR_TSIZE); |
1382 | return TRUE; | 1385 | return TRUE; |
1383 | } | 1386 | } |
1384 | } | 1387 | } |
1385 | if(m_Options.Lookup(tftpoBSize,v)){ | 1388 | if(m_Options.Lookup(tftpoBSize,v)){ |
1386 | m_blkSize=atoi(v); | 1389 | m_blkSize=atoi(v); |
1387 | if(!m_blkSize){// *** Do more about sanity check | 1390 | if(!m_blkSize){// *** Do more about sanity check |
1388 | Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE); | 1391 | Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE); |
1389 | return TRUE; | 1392 | return TRUE; |
1390 | } | 1393 | } |
1391 | v.Format("%u",m_blkSize); | 1394 | v.Format("%u",m_blkSize); |
1392 | oack[tftpoBSize]=v; | 1395 | oack[tftpoBSize]=v; |
1393 | } | 1396 | } |
1394 | if(m_Options.Lookup(tftpoTOut,v)){ | 1397 | if(m_Options.Lookup(tftpoTOut,v)){ |
1395 | m_timeOut=atoi(v); | 1398 | m_timeOut=atoi(v); |
1396 | if(!m_timeOut){// *** Do more about sanity check | 1399 | if(!m_timeOut){// *** Do more about sanity check |
1397 | Deny(tftp::errOption,IDS_TFTP_ERROR_TOUT); | 1400 | Deny(tftp::errOption,IDS_TFTP_ERROR_TOUT); |
1398 | return TRUE; | 1401 | return TRUE; |
1399 | } | 1402 | } |
1400 | v.Format("%u",m_timeOut); | 1403 | v.Format("%u",m_timeOut); |
1401 | oack[tftpoTOut]=v; | 1404 | oack[tftpoTOut]=v; |
1402 | } | 1405 | } |
1403 | if(m_Options.Lookup(tftpoXResume,v) && m_bResume){ | 1406 | if(m_Options.Lookup(tftpoXResume,v) && m_bResume){ |
1404 | m_ACK=m_File.GetLength()/m_blkSize; | 1407 | m_ACK=m_File.GetLength()/m_blkSize; |
1405 | v.Format("%u",m_ACK); | 1408 | v.Format("%u",m_ACK); |
1406 | oack[tftpoXResume]=v; | 1409 | oack[tftpoXResume]=v; |
1407 | }else | 1410 | }else |
1408 | m_ACK=0; | 1411 | m_ACK=0; |
1409 | state=stateXfer; | 1412 | state=stateXfer; |
1410 | if(oack.GetCount()){ | 1413 | if(oack.GetCount()){ |
1411 | tftp *p = tftp::Allocate(tftp::tftpOACK::tftpSize(&oack)); | 1414 | tftp *p = tftp::Allocate(tftp::tftpOACK::tftpSize(&oack)); |
1412 | ASSERT(p); | 1415 | ASSERT(p); |
1413 | p->SetOpcode(tftp::opOACK); | 1416 | p->SetOpcode(tftp::opOACK); |
1414 | p->data.m_OACK.Set(&oack); | 1417 | p->data.m_OACK.Set(&oack); |
1415 | PostTFTP(p,TRUE); | 1418 | PostTFTP(p,TRUE); |
1416 | }else | 1419 | }else |
1417 | DoXfer(); | 1420 | DoXfer(); |
1418 | return TRUE; | 1421 | return TRUE; |
1419 | } | 1422 | } |
1420 | 1423 | ||
1421 | BOOL CWRQSocket::ConfirmRequest() | 1424 | BOOL CWRQSocket::ConfirmRequest() |
1422 | { | 1425 | { |
1423 | CConfirmWRQDlg cd(NULL); | 1426 | CConfirmWRQDlg cd(NULL); |
1424 | cd.m_Daddy=this; | 1427 | cd.m_Daddy=this; |
1425 | cd.m_File=m_FileName; | 1428 | cd.m_File=m_FileName; |
1426 | cd.m_Host=inet_ntoa(m_Peer.sin_addr); | 1429 | cd.m_Host=inet_ntoa(m_Peer.sin_addr); |
1427 | switch(cd.DoModal()){ | 1430 | switch(cd.DoModal()){ |
1428 | case IDOK: | 1431 | case IDOK: |
1429 | m_Rename=FALSE; | 1432 | m_Rename=FALSE; |
1430 | m_bResume=FALSE; | 1433 | m_bResume=FALSE; |
1431 | return TRUE; | 1434 | return TRUE; |
1432 | case IDC_RENAME: | 1435 | case IDC_RENAME: |
1433 | m_bResume=FALSE; | 1436 | m_bResume=FALSE; |
1434 | m_Rename=TRUE; | 1437 | m_Rename=TRUE; |
1435 | return TRUE; | 1438 | return TRUE; |
1436 | case IDC_RESUME: | 1439 | case IDC_RESUME: |
1437 | m_Rename=FALSE; | 1440 | m_Rename=FALSE; |
1438 | m_bResume=TRUE; | 1441 | m_bResume=TRUE; |
1439 | return TRUE; | 1442 | return TRUE; |
1440 | case IDCANCEL: | 1443 | case IDCANCEL: |
1441 | return FALSE; | 1444 | return FALSE; |
1442 | } | 1445 | } |
1443 | return FALSE; | 1446 | return FALSE; |
1444 | } | 1447 | } |
1445 | 1448 | ||
1446 | BOOL CWRQSocket::RenameFile(CString& fn) | 1449 | BOOL CWRQSocket::RenameFile(CString& fn) |
1447 | { | 1450 | { |
1448 | CString renamed = fn; | 1451 | CString renamed = fn; |
1449 | if(fn.IsEmpty()) | 1452 | if(fn.IsEmpty()) |
1450 | return FALSE; | 1453 | return FALSE; |
1451 | if(fn[fn.GetLength()-1]==')'){ | 1454 | if(fn[fn.GetLength()-1]==')'){ |
1452 | int op = fn.ReverseFind('('); | 1455 | int op = fn.ReverseFind('('); |
1453 | if(op>0 && fn[op-1]==' '){ | 1456 | if(op>0 && fn[op-1]==' '){ |
1454 | if(fn.Mid(op+1,fn.GetLength()-op-2).SpanExcluding("0123456789").IsEmpty()) | 1457 | if(fn.Mid(op+1,fn.GetLength()-op-2).SpanExcluding("0123456789").IsEmpty()) |
1455 | renamed = renamed.Left(op-1); | 1458 | renamed = renamed.Left(op-1); |
1456 | } | 1459 | } |
1457 | } | 1460 | } |
1458 | CString testFN; | 1461 | CString testFN; |
1459 | for(UINT tmp=0;tmp<32768;tmp++){ | 1462 | for(UINT tmp=0;tmp<32768;tmp++){ |
1460 | testFN.Format("%s (%u)",(LPCTSTR)renamed,tmp); | 1463 | testFN.Format("%s (%u)",(LPCTSTR)renamed,tmp); |
1461 | if(!_access((LPCTSTR)testFN,0)) | 1464 | if(!_access((LPCTSTR)testFN,0)) |
1462 | continue; | 1465 | continue; |
1463 | fn=testFN; | 1466 | fn=testFN; |
1464 | return TRUE; | 1467 | return TRUE; |
1465 | } | 1468 | } |
1466 | return FALSE; | 1469 | return FALSE; |
1467 | } | 1470 | } |
1468 | 1471 | ||
1469 | BOOL CWRQSocket::SaveAs(CString& fn) | 1472 | BOOL CWRQSocket::SaveAs(CString& fn) |
1470 | { | 1473 | { |
1471 | CFileDialog cfd(FALSE,NULL,fn,OFN_EXPLORER|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST,NULL,m_Daddy); | 1474 | CFileDialog cfd(FALSE,NULL,fn,OFN_EXPLORER|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST,NULL,m_Daddy); |
1472 | CString title; | 1475 | CString title; |
1473 | title.LoadString(IDS_RENAME_TITLE); | 1476 | title.LoadString(IDS_RENAME_TITLE); |
1474 | cfd.m_ofn.lpstrTitle=(LPCTSTR)title; | 1477 | cfd.m_ofn.lpstrTitle=(LPCTSTR)title; |
1475 | if(cfd.DoModal()!=IDOK) | 1478 | if(cfd.DoModal()!=IDOK) |
1476 | return FALSE; | 1479 | return FALSE; |
1477 | fn = cfd.GetPathName(); | 1480 | fn = cfd.GetPathName(); |
1478 | return TRUE; | 1481 | return TRUE; |
1479 | } | 1482 | } |
1480 | 1483 | ||
1481 | void CWRQSocket::DoXfer() | 1484 | void CWRQSocket::DoXfer() |
1482 | { | 1485 | { |
1483 | tftp *p = tftp::Allocate(tftp::tftpACK::tftpSize()); | 1486 | tftp *p = tftp::Allocate(tftp::tftpACK::tftpSize()); |
1484 | ASSERT(p); | 1487 | ASSERT(p); |
1485 | p->SetOpcode(tftp::opACK); | 1488 | p->SetOpcode(tftp::opACK); |
1486 | p->data.m_ACK.SetBlock(m_ACK); | 1489 | p->data.m_ACK.SetBlock(m_ACK); |
1487 | TRACE1("WRQ-ACK-%u\n",m_ACK); | 1490 | TRACE1("WRQ-ACK-%u\n",m_ACK); |
1488 | PostTFTP(p,TRUE);// *** ??? Hope this is right | 1491 | PostTFTP(p,TRUE);// *** ??? Hope this is right |
1489 | } | 1492 | } |
1490 | 1493 | ||
1491 | UINT tftp::tftpACK::tftpSize() | 1494 | UINT tftp::tftpACK::tftpSize() |
1492 | { | 1495 | { |
1493 | return tftpHdrSize-tftpSlackSize+sizeof(tftp::tftpACK); | 1496 | return tftpHdrSize-tftpSlackSize+sizeof(tftp::tftpACK); |
1494 | } | 1497 | } |
1495 | 1498 | ||
1496 | ULONG CWRQSocket::GetACK() | 1499 | ULONG CWRQSocket::GetACK() |
1497 | { | 1500 | { |
1498 | return (m_ACK*m_blkSize)-m_LastSlack; | 1501 | return (m_ACK*m_blkSize)-m_LastSlack; |
1499 | } | 1502 | } |
1500 | 1503 | ||
1501 | void CXferSocket::ResetTimeout() | 1504 | void CXferSocket::ResetTimeout() |
1502 | { | 1505 | { |
1503 | ASSERT(m_Daddy); | 1506 | ASSERT(m_Daddy); |
1504 | m_Daddy->m_Retrier->KillTimer(m_hSocket); | 1507 | m_Daddy->m_Retrier->KillTimer(m_hSocket); |
1505 | if(m_Retry) | 1508 | if(m_Retry) |
1506 | m_Daddy->m_Retrier->SetTimer(m_hSocket,min(60,m_Daddy->m_RetryTimeOut.GetTotalSeconds())*1000,NULL); | 1509 | m_Daddy->m_Retrier->SetTimer(m_hSocket,min(60,m_Daddy->m_RetryTimeOut.GetTotalSeconds())*1000,NULL); |
1507 | if(!m_bRetry){ | 1510 | if(!m_bRetry){ |
1508 | m_Daddy->KillTimer(m_hSocket); | 1511 | m_Daddy->KillTimer(m_hSocket); |
1509 | m_Daddy->SetTimer(m_hSocket,min(60,m_timeOut)*1000,NULL); | 1512 | m_Daddy->SetTimer(m_hSocket,min(60,m_timeOut)*1000,NULL); |
1510 | } | 1513 | } |
1511 | } | 1514 | } |
1512 | 1515 | ||
1513 | void CXferSocket::Abort() | 1516 | void CXferSocket::Abort() |
1514 | { | 1517 | { |
1515 | ASSERT(m_Daddy); | 1518 | ASSERT(m_Daddy); |
1516 | CString tmp; | 1519 | CString tmp; |
1517 | tmp.Format(IDS_LOG_XFERABORTED,(LPCTSTR)m_FileName); | 1520 | tmp.Format(IDS_LOG_XFERABORTED,(LPCTSTR)m_FileName); |
1518 | m_Daddy->LogLine(tmp); | 1521 | m_Daddy->LogLine(tmp); |
1519 | Destroy(FALSE); | 1522 | Destroy(FALSE); |
1520 | } | 1523 | } |
1521 | 1524 | ||
1522 | void CPumpKINDlg::OnTimer(UINT nIDEvent) | 1525 | void CPumpKINDlg::OnTimer(UINT nIDEvent) |
1523 | { | 1526 | { |
1524 | CXferSocket *socket; | 1527 | CXferSocket *socket; |
1525 | if(m_Xfers.Lookup(nIDEvent,socket)){ | 1528 | if(m_Xfers.Lookup(nIDEvent,socket)){ |
1526 | CString tmp; | 1529 | CString tmp; |
1527 | tmp.Format(IDS_LOG_TIMEDOUT,socket->m_FileName); | 1530 | tmp.Format(IDS_LOG_TIMEDOUT,socket->m_FileName); |
1528 | LogLine(tmp); | 1531 | LogLine(tmp); |
1529 | socket->Abort(); | 1532 | socket->Abort(); |
1530 | }else{ | 1533 | }else{ |
1531 | TRACE0("Failed to find timed out socket!\n"); | 1534 | TRACE0("Failed to find timed out socket!\n"); |
1532 | } | 1535 | } |
1533 | CDialog::OnTimer(nIDEvent); | 1536 | CDialog::OnTimer(nIDEvent); |
1534 | } | 1537 | } |
1535 | 1538 | ||
1536 | void CPumpKINDlg::OnExit() | 1539 | void CPumpKINDlg::OnExit() |
1537 | { | 1540 | { |
1538 | if(!m_Xfers.IsEmpty()){ | 1541 | if(!m_Xfers.IsEmpty()){ |
1539 | CString title,text; | 1542 | CString title,text; |
1540 | title.LoadString(IDS_CONFIRMEXIT_TITLE); | 1543 | title.LoadString(IDS_CONFIRMEXIT_TITLE); |
1541 | text.LoadString(IDS_CONFIRMEXIT_TEXT); | 1544 | text.LoadString(IDS_CONFIRMEXIT_TEXT); |
1542 | if(MessageBox(text,title,MB_ICONQUESTION|MB_YESNO)!=IDYES) | 1545 | if(MessageBox(text,title,MB_ICONQUESTION|MB_YESNO)!=IDYES) |
1543 | return; | 1546 | return; |
1544 | } | 1547 | } |
1545 | m_bExiting=TRUE; | 1548 | m_bExiting=TRUE; |
1546 | EndDialog(IDOK); | 1549 | EndDialog(IDOK); |
1547 | } | 1550 | } |
1548 | 1551 | ||
1549 | void CPumpKINDlg::OnPut() | 1552 | void CPumpKINDlg::OnPut() |
1550 | { | 1553 | { |
1551 | CRequestDlg crd(NULL); | 1554 | CRequestDlg crd(NULL); |
1552 | crd.m_Put=TRUE; | 1555 | crd.m_Put=TRUE; |
1553 | crd.m_BSize=m_BlockSize; | 1556 | crd.m_BSize=m_BlockSize; |
1554 | if(crd.DoModal()==IDOK){ | 1557 | if(crd.DoModal()==IDOK){ |
1555 | CRRQSocket *socket = new CRRQSocket(this,crd.m_RemoteFile,crd.m_Type,NULL); | 1558 | CRRQSocket *socket = new CRRQSocket(this,crd.m_RemoteFile,crd.m_Type,NULL); |
1556 | if(crd.m_BSize) | 1559 | if(crd.m_BSize) |
1557 | socket->m__blkSize=crd.m_BSize; | 1560 | socket->m__blkSize=crd.m_BSize; |
1558 | if(!socket->Create(crd.m_LocalFile,crd.m_Host)) | 1561 | if(!socket->Create(crd.m_LocalFile,crd.m_Host)) |
1559 | socket->Destroy(); | 1562 | socket->Destroy(); |
1560 | } | 1563 | } |
1561 | } | 1564 | } |
1562 | 1565 | ||
1563 | void CPumpKINDlg::OnGet() | 1566 | void CPumpKINDlg::OnGet() |
1564 | { | 1567 | { |
1565 | CRequestDlg crd(NULL); | 1568 | CRequestDlg crd(NULL); |
1566 | crd.m_Put=FALSE; | 1569 | crd.m_Put=FALSE; |
1567 | crd.m_BSize=m_BlockSize; | 1570 | crd.m_BSize=m_BlockSize; |
1568 | if(crd.DoModal()==IDOK){ | 1571 | if(crd.DoModal()==IDOK){ |
1569 | CWRQSocket *socket = new CWRQSocket(this,crd.m_RemoteFile,crd.m_Type,NULL); | 1572 | CWRQSocket *socket = new CWRQSocket(this,crd.m_RemoteFile,crd.m_Type,NULL); |
1570 | if(crd.m_BSize) | 1573 | if(crd.m_BSize) |
1571 | socket->m__blkSize=crd.m_BSize; | 1574 | socket->m__blkSize=crd.m_BSize; |
1572 | if(!socket->Create(crd.m_LocalFile,crd.m_Host)) | 1575 | if(!socket->Create(crd.m_LocalFile,crd.m_Host)) |
1573 | socket->Destroy(); | 1576 | socket->Destroy(); |
1574 | } | 1577 | } |
1575 | } | 1578 | } |
1576 | 1579 | ||
1577 | void CPumpKINDlg::SetupButtons() | 1580 | void CPumpKINDlg::SetupButtons() |
1578 | { | 1581 | { |
1579 | m_AbortCtl.EnableWindow(m_List.GetSelectedCount()>0); | 1582 | m_AbortCtl.EnableWindow(m_List.GetSelectedCount()>0); |
1580 | } | 1583 | } |
1581 | 1584 | ||
1582 | void CPumpKINDlg::OnDeleteallitemsConnections(NMHDR* pNMHDR, LRESULT* pResult) | 1585 | void CPumpKINDlg::OnDeleteallitemsConnections(NMHDR* pNMHDR, LRESULT* pResult) |
1583 | { | 1586 | { |
1584 | NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; | 1587 | NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; |
1585 | SetupButtons(); | 1588 | SetupButtons(); |
1586 | *pResult = 0; | 1589 | *pResult = 0; |
1587 | } | 1590 | } |
1588 | 1591 | ||
1589 | void CPumpKINDlg::OnDeleteitemConnections(NMHDR* pNMHDR, LRESULT* pResult) | 1592 | void CPumpKINDlg::OnDeleteitemConnections(NMHDR* pNMHDR, LRESULT* pResult) |
1590 | { | 1593 | { |
1591 | NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; | 1594 | NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; |
1592 | SetupButtons(); | 1595 | SetupButtons(); |
1593 | *pResult = 0; | 1596 | *pResult = 0; |
1594 | } | 1597 | } |
1595 | 1598 | ||
1596 | void CPumpKINDlg::OnInsertitemConnections(NMHDR* pNMHDR, LRESULT* pResult) | 1599 | void CPumpKINDlg::OnInsertitemConnections(NMHDR* pNMHDR, LRESULT* pResult) |
1597 | { | 1600 | { |
1598 | NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; | 1601 | NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; |
1599 | SetupButtons(); | 1602 | SetupButtons(); |
1600 | *pResult = 0; | 1603 | *pResult = 0; |
1601 | } | 1604 | } |
1602 | 1605 | ||
1603 | void CPumpKINDlg::OnItemchangedConnections(NMHDR* pNMHDR, LRESULT* pResult) | 1606 | void CPumpKINDlg::OnItemchangedConnections(NMHDR* pNMHDR, LRESULT* pResult) |
1604 | { | 1607 | { |
1605 | NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; | 1608 | NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; |
1606 | SetupButtons(); | 1609 | SetupButtons(); |
1607 | *pResult = 0; | 1610 | *pResult = 0; |
1608 | } | 1611 | } |
1609 | 1612 | ||
1610 | void CPumpKINDlg::OnAbort() | 1613 | void CPumpKINDlg::OnAbort() |
1611 | { | 1614 | { |
1612 | if(!m_List.GetSelectedCount()) | 1615 | if(!m_List.GetSelectedCount()) |
1613 | return; | 1616 | return; |
1614 | intitems = m_List.GetItemCount(); | 1617 | intitems = m_List.GetItemCount(); |
1615 | for(int tmp=0;tmp<items;tmp++){ | 1618 | for(int tmp=0;tmp<items;tmp++){ |
1616 | if(!(m_List.GetItemState(tmp,LVIS_SELECTED)&LVIS_SELECTED)) | 1619 | if(!(m_List.GetItemState(tmp,LVIS_SELECTED)&LVIS_SELECTED)) |
1617 | continue; | 1620 | continue; |
1618 | CXferSocket *xfer = (CXferSocket*) m_List.GetItemData(tmp); | 1621 | CXferSocket *xfer = (CXferSocket*) m_List.GetItemData(tmp); |
1619 | ASSERT(xfer); | 1622 | ASSERT(xfer); |
1620 | xfer->Abort(); | 1623 | xfer->Abort(); |
1621 | } | 1624 | } |
1622 | } | 1625 | } |
1623 | 1626 | ||
1624 | void CXferSocket::OnFailedToResolve() | 1627 | void CXferSocket::OnFailedToResolve() |
1625 | { | 1628 | { |
1626 | TRACE0("Resolve failed\n"); | 1629 | TRACE0("Resolve failed\n"); |
1627 | delete m_wndResolver; | 1630 | delete m_wndResolver; |
1628 | m_wndResolver=NULL; | 1631 | m_wndResolver=NULL; |
1629 | ASSERT(m_Daddy); | 1632 | ASSERT(m_Daddy); |
1630 | CString tmp; | 1633 | CString tmp; |
1631 | tmp.Format(IDS_LOG_RESOLVEFAILED,m_HostName); | 1634 | tmp.Format(IDS_LOG_RESOLVEFAILED,m_HostName); |
1632 | m_Daddy->LogLine(tmp); | 1635 | m_Daddy->LogLine(tmp); |
1633 | Abort(); | 1636 | Abort(); |
1634 | } | 1637 | } |
1635 | 1638 | ||
1636 | void CXferSocket::OnResolved() | 1639 | void CXferSocket::OnResolved() |
1637 | { | 1640 | { |
1638 | delete m_wndResolver; | 1641 | delete m_wndResolver; |
1639 | m_wndResolver=NULL; | 1642 | m_wndResolver=NULL; |
1640 | TRACE0("Resolved\n"); | 1643 | TRACE0("Resolved\n"); |
1641 | m_Peer.sin_addr.s_addr = *(DWORD*)(((hostent*)m_ResolveBuff)->h_addr); | 1644 | m_Peer.sin_addr.s_addr = *(DWORD*)(((hostent*)m_ResolveBuff)->h_addr); |
1642 | } | 1645 | } |
1643 | 1646 | ||
1644 | void CRRQSocket::OnResolved() | 1647 | void CRRQSocket::OnResolved() |
1645 | { | 1648 | { |
1646 | CXferSocket::OnResolved(); | 1649 | CXferSocket::OnResolved(); |
1647 | OnHostKnown(); | 1650 | OnHostKnown(); |
1648 | } | 1651 | } |
1649 | 1652 | ||
1650 | void CRRQSocket::OnHostKnown() | 1653 | void CRRQSocket::OnHostKnown() |
1651 | { | 1654 | { |
1652 | ASSERT(m_Daddy); | 1655 | ASSERT(m_Daddy); |
1653 | m_Peer.sin_port=htons(m_Daddy->m_SpeakPort); | 1656 | m_Peer.sin_port=htons(m_Daddy->m_SpeakPort); |
1654 | tftp::tftpOptions o; | 1657 | tftp::tftpOptions o; |
1655 | CString v; | 1658 | CString v; |
1656 | ASSERT(m_xferSize>=0); | 1659 | ASSERT(m_xferSize>=0); |
1657 | v.Format("%lu",m_xferSize); | 1660 | v.Format("%lu",m_xferSize); |
1658 | o[tftpoTSize] = v; | 1661 | o[tftpoTSize] = v; |
1659 | ASSERT(m__blkSize); | 1662 | ASSERT(m__blkSize); |
1660 | v.Format("%u",m__blkSize); | 1663 | v.Format("%u",m__blkSize); |
1661 | o[tftpoBSize] = v; | 1664 | o[tftpoBSize] = v; |
1662 | ASSERT(m__timeOut); | 1665 | ASSERT(m__timeOut); |
1663 | v.Format("%u",m__timeOut); | 1666 | v.Format("%u",m__timeOut); |
1664 | o[tftpoTOut] = v; | 1667 | o[tftpoTOut] = v; |
1665 | o[tftpoXResume] = "0"; | 1668 | o[tftpoXResume] = "0"; |
1666 | tftp*p = tftp::Allocate(tftp::tftpWRQ::tftpSize(m_FileName,m_Type,&o)); | 1669 | tftp*p = tftp::Allocate(tftp::tftpWRQ::tftpSize(m_FileName,m_Type,&o)); |
1667 | ASSERT(p); | 1670 | ASSERT(p); |
1668 | p->SetOpcode(tftp::opWRQ); | 1671 | p->SetOpcode(tftp::opWRQ); |
1669 | p->data.m_WRQ.Set(m_FileName,m_Type,&o); | 1672 | p->data.m_WRQ.Set(m_FileName,m_Type,&o); |
1670 | PostTFTP(p,TRUE); | 1673 | PostTFTP(p,TRUE); |
1671 | state=stateInit; | 1674 | state=stateInit; |
1672 | UpdateList(); | 1675 | UpdateList(); |
1673 | } | 1676 | } |
1674 | 1677 | ||
1675 | UINT tftp::tftpRQ::tftpSize(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) | 1678 | UINT tftp::tftpRQ::tftpSize(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) |
1676 | { | 1679 | { |
1677 | UINT rv = tftpHdrSize-tftpSlackSize+strlen(file)+1+strlen(type)+1; | 1680 | UINT rv = tftpHdrSize-tftpSlackSize+strlen(file)+1+strlen(type)+1; |
1678 | if(ops){ | 1681 | if(ops){ |
1679 | tftpOptions& o = *ops; | 1682 | tftpOptions& o = *ops; |
1680 | POSITION p = o.GetStartPosition(); | 1683 | POSITION p = o.GetStartPosition(); |
1681 | while(p){ | 1684 | while(p){ |
1682 | CString n,v; | 1685 | CString n,v; |
1683 | o.GetNextAssoc(p,n,v); | 1686 | o.GetNextAssoc(p,n,v); |
1684 | rv+=n.GetLength()+1+v.GetLength()+1; | 1687 | rv+=n.GetLength()+1+v.GetLength()+1; |
1685 | } | 1688 | } |
1686 | } | 1689 | } |
1687 | return rv; | 1690 | return rv; |
1688 | } | 1691 | } |
1689 | UINT tftp::tftpRRQ::tftpSize(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) | 1692 | UINT tftp::tftpRRQ::tftpSize(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) |
1690 | { | 1693 | { |
1691 | return tftp::tftpRQ::tftpSize(file,type,ops); | 1694 | return tftp::tftpRQ::tftpSize(file,type,ops); |
1692 | } | 1695 | } |
1693 | UINT tftp::tftpWRQ::tftpSize(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) | 1696 | UINT tftp::tftpWRQ::tftpSize(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) |
1694 | { | 1697 | { |
1695 | return tftp::tftpRQ::tftpSize(file,type,ops); | 1698 | return tftp::tftpRQ::tftpSize(file,type,ops); |
1696 | } | 1699 | } |
1697 | UINT tftp::tftpOACK::tftpSize(tftp::tftpOptions* ops) | 1700 | UINT tftp::tftpOACK::tftpSize(tftp::tftpOptions* ops) |
1698 | { | 1701 | { |
1699 | UINT rv = tftpHdrSize-tftpSlackSize; | 1702 | UINT rv = tftpHdrSize-tftpSlackSize; |
1700 | if(ops){ | 1703 | if(ops){ |
1701 | tftpOptions& o = *ops; | 1704 | tftpOptions& o = *ops; |
1702 | POSITION p = o.GetStartPosition(); | 1705 | POSITION p = o.GetStartPosition(); |
1703 | while(p){ | 1706 | while(p){ |
1704 | CString n,v; | 1707 | CString n,v; |
1705 | o.GetNextAssoc(p,n,v); | 1708 | o.GetNextAssoc(p,n,v); |
1706 | rv+=n.GetLength()+1+v.GetLength()+1; | 1709 | rv+=n.GetLength()+1+v.GetLength()+1; |
1707 | } | 1710 | } |
1708 | } | 1711 | } |
1709 | return rv; | 1712 | return rv; |
1710 | } | 1713 | } |
1711 | void tftp::tftpRQ::Set(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) | 1714 | void tftp::tftpRQ::Set(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) |
1712 | { | 1715 | { |
1713 | // MAY BE DANGEROUS! | 1716 | // MAY BE DANGEROUS! |
1714 | UINT ptr = 0; | 1717 | UINT ptr = 0; |
1715 | strcpy((LPTSTR)&data[ptr],file); ptr+=strlen(file)+1; | 1718 | strcpy((LPTSTR)&data[ptr],file); ptr+=strlen(file)+1; |
1716 | strcpy((LPTSTR)&data[ptr],type); ptr+=strlen(type)+1; | 1719 | strcpy((LPTSTR)&data[ptr],type); ptr+=strlen(type)+1; |
1717 | if(ops){ | 1720 | if(ops){ |
1718 | tftpOptions& o = *ops; | 1721 | tftpOptions& o = *ops; |
1719 | POSITION p = o.GetStartPosition(); | 1722 | POSITION p = o.GetStartPosition(); |
1720 | while(p){ | 1723 | while(p){ |
1721 | CString n,v; | 1724 | CString n,v; |
1722 | o.GetNextAssoc(p,n,v); | 1725 | o.GetNextAssoc(p,n,v); |
1723 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)n); ptr+=n.GetLength()+1; | 1726 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)n); ptr+=n.GetLength()+1; |
1724 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)v); ptr+=v.GetLength()+1; | 1727 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)v); ptr+=v.GetLength()+1; |
1725 | } | 1728 | } |
1726 | } | 1729 | } |
1727 | } | 1730 | } |
1728 | void tftp::tftpRRQ::Set(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) | 1731 | void tftp::tftpRRQ::Set(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) |
1729 | { | 1732 | { |
1730 | // MAY BE DANGEROUS! | 1733 | // MAY BE DANGEROUS! |
1731 | UINT ptr = 0; | 1734 | UINT ptr = 0; |
1732 | strcpy((LPTSTR)&data[ptr],file); ptr+=strlen(file)+1; | 1735 | strcpy((LPTSTR)&data[ptr],file); ptr+=strlen(file)+1; |
1733 | strcpy((LPTSTR)&data[ptr],type); ptr+=strlen(type)+1; | 1736 | strcpy((LPTSTR)&data[ptr],type); ptr+=strlen(type)+1; |
1734 | if(ops){ | 1737 | if(ops){ |
1735 | tftpOptions& o = *ops; | 1738 | tftpOptions& o = *ops; |
1736 | POSITION p = o.GetStartPosition(); | 1739 | POSITION p = o.GetStartPosition(); |
1737 | while(p){ | 1740 | while(p){ |
1738 | CString n,v; | 1741 | CString n,v; |
1739 | o.GetNextAssoc(p,n,v); | 1742 | o.GetNextAssoc(p,n,v); |
1740 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)n); ptr+=n.GetLength()+1; | 1743 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)n); ptr+=n.GetLength()+1; |
1741 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)v); ptr+=v.GetLength()+1; | 1744 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)v); ptr+=v.GetLength()+1; |
1742 | } | 1745 | } |
1743 | } | 1746 | } |
1744 | } | 1747 | } |
1745 | void tftp::tftpWRQ::Set(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) | 1748 | void tftp::tftpWRQ::Set(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) |
1746 | { | 1749 | { |
1747 | // MAY BE DANGEROUS! | 1750 | // MAY BE DANGEROUS! |
1748 | UINT ptr = 0; | 1751 | UINT ptr = 0; |
1749 | strcpy((LPTSTR)&data[ptr],file); ptr+=strlen(file)+1; | 1752 | strcpy((LPTSTR)&data[ptr],file); ptr+=strlen(file)+1; |
1750 | strcpy((LPTSTR)&data[ptr],type); ptr+=strlen(type)+1; | 1753 | strcpy((LPTSTR)&data[ptr],type); ptr+=strlen(type)+1; |
1751 | if(ops){ | 1754 | if(ops){ |
1752 | tftpOptions& o = *ops; | 1755 | tftpOptions& o = *ops; |
1753 | POSITION p = o.GetStartPosition(); | 1756 | POSITION p = o.GetStartPosition(); |
1754 | while(p){ | 1757 | while(p){ |
1755 | CString n,v; | 1758 | CString n,v; |
1756 | o.GetNextAssoc(p,n,v); | 1759 | o.GetNextAssoc(p,n,v); |
1757 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)n); ptr+=n.GetLength()+1; | 1760 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)n); ptr+=n.GetLength()+1; |
1758 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)v); ptr+=v.GetLength()+1; | 1761 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)v); ptr+=v.GetLength()+1; |
1759 | } | 1762 | } |
1760 | } | 1763 | } |
1761 | } | 1764 | } |
1762 | void tftp::tftpOACK::Set(tftpOptions* ops) | 1765 | void tftp::tftpOACK::Set(tftpOptions* ops) |
1763 | { | 1766 | { |
1764 | ASSERT(ops); | 1767 | ASSERT(ops); |
1765 | UINT ptr = 0; | 1768 | UINT ptr = 0; |
1766 | tftpOptions& o = *ops; | 1769 | tftpOptions& o = *ops; |
1767 | POSITION p = o.GetStartPosition(); | 1770 | POSITION p = o.GetStartPosition(); |
1768 | while(p){ | 1771 | while(p){ |
1769 | CString n,v; | 1772 | CString n,v; |
1770 | o.GetNextAssoc(p,n,v); | 1773 | o.GetNextAssoc(p,n,v); |
1771 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)n); ptr+=n.GetLength()+1; | 1774 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)n); ptr+=n.GetLength()+1; |
1772 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)v); ptr+=v.GetLength()+1; | 1775 | strcpy((LPTSTR)&data[ptr],(LPCTSTR)v); ptr+=v.GetLength()+1; |
1773 | } | 1776 | } |
1774 | } | 1777 | } |
1775 | 1778 | ||
1776 | void CWRQSocket::OnResolved() | 1779 | void CWRQSocket::OnResolved() |
1777 | { | 1780 | { |
1778 | CXferSocket::OnResolved(); | 1781 | CXferSocket::OnResolved(); |
1779 | OnHostKnown(); | 1782 | OnHostKnown(); |
1780 | } | 1783 | } |
1781 | 1784 | ||
1782 | void CWRQSocket::OnHostKnown() | 1785 | void CWRQSocket::OnHostKnown() |
1783 | { | 1786 | { |
1784 | ASSERT(m_Daddy); | 1787 | ASSERT(m_Daddy); |
1785 | m_Peer.sin_port=htons(m_Daddy->m_SpeakPort); | 1788 | m_Peer.sin_port=htons(m_Daddy->m_SpeakPort); |
1786 | tftp::tftpOptions o; | 1789 | tftp::tftpOptions o; |
1787 | CString v; | 1790 | CString v; |
1788 | o[tftpoTSize]="0"; | 1791 | o[tftpoTSize]="0"; |
1789 | if(m__blkSize){ | 1792 | if(m__blkSize){ |
1790 | v.Format("%u",m__blkSize); | 1793 | v.Format("%u",m__blkSize); |
1791 | o[tftpoBSize]=v; | 1794 | o[tftpoBSize]=v; |
1792 | } | 1795 | } |
1793 | if(m__timeOut){ | 1796 | if(m__timeOut){ |
1794 | v.Format("%u",m__timeOut); | 1797 | v.Format("%u",m__timeOut); |
1795 | o[tftpoTOut]=v; | 1798 | o[tftpoTOut]=v; |
1796 | } | 1799 | } |
1797 | tftp*p = tftp::Allocate(tftp::tftpRRQ::tftpSize(m_FileName,m_Type,&o)); | 1800 | tftp*p = tftp::Allocate(tftp::tftpRRQ::tftpSize(m_FileName,m_Type,&o)); |
1798 | ASSERT(p); | 1801 | ASSERT(p); |
1799 | p->SetOpcode(tftp::opRRQ); | 1802 | p->SetOpcode(tftp::opRRQ); |
1800 | p->data.m_RRQ.Set(m_FileName,m_Type,&o); | 1803 | p->data.m_RRQ.Set(m_FileName,m_Type,&o); |
1801 | PostTFTP(p,TRUE); | 1804 | PostTFTP(p,TRUE); |
1802 | state=stateInit; | 1805 | state=stateInit; |
1803 | UpdateList(); | 1806 | UpdateList(); |
1804 | } | 1807 | } |
1805 | 1808 | ||
1806 | void CPumpKINDlg::OnClose() | 1809 | void CPumpKINDlg::OnClose() |
1807 | { | 1810 | { |
1808 | OnTrayShowpumpkinwindow(); | 1811 | OnTrayShowpumpkinwindow(); |
1809 | } | 1812 | } |
1810 | 1813 | ||
1811 | void CPumpKINDlg::OnTrayShowpumpkinwindow() | 1814 | void CPumpKINDlg::OnTrayShowpumpkinwindow() |
1812 | { | 1815 | { |
1813 | if(IsWindowVisible()){ | 1816 | if(IsWindowVisible()){ |
1814 | m_bShown=FALSE; | 1817 | m_bShown=FALSE; |
1815 | ShowWindow(SW_HIDE); | 1818 | ShowWindow(SW_HIDE); |
1816 | }else{ | 1819 | }else{ |
1817 | m_bShown=TRUE; | 1820 | m_bShown=TRUE; |
1818 | ShowWindow(SW_SHOW); | 1821 | ShowWindow(SW_SHOW); |
1819 | SetForegroundWindow(); | 1822 | SetForegroundWindow(); |
1820 | SetFocus(); | 1823 | SetFocus(); |
1821 | } | 1824 | } |
1822 | } | 1825 | } |
1823 | 1826 | ||
1824 | void CPumpKINDlg::OnTrayExit() | 1827 | void CPumpKINDlg::OnTrayExit() |
1825 | { | 1828 | { |
1826 | OnExit(); | 1829 | OnExit(); |
1827 | } | 1830 | } |
1828 | 1831 | ||
1829 | void CPumpKINDlg::OnTrayAboutpumpkin() | 1832 | void CPumpKINDlg::OnTrayAboutpumpkin() |
1830 | { | 1833 | { |
1831 | CAboutDlg dlgAbout; | 1834 | CAboutDlg dlgAbout; |
1832 | dlgAbout.DoModal(); | 1835 | dlgAbout.DoModal(); |
1833 | } | 1836 | } |
1834 | 1837 | ||
1835 | void CPumpKINDlg::OnTrayFetchfile() | 1838 | void CPumpKINDlg::OnTrayFetchfile() |
1836 | { | 1839 | { |
1837 | OnGet(); | 1840 | OnGet(); |
1838 | } | 1841 | } |
1839 | 1842 | ||
1840 | void CPumpKINDlg::OnTrayHelp() | 1843 | void CPumpKINDlg::OnTrayHelp() |
1841 | { | 1844 | { |
1842 | OnHelp(); | 1845 | OnHelp(); |
1843 | } | 1846 | } |
1844 | 1847 | ||
1845 | void CPumpKINDlg::OnTrayOptions() | 1848 | void CPumpKINDlg::OnTrayOptions() |
1846 | { | 1849 | { |
1847 | OnOptions(); | 1850 | OnOptions(); |
1848 | } | 1851 | } |
1849 | 1852 | ||
1850 | void CPumpKINDlg::OnTraySendfile() | 1853 | void CPumpKINDlg::OnTraySendfile() |
1851 | { | 1854 | { |
1852 | OnPut(); | 1855 | OnPut(); |
1853 | } | 1856 | } |
1854 | 1857 | ||
1855 | void CPumpKINDlg::LoadSettings() | 1858 | void CPumpKINDlg::LoadSettings() |
1856 | { | 1859 | { |
1857 | CWinApp *app = AfxGetApp(); | 1860 | CWinApp *app = AfxGetApp(); |
1858 | ASSERT(app); | 1861 | ASSERT(app); |
1859 | m_bListen=app->GetProfileInt("TFTPSettings","Listen",m_bListen); | 1862 | m_bListen=app->GetProfileInt("TFTPSettings","Listen",m_bListen); |
1860 | m_bnwRequest=app->GetProfileString("BellsNWhistles","Request",m_bnwRequest); | 1863 | m_bnwRequest=app->GetProfileString("BellsNWhistles","Request",m_bnwRequest); |
1861 | m_bnwSuccess=app->GetProfileString("BellsNWhistles","Success",m_bnwSuccess); | 1864 | m_bnwSuccess=app->GetProfileString("BellsNWhistles","Success",m_bnwSuccess); |
1862 | m_bnwAbort=app->GetProfileString("BellsNWhistles","Abort",m_bnwAbort); | 1865 | m_bnwAbort=app->GetProfileString("BellsNWhistles","Abort",m_bnwAbort); |
1863 | m_bTFTPSubdirs=app->GetProfileInt("TFTPSettings","Subdirs",m_bTFTPSubdirs); | 1866 | m_bTFTPSubdirs=app->GetProfileInt("TFTPSettings","Subdirs",m_bTFTPSubdirs); |
1864 | m_ListenPort=app->GetProfileInt("TFTPSettings","ListenPort",m_ListenPort); | 1867 | m_ListenPort=app->GetProfileInt("TFTPSettings","ListenPort",m_ListenPort); |
1865 | m_LogLength=app->GetProfileInt("UISettings","LogLength",m_LogLength); | 1868 | m_LogLength=app->GetProfileInt("UISettings","LogLength",m_LogLength); |
1866 | m_PromptTimeOut=app->GetProfileInt("UISettings","PromptTimeout",m_PromptTimeOut); | 1869 | m_PromptTimeOut=app->GetProfileInt("UISettings","PromptTimeout",m_PromptTimeOut); |
1867 | m_RRQMode=app->GetProfileInt("TFTPSettings","RRQMode",m_RRQMode); | 1870 | m_RRQMode=app->GetProfileInt("TFTPSettings","RRQMode",m_RRQMode); |
1868 | m_SpeakPort=app->GetProfileInt("TFTPSettings","SpeakPort",m_SpeakPort); | 1871 | m_SpeakPort=app->GetProfileInt("TFTPSettings","SpeakPort",m_SpeakPort); |
1869 | m_TFTPRoot=app->GetProfileString("TFTPSettings","TFTPRoot",m_TFTPRoot); | 1872 | m_TFTPRoot=app->GetProfileString("TFTPSettings","TFTPRoot",m_TFTPRoot); |
1870 | m_LogFile=app->GetProfileString("General","LogFile",m_LogFile); | 1873 | m_LogFile=app->GetProfileString("General","LogFile",m_LogFile); |
1871 | m_TFTPTimeOut=CTimeSpan(app->GetProfileInt("TFTPSettings","TFTPTimeout",m_TFTPTimeOut.GetTotalSeconds())); | 1874 | m_TFTPTimeOut=CTimeSpan(app->GetProfileInt("TFTPSettings","TFTPTimeout",m_TFTPTimeOut.GetTotalSeconds())); |
1872 | m_BlockSize=app->GetProfileInt("TFTPSettings","TFTPBlockSize",m_BlockSize); | 1875 | m_BlockSize=app->GetProfileInt("TFTPSettings","TFTPBlockSize",m_BlockSize); |
1873 | m_RetryTimeOut=CTimeSpan(app->GetProfileInt("TFTPSettings","RetryTimeout",m_RetryTimeOut.GetTotalSeconds())); | 1876 | m_RetryTimeOut=CTimeSpan(app->GetProfileInt("TFTPSettings","RetryTimeout",m_RetryTimeOut.GetTotalSeconds())); |
1874 | m_WRQMode=app->GetProfileInt("TFTPSettings","WRQMode",m_WRQMode); | 1877 | m_WRQMode=app->GetProfileInt("TFTPSettings","WRQMode",m_WRQMode); |
1875 | m_bShown=app->GetProfileInt("UISettings","Visble",m_bShown); | 1878 | m_bShown=app->GetProfileInt("UISettings","Visble",m_bShown); |
1876 | if(m_TFTPRoot.IsEmpty()){ | 1879 | if(m_TFTPRoot.IsEmpty()){ |
1877 | DWORD dL = ::GetCurrentDirectory(0,NULL); | 1880 | DWORD dL = ::GetCurrentDirectory(0,NULL); |
1878 | VERIFY(::GetCurrentDirectory(dL,m_TFTPRoot.GetBuffer(dL))); | 1881 | VERIFY(::GetCurrentDirectory(dL,m_TFTPRoot.GetBuffer(dL))); |
1879 | m_TFTPRoot.ReleaseBuffer(); | 1882 | m_TFTPRoot.ReleaseBuffer(); |
1880 | } | 1883 | } |
1881 | ::SetCurrentDirectory(m_TFTPRoot); | 1884 | ::SetCurrentDirectory(m_TFTPRoot); |
1882 | m_aclRules.LoadProfile(app); | 1885 | m_aclRules.LoadProfile(app); |
1883 | } | 1886 | } |
1884 | 1887 | ||
1885 | void CPumpKINDlg::SaveSettings() | 1888 | void CPumpKINDlg::SaveSettings() |
1886 | { | 1889 | { |
1887 | CWinApp *app = AfxGetApp(); | 1890 | CWinApp *app = AfxGetApp(); |
1888 | ASSERT(app); | 1891 | ASSERT(app); |
1889 | app->WriteProfileInt("TFTPSettings","Listen",m_bListen); | 1892 | app->WriteProfileInt("TFTPSettings","Listen",m_bListen); |
1890 | app->WriteProfileString("BellsNWhistles","Request",m_bnwRequest); | 1893 | app->WriteProfileString("BellsNWhistles","Request",m_bnwRequest); |
1891 | app->WriteProfileString("BellsNWhistles","Success",m_bnwSuccess); | 1894 | app->WriteProfileString("BellsNWhistles","Success",m_bnwSuccess); |
1892 | app->WriteProfileString("BellsNWhistles","Abort",m_bnwAbort); | 1895 | app->WriteProfileString("BellsNWhistles","Abort",m_bnwAbort); |
1893 | app->WriteProfileInt("TFTPSettings","Subdirs",m_bTFTPSubdirs); | 1896 | app->WriteProfileInt("TFTPSettings","Subdirs",m_bTFTPSubdirs); |
1894 | app->WriteProfileInt("TFTPSettings","ListenPort",m_ListenPort); | 1897 | app->WriteProfileInt("TFTPSettings","ListenPort",m_ListenPort); |
1895 | app->WriteProfileInt("UISettings","LogLength",m_LogLength); | 1898 | app->WriteProfileInt("UISettings","LogLength",m_LogLength); |
1896 | app->WriteProfileInt("UISettings","PromptTimeout",m_PromptTimeOut); | 1899 | app->WriteProfileInt("UISettings","PromptTimeout",m_PromptTimeOut); |
1897 | app->WriteProfileInt("TFTPSettings","RRQMode",m_RRQMode); | 1900 | app->WriteProfileInt("TFTPSettings","RRQMode",m_RRQMode); |
1898 | app->WriteProfileInt("TFTPSettings","SpeakPort",m_SpeakPort); | 1901 | app->WriteProfileInt("TFTPSettings","SpeakPort",m_SpeakPort); |
1899 | app->WriteProfileString("TFTPSettings","TFTPRoot",m_TFTPRoot); | 1902 | app->WriteProfileString("TFTPSettings","TFTPRoot",m_TFTPRoot); |
1900 | app->WriteProfileString("General","LogFile",m_LogFile); | 1903 | app->WriteProfileString("General","LogFile",m_LogFile); |
1901 | app->WriteProfileInt("TFTPSettings","TFTPTimeout",m_TFTPTimeOut.GetTotalSeconds()); | 1904 | app->WriteProfileInt("TFTPSettings","TFTPTimeout",m_TFTPTimeOut.GetTotalSeconds()); |
1902 | app->WriteProfileInt("TFTPSettings","TFTPBlockSize",m_BlockSize); | 1905 | app->WriteProfileInt("TFTPSettings","TFTPBlockSize",m_BlockSize); |
1903 | app->WriteProfileInt("TFTPSettings","RetryTimeout",m_RetryTimeOut.GetTotalSeconds()); | 1906 | app->WriteProfileInt("TFTPSettings","RetryTimeout",m_RetryTimeOut.GetTotalSeconds()); |
1904 | app->WriteProfileInt("TFTPSettings","WRQMode",m_WRQMode); | 1907 | app->WriteProfileInt("TFTPSettings","WRQMode",m_WRQMode); |
1905 | app->WriteProfileInt("UISettings","Visble",m_bShown); | 1908 | app->WriteProfileInt("UISettings","Visble",m_bShown); |
1906 | m_aclRules.SaveProfile(app); | 1909 | m_aclRules.SaveProfile(app); |
1907 | } | 1910 | } |
1908 | 1911 | ||
1909 | void CPumpKINDlg::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos) | 1912 | void CPumpKINDlg::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos) |
@@ -1,686 +1,687 @@ | |||
1 | //Microsoft Developer Studio generated resource script. | 1 | //Microsoft Developer Studio generated resource script. |
2 | // | 2 | // |
3 | #include "resource.h" | 3 | #include "resource.h" |
4 | 4 | ||
5 | #define APSTUDIO_READONLY_SYMBOLS | 5 | #define APSTUDIO_READONLY_SYMBOLS |
6 | ///////////////////////////////////////////////////////////////////////////// | 6 | ///////////////////////////////////////////////////////////////////////////// |
7 | // | 7 | // |
8 | // Generated from the TEXTINCLUDE 2 resource. | 8 | // Generated from the TEXTINCLUDE 2 resource. |
9 | // | 9 | // |
10 | #include "afxres.h" | 10 | #include "afxres.h" |
11 | 11 | ||
12 | ///////////////////////////////////////////////////////////////////////////// | 12 | ///////////////////////////////////////////////////////////////////////////// |
13 | #undef APSTUDIO_READONLY_SYMBOLS | 13 | #undef APSTUDIO_READONLY_SYMBOLS |
14 | 14 | ||
15 | ///////////////////////////////////////////////////////////////////////////// | 15 | ///////////////////////////////////////////////////////////////////////////// |
16 | // English (U.S.) resources | 16 | // English (U.S.) resources |
17 | 17 | ||
18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) |
19 | #ifdef _WIN32 | 19 | #ifdef _WIN32 |
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US | 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US |
21 | #pragma code_page(1252) | 21 | #pragma code_page(1252) |
22 | #endif //_WIN32 | 22 | #endif //_WIN32 |
23 | 23 | ||
24 | #ifdef APSTUDIO_INVOKED | 24 | #ifdef APSTUDIO_INVOKED |
25 | ///////////////////////////////////////////////////////////////////////////// | 25 | ///////////////////////////////////////////////////////////////////////////// |
26 | // | 26 | // |
27 | // TEXTINCLUDE | 27 | // TEXTINCLUDE |
28 | // | 28 | // |
29 | 29 | ||
30 | 1 TEXTINCLUDE DISCARDABLE | 30 | 1 TEXTINCLUDE DISCARDABLE |
31 | BEGIN | 31 | BEGIN |
32 | "resource.h\0" | 32 | "resource.h\0" |
33 | END | 33 | END |
34 | 34 | ||
35 | 2 TEXTINCLUDE DISCARDABLE | 35 | 2 TEXTINCLUDE DISCARDABLE |
36 | BEGIN | 36 | BEGIN |
37 | "#include ""afxres.h""\r\n" | 37 | "#include ""afxres.h""\r\n" |
38 | "\0" | 38 | "\0" |
39 | END | 39 | END |
40 | 40 | ||
41 | 3 TEXTINCLUDE DISCARDABLE | 41 | 3 TEXTINCLUDE DISCARDABLE |
42 | BEGIN | 42 | BEGIN |
43 | "#define _AFX_NO_SPLITTER_RESOURCES\r\n" | 43 | "#define _AFX_NO_SPLITTER_RESOURCES\r\n" |
44 | "#define _AFX_NO_OLE_RESOURCES\r\n" | 44 | "#define _AFX_NO_OLE_RESOURCES\r\n" |
45 | "#define _AFX_NO_TRACKER_RESOURCES\r\n" | 45 | "#define _AFX_NO_TRACKER_RESOURCES\r\n" |
46 | "#define _AFX_NO_PROPERTY_RESOURCES\r\n" | 46 | "#define _AFX_NO_PROPERTY_RESOURCES\r\n" |
47 | "\r\n" | 47 | "\r\n" |
48 | "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" | 48 | "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" |
49 | "#ifdef _WIN32\r\n" | 49 | "#ifdef _WIN32\r\n" |
50 | "LANGUAGE 9, 1\r\n" | 50 | "LANGUAGE 9, 1\r\n" |
51 | "#pragma code_page(1252)\r\n" | 51 | "#pragma code_page(1252)\r\n" |
52 | "#endif\r\n" | 52 | "#endif\r\n" |
53 | "#include ""res\\PumpKIN.rc2"" // non-Microsoft Visual C++ edited resources\r\n" | 53 | "#include ""res\\PumpKIN.rc2"" // non-Microsoft Visual C++ edited resources\r\n" |
54 | "#include ""afxres.rc"" // Standard components\r\n" | 54 | "#include ""afxres.rc"" // Standard components\r\n" |
55 | "#endif\0" | 55 | "#endif\0" |
56 | END | 56 | END |
57 | 57 | ||
58 | #endif // APSTUDIO_INVOKED | 58 | #endif // APSTUDIO_INVOKED |
59 | 59 | ||
60 | 60 | ||
61 | ///////////////////////////////////////////////////////////////////////////// | 61 | ///////////////////////////////////////////////////////////////////////////// |
62 | // | 62 | // |
63 | // Icon | 63 | // Icon |
64 | // | 64 | // |
65 | 65 | ||
66 | // Icon with lowest ID value placed first to ensure application icon | 66 | // Icon with lowest ID value placed first to ensure application icon |
67 | // remains consistent on all systems. | 67 | // remains consistent on all systems. |
68 | IDI_RRQ ICON DISCARDABLE "res\\wrq.ico" | 68 | IDI_RRQ ICON DISCARDABLE "res\\wrq.ico" |
69 | IDI_WRQ ICON DISCARDABLE "res\\rrq.ico" | 69 | IDI_WRQ ICON DISCARDABLE "res\\rrq.ico" |
70 | IDI_BROWSE ICON DISCARDABLE "shared-data/browse-icon.ico" | 70 | IDI_BROWSE ICON DISCARDABLE "shared-data/browse-icon.ico" |
71 | IDR_MAINFRAME ICON DISCARDABLE "res\\pumpkin.ico" | 71 | IDR_MAINFRAME ICON DISCARDABLE "res\\pumpkin.ico" |
72 | IDI_PLAY ICON DISCARDABLE "shared-data/play-icon.ico" | 72 | IDI_PLAY ICON DISCARDABLE "shared-data/play-icon.ico" |
73 | IDI_UP ICON DISCARDABLE "res\\up.ico" | 73 | IDI_UP ICON DISCARDABLE "res\\up.ico" |
74 | IDI_DOWN ICON DISCARDABLE "res\\down.ico" | 74 | IDI_DOWN ICON DISCARDABLE "res\\down.ico" |
75 | IDI_REMOVE ICON DISCARDABLE "res\\remove.ico" | 75 | IDI_REMOVE ICON DISCARDABLE "res\\remove.ico" |
76 | 76 | ||
77 | ///////////////////////////////////////////////////////////////////////////// | 77 | ///////////////////////////////////////////////////////////////////////////// |
78 | // | 78 | // |
79 | // Dialog | 79 | // Dialog |
80 | // | 80 | // |
81 | 81 | ||
82 | IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 217, 74 | 82 | IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 217, 74 |
83 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | 83 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
84 | CAPTION "About PumpKIN" | 84 | CAPTION "About PumpKIN" |
85 | FONT 8, "MS Sans Serif" | 85 | FONT 8, "MS Sans Serif" |
86 | BEGIN | 86 | BEGIN |
87 | ICON IDR_MAINFRAME,IDC_STATIC,7,17,18,20 | 87 | ICON IDR_MAINFRAME,IDC_STATIC,7,17,18,20 |
88 | LTEXT "PumpKIN, Version 2.7.1",IDC_STATIC,40,15,119,8, | 88 | LTEXT "PumpKIN, Version 2.7.1",IDC_STATIC,40,15,119,8, |
89 | SS_NOPREFIX | 89 | SS_NOPREFIX |
90 | LTEXT "Copyright © 1997-2006 Klever Group",IDC_STATIC,40,30, | 90 | LTEXT "Copyright © 1997-2006 Klever Group",IDC_STATIC,40,30, |
91 | 170,8 | 91 | 170,8 |
92 | DEFPUSHBUTTON "OK",IDOK,178,7,32,14,WS_GROUP | 92 | DEFPUSHBUTTON "OK",IDOK,178,7,32,14,WS_GROUP |
93 | PUSHBUTTON "http://www.klever.net/",IDC_KLEVERNET,124,53,86,14 | 93 | PUSHBUTTON "http://www.klever.net/",IDC_KLEVERNET,124,53,86,14 |
94 | END | 94 | END |
95 | 95 | ||
96 | IDD_PUMPKIN_DIALOG DIALOGEX 0, 0, 362, 193 | 96 | IDD_PUMPKIN_DIALOG DIALOGEX 0, 0, 362, 193 |
97 | STYLE DS_3DLOOK | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | 97 | STYLE DS_3DLOOK | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME |
98 | EXSTYLE WS_EX_ACCEPTFILES | WS_EX_APPWINDOW | 98 | EXSTYLE WS_EX_ACCEPTFILES | WS_EX_APPWINDOW |
99 | CAPTION " PumpKIN" | 99 | CAPTION " PumpKIN" |
100 | FONT 8, "MS Sans Serif" | 100 | FONT 8, "MS Sans Serif", 0, 0, 0x1 |
101 | BEGIN | 101 | BEGIN |
102 | CONTROL "List1",IDC_CONNECTIONS,"SysListView32",LVS_REPORT | | 102 | CONTROL "List1",IDC_CONNECTIONS,"SysListView32",LVS_REPORT | |
103 | LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP,7,7,295,108, | 103 | LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP,7,7,295,108, |
104 | WS_EX_DLGMODALFRAME | 104 | WS_EX_DLGMODALFRAME |
105 | PUSHBUTTON "&Get File",IDC_GET,305,7,50,17,BS_NOTIFY, | 105 | PUSHBUTTON "&Get File",IDC_GET,305,7,50,17,BS_NOTIFY, |
106 | WS_EX_CLIENTEDGE | 106 | WS_EX_CLIENTEDGE |
107 | PUSHBUTTON "&Put File",IDC_PUT,305,25,50,17,BS_NOTIFY, | 107 | PUSHBUTTON "&Put File",IDC_PUT,305,25,50,17,BS_NOTIFY, |
108 | WS_EX_CLIENTEDGE | 108 | WS_EX_CLIENTEDGE |
109 | PUSHBUTTON "&Abort xfer",IDC_ABORT,305,43,50,17,BS_NOTIFY, | 109 | PUSHBUTTON "&Abort xfer",IDC_ABORT,305,43,50,17,BS_NOTIFY, |
110 | WS_EX_CLIENTEDGE | 110 | WS_EX_CLIENTEDGE |
111 | PUSHBUTTON "&Options",IDC_OPTIONS,305,61,50,17,BS_NOTIFY, | 111 | PUSHBUTTON "&Options",IDC_OPTIONS,305,61,50,17,BS_NOTIFY, |
112 | WS_EX_CLIENTEDGE | 112 | WS_EX_CLIENTEDGE |
113 | PUSHBUTTON "E&xit",IDC_EXIT,305,79,50,17,BS_NOTIFY,WS_EX_CLIENTEDGE | 113 | PUSHBUTTON "E&xit",IDC_EXIT,305,79,50,17,BS_NOTIFY,WS_EX_CLIENTEDGE |
114 | PUSHBUTTON "&Help",ID_HELP,305,97,50,17,BS_NOTIFY,WS_EX_CLIENTEDGE | 114 | PUSHBUTTON "&Help",ID_HELP,305,97,50,17,BS_NOTIFY,WS_EX_CLIENTEDGE |
115 | LISTBOX IDC_LOG,7,115,348,64,LBS_USETABSTOPS | | 115 | LISTBOX IDC_LOG,7,115,348,64,LBS_USETABSTOPS | |
116 | LBS_NOINTEGRALHEIGHT | LBS_NOSEL | WS_VSCROLL | | 116 | LBS_NOINTEGRALHEIGHT | LBS_NOSEL | WS_VSCROLL | |
117 | WS_HSCROLL,WS_EX_DLGMODALFRAME | 117 | WS_HSCROLL,WS_EX_DLGMODALFRAME |
118 | PUSHBUTTON "..",IDCANCEL,0,183,6,7,NOT WS_VISIBLE | NOT WS_TABSTOP | 118 | PUSHBUTTON "..",IDCANCEL,0,183,6,7,NOT WS_VISIBLE | NOT WS_TABSTOP |
119 | CONTROL "&Server is running",IDC_LISTENING,"Button", | 119 | CONTROL "&Server is running",IDC_LISTENING,"Button", |
120 | BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_FLAT | WS_TABSTOP,286, | 120 | BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_FLAT | WS_TABSTOP,286, |
121 | 181,69,11,WS_EX_TRANSPARENT | WS_EX_STATICEDGE | 121 | 181,69,11,WS_EX_TRANSPARENT | WS_EX_STATICEDGE |
122 | END | 122 | END |
123 | 123 | ||
124 | IDD_PROPS_SERVER DIALOG DISCARDABLE 0, 0, 300, 201 | 124 | IDD_PROPS_SERVER DIALOG DISCARDABLE 0, 0, 300, 201 |
125 | STYLE WS_CHILD | WS_DISABLED | WS_CAPTION | 125 | STYLE WS_CHILD | WS_DISABLED | WS_CAPTION |
126 | CAPTION "Server" | 126 | CAPTION "Server" |
127 | FONT 8, "MS Sans Serif" | 127 | FONT 8, "MS Sans Serif" |
128 | BEGIN | 128 | BEGIN |
129 | GROUPBOX "TFTP filesystem &root (download path)",IDC_STATIC,7,7, | 129 | GROUPBOX "TFTP filesystem &root (download path)",IDC_STATIC,7,7, |
130 | 286,38 | 130 | 286,38 |
131 | EDITTEXT IDC_TFTPROOT,13,16,256,13,ES_AUTOHSCROLL | 131 | EDITTEXT IDC_TFTPROOT,13,16,256,13,ES_AUTOHSCROLL |
132 | PUSHBUTTON "&B",IDC_BROWSE,274,16,13,13,BS_ICON | 132 | PUSHBUTTON "&B",IDC_BROWSE,274,16,13,13,BS_ICON |
133 | CONTROL "Allow access to &subdirectories",IDC_TFTPSUBDIRS, | 133 | CONTROL "Allow access to &subdirectories",IDC_TFTPSUBDIRS, |
134 | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,31,111,10 | 134 | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,31,111,10 |
135 | GROUPBOX "Read Request Behavior",IDC_STATIC,7,48,243,56 | 135 | GROUPBOX "Read Request Behavior",IDC_STATIC,7,48,243,56 |
136 | CONTROL "Give &all files",IDC_RRQ_GIVEALL,"Button", | 136 | CONTROL "Give &all files",IDC_RRQ_GIVEALL,"Button", |
137 | BS_AUTORADIOBUTTON | BS_NOTIFY | WS_GROUP,13,63,53,10 | 137 | BS_AUTORADIOBUTTON | BS_NOTIFY | WS_GROUP,13,63,53,10 |
138 | CONTROL "&Prompt before giving file",IDC_RRQ_ALWAYSCONFIRM, | 138 | CONTROL "&Prompt before giving file",IDC_RRQ_ALWAYSCONFIRM, |
139 | "Button",BS_AUTORADIOBUTTON | BS_NOTIFY,43,75,91,10 | 139 | "Button",BS_AUTORADIOBUTTON | BS_NOTIFY,43,75,91,10 |
140 | CONTROL "&Deny all requests",IDC_RRQ_DENYALL,"Button", | 140 | CONTROL "&Deny all requests",IDC_RRQ_DENYALL,"Button", |
141 | BS_AUTORADIOBUTTON | BS_NOTIFY,73,87,70,10 | 141 | BS_AUTORADIOBUTTON | BS_NOTIFY,73,87,70,10 |
142 | GROUPBOX "Write Request Behavior",IDC_STATIC,7,106,243,56, | 142 | GROUPBOX "Write Request Behavior",IDC_STATIC,7,106,243,56, |
143 | WS_GROUP | 143 | WS_GROUP |
144 | CONTROL "Take a&ll files",IDC_WRQ_TAKEALL,"Button", | 144 | CONTROL "Take a&ll files",IDC_WRQ_TAKEALL,"Button", |
145 | BS_AUTORADIOBUTTON | WS_GROUP,13,116,55,10 | 145 | BS_AUTORADIOBUTTON | WS_GROUP,13,116,55,10 |
146 | CONTROL "Prompt if file &exists",IDC_WRQ_PROMPTEXISTING,"Button", | 146 | CONTROL "Prompt if file &exists",IDC_WRQ_PROMPTEXISTING,"Button", |
147 | BS_AUTORADIOBUTTON,43,126,73,10 | 147 | BS_AUTORADIOBUTTON,43,126,73,10 |
148 | CONTROL "Always pro&mpt before accepting file", | 148 | CONTROL "Always pro&mpt before accepting file", |
149 | IDC_WRQ_ALWAYSCONFIRM,"Button",BS_AUTORADIOBUTTON,73,136, | 149 | IDC_WRQ_ALWAYSCONFIRM,"Button",BS_AUTORADIOBUTTON,73,136, |
150 | 139,10 | 150 | 139,10 |
151 | CONTROL "D&eny all requests",IDC_WRQ_DENYALL,"Button", | 151 | CONTROL "D&eny all requests",IDC_WRQ_DENYALL,"Button", |
152 | BS_AUTORADIOBUTTON,103,146,70,10 | 152 | BS_AUTORADIOBUTTON,103,146,70,10 |
153 | CTEXT "Confirmation &timeout",IDC_STATIC,253,52,40,19, | 153 | CTEXT "Confirmation &timeout",IDC_STATIC,253,52,40,19, |
154 | SS_NOTIFY | 154 | SS_NOTIFY |
155 | CONTROL "Slider1",IDC_PROMPTTIMEOUT,"msctls_trackbar32", | 155 | CONTROL "Slider1",IDC_PROMPTTIMEOUT,"msctls_trackbar32", |
156 | TBS_AUTOTICKS | TBS_VERT | TBS_TOP | WS_TABSTOP,272,72, | 156 | TBS_AUTOTICKS | TBS_VERT | TBS_TOP | WS_TABSTOP,272,72, |
157 | 21,90 | 157 | 21,90 |
158 | GROUPBOX "Log file (leave empty to disable logging to file)", | 158 | GROUPBOX "Log file (leave empty to disable logging to file)", |
159 | IDC_STATIC,7,165,286,29 | 159 | IDC_STATIC,7,165,286,29 |
160 | EDITTEXT IDC_LOGFILE,13,175,256,13,ES_AUTOHSCROLL | 160 | EDITTEXT IDC_LOGFILE,13,175,256,13,ES_AUTOHSCROLL |
161 | PUSHBUTTON "",IDC_LOGFILE_BROWSE,274,175,13,13,BS_ICON | 161 | PUSHBUTTON "",IDC_LOGFILE_BROWSE,274,175,13,13,BS_ICON |
162 | END | 162 | END |
163 | 163 | ||
164 | IDD_PROPS_NETWORK DIALOG DISCARDABLE 0, 0, 300, 201 | 164 | IDD_PROPS_NETWORK DIALOG DISCARDABLE 0, 0, 300, 201 |
165 | STYLE WS_CHILD | WS_DISABLED | WS_CAPTION | 165 | STYLE WS_CHILD | WS_DISABLED | WS_CAPTION |
166 | CAPTION "Network" | 166 | CAPTION "Network" |
167 | FONT 8, "MS Sans Serif" | 167 | FONT 8, "MS Sans Serif" |
168 | BEGIN | 168 | BEGIN |
169 | GROUPBOX "UDP Ports",IDC_STATIC,7,7,286,40 | 169 | GROUPBOX "UDP Ports",IDC_STATIC,7,7,286,40 |
170 | RTEXT "Listen for &incoming requests on port:",IDC_STATIC,13, | 170 | RTEXT "Listen for &incoming requests on port:",IDC_STATIC,13, |
171 | 18,135,8 | 171 | 18,135,8 |
172 | EDITTEXT IDC_LISTENPORT,154,16,40,13,ES_AUTOHSCROLL | 172 | EDITTEXT IDC_LISTENPORT,154,16,40,13,ES_AUTOHSCROLL |
173 | CONTROL "Spin1",IDC_LISTENSPIN,"msctls_updown32",UDS_WRAP | | 173 | CONTROL "Spin1",IDC_LISTENSPIN,"msctls_updown32",UDS_WRAP | |
174 | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | | 174 | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | |
175 | UDS_ARROWKEYS | UDS_NOTHOUSANDS,183,16,11,13 | 175 | UDS_ARROWKEYS | UDS_NOTHOUSANDS,183,16,11,13 |
176 | RTEXT "Send &outging requests to port:",IDC_STATIC,13,31,135,8 | 176 | RTEXT "Send &outging requests to port:",IDC_STATIC,13,31,135,8 |
177 | EDITTEXT IDC_SPEAKPORT,154,29,40,13,ES_AUTOHSCROLL | 177 | EDITTEXT IDC_SPEAKPORT,154,29,40,13,ES_AUTOHSCROLL |
178 | CONTROL "Spin1",IDC_SPEAKSPIN,"msctls_updown32",UDS_WRAP | | 178 | CONTROL "Spin1",IDC_SPEAKSPIN,"msctls_updown32",UDS_WRAP | |
179 | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | | 179 | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | |
180 | UDS_ARROWKEYS | UDS_NOTHOUSANDS,183,29,11,13 | 180 | UDS_ARROWKEYS | UDS_NOTHOUSANDS,183,29,11,13 |
181 | LTEXT "Default connection timeout:",IDC_STATIC,7,52,88,8 | 181 | LTEXT "Default connection timeout:",IDC_STATIC,7,52,88,8 |
182 | EDITTEXT IDC_TIMEOUT,110,50,40,13,ES_AUTOHSCROLL | ES_NUMBER | 182 | EDITTEXT IDC_TIMEOUT,110,50,40,13,ES_AUTOHSCROLL | ES_NUMBER |
183 | CONTROL "Spin3",IDC_TIMESPIN,"msctls_updown32",UDS_WRAP | | 183 | CONTROL "Spin3",IDC_TIMESPIN,"msctls_updown32",UDS_WRAP | |
184 | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | | 184 | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | |
185 | UDS_ARROWKEYS | UDS_NOTHOUSANDS,140,50,11,13 | 185 | UDS_ARROWKEYS | UDS_NOTHOUSANDS,140,50,11,13 |
186 | LTEXT "Default block size:",IDC_STATIC,7,66,59,8 | 186 | LTEXT "Default block size:",IDC_STATIC,7,66,59,8 |
187 | LTEXT "seconds",IDC_STATIC,154,52,28,8 | 187 | LTEXT "seconds",IDC_STATIC,154,52,28,8 |
188 | LTEXT "bytes",IDC_STATIC,154,66,18,8 | 188 | LTEXT "bytes",IDC_STATIC,154,66,18,8 |
189 | EDITTEXT IDC_BLOCKSIZE,110,64,40,13,ES_AUTOHSCROLL | ES_NUMBER | 189 | EDITTEXT IDC_BLOCKSIZE,110,64,40,13,ES_AUTOHSCROLL | ES_NUMBER |
190 | CONTROL "Spin3",IDC_BSIZESPIN,"msctls_updown32",UDS_WRAP | | 190 | CONTROL "Spin3",IDC_BSIZESPIN,"msctls_updown32",UDS_WRAP | |
191 | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | | 191 | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | |
192 | UDS_ARROWKEYS | UDS_NOTHOUSANDS,140,64,11,13 | 192 | UDS_ARROWKEYS | UDS_NOTHOUSANDS,140,64,11,13 |
193 | END | 193 | END |
194 | 194 | ||
195 | IDD_CONFIRM_RRQ DIALOGEX 0, 0, 181, 79 | 195 | IDD_CONFIRM_RRQ DIALOGEX 0, 0, 181, 79 |
196 | STYLE DS_MODALFRAME | DS_NOIDLEMSG | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | | 196 | STYLE DS_MODALFRAME | DS_NOIDLEMSG | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | |
197 | WS_CAPTION | 197 | WS_CAPTION |
198 | EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE | 198 | EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE |
199 | CAPTION " PumpKIN - Confirm Read Request" | 199 | CAPTION " PumpKIN - Confirm Read Request" |
200 | FONT 8, "MS Sans Serif", 0, 0, 0x1 | 200 | FONT 8, "MS Sans Serif", 0, 0, 0x1 |
201 | BEGIN | 201 | BEGIN |
202 | DEFPUSHBUTTON "&Grant Access",IDOK,27,58,54,14 | 202 | DEFPUSHBUTTON "&Grant Access",IDOK,27,58,54,14 |
203 | PUSHBUTTON "&Deny Access",IDCANCEL,97,58,54,14 | 203 | PUSHBUTTON "&Deny Access",IDCANCEL,97,58,54,14 |
204 | LTEXT "The host",IDC_STATIC,77,7,29,8 | 204 | LTEXT "The host",IDC_STATIC,77,7,29,8 |
205 | CTEXT "255.255.255.255",IDC_HOST,57,15,68,14,SS_NOTIFY | | 205 | CTEXT "255.255.255.255",IDC_HOST,57,15,68,14,SS_NOTIFY | |
206 | SS_SUNKEN | WS_BORDER,WS_EX_DLGMODALFRAME | | 206 | SS_SUNKEN | WS_BORDER,WS_EX_DLGMODALFRAME | |
207 | WS_EX_CLIENTEDGE | 207 | WS_EX_CLIENTEDGE |
208 | CTEXT "is requesting the file",IDC_STATIC,23,29,135,8 | 208 | CTEXT "is requesting the file",IDC_STATIC,23,29,135,8 |
209 | CTEXT "",IDC_FILE,23,37,135,14,SS_NOTIFY | SS_SUNKEN | | 209 | CTEXT "",IDC_FILE,23,37,135,14,SS_NOTIFY | SS_SUNKEN | |
210 | WS_BORDER,WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | 210 | WS_BORDER,WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE |
211 | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,54,167,1 | 211 | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,54,167,1 |
212 | ICON IDR_MAINFRAME,IDC_STATIC,7,7,18,20 | 212 | ICON IDR_MAINFRAME,IDC_STATIC,7,7,18,20 |
213 | ICON IDR_MAINFRAME,IDC_STATIC,153,7,18,20 | 213 | ICON IDR_MAINFRAME,IDC_STATIC,153,7,18,20 |
214 | END | 214 | END |
215 | 215 | ||
216 | IDD_CONFIRM_WRQ DIALOGEX 0, 0, 201, 95 | 216 | IDD_CONFIRM_WRQ DIALOGEX 0, 0, 201, 95 |
217 | STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | WS_CAPTION | 217 | STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | WS_CAPTION |
218 | EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE | 218 | EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE |
219 | CAPTION " PumpKIN - Confirm Write Request" | 219 | CAPTION " PumpKIN - Confirm Write Request" |
220 | FONT 8, "MS Sans Serif", 0, 0, 0x1 | 220 | FONT 8, "MS Sans Serif", 0, 0, 0x1 |
221 | BEGIN | 221 | BEGIN |
222 | DEFPUSHBUTTON "&Accept",IDOK,7,58,59,14 | 222 | DEFPUSHBUTTON "&Accept",IDOK,7,58,59,14 |
223 | PUSHBUTTON "&Rename",IDC_RENAME,71,58,59,14 | 223 | PUSHBUTTON "&Rename",IDC_RENAME,71,58,59,14 |
224 | PUSHBUTTON "&Deny Access",IDCANCEL,135,58,59,14 | 224 | PUSHBUTTON "&Deny Access",IDCANCEL,135,58,59,14 |
225 | LTEXT "The host",IDC_STATIC,87,7,29,8 | 225 | LTEXT "The host",IDC_STATIC,87,7,29,8 |
226 | CTEXT "255.255.255.255",IDC_HOST,67,15,68,14,SS_NOTIFY | | 226 | CTEXT "255.255.255.255",IDC_HOST,67,15,68,14,SS_NOTIFY | |
227 | SS_SUNKEN | WS_BORDER,WS_EX_DLGMODALFRAME | | 227 | SS_SUNKEN | WS_BORDER,WS_EX_DLGMODALFRAME | |
228 | WS_EX_CLIENTEDGE | 228 | WS_EX_CLIENTEDGE |
229 | CTEXT "is attempting to send you a file",IDC_STATIC,33,29,135, | 229 | CTEXT "is attempting to send you a file",IDC_STATIC,33,29,135, |
230 | 8 | 230 | 8 |
231 | CTEXT "",IDC_FILE,33,37,135,14,SS_NOTIFY | SS_SUNKEN | | 231 | CTEXT "",IDC_FILE,33,37,135,14,SS_NOTIFY | SS_SUNKEN | |
232 | WS_BORDER,WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | 232 | WS_BORDER,WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE |
233 | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,54,187,1 | 233 | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,54,187,1 |
234 | ICON IDR_MAINFRAME,IDC_STATIC,7,7,21,20 | 234 | ICON IDR_MAINFRAME,IDC_STATIC,7,7,21,20 |
235 | ICON IDR_MAINFRAME,IDC_STATIC,173,7,21,20 | 235 | ICON IDR_MAINFRAME,IDC_STATIC,173,7,21,20 |
236 | PUSHBUTTON "Res&ume",IDC_RESUME,71,74,59,14 | 236 | PUSHBUTTON "Res&ume",IDC_RESUME,71,74,59,14 |
237 | END | 237 | END |
238 | 238 | ||
239 | IDD_REQUEST DIALOGEX 0, 0, 191, 161 | 239 | IDD_REQUEST DIALOGEX 0, 0, 191, 161 |
240 | STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | WS_CAPTION | | 240 | STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | WS_CAPTION | |
241 | WS_SYSMENU | 241 | WS_SYSMENU |
242 | EXSTYLE WS_EX_CLIENTEDGE | 242 | EXSTYLE WS_EX_CLIENTEDGE |
243 | CAPTION "Request" | 243 | CAPTION "Request" |
244 | FONT 8, "MS Sans Serif", 0, 0, 0x1 | 244 | FONT 8, "MS Sans Serif", 0, 0, 0x1 |
245 | BEGIN | 245 | BEGIN |
246 | LTEXT "&Local file:",IDC_STATIC,7,7,31,8,SS_NOTIFY | 246 | LTEXT "&Local file:",IDC_STATIC,7,7,31,8,SS_NOTIFY |
247 | EDITTEXT IDC_LOCALFILE,7,16,157,14,ES_AUTOHSCROLL, | 247 | EDITTEXT IDC_LOCALFILE,7,16,157,14,ES_AUTOHSCROLL, |
248 | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE | 248 | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE |
249 | PUSHBUTTON "...",IDC_BROWSE,165,16,19,14,BS_ICON,WS_EX_STATICEDGE | 249 | PUSHBUTTON "...",IDC_BROWSE,165,16,19,14,BS_ICON,WS_EX_STATICEDGE |
250 | LTEXT "&Remote file:",IDC_STATIC,7,34,38,8,SS_NOTIFY | 250 | LTEXT "&Remote file:",IDC_STATIC,7,34,38,8,SS_NOTIFY |
251 | EDITTEXT IDC_REMOTEFILE,7,44,177,14,ES_AUTOHSCROLL, | 251 | EDITTEXT IDC_REMOTEFILE,7,44,177,14,ES_AUTOHSCROLL, |
252 | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE | 252 | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE |
253 | LTEXT "Remote &host:",IDC_STATIC,7,61,43,8,SS_NOTIFY | 253 | LTEXT "Remote &host:",IDC_STATIC,7,61,43,8,SS_NOTIFY |
254 | COMBOBOX IDC_TALKS,7,72,157,66,CBS_SIMPLE | CBS_AUTOHSCROLL | | 254 | COMBOBOX IDC_TALKS,7,72,157,66,CBS_SIMPLE | CBS_AUTOHSCROLL | |
255 | CBS_SORT | CBS_NOINTEGRALHEIGHT | WS_VSCROLL | | 255 | CBS_SORT | CBS_NOINTEGRALHEIGHT | WS_VSCROLL | |
256 | WS_TABSTOP,WS_EX_CLIENTEDGE | WS_EX_STATICEDGE | 256 | WS_TABSTOP,WS_EX_CLIENTEDGE | WS_EX_STATICEDGE |
257 | PUSHBUTTON "R\nE\n&F\nR\nE\nS\nH",IDC_REFRESH,165,72,19,66, | 257 | PUSHBUTTON "R\nE\n&F\nR\nE\nS\nH",IDC_REFRESH,165,72,19,66, |
258 | BS_CENTER | BS_VCENTER | BS_MULTILINE | BS_NOTIFY, | 258 | BS_CENTER | BS_VCENTER | BS_MULTILINE | BS_NOTIFY, |
259 | WS_EX_CLIENTEDGE | 259 | WS_EX_CLIENTEDGE |
260 | LTEXT "&Type:",IDC_STATIC,58,34,19,8 | 260 | LTEXT "&Type:",IDC_STATIC,58,34,19,8 |
261 | COMBOBOX IDC_TYPE,80,31,43,41,CBS_DROPDOWN | CBS_AUTOHSCROLL | | 261 | COMBOBOX IDC_TYPE,80,31,43,41,CBS_DROPDOWN | CBS_AUTOHSCROLL | |
262 | CBS_LOWERCASE | WS_VSCROLL | WS_TABSTOP | 262 | CBS_LOWERCASE | WS_VSCROLL | WS_TABSTOP |
263 | LTEXT "&Block:",IDC_STATIC,127,34,21,8 | 263 | LTEXT "&Block:",IDC_STATIC,127,34,21,8 |
264 | COMBOBOX IDC_BSIZE,149,31,35,53,CBS_DROPDOWN | WS_VSCROLL | | 264 | COMBOBOX IDC_BSIZE,149,31,35,53,CBS_DROPDOWN | WS_VSCROLL | |
265 | WS_TABSTOP | 265 | WS_TABSTOP |
266 | DEFPUSHBUTTON "OK",IDOK,35,140,50,14 | 266 | DEFPUSHBUTTON "OK",IDOK,35,140,50,14 |
267 | PUSHBUTTON "Cancel",IDCANCEL,101,140,50,14 | 267 | PUSHBUTTON "Cancel",IDCANCEL,101,140,50,14 |
268 | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDVERT,52,32,1,11 | 268 | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDVERT,52,32,1,11 |
269 | END | 269 | END |
270 | 270 | ||
271 | IDD_PROPS_SOUNDS DIALOG DISCARDABLE 0, 0, 300, 201 | 271 | IDD_PROPS_SOUNDS DIALOG DISCARDABLE 0, 0, 300, 201 |
272 | STYLE WS_CHILD | WS_DISABLED | WS_CAPTION | 272 | STYLE WS_CHILD | WS_DISABLED | WS_CAPTION |
273 | CAPTION "Sounds" | 273 | CAPTION "Sounds" |
274 | FONT 8, "MS Sans Serif" | 274 | FONT 8, "MS Sans Serif" |
275 | BEGIN | 275 | BEGIN |
276 | LTEXT "&Incoming request:",IDC_STATIC,7,9,57,8 | 276 | LTEXT "&Incoming request:",IDC_STATIC,7,9,57,8 |
277 | COMBOBOX IDC_RING,70,7,188,100,CBS_DROPDOWN | CBS_AUTOHSCROLL | | 277 | COMBOBOX IDC_RING,70,7,188,100,CBS_DROPDOWN | CBS_AUTOHSCROLL | |
278 | CBS_SORT | WS_VSCROLL | WS_TABSTOP | 278 | CBS_SORT | WS_VSCROLL | WS_TABSTOP |
279 | PUSHBUTTON "browse",IDC_RING_BROWSE,263,7,13,13,BS_ICON | 279 | PUSHBUTTON "browse",IDC_RING_BROWSE,263,7,13,13,BS_ICON |
280 | PUSHBUTTON "play",IDC_RING_PLAY,280,7,13,13,BS_ICON | 280 | PUSHBUTTON "play",IDC_RING_PLAY,280,7,13,13,BS_ICON |
281 | LTEXT "xfer &finished:",IDC_STATIC,7,25,57,8 | 281 | LTEXT "xfer &finished:",IDC_STATIC,7,25,57,8 |
282 | COMBOBOX IDC_FINISHED,70,22,188,100,CBS_DROPDOWN | | 282 | COMBOBOX IDC_FINISHED,70,22,188,100,CBS_DROPDOWN | |
283 | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP | 283 | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP |
284 | PUSHBUTTON "browse",IDC_FINISHED_BROWSE,263,22,13,13,BS_ICON | 284 | PUSHBUTTON "browse",IDC_FINISHED_BROWSE,263,22,13,13,BS_ICON |
285 | PUSHBUTTON "play",IDC_FINISHED_PLAY,280,22,13,13,BS_ICON | 285 | PUSHBUTTON "play",IDC_FINISHED_PLAY,280,22,13,13,BS_ICON |
286 | LTEXT "xfer &aborted:",IDC_STATIC,7,40,57,8 | 286 | LTEXT "xfer &aborted:",IDC_STATIC,7,40,57,8 |
287 | COMBOBOX IDC_ABORTED,70,37,188,100,CBS_DROPDOWN | CBS_AUTOHSCROLL | | 287 | COMBOBOX IDC_ABORTED,70,37,188,100,CBS_DROPDOWN | CBS_AUTOHSCROLL | |
288 | CBS_SORT | WS_VSCROLL | WS_TABSTOP | 288 | CBS_SORT | WS_VSCROLL | WS_TABSTOP |
289 | PUSHBUTTON "browse",IDC_ABORTED_BROWSE,263,37,13,13,BS_ICON | 289 | PUSHBUTTON "browse",IDC_ABORTED_BROWSE,263,37,13,13,BS_ICON |
290 | PUSHBUTTON "play",IDC_ABORTED_PLAY,280,37,13,13,BS_ICON | 290 | PUSHBUTTON "play",IDC_ABORTED_PLAY,280,37,13,13,BS_ICON |
291 | END | 291 | END |
292 | 292 | ||
293 | IDD_PROPS_ACL DIALOG DISCARDABLE 0, 0, 300, 201 | 293 | IDD_PROPS_ACL DIALOG DISCARDABLE 0, 0, 300, 201 |
294 | STYLE WS_CHILD | WS_DISABLED | WS_CAPTION | 294 | STYLE WS_CHILD | WS_DISABLED | WS_CAPTION |
295 | CAPTION "Access Lists" | 295 | CAPTION "Access Lists" |
296 | FONT 8, "MS Sans Serif" | 296 | FONT 8, "MS Sans Serif" |
297 | BEGIN | 297 | BEGIN |
298 | CONTROL "List1",IDC_ACL_LIST,"SysListView32",LVS_REPORT | | 298 | CONTROL "List1",IDC_ACL_LIST,"SysListView32",LVS_REPORT | |
299 | WS_BORDER | WS_TABSTOP,7,7,258,110 | 299 | WS_BORDER | WS_TABSTOP,7,7,258,110 |
300 | PUSHBUTTON "&Up",IDC_ACL_UP,273,7,20,30,BS_ICON | BS_CENTER | | 300 | PUSHBUTTON "&Up",IDC_ACL_UP,273,7,20,30,BS_ICON | BS_CENTER | |
301 | BS_VCENTER | 301 | BS_VCENTER |
302 | PUSHBUTTON "&Down",IDC_ACL_DOWN,273,87,20,30,BS_ICON | BS_CENTER | | 302 | PUSHBUTTON "&Down",IDC_ACL_DOWN,273,87,20,30,BS_ICON | BS_CENTER | |
303 | BS_VCENTER | 303 | BS_VCENTER |
304 | PUSHBUTTON "&Remove",IDC_ACL_REMOVE,273,47,20,30,BS_ICON | | 304 | PUSHBUTTON "&Remove",IDC_ACL_REMOVE,273,47,20,30,BS_ICON | |
305 | BS_CENTER | BS_VCENTER | 305 | BS_CENTER | BS_VCENTER |
306 | LTEXT "If",IDC_STATIC,13,128,8,8 | 306 | LTEXT "If",IDC_STATIC,13,128,8,8 |
307 | COMBOBOX IDC_ACL_XFER,21,125,48,67,CBS_DROPDOWNLIST | WS_VSCROLL | | 307 | COMBOBOX IDC_ACL_XFER,21,125,48,67,CBS_DROPDOWNLIST | WS_VSCROLL | |
308 | WS_TABSTOP | 308 | WS_TABSTOP |
309 | LTEXT "request comes from the address in the network", | 309 | LTEXT "request comes from the address in the network", |
310 | IDC_STATIC,71,128,122,8 | 310 | IDC_STATIC,71,128,122,8 |
311 | EDITTEXT IDC_ACL_ADDR,47,143,80,12,ES_AUTOHSCROLL | 311 | EDITTEXT IDC_ACL_ADDR,47,143,80,12,ES_AUTOHSCROLL |
312 | LTEXT "with netmask",IDC_STATIC,129,145,41,8 | 312 | LTEXT "with netmask",IDC_STATIC,129,145,41,8 |
313 | EDITTEXT IDC_ACL_NETMASK,173,143,80,12,ES_AUTOHSCROLL | 313 | EDITTEXT IDC_ACL_NETMASK,173,143,80,12,ES_AUTOHSCROLL |
314 | LTEXT "then",IDC_STATIC,124,160,15,8 | 314 | LTEXT "then",IDC_STATIC,124,160,15,8 |
315 | COMBOBOX IDC_ACL_RULE,143,158,123,117,CBS_DROPDOWNLIST | | 315 | COMBOBOX IDC_ACL_RULE,143,158,123,117,CBS_DROPDOWNLIST | |
316 | WS_VSCROLL | WS_TABSTOP | 316 | WS_VSCROLL | WS_TABSTOP |
317 | PUSHBUTTON "&Add new rule",IDC_ACL_ADD,7,178,130,16 | 317 | PUSHBUTTON "&Add new rule",IDC_ACL_ADD,7,178,130,16 |
318 | PUSHBUTTON "&Replace rule",IDC_ACL_REPLACE,152,178,130,16 | 318 | PUSHBUTTON "&Replace rule",IDC_ACL_REPLACE,152,178,130,16 |
319 | END | 319 | END |
320 | 320 | ||
321 | 321 | ||
322 | #ifndef _MAC | 322 | #ifndef _MAC |
323 | ///////////////////////////////////////////////////////////////////////////// | 323 | ///////////////////////////////////////////////////////////////////////////// |
324 | // | 324 | // |
325 | // Version | 325 | // Version |
326 | // | 326 | // |
327 | 327 | ||
328 | VS_VERSION_INFO VERSIONINFO | 328 | VS_VERSION_INFO VERSIONINFO |
329 | FILEVERSION 2,7,1,0 | 329 | FILEVERSION 2,7,1,0 |
330 | PRODUCTVERSION 2,7,1,0 | 330 | PRODUCTVERSION 2,7,1,0 |
331 | FILEFLAGSMASK 0x3fL | 331 | FILEFLAGSMASK 0x3fL |
332 | #ifdef _DEBUG | 332 | #ifdef _DEBUG |
333 | FILEFLAGS 0x1L | 333 | FILEFLAGS 0x1L |
334 | #else | 334 | #else |
335 | FILEFLAGS 0x0L | 335 | FILEFLAGS 0x0L |
336 | #endif | 336 | #endif |
337 | FILEOS 0x4L | 337 | FILEOS 0x4L |
338 | FILETYPE 0x1L | 338 | FILETYPE 0x1L |
339 | FILESUBTYPE 0x0L | 339 | FILESUBTYPE 0x0L |
340 | BEGIN | 340 | BEGIN |
341 | BLOCK "StringFileInfo" | 341 | BLOCK "StringFileInfo" |
342 | BEGIN | 342 | BEGIN |
343 | BLOCK "040904b0" | 343 | BLOCK "040904b0" |
344 | BEGIN | 344 | BEGIN |
345 | VALUE "CompanyName", "Klever Group (http://www.klever.net/)\0" | 345 | VALUE "CompanyName", "Klever Group (http://www.klever.net/)\0" |
346 | VALUE "FileDescription", "PumpKIN, tftp client/daemon\0" | 346 | VALUE "FileDescription", "PumpKIN, tftp client/daemon\0" |
347 | VALUE "FileVersion", "2, 7, 1, 0\0" | 347 | VALUE "FileVersion", "2, 7, 1, 0\0" |
348 | VALUE "InternalName", "PUMPKIN\0" | 348 | VALUE "InternalName", "PUMPKIN\0" |
349 | VALUE "LegalCopyright", "Copyright © 1997-2006 Klever Group (http://www.klever.net)\0" | 349 | VALUE "LegalCopyright", "Copyright © 1997-2006 Klever Group (http://www.klever.net)\0" |
350 | VALUE "LegalTrademarks", "Klever Group (http://www.klever.net/)\0" | 350 | VALUE "LegalTrademarks", "Klever Group (http://www.klever.net/)\0" |
351 | VALUE "OriginalFilename", "PUMPKIN.EXE\0" | 351 | VALUE "OriginalFilename", "PUMPKIN.EXE\0" |
352 | VALUE "ProductName", "PumpKIN\0" | 352 | VALUE "ProductName", "PumpKIN\0" |
353 | VALUE "ProductVersion", "2, 7, 1, 0\0" | 353 | VALUE "ProductVersion", "2, 7, 1, 0\0" |
354 | END | 354 | END |
355 | END | 355 | END |
356 | BLOCK "VarFileInfo" | 356 | BLOCK "VarFileInfo" |
357 | BEGIN | 357 | BEGIN |
358 | VALUE "Translation", 0x409, 1200 | 358 | VALUE "Translation", 0x409, 1200 |
359 | END | 359 | END |
360 | END | 360 | END |
361 | 361 | ||
362 | #endif // !_MAC | 362 | #endif // !_MAC |
363 | 363 | ||
364 | 364 | ||
365 | ///////////////////////////////////////////////////////////////////////////// | 365 | ///////////////////////////////////////////////////////////////////////////// |
366 | // | 366 | // |
367 | // DESIGNINFO | 367 | // DESIGNINFO |
368 | // | 368 | // |
369 | 369 | ||
370 | #ifdef APSTUDIO_INVOKED | 370 | #ifdef APSTUDIO_INVOKED |
371 | GUIDELINES DESIGNINFO DISCARDABLE | 371 | GUIDELINES DESIGNINFO DISCARDABLE |
372 | BEGIN | 372 | BEGIN |
373 | IDD_ABOUTBOX, DIALOG | 373 | IDD_ABOUTBOX, DIALOG |
374 | BEGIN | 374 | BEGIN |
375 | LEFTMARGIN, 7 | 375 | LEFTMARGIN, 7 |
376 | RIGHTMARGIN, 210 | 376 | RIGHTMARGIN, 210 |
377 | TOPMARGIN, 7 | 377 | TOPMARGIN, 7 |
378 | BOTTOMMARGIN, 67 | 378 | BOTTOMMARGIN, 67 |
379 | END | 379 | END |
380 | 380 | ||
381 | IDD_PUMPKIN_DIALOG, DIALOG | 381 | IDD_PUMPKIN_DIALOG, DIALOG |
382 | BEGIN | 382 | BEGIN |
383 | LEFTMARGIN, 7 | 383 | LEFTMARGIN, 7 |
384 | RIGHTMARGIN, 355 | 384 | RIGHTMARGIN, 355 |
385 | TOPMARGIN, 7 | 385 | TOPMARGIN, 7 |
386 | BOTTOMMARGIN, 186 | 386 | BOTTOMMARGIN, 186 |
387 | HORZGUIDE, 115 | 387 | HORZGUIDE, 115 |
388 | END | 388 | END |
389 | 389 | ||
390 | IDD_PROPS_SERVER, DIALOG | 390 | IDD_PROPS_SERVER, DIALOG |
391 | BEGIN | 391 | BEGIN |
392 | LEFTMARGIN, 7 | 392 | LEFTMARGIN, 7 |
393 | RIGHTMARGIN, 293 | 393 | RIGHTMARGIN, 293 |
394 | TOPMARGIN, 7 | 394 | TOPMARGIN, 7 |
395 | BOTTOMMARGIN, 194 | 395 | BOTTOMMARGIN, 194 |
396 | END | 396 | END |
397 | 397 | ||
398 | IDD_PROPS_NETWORK, DIALOG | 398 | IDD_PROPS_NETWORK, DIALOG |
399 | BEGIN | 399 | BEGIN |
400 | LEFTMARGIN, 7 | 400 | LEFTMARGIN, 7 |
401 | RIGHTMARGIN, 293 | 401 | RIGHTMARGIN, 293 |
402 | TOPMARGIN, 7 | 402 | TOPMARGIN, 7 |
403 | BOTTOMMARGIN, 194 | 403 | BOTTOMMARGIN, 194 |
404 | END | 404 | END |
405 | 405 | ||
406 | IDD_CONFIRM_RRQ, DIALOG | 406 | IDD_CONFIRM_RRQ, DIALOG |
407 | BEGIN | 407 | BEGIN |
408 | LEFTMARGIN, 7 | 408 | LEFTMARGIN, 7 |
409 | RIGHTMARGIN, 174 | 409 | RIGHTMARGIN, 174 |
410 | TOPMARGIN, 7 | 410 | TOPMARGIN, 7 |
411 | BOTTOMMARGIN, 72 | 411 | BOTTOMMARGIN, 72 |
412 | END | 412 | END |
413 | 413 | ||
414 | IDD_CONFIRM_WRQ, DIALOG | 414 | IDD_CONFIRM_WRQ, DIALOG |
415 | BEGIN | 415 | BEGIN |
416 | LEFTMARGIN, 7 | 416 | LEFTMARGIN, 7 |
417 | RIGHTMARGIN, 194 | 417 | RIGHTMARGIN, 194 |
418 | TOPMARGIN, 7 | 418 | TOPMARGIN, 7 |
419 | BOTTOMMARGIN, 88 | 419 | BOTTOMMARGIN, 88 |
420 | END | 420 | END |
421 | 421 | ||
422 | IDD_REQUEST, DIALOG | 422 | IDD_REQUEST, DIALOG |
423 | BEGIN | 423 | BEGIN |
424 | LEFTMARGIN, 7 | 424 | LEFTMARGIN, 7 |
425 | RIGHTMARGIN, 184 | 425 | RIGHTMARGIN, 184 |
426 | TOPMARGIN, 7 | 426 | TOPMARGIN, 7 |
427 | BOTTOMMARGIN, 154 | 427 | BOTTOMMARGIN, 154 |
428 | END | 428 | END |
429 | 429 | ||
430 | IDD_PROPS_SOUNDS, DIALOG | 430 | IDD_PROPS_SOUNDS, DIALOG |
431 | BEGIN | 431 | BEGIN |
432 | LEFTMARGIN, 7 | 432 | LEFTMARGIN, 7 |
433 | RIGHTMARGIN, 293 | 433 | RIGHTMARGIN, 293 |
434 | TOPMARGIN, 7 | 434 | TOPMARGIN, 7 |
435 | BOTTOMMARGIN, 194 | 435 | BOTTOMMARGIN, 194 |
436 | END | 436 | END |
437 | 437 | ||
438 | IDD_PROPS_ACL, DIALOG | 438 | IDD_PROPS_ACL, DIALOG |
439 | BEGIN | 439 | BEGIN |
440 | LEFTMARGIN, 7 | 440 | LEFTMARGIN, 7 |
441 | RIGHTMARGIN, 293 | 441 | RIGHTMARGIN, 293 |
442 | TOPMARGIN, 7 | 442 | TOPMARGIN, 7 |
443 | BOTTOMMARGIN, 194 | 443 | BOTTOMMARGIN, 194 |
444 | HORZGUIDE, 117 | 444 | HORZGUIDE, 117 |
445 | HORZGUIDE, 125 | 445 | HORZGUIDE, 125 |
446 | END | 446 | END |
447 | END | 447 | END |
448 | #endif // APSTUDIO_INVOKED | 448 | #endif // APSTUDIO_INVOKED |
449 | 449 | ||
450 | 450 | ||
451 | ///////////////////////////////////////////////////////////////////////////// | 451 | ///////////////////////////////////////////////////////////////////////////// |
452 | // | 452 | // |
453 | // Bitmap | 453 | // Bitmap |
454 | // | 454 | // |
455 | 455 | ||
456 | IDB_BACKGROUND BITMAP DISCARDABLE "shared-data/klever-background.bmp" | 456 | IDB_BACKGROUND BITMAP DISCARDABLE "shared-data/klever-background.bmp" |
457 | 457 | ||
458 | ///////////////////////////////////////////////////////////////////////////// | 458 | ///////////////////////////////////////////////////////////////////////////// |
459 | // | 459 | // |
460 | // WAVE | 460 | // WAVE |
461 | // | 461 | // |
462 | 462 | ||
463 | IDR_WAVE_RING WAVE DISCARDABLE "res\\ring.wav" | 463 | IDR_WAVE_RING WAVE DISCARDABLE "res\\ring.wav" |
464 | IDR_WAVE_FINISHED WAVE DISCARDABLE "res\\finished.wav" | 464 | IDR_WAVE_FINISHED WAVE DISCARDABLE "res\\finished.wav" |
465 | IDR_WAVE_ABORTED WAVE DISCARDABLE "res\\failed.wav" | 465 | IDR_WAVE_ABORTED WAVE DISCARDABLE "res\\failed.wav" |
466 | 466 | ||
467 | ///////////////////////////////////////////////////////////////////////////// | 467 | ///////////////////////////////////////////////////////////////////////////// |
468 | // | 468 | // |
469 | // Dialog Info | 469 | // Dialog Info |
470 | // | 470 | // |
471 | 471 | ||
472 | IDD_REQUEST DLGINIT | 472 | IDD_REQUEST DLGINIT |
473 | BEGIN | 473 | BEGIN |
474 | IDC_TYPE, 0x403, 6, 0 | 474 | IDC_TYPE, 0x403, 6, 0 |
475 | 0x636f, 0x6574, 0x0074, | 475 | 0x636f, 0x6574, 0x0074, |
476 | IDC_TYPE, 0x403, 9, 0 | 476 | IDC_TYPE, 0x403, 9, 0 |
477 | 0x656e, 0x6174, 0x6373, 0x6969, "\000" | 477 | 0x656e, 0x6174, 0x6373, 0x6969, "\000" |
478 | IDC_BSIZE, 0x403, 4, 0 | 478 | IDC_BSIZE, 0x403, 4, 0 |
479 | 0x3135, 0x0032, | 479 | 0x3135, 0x0032, |
480 | IDC_BSIZE, 0x403, 5, 0 | 480 | IDC_BSIZE, 0x403, 5, 0 |
481 | 0x3031, 0x3432, "\000" | 481 | 0x3031, 0x3432, "\000" |
482 | IDC_BSIZE, 0x403, 5, 0 | 482 | IDC_BSIZE, 0x403, 5, 0 |
483 | 0x3032, 0x3834, "\000" | 483 | 0x3032, 0x3834, "\000" |
484 | IDC_BSIZE, 0x403, 5, 0 | 484 | IDC_BSIZE, 0x403, 5, 0 |
485 | 0x3034, 0x3639, "\000" | 485 | 0x3034, 0x3639, "\000" |
486 | IDC_BSIZE, 0x403, 5, 0 | 486 | IDC_BSIZE, 0x403, 5, 0 |
487 | 0x3138, 0x3239, "\000" | 487 | 0x3138, 0x3239, "\000" |
488 | 0 | 488 | 0 |
489 | END | 489 | END |
490 | 490 | ||
491 | IDD_PROPS_ACL DLGINIT | 491 | IDD_PROPS_ACL DLGINIT |
492 | BEGIN | 492 | BEGIN |
493 | IDC_ACL_XFER, 0x403, 5, 0 | 493 | IDC_ACL_XFER, 0x403, 5, 0 |
494 | 0x6572, 0x6461, "\000" | 494 | 0x6572, 0x6461, "\000" |
495 | IDC_ACL_XFER, 0x403, 6, 0 | 495 | IDC_ACL_XFER, 0x403, 6, 0 |
496 | 0x7277, 0x7469, 0x0065, | 496 | 0x7277, 0x7469, 0x0065, |
497 | IDC_ACL_RULE, 0x403, 12, 0 | 497 | IDC_ACL_RULE, 0x403, 12, 0 |
498 | 0x6361, 0x6563, 0x7470, 0x6620, 0x6c69, 0x0065, | 498 | 0x6361, 0x6563, 0x7470, 0x6620, 0x6c69, 0x0065, |
499 | IDC_ACL_RULE, 0x403, 33, 0 | 499 | IDC_ACL_RULE, 0x403, 33, 0 |
500 | 0x6361, 0x6563, 0x7470, 0x6120, 0x646e, 0x7220, 0x6e65, 0x6d61, 0x2065, | 500 | 0x6361, 0x6563, 0x7470, 0x6120, 0x646e, 0x7220, 0x6e65, 0x6d61, 0x2065, |
501 | 0x6669, 0x6620, 0x6c69, 0x2065, 0x7865, 0x7369, 0x7374, "\000" | 501 | 0x6669, 0x6620, 0x6c69, 0x2065, 0x7865, 0x7369, 0x7374, "\000" |
502 | IDC_ACL_RULE, 0x403, 12, 0 | 502 | IDC_ACL_RULE, 0x403, 12, 0 |
503 | 0x6572, 0x656a, 0x7463, 0x6620, 0x6c69, 0x0065, | 503 | 0x6572, 0x656a, 0x7463, 0x6620, 0x6c69, 0x0065, |
504 | IDC_ACL_RULE, 0x403, 31, 0 | 504 | IDC_ACL_RULE, 0x403, 31, 0 |
505 | 0x6166, 0x6c6c, 0x6162, 0x6b63, 0x7420, 0x206f, 0x6874, 0x2065, 0x6c67, | 505 | 0x6166, 0x6c6c, 0x6162, 0x6b63, 0x7420, 0x206f, 0x6874, 0x2065, 0x6c67, |
506 | 0x626f, 0x6c61, 0x7320, 0x7465, 0x6974, 0x676e, "\000" | 506 | 0x626f, 0x6c61, 0x7320, 0x7465, 0x6974, 0x676e, "\000" |
507 | 0 | 507 | 0 |
508 | END | 508 | END |
509 | 509 | ||
510 | 510 | ||
511 | ///////////////////////////////////////////////////////////////////////////// | 511 | ///////////////////////////////////////////////////////////////////////////// |
512 | // | 512 | // |
513 | // Menu | 513 | // Menu |
514 | // | 514 | // |
515 | 515 | ||
516 | IDM_POPUPS MENU DISCARDABLE | 516 | IDM_POPUPS MENU DISCARDABLE |
517 | BEGIN | 517 | BEGIN |
518 | POPUP "&Tray" | 518 | POPUP "&Tray" |
519 | BEGIN | 519 | BEGIN |
520 | MENUITEM "&Send File", ID_TRAY_SENDFILE | 520 | MENUITEM "&Send File", ID_TRAY_SENDFILE |
521 | MENUITEM "F&etch file", ID_TRAY_FETCHFILE | 521 | MENUITEM "F&etch file", ID_TRAY_FETCHFILE |
522 | MENUITEM "&Options", ID_TRAY_OPTIONS | 522 | MENUITEM "&Options", ID_TRAY_OPTIONS |
523 | MENUITEM "&Listen to requests", ID_TRAY_LISTEN | 523 | MENUITEM "&Listen to requests", ID_TRAY_LISTEN |
524 | MENUITEM "Show &PumpKIN Window", ID_TRAY_SHOWPUMPKINWINDOW | 524 | MENUITEM "Show &PumpKIN Window", ID_TRAY_SHOWPUMPKINWINDOW |
525 | MENUITEM "Open &Files Folder", ID_TRAY_OPENFILESFOLDER | 525 | MENUITEM "Open &Files Folder", ID_TRAY_OPENFILESFOLDER |
526 | MENUITEM SEPARATOR | 526 | MENUITEM SEPARATOR |
527 | MENUITEM "&Help Topics", ID_TRAY_HELP | 527 | MENUITEM "&Help Topics", ID_TRAY_HELP |
528 | MENUITEM "&About PumpKIN", ID_TRAY_ABOUTPUMPKIN | 528 | MENUITEM "&About PumpKIN", ID_TRAY_ABOUTPUMPKIN |
529 | MENUITEM SEPARATOR | 529 | MENUITEM SEPARATOR |
530 | MENUITEM "E&xit", ID_TRAY_EXIT | 530 | MENUITEM "E&xit", ID_TRAY_EXIT |
531 | END | 531 | END |
532 | END | 532 | END |
533 | 533 | ||
534 | 534 | ||
535 | ///////////////////////////////////////////////////////////////////////////// | 535 | ///////////////////////////////////////////////////////////////////////////// |
536 | // | 536 | // |
537 | // String Table | 537 | // String Table |
538 | // | 538 | // |
539 | 539 | ||
540 | STRINGTABLE DISCARDABLE | 540 | STRINGTABLE DISCARDABLE |
541 | BEGIN | 541 | BEGIN |
542 | IDS_ABOUTBOX "&About PumpKIN..." | 542 | IDS_ABOUTBOX "&About PumpKIN..." |
543 | IDS_FMT_BYTES "%lu" | 543 | IDS_FMT_BYTES "%lu" |
544 | IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed." | 544 | IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed." |
545 | IDS_TFTP_ERROR_ACCESS "Access violation" | 545 | IDS_TFTP_ERROR_ACCESS "Access violation" |
546 | IDS_TFTP_ERROR_NOTFOUND "File not found" | 546 | IDS_TFTP_ERROR_NOTFOUND "File not found" |
547 | IDS_TFTP_ERROR_DIRFULL "Directory is full" | 547 | IDS_TFTP_ERROR_DIRFULL "Directory is full" |
548 | IDS_TFTP_ERROR_SHARING "Sharing violation" | 548 | IDS_TFTP_ERROR_SHARING "Sharing violation" |
549 | IDS_TFTP_ERROR_DISKFULL "Disk full" | 549 | IDS_TFTP_ERROR_DISKFULL "Disk full" |
550 | IDS_TFTP_ERROR_UNDEFINED "Undefined error" | 550 | IDS_TFTP_ERROR_UNDEFINED "Undefined error" |
551 | IDS_LOG_START "PumpKIN started" | 551 | IDS_LOG_START "PumpKIN started" |
552 | IDS_LOG_LISTENRECEIVEERROR "Error listening for incoming connections" | 552 | IDS_LOG_LISTENRECEIVEERROR "Error listening for incoming connections" |
553 | END | 553 | END |
554 | 554 | ||
555 | STRINGTABLE DISCARDABLE | 555 | STRINGTABLE DISCARDABLE |
556 | BEGIN | 556 | BEGIN |
557 | IDS_LOG_LISTENACCEPTERROR "Error accepting incoming connection" | 557 | IDS_LOG_LISTENACCEPTERROR "Error accepting incoming connection" |
558 | IDS_LOG_RRQSERVE "'%s' of type '%s' is requested from %s" | 558 | IDS_LOG_RRQSERVE "'%s' of type '%s' is requested from %s" |
559 | IDS_LOG_LISTENOPCODE "Invalid opcode in initial connection request" | 559 | IDS_LOG_LISTENOPCODE "Invalid opcode in initial connection request" |
560 | IDS_LOG_XFERUDPSEND "UDP packet send failed" | 560 | IDS_LOG_XFERUDPSEND "UDP packet send failed" |
561 | IDS_LOG_XFERRECEIVE "Error on xfer socket" | 561 | IDS_LOG_XFERRECEIVE "Error on xfer socket" |
562 | IDS_LOG_XFERSEND "Error on xfer socket" | 562 | IDS_LOG_XFERSEND "Error on xfer socket" |
563 | IDS_LOG_XFERUDPRECEIVE "UDP packet receive failed" | 563 | IDS_LOG_XFERUDPRECEIVE "UDP packet receive failed" |
564 | IDS_LOG_XFERSOURCETID "Packet from unexpected source" | 564 | IDS_LOG_XFERSOURCETID "Packet from unexpected source" |
565 | IDS_LOG_SENTTFTPERROR ":%u: %s" | 565 | IDS_LOG_SENTTFTPERROR ">> %u: %s" |
566 | IDS_LOG_GOTTFTPERROR "TFTP:%u: %s" | 566 | IDS_LOG_GOTTFTPERROR "TFTP:%u: %s" |
567 | IDS_LOG_XFEROPCODE "Invalid opcode (%u) during transfer received" | 567 | IDS_LOG_XFEROPCODE "Invalid opcode (%u) during transfer received" |
568 | IDS_LOG_XFERRRQFINISHED "Transfer of '%s' has successfully completed" | 568 | IDS_LOG_XFERRRQFINISHED "Transfer of '%s' has successfully completed" |
569 | IDS_TITLE_OPTIONS "Options" | 569 | IDS_TITLE_OPTIONS "Options" |
570 | IDS_LOG_WRQSERVE "Writing of '%s' of type '%s' is requested by %s" | 570 | IDS_LOG_WRQSERVE "Writing of '%s' of type '%s' is requested by %s" |
571 | IDS_TFTP_ERROR_FAILEDTORENAME "Too many clones of the file" | 571 | IDS_TFTP_ERROR_FAILEDTORENAME "Too many clones of the file" |
572 | IDS_RENAME_TITLE "Save As" | 572 | IDS_RENAME_TITLE "Save As" |
573 | END | 573 | END |
574 | 574 | ||
575 | STRINGTABLE DISCARDABLE | 575 | STRINGTABLE DISCARDABLE |
576 | BEGIN | 576 | BEGIN |
577 | IDS_LOG_TIMEDOUT "Transmission of '%s' is timed out" | 577 | IDS_LOG_TIMEDOUT "Transmission of '%s' is timed out" |
578 | IDS_CONFIRMEXIT_TITLE "Exit" | 578 | IDS_CONFIRMEXIT_TITLE "Exit" |
579 | IDS_CONFIRMEXIT_TEXT "File transmission is currently in progress. Are you sure you want to exit?" | 579 | IDS_CONFIRMEXIT_TEXT "File transmission is currently in progress. Are you sure you want to exit?" |
580 | IDS_LOG_XFERWRQFINISHED "Transfer of '%s' has successfully completed" | 580 | IDS_LOG_XFERWRQFINISHED "Transfer of '%s' has successfully completed" |
581 | IDS_LOG_XFERABORTED "Transfer of '%s' was aborted" | 581 | IDS_LOG_XFERABORTED "Transfer of '%s' was aborted" |
582 | IDS_TITLE_PUTREQUEST "Send file" | 582 | IDS_TITLE_PUTREQUEST "Send file" |
583 | IDS_TITLE_GETREQUEST "Fetch file" | 583 | IDS_TITLE_GETREQUEST "Fetch file" |
584 | IDS_WTALKHEADING "Talk with " | 584 | IDS_WTALKHEADING "Talk with " |
585 | IDS_TITLE_BROWSEFILE "Browse" | 585 | IDS_TITLE_BROWSEFILE "Browse" |
586 | IDS_LOG_RESOLVEFAILED "Failed to resolve host address for '%s'" | 586 | IDS_LOG_RESOLVEFAILED "Failed to resolve host address for '%s'" |
587 | IDS_LOG_FAILEDLOCALFILE "Failed to open local file '%s'" | 587 | IDS_LOG_FAILEDLOCALFILE "Failed to open local file '%s'" |
588 | IDS_LOG_FAILEDTOOPEN "Failed to open '%s'" | 588 | IDS_LOG_FAILEDTOOPEN "Failed to open '%s'" |
589 | IDS_OTALXHEADING "Open Talks: talking to " | 589 | IDS_OTALXHEADING "Open Talks: talking to " |
590 | IDS_REGISTRYKEY "Klever Group" | 590 | IDS_REGISTRYKEY "Klever Group" |
591 | IDS_KLEVERNET_URL "http://www.klever.net/" | 591 | IDS_KLEVERNET_URL "http://www.klever.net/" |
592 | IDS_LOGTIMEFORMAT "%H:%M:%S %B %d" | 592 | IDS_LOGTIMEFORMAT "%H:%M:%S %B %d" |
593 | END | 593 | END |
594 | 594 | ||
595 | STRINGTABLE DISCARDABLE | 595 | STRINGTABLE DISCARDABLE |
596 | BEGIN | 596 | BEGIN |
597 | ID_TRAY_HELP "Read the help on PumpKIN" | 597 | ID_TRAY_HELP "Read the help on PumpKIN" |
598 | ID_TRAY_ABOUTPUMPKIN "Learn about PumpKIN and it's creator" | 598 | ID_TRAY_ABOUTPUMPKIN "Learn about PumpKIN and it's creator" |
599 | ID_TRAY_EXIT "Close PumpKIN" | 599 | ID_TRAY_EXIT "Close PumpKIN" |
600 | ID_TRAY_SENDFILE "Send file over the network to your tete-a-tete" | 600 | ID_TRAY_SENDFILE "Send file over the network to your tete-a-tete" |
601 | ID_TRAY_FETCHFILE "Fetch file from remote computer" | 601 | ID_TRAY_FETCHFILE "Fetch file from remote computer" |
602 | ID_TRAY_OPTIONS "Set PumpKIN options" | 602 | ID_TRAY_OPTIONS "Set PumpKIN options" |
603 | ID_TRAY_SHOWPUMPKINWINDOW "Show main window" | 603 | ID_TRAY_SHOWPUMPKINWINDOW "Show main window" |
604 | ID_TRAY_OPENFILESFOLDER "Explore TFTP root folder" | 604 | ID_TRAY_OPENFILESFOLDER "Explore TFTP root folder" |
605 | ID_TRAY_LISTEN "Listen for incoming requests" | 605 | ID_TRAY_LISTEN "Listen for incoming requests" |
606 | END | 606 | END |
607 | 607 | ||
608 | STRINGTABLE DISCARDABLE | 608 | STRINGTABLE DISCARDABLE |
609 | BEGIN | 609 | BEGIN |
610 | IDC_CONNECTIONS "Active transfers" | 610 | IDC_CONNECTIONS "Active transfers" |
611 | IDC_LOG "PumpKIN Activity Log" | 611 | IDC_LOG "PumpKIN Activity Log" |
612 | IDC_GET "Fetch file from remote server" | 612 | IDC_GET "Fetch file from remote server" |
613 | IDC_PUT "Send file over the net" | 613 | IDC_PUT "Send file over the net" |
614 | IDC_ABORT "Abort transfer currently in progress" | 614 | IDC_ABORT "Abort transfer currently in progress" |
615 | IDC_EXIT "Close PumpKIN" | 615 | IDC_EXIT "Close PumpKIN" |
616 | END | 616 | END |
617 | 617 | ||
618 | STRINGTABLE DISCARDABLE | 618 | STRINGTABLE DISCARDABLE |
619 | BEGIN | 619 | BEGIN |
620 | IDC_OPTIONS "Set PumpKIN options" | 620 | IDC_OPTIONS "Set PumpKIN options" |
621 | IDC_REFRESH "Refresh talks list" | 621 | IDC_REFRESH "Refresh talks list" |
622 | IDC_BROWSE "Browse" | 622 | IDC_BROWSE "Browse" |
623 | END | 623 | END |
624 | 624 | ||
625 | STRINGTABLE DISCARDABLE | 625 | STRINGTABLE DISCARDABLE |
626 | BEGIN | 626 | BEGIN |
627 | ID_HELP "Read help on PumpKIN" | 627 | ID_HELP "Read help on PumpKIN" |
628 | END | 628 | END |
629 | 629 | ||
630 | STRINGTABLE DISCARDABLE | 630 | STRINGTABLE DISCARDABLE |
631 | BEGIN | 631 | BEGIN |
632 | IDS_DROPFILES_TITLE "Drop Files" | 632 | IDS_DROPFILES_TITLE "Drop Files" |
633 | IDS_NOMULTIPLEDROP_TEXT "You can't drop more than one file here. Only the first one will be accepted" | 633 | IDS_NOMULTIPLEDROP_TEXT "You can't drop more than one file here. Only the first one will be accepted" |
634 | IDS_LOG_REQUESTING "Requesting '%s' from '%s'" | 634 | IDS_LOG_REQUESTING "Requesting '%s' from '%s'" |
635 | IDS_LOG_SENDING "Sending '%s' to '%s'" | 635 | IDS_LOG_SENDING "Sending '%s' to '%s'" |
636 | IDS_WTALKAT "@" | 636 | IDS_WTALKAT "@" |
637 | IDS_OTALXAT " at " | 637 | IDS_OTALXAT " at " |
638 | IDS_TFTP_ERROR_TSIZE "Invalid transfer size" | 638 | IDS_TFTP_ERROR_TSIZE "Invalid transfer size" |
639 | IDS_TFTP_ERROR_BSIZE "Invalid block size" | 639 | IDS_TFTP_ERROR_BSIZE "Invalid block size" |
640 | IDS_TFTP_ERROR_TOUT "Invalid timeout" | 640 | IDS_TFTP_ERROR_TOUT "Invalid timeout" |
641 | IDS_SELECT_TFTPROOT "Select TFTP filesystem root.." | 641 | IDS_SELECT_TFTPROOT "Select TFTP filesystem root.." |
642 | IDS_FILTER_WAV "Sound Files (*.wav)|*.wav||" | 642 | IDS_FILTER_WAV "Sound Files (*.wav)|*.wav||" |
643 | IDS_TITLE_WAV "Select sound.." | 643 | IDS_TITLE_WAV "Select sound.." |
644 | IDS_BOX_CANTBIND "Failed to create listening socket. The port may be in use by another application." | 644 | IDS_BOX_CANTBIND "Failed to create listening socket. The port may be in use by another application." |
645 | IDS_NO_XFER_OP "No request type specified." | 645 | IDS_NO_XFER_OP "No request type specified." |
646 | IDS_INVALID_IP "Invalid IP address." | 646 | IDS_INVALID_IP "Invalid IP address." |
647 | IDS_INVALID_NETMASK "Invalid netmask." | 647 | IDS_INVALID_NETMASK "Invalid netmask." |
648 | END | 648 | END |
649 | 649 | ||
650 | STRINGTABLE DISCARDABLE | 650 | STRINGTABLE DISCARDABLE |
651 | BEGIN | 651 | BEGIN |
652 | AFX_IDS_APP_TITLE "PUMPKIN" | 652 | AFX_IDS_APP_TITLE "PUMPKIN" |
653 | END | 653 | END |
654 | 654 | ||
655 | STRINGTABLE DISCARDABLE | 655 | STRINGTABLE DISCARDABLE |
656 | BEGIN | 656 | BEGIN |
657 | IDS_INVALID_RULE "Invalid access rule." | 657 | IDS_INVALID_RULE "Invalid access rule." |
658 | IDS_LOG_LOGERROR "Error logging to '%s'" | 658 | IDS_LOG_LOGERROR "Error logging to '%s'" |
659 | IDS_TFTP_ERROR_TOOBIG "File is too big, try increasing block size" | ||
659 | END | 660 | END |
660 | 661 | ||
661 | #endif // English (U.S.) resources | 662 | #endif // English (U.S.) resources |
662 | ///////////////////////////////////////////////////////////////////////////// | 663 | ///////////////////////////////////////////////////////////////////////////// |
663 | 664 | ||
664 | 665 | ||
665 | 666 | ||
666 | #ifndef APSTUDIO_INVOKED | 667 | #ifndef APSTUDIO_INVOKED |
667 | ///////////////////////////////////////////////////////////////////////////// | 668 | ///////////////////////////////////////////////////////////////////////////// |
668 | // | 669 | // |
669 | // Generated from the TEXTINCLUDE 3 resource. | 670 | // Generated from the TEXTINCLUDE 3 resource. |
670 | // | 671 | // |
671 | #define _AFX_NO_SPLITTER_RESOURCES | 672 | #define _AFX_NO_SPLITTER_RESOURCES |
672 | #define _AFX_NO_OLE_RESOURCES | 673 | #define _AFX_NO_OLE_RESOURCES |
673 | #define _AFX_NO_TRACKER_RESOURCES | 674 | #define _AFX_NO_TRACKER_RESOURCES |
674 | #define _AFX_NO_PROPERTY_RESOURCES | 675 | #define _AFX_NO_PROPERTY_RESOURCES |
675 | 676 | ||
676 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) | 677 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) |
677 | #ifdef _WIN32 | 678 | #ifdef _WIN32 |
678 | LANGUAGE 9, 1 | 679 | LANGUAGE 9, 1 |
679 | #pragma code_page(1252) | 680 | #pragma code_page(1252) |
680 | #endif | 681 | #endif |
681 | #include "res\PumpKIN.rc2" // non-Microsoft Visual C++ edited resources | 682 | #include "res\PumpKIN.rc2" // non-Microsoft Visual C++ edited resources |
682 | #include "afxres.rc" // Standard components | 683 | #include "afxres.rc" // Standard components |
683 | #endif | 684 | #endif |
684 | ///////////////////////////////////////////////////////////////////////////// | 685 | ///////////////////////////////////////////////////////////////////////////// |
685 | #endif // not APSTUDIO_INVOKED | 686 | #endif // not APSTUDIO_INVOKED |
686 | 687 | ||
@@ -1,171 +1,173 @@ | |||
1 | //{{NO_DEPENDENCIES}} | 1 | //{{NO_DEPENDENCIES}} |
2 | // Microsoft Developer Studio generated include file. | 2 | // Microsoft Developer Studio generated include file. |
3 | // Used by PumpKIN.rc | 3 | // Used by PumpKIN.rc |
4 | // | 4 | // |
5 | #define IDM_ABOUTBOX 0x0010 | 5 | #define IDM_ABOUTBOX 0x0010 |
6 | #define IDD_ABOUTBOX 100 | 6 | #define IDD_ABOUTBOX 100 |
7 | #define IDS_ABOUTBOX 101 | 7 | #define IDS_ABOUTBOX 101 |
8 | #define IDC_TRAYICON 101 | 8 | #define IDC_TRAYICON 101 |
9 | #define IDD_PUMPKIN_DIALOG 102 | 9 | #define IDD_PUMPKIN_DIALOG 102 |
10 | #define IDS_FMT_BYTES 102 | 10 | #define IDS_FMT_BYTES 102 |
11 | #define IDP_SOCKETS_INIT_FAILED 103 | 11 | #define IDP_SOCKETS_INIT_FAILED 103 |
12 | #define IDS_TFTP_ERROR_ACCESS 104 | 12 | #define IDS_TFTP_ERROR_ACCESS 104 |
13 | #define IDS_TFTP_ERROR_NOTFOUND 105 | 13 | #define IDS_TFTP_ERROR_NOTFOUND 105 |
14 | #define IDS_TFTP_ERROR_DIRFULL 106 | 14 | #define IDS_TFTP_ERROR_DIRFULL 106 |
15 | #define IDD_PROPS_SERVER 106 | 15 | #define IDD_PROPS_SERVER 106 |
16 | #define IDS_TFTP_ERROR_SHARING 107 | 16 | #define IDS_TFTP_ERROR_SHARING 107 |
17 | #define IDD_PROPS_NETWORK 107 | 17 | #define IDD_PROPS_NETWORK 107 |
18 | #define IDS_TFTP_ERROR_DISKFULL 108 | 18 | #define IDS_TFTP_ERROR_DISKFULL 108 |
19 | #define IDS_TFTP_ERROR_UNDEFINED 109 | 19 | #define IDS_TFTP_ERROR_UNDEFINED 109 |
20 | #define IDS_LOG_START 110 | 20 | #define IDS_LOG_START 110 |
21 | #define IDS_LOG_LISTENRECEIVEERROR 111 | 21 | #define IDS_LOG_LISTENRECEIVEERROR 111 |
22 | #define IDS_LOG_LISTENACCEPTERROR 112 | 22 | #define IDS_LOG_LISTENACCEPTERROR 112 |
23 | #define IDS_LOG_RRQSERVE 113 | 23 | #define IDS_LOG_RRQSERVE 113 |
24 | #define IDS_LOG_LISTENOPCODE 114 | 24 | #define IDS_LOG_LISTENOPCODE 114 |
25 | #define IDS_LOG_XFERUDPSEND 115 | 25 | #define IDS_LOG_XFERUDPSEND 115 |
26 | #define IDS_LOG_XFERRECEIVE 116 | 26 | #define IDS_LOG_XFERRECEIVE 116 |
27 | #define IDS_LOG_XFERSEND 117 | 27 | #define IDS_LOG_XFERSEND 117 |
28 | #define IDS_LOG_XFERUDPRECEIVE 118 | 28 | #define IDS_LOG_XFERUDPRECEIVE 118 |
29 | #define IDS_LOG_XFERSOURCETID 119 | 29 | #define IDS_LOG_XFERSOURCETID 119 |
30 | #define IDS_LOG_SENTTFTPERROR 120 | 30 | #define IDS_LOG_SENTTFTPERROR 120 |
31 | #define IDS_LOG_GOTTFTPERROR 121 | 31 | #define IDS_LOG_GOTTFTPERROR 121 |
32 | #define IDS_LOG_XFEROPCODE 122 | 32 | #define IDS_LOG_XFEROPCODE 122 |
33 | #define IDS_LOG_XFERRRQFINISHED 123 | 33 | #define IDS_LOG_XFERRRQFINISHED 123 |
34 | #define IDS_TITLE_OPTIONS 124 | 34 | #define IDS_TITLE_OPTIONS 124 |
35 | #define IDS_LOG_WRQSERVE 125 | 35 | #define IDS_LOG_WRQSERVE 125 |
36 | #define IDS_TFTP_ERROR_FAILEDTORENAME 126 | 36 | #define IDS_TFTP_ERROR_FAILEDTORENAME 126 |
37 | #define IDS_RENAME_TITLE 127 | 37 | #define IDS_RENAME_TITLE 127 |
38 | #define IDR_MAINFRAME 128 | 38 | #define IDR_MAINFRAME 128 |
39 | #define IDS_LOG_TIMEDOUT 128 | 39 | #define IDS_LOG_TIMEDOUT 128 |
40 | #define IDS_CONFIRMEXIT_TITLE 129 | 40 | #define IDS_CONFIRMEXIT_TITLE 129 |
41 | #define IDI_RRQ 129 | 41 | #define IDI_RRQ 129 |
42 | #define IDS_CONFIRMEXIT_TEXT 130 | 42 | #define IDS_CONFIRMEXIT_TEXT 130 |
43 | #define IDI_WRQ 130 | 43 | #define IDI_WRQ 130 |
44 | #define IDD_CONFIRM_RRQ 131 | 44 | #define IDD_CONFIRM_RRQ 131 |
45 | #define IDS_LOG_XFERWRQFINISHED 131 | 45 | #define IDS_LOG_XFERWRQFINISHED 131 |
46 | #define IDD_CONFIRM_WRQ 132 | 46 | #define IDD_CONFIRM_WRQ 132 |
47 | #define IDB_BACKGROUND 132 | 47 | #define IDB_BACKGROUND 132 |
48 | #define IDS_LOG_XFERABORTED 132 | 48 | #define IDS_LOG_XFERABORTED 132 |
49 | #define IDS_TITLE_PUTREQUEST 133 | 49 | #define IDS_TITLE_PUTREQUEST 133 |
50 | #define IDS_TITLE_GETREQUEST 134 | 50 | #define IDS_TITLE_GETREQUEST 134 |
51 | #define IDR_WAVE_RING 135 | 51 | #define IDR_WAVE_RING 135 |
52 | #define IDS_TALKHEADING 135 | 52 | #define IDS_TALKHEADING 135 |
53 | #define IDS_WTALKHEADING 135 | 53 | #define IDS_WTALKHEADING 135 |
54 | #define IDR_WAVE_FINISHED 136 | 54 | #define IDR_WAVE_FINISHED 136 |
55 | #define IDS_TITLE_BROWSEFILE 136 | 55 | #define IDS_TITLE_BROWSEFILE 136 |
56 | #define IDD_REQUEST 137 | 56 | #define IDD_REQUEST 137 |
57 | #define IDS_LOG_RESOLVEFAILED 137 | 57 | #define IDS_LOG_RESOLVEFAILED 137 |
58 | #define IDS_LOG_FAILEDLOCALFILE 138 | 58 | #define IDS_LOG_FAILEDLOCALFILE 138 |
59 | #define IDD_PROPS_SOUNDS 138 | 59 | #define IDD_PROPS_SOUNDS 138 |
60 | #define IDS_LOG_FAILEDTOOPEN 139 | 60 | #define IDS_LOG_FAILEDTOOPEN 139 |
61 | #define IDM_POPUPS 140 | 61 | #define IDM_POPUPS 140 |
62 | #define IDS_OTALXHEADING 140 | 62 | #define IDS_OTALXHEADING 140 |
63 | #define IDS_REGISTRYKEY 141 | 63 | #define IDS_REGISTRYKEY 141 |
64 | #define IDS_KLEVERNET_URL 142 | 64 | #define IDS_KLEVERNET_URL 142 |
65 | #define IDR_WAVE_ABORTED 142 | 65 | #define IDR_WAVE_ABORTED 142 |
66 | #define IDS_LOGTIMEFORMAT 143 | 66 | #define IDS_LOGTIMEFORMAT 143 |
67 | #define IDS_DROPFILES_TITLE 144 | 67 | #define IDS_DROPFILES_TITLE 144 |
68 | #define IDS_NOMULTIPLEDROP_TEXT 145 | 68 | #define IDS_NOMULTIPLEDROP_TEXT 145 |
69 | #define IDI_BROWSE 145 | 69 | #define IDI_BROWSE 145 |
70 | #define IDS_LOG_REQUESTING 146 | 70 | #define IDS_LOG_REQUESTING 146 |
71 | #define IDS_LOG_SENDING 147 | 71 | #define IDS_LOG_SENDING 147 |
72 | #define IDS_WTALKAT 148 | 72 | #define IDS_WTALKAT 148 |
73 | #define IDS_OTALXAT 149 | 73 | #define IDS_OTALXAT 149 |
74 | #define IDI_PLAY 149 | 74 | #define IDI_PLAY 149 |
75 | #define IDS_TFTP_ERROR_TSIZE 150 | 75 | #define IDS_TFTP_ERROR_TSIZE 150 |
76 | #define IDD_PROPS_ACL 150 | 76 | #define IDD_PROPS_ACL 150 |
77 | #define IDS_TFTP_ERROR_BSIZE 151 | 77 | #define IDS_TFTP_ERROR_BSIZE 151 |
78 | #define IDS_TFTP_ERROR_TOUT 152 | 78 | #define IDS_TFTP_ERROR_TOUT 152 |
79 | #define IDI_UP 152 | 79 | #define IDI_UP 152 |
80 | #define IDS_SELECT_TFTPROOT 153 | 80 | #define IDS_SELECT_TFTPROOT 153 |
81 | #define IDI_DOWN 153 | 81 | #define IDI_DOWN 153 |
82 | #define IDS_FILTER_WAV 154 | 82 | #define IDS_FILTER_WAV 154 |
83 | #define IDI_REMOVE 154 | 83 | #define IDI_REMOVE 154 |
84 | #define IDS_TITLE_WAV 155 | 84 | #define IDS_TITLE_WAV 155 |
85 | #define IDS_BOX_CANTBIND 156 | 85 | #define IDS_BOX_CANTBIND 156 |
86 | #define IDS_NO_XFER_OP 157 | 86 | #define IDS_NO_XFER_OP 157 |
87 | #define IDS_INVALID_IP 158 | 87 | #define IDS_INVALID_IP 158 |
88 | #define IDS_INVALID_NETMASK 159 | 88 | #define IDS_INVALID_NETMASK 159 |
89 | #define IDS_INVALID_RULE 160 | 89 | #define IDS_INVALID_RULE 160 |
90 | #define IDS_LOG_LOGERROR 161 | 90 | #define IDS_LOG_LOGERROR 161 |
91 | #define IDS_TFTP_ERROR_TOOBIG 162 | ||
92 | #define IDS_LOG_DENYING 163 | ||
91 | #define IDC_KLEVERNET 1000 | 93 | #define IDC_KLEVERNET 1000 |
92 | #define IDC_CONNECTIONS 1001 | 94 | #define IDC_CONNECTIONS 1001 |
93 | #define IDC_LOG 1003 | 95 | #define IDC_LOG 1003 |
94 | #define IDC_GET 1004 | 96 | #define IDC_GET 1004 |
95 | #define IDC_PUT 1005 | 97 | #define IDC_PUT 1005 |
96 | #define IDC_ABORT 1006 | 98 | #define IDC_ABORT 1006 |
97 | #define IDC_EXIT 1007 | 99 | #define IDC_EXIT 1007 |
98 | #define IDC_TFTPROOT 1008 | 100 | #define IDC_TFTPROOT 1008 |
99 | #define IDC_TFTPSUBDIRS 1009 | 101 | #define IDC_TFTPSUBDIRS 1009 |
100 | #define IDC_RRQ_GIVEALL 1010 | 102 | #define IDC_RRQ_GIVEALL 1010 |
101 | #define IDC_RRQ_ALWAYSCONFIRM 1011 | 103 | #define IDC_RRQ_ALWAYSCONFIRM 1011 |
102 | #define IDC_RRQ_DENYALL 1012 | 104 | #define IDC_RRQ_DENYALL 1012 |
103 | #define IDC_WRQ_TAKEALL 1013 | 105 | #define IDC_WRQ_TAKEALL 1013 |
104 | #define IDC_WRQ_PROMPTEXISTING 1014 | 106 | #define IDC_WRQ_PROMPTEXISTING 1014 |
105 | #define IDC_WRQ_ALWAYSCONFIRM 1015 | 107 | #define IDC_WRQ_ALWAYSCONFIRM 1015 |
106 | #define IDC_WRQ_DENYALL 1016 | 108 | #define IDC_WRQ_DENYALL 1016 |
107 | #define IDC_PROMPTTIMEOUT 1017 | 109 | #define IDC_PROMPTTIMEOUT 1017 |
108 | #define IDC_LISTENPORT 1018 | 110 | #define IDC_LISTENPORT 1018 |
109 | #define IDC_LISTENSPIN 1019 | 111 | #define IDC_LISTENSPIN 1019 |
110 | #define IDC_SPEAKPORT 1020 | 112 | #define IDC_SPEAKPORT 1020 |
111 | #define IDC_SPEAKSPIN 1021 | 113 | #define IDC_SPEAKSPIN 1021 |
112 | #define IDC_MAXUDPSIZE 1022 | 114 | #define IDC_MAXUDPSIZE 1022 |
113 | #define IDC_MAXUDPSPIN 1023 | 115 | #define IDC_MAXUDPSPIN 1023 |
114 | #define IDC_TIMEOUT 1024 | 116 | #define IDC_TIMEOUT 1024 |
115 | #define IDC_TIMESPIN 1025 | 117 | #define IDC_TIMESPIN 1025 |
116 | #define IDC_OPTIONS 1026 | 118 | #define IDC_OPTIONS 1026 |
117 | #define IDC_BLOCKSIZE 1026 | 119 | #define IDC_BLOCKSIZE 1026 |
118 | #define IDC_BSIZESPIN 1027 | 120 | #define IDC_BSIZESPIN 1027 |
119 | #define IDC_HOST 1028 | 121 | #define IDC_HOST 1028 |
120 | #define IDC_FILE 1029 | 122 | #define IDC_FILE 1029 |
121 | #define IDC_RENAME 1030 | 123 | #define IDC_RENAME 1030 |
122 | #define IDC_REMOTEFILE 1030 | 124 | #define IDC_REMOTEFILE 1030 |
123 | #define IDC_RESUME 1031 | 125 | #define IDC_RESUME 1031 |
124 | #define IDC_REFRESH 1032 | 126 | #define IDC_REFRESH 1032 |
125 | #define IDC_BROWSE 1034 | 127 | #define IDC_BROWSE 1034 |
126 | #define IDC_TALKS 1035 | 128 | #define IDC_TALKS 1035 |
127 | #define IDC_LOCALFILE 1036 | 129 | #define IDC_LOCALFILE 1036 |
128 | #define IDC_TYPE 1037 | 130 | #define IDC_TYPE 1037 |
129 | #define IDC_BSIZE 1039 | 131 | #define IDC_BSIZE 1039 |
130 | #define IDC_RING 1041 | 132 | #define IDC_RING 1041 |
131 | #define IDC_RING_BROWSE 1042 | 133 | #define IDC_RING_BROWSE 1042 |
132 | #define IDC_RING_PLAY 1043 | 134 | #define IDC_RING_PLAY 1043 |
133 | #define IDC_ACL_LIST 1043 | 135 | #define IDC_ACL_LIST 1043 |
134 | #define IDC_FINISHED 1044 | 136 | #define IDC_FINISHED 1044 |
135 | #define IDC_ACL_UP 1044 | 137 | #define IDC_ACL_UP 1044 |
136 | #define IDC_FINISHED_BROWSE 1045 | 138 | #define IDC_FINISHED_BROWSE 1045 |
137 | #define IDC_ACL_DOWN 1045 | 139 | #define IDC_ACL_DOWN 1045 |
138 | #define IDC_FINISHED_PLAY 1046 | 140 | #define IDC_FINISHED_PLAY 1046 |
139 | #define IDC_ACL_REMOVE 1046 | 141 | #define IDC_ACL_REMOVE 1046 |
140 | #define IDC_ABORTED 1047 | 142 | #define IDC_ABORTED 1047 |
141 | #define IDC_ACL_ADDR 1047 | 143 | #define IDC_ACL_ADDR 1047 |
142 | #define IDC_ABORTED_BROWSE 1048 | 144 | #define IDC_ABORTED_BROWSE 1048 |
143 | #define IDC_ACL_RULE 1048 | 145 | #define IDC_ACL_RULE 1048 |
144 | #define IDC_ABORTED_PLAY 1049 | 146 | #define IDC_ABORTED_PLAY 1049 |
145 | #define IDC_ACL_NETMASK 1049 | 147 | #define IDC_ACL_NETMASK 1049 |
146 | #define IDC_ACL_ADD 1050 | 148 | #define IDC_ACL_ADD 1050 |
147 | #define IDC_ACL_XFER 1051 | 149 | #define IDC_ACL_XFER 1051 |
148 | #define IDC_ACL_REPLACE 1052 | 150 | #define IDC_ACL_REPLACE 1052 |
149 | #define IDC_LISTENING 1052 | 151 | #define IDC_LISTENING 1052 |
150 | #define IDC_LOGFILE 1053 | 152 | #define IDC_LOGFILE 1053 |
151 | #define IDC_LOGFILE_BROWSE 1054 | 153 | #define IDC_LOGFILE_BROWSE 1054 |
152 | #define ID_TRAY_HELP 32771 | 154 | #define ID_TRAY_HELP 32771 |
153 | #define ID_TRAY_ABOUTPUMPKIN 32772 | 155 | #define ID_TRAY_ABOUTPUMPKIN 32772 |
154 | #define ID_TRAY_EXIT 32773 | 156 | #define ID_TRAY_EXIT 32773 |
155 | #define ID_TRAY_SENDFILE 32774 | 157 | #define ID_TRAY_SENDFILE 32774 |
156 | #define ID_TRAY_FETCHFILE 32775 | 158 | #define ID_TRAY_FETCHFILE 32775 |
157 | #define ID_TRAY_OPTIONS 32776 | 159 | #define ID_TRAY_OPTIONS 32776 |
158 | #define ID_TRAY_SHOWPUMPKINWINDOW 32777 | 160 | #define ID_TRAY_SHOWPUMPKINWINDOW 32777 |
159 | #define ID_TRAY_OPENFILESFOLDER 32778 | 161 | #define ID_TRAY_OPENFILESFOLDER 32778 |
160 | #define ID_TRAY_LISTEN 32780 | 162 | #define ID_TRAY_LISTEN 32780 |
161 | 163 | ||
162 | // Next default values for new objects | 164 | // Next default values for new objects |
163 | // | 165 | // |
164 | #ifdef APSTUDIO_INVOKED | 166 | #ifdef APSTUDIO_INVOKED |
165 | #ifndef APSTUDIO_READONLY_SYMBOLS | 167 | #ifndef APSTUDIO_READONLY_SYMBOLS |
166 | #define _APS_NEXT_RESOURCE_VALUE 155 | 168 | #define _APS_NEXT_RESOURCE_VALUE 155 |
167 | #define _APS_NEXT_COMMAND_VALUE 32781 | 169 | #define _APS_NEXT_COMMAND_VALUE 32781 |
168 | #define _APS_NEXT_CONTROL_VALUE 1055 | 170 | #define _APS_NEXT_CONTROL_VALUE 1055 |
169 | #define _APS_NEXT_SYMED_VALUE 102 | 171 | #define _APS_NEXT_SYMED_VALUE 102 |
170 | #endif | 172 | #endif |
171 | #endif | 173 | #endif |