PcapPlusPlus
PcapRemoteDevice.h
Go to the documentation of this file.
1 #ifndef PCAPPP_PCAP_REMOTE_DEVICE
2 #define PCAPPP_PCAP_REMOTE_DEVICE
3 
4 #if defined(WIN32) || defined(WINx64) || defined(PCAPPP_MINGW_ENV)
5 
6 #include <vector>
7 #include "PcapLiveDevice.h"
8 
9 
11 
12 struct pcap_rmtauth;
13 
18 namespace pcpp
19 {
20 
28  {
29  public:
35  PcapRemoteAuthentication(const std::string username, const std::string password) { userName = username; this->password = password; }
36 
42 
46  std::string userName;
47 
51  std::string password;
52 
59  pcap_rmtauth getPcapRmAuth();
60  };
61 
80  {
81  friend class PcapRemoteDeviceList;
82  private:
83  IPAddress* m_RemoteMachineIpAddress;
84  uint16_t m_RemoteMachinePort;
85  PcapRemoteAuthentication* m_RemoteAuthentication;
86 
87  // c'tor is private, as only PcapRemoteDeviceList should create instances of it, and it'll create only one for every remote interface
88  PcapRemoteDevice(pcap_if_t* iface, PcapRemoteAuthentication* remoteAuthentication, IPAddress* remoteMachineIP, uint16_t remoteMachinePort);
89 
90  // private copy c'tor
91  PcapRemoteDevice( const PcapRemoteDevice& other );
92  // private assignment operator
93  PcapRemoteDevice& operator=(const PcapRemoteDevice& other);
94 
95  static void* remoteDeviceCaptureThreadMain(void *ptr);
96 
97  //overridden methods
98  ThreadStart getCaptureThreadStart();
99 
100  public:
101  virtual ~PcapRemoteDevice() {}
102 
106  IPAddress* getRemoteMachineIpAddress() { return m_RemoteMachineIpAddress; }
107 
111  uint16_t getRemoteMachinePort() { return m_RemoteMachinePort; }
112 
113  //overridden methods
114 
116 
121  virtual uint16_t getMtu();
122 
127  virtual MacAddress getMacAddress();
128 
138  virtual bool open();
139 
140  void getStatistics(pcap_stat& stats);
141  };
142 
143 } // namespace pcpp
144 
145 #endif // WIN32 || WINx64
146 
147 #endif /* PCAPPP_PCAP_REMOTE_DEVICE */
virtual LiveDeviceType getDeviceType()
Definition: PcapRemoteDevice.h:115
Definition: PcapRemoteDeviceList.h:28
virtual uint16_t getMtu()
virtual bool open()
PcapRemoteAuthentication(const std::string username, const std::string password)
Definition: PcapRemoteDevice.h:35
virtual MacAddress getMacAddress()
The main namespace for the PcapPlusPlus lib.
IPAddress * getRemoteMachineIpAddress()
Definition: PcapRemoteDevice.h:106
Definition: PcapRemoteDevice.h:79
Definition: PcapLiveDevice.h:76
Definition: IpAddress.h:27
Definition: PcapRemoteDevice.h:27
Definition: PcapLiveDevice.h:132
PcapRemoteAuthentication(const PcapRemoteAuthentication &other)
Definition: PcapRemoteDevice.h:41
Definition: MacAddress.h:21
uint16_t getRemoteMachinePort()
Definition: PcapRemoteDevice.h:111
void getStatistics(pcap_stat &stats)
LiveDeviceType
Definition: PcapLiveDevice.h:126
std::string password
Definition: PcapRemoteDevice.h:51
std::string userName
Definition: PcapRemoteDevice.h:46