root/honeyclient/branches/rel/1.0/Capture2/capture-client-xeno-mod/FileUploader.h
| Revision 823, 2.2 kB (checked in by xkovah, 1 year ago) |
|---|
| Line | |
|---|---|
| 1 | /* |
| 2 | * PROJECT: Capture |
| 3 | * FILE: FileUploader.h |
| 4 | * AUTHORS: Ramon Steenson (rsteenson@gmail.com) & Christian Seifert (christian.seifert@gmail.com) |
| 5 | * |
| 6 | * Developed by Victoria University of Wellington and the New Zealand Honeynet Alliance |
| 7 | * |
| 8 | * This file is part of Capture. |
| 9 | * |
| 10 | * Capture is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation; either version 2 of the License, or |
| 13 | * (at your option) any later version. |
| 14 | * |
| 15 | * Capture is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with Capture; if not, write to the Free Software |
| 22 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 23 | */ |
| 24 | #pragma once |
| 25 | #include "CaptureGlobal.h" |
| 26 | #include "Server.h" |
| 27 | #include <boost/lexical_cast.hpp> |
| 28 | |
| 29 | /* |
| 30 | Class: FileUploader |
| 31 | |
| 32 | Uploads files to the remote server. Encodes binary data into base64 which is then |
| 33 | split up into XML documents to be sent to the server. |
| 34 | |
| 35 | Listens to various events in the <EventController> to do with progress of the file |
| 36 | transfer. |
| 37 | */ |
| 38 | class FileUploader |
| 39 | { |
| 40 | public: |
| 41 | FileUploader(Server* s); |
| 42 | ~FileUploader(void); |
| 43 | |
| 44 | bool sendFile(wstring file); |
| 45 | private: |
| 46 | Server* server; |
| 47 | |
| 48 | void onReceiveFileOkEvent(Element* pElement); |
| 49 | void onReceiveFileErrorEvent(Element* pElement); |
| 50 | void onReceiveFileAcceptEvent(Element* pElement); |
| 51 | void onReceiveFileRejectEvent(Element* pElement); |
| 52 | |
| 53 | BOOL getFileSize(wstring file, PLARGE_INTEGER fileSize); |
| 54 | size_t sendFilePart(unsigned int start, unsigned int size); |
| 55 | |
| 56 | boost::signals::connection onReceiveFileOkEventConnection; |
| 57 | boost::signals::connection onReceiveFileErrorEventConnection; |
| 58 | boost::signals::connection onReceiveFileAcceptEventConnection; |
| 59 | boost::signals::connection onReceiveFileRejectEventConnection; |
| 60 | |
| 61 | bool fileAccepted; |
| 62 | bool fileOpened; |
| 63 | wstring fileName; |
| 64 | bool busy; |
| 65 | LARGE_INTEGER fileSize; |
| 66 | HANDLE hFileAcknowledged; |
| 67 | FILE* pFileStream; |
| 68 | }; |
Note: See TracBrowser for help on using the browser.
