root/honeyclient/branches/rel/1.0/Capture2/capture-client-xeno-mod/NetworkAdapter.h
| Revision 823, 1.8 kB (checked in by xkovah, 1 year ago) |
|---|
| Line | |
|---|---|
| 1 | /* |
| 2 | * PROJECT: Capture |
| 3 | * FILE: NetworkAdapter.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 "Thread.h" |
| 27 | #include "Monitor.h" |
| 28 | #include <pcap.h> |
| 29 | #include <string> |
| 30 | #include "NetworkPacketDumper.h" |
| 31 | /* |
| 32 | Class: NetworkAdapter |
| 33 | |
| 34 | Contains information about a particular network adapter on the system. When |
| 35 | required it will start dumping packets sent and received on the adapter to |
| 36 | a file. |
| 37 | */ |
| 38 | |
| 39 | /* Gah ... A circular dependency */ |
| 40 | class NetworkPacketDumper; |
| 41 | |
| 42 | using namespace std; |
| 43 | |
| 44 | class NetworkAdapter : public Runnable, Monitor |
| 45 | { |
| 46 | public: |
| 47 | NetworkAdapter(NetworkPacketDumper* npDumper, string aName, pcap_t* adap); |
| 48 | ~NetworkAdapter(void); |
| 49 | |
| 50 | void start(); |
| 51 | void stop(); |
| 52 | void run(); |
| 53 | private: |
| 54 | bool running; |
| 55 | string adapterName; |
| 56 | pcap_t* adapter; |
| 57 | NetworkPacketDumper* networkPacketDumper; |
| 58 | pcap_dumper_t *dumpFile; |
| 59 | Thread* adapterThread; |
| 60 | }; |
Note: See TracBrowser for help on using the browser.
