PcapPlusPlus  20.08
PcapRemoteDeviceList.h
Go to the documentation of this file.
1 #ifndef PCAPP_PCAP_REMOTE_DEVICE_LIST
2 #define PCAPP_PCAP_REMOTE_DEVICE_LIST
3 
4 #if defined(WIN32) || defined(WINx64) || defined(PCAPPP_MINGW_ENV)
5 
6 #include "IpAddress.h"
7 #include "PcapRemoteDevice.h"
8 
10 
15 namespace pcpp
16 {
17 
29  {
30  private:
31  std::vector<PcapRemoteDevice*> m_RemoteDeviceList;
32  IPAddress m_RemoteMachineIpAddress;
33  uint16_t m_RemoteMachinePort;
34  PcapRemoteAuthentication* m_RemoteAuthentication;
35 
36  // private c'tor. User should create the list via static methods PcapRemoteDeviceList::getRemoteDeviceList()
37  PcapRemoteDeviceList() : m_RemoteMachinePort(0), m_RemoteAuthentication(NULL) {}
38  // private copy c'tor
40  PcapRemoteDeviceList& operator=(const PcapRemoteDeviceList& other);
41 
42  void setRemoteMachineIpAddress(const IPAddress& ipAddress);
43  void setRemoteMachinePort(uint16_t port);
44  void setRemoteAuthentication(const PcapRemoteAuthentication* remoteAuth);
45 
46  public:
50  typedef typename std::vector<PcapRemoteDevice*>::iterator RemoteDeviceListIterator;
51 
55  typedef typename std::vector<PcapRemoteDevice*>::const_iterator ConstRemoteDeviceListIterator;
56 
58 
72  static PcapRemoteDeviceList* getRemoteDeviceList(const IPAddress& ipAddress, uint16_t port);
73 
86  static PcapRemoteDeviceList* getRemoteDeviceList(const IPAddress& ipAddress, uint16_t port, PcapRemoteAuthentication* remoteAuth);
87 
91  IPAddress getRemoteMachineIpAddress() const { return m_RemoteMachineIpAddress; }
92 
96  uint16_t getRemoteMachinePort() const { return m_RemoteMachinePort; }
97 
103  PcapRemoteDevice* getRemoteDeviceByIP(const IPv4Address& ip4Addr) const;
104 
110  PcapRemoteDevice* getRemoteDeviceByIP(const IPv6Address& ip6Addr) const;
111 
117  PcapRemoteDevice* getRemoteDeviceByIP(const IPAddress& ipAddr) const;
118 
124  PcapRemoteDevice* getRemoteDeviceByIP(const std::string& ipAddrAsString) const;
125 
129  RemoteDeviceListIterator begin() { return m_RemoteDeviceList.begin(); }
130 
134  ConstRemoteDeviceListIterator begin() const { return m_RemoteDeviceList.begin(); }
135 
139  RemoteDeviceListIterator end() { return m_RemoteDeviceList.end(); }
140 
144  ConstRemoteDeviceListIterator end() const { return m_RemoteDeviceList.end(); }
145 
146  };
147 
148 } // namespace pcpp
149 
150 #endif // WIN32 || WINx64
151 
152 #endif /* PCAPP_PCAP_REMOTE_DEVICE_LIST */
PcapRemoteDevice.h
pcpp::IPv4Address
Definition: IpAddress.h:26
pcpp::IPv6Address
Definition: IpAddress.h:140
pcpp::PcapRemoteDeviceList::begin
ConstRemoteDeviceListIterator begin() const
Definition: PcapRemoteDeviceList.h:134
pcpp::PcapRemoteDeviceList::end
RemoteDeviceListIterator end()
Definition: PcapRemoteDeviceList.h:139
pcpp::PcapRemoteDeviceList::begin
RemoteDeviceListIterator begin()
Definition: PcapRemoteDeviceList.h:129
pcpp::IPAddress
‍**
Definition: IpAddress.h:236
pcpp::PcapRemoteDeviceList::end
ConstRemoteDeviceListIterator end() const
Definition: PcapRemoteDeviceList.h:144
pcpp::PcapRemoteDeviceList::getRemoteDeviceList
static PcapRemoteDeviceList * getRemoteDeviceList(const IPAddress &ipAddress, uint16_t port)
pcpp::PcapRemoteDeviceList::getRemoteMachineIpAddress
IPAddress getRemoteMachineIpAddress() const
Definition: PcapRemoteDeviceList.h:91
pcpp::PcapRemoteDeviceList::getRemoteDeviceByIP
PcapRemoteDevice * getRemoteDeviceByIP(const IPv4Address &ip4Addr) const
pcpp::PcapRemoteAuthentication
Definition: PcapRemoteDevice.h:27
IpAddress.h
pcpp
The main namespace for the PcapPlusPlus lib.
pcpp::PcapRemoteDeviceList::ConstRemoteDeviceListIterator
std::vector< PcapRemoteDevice * >::const_iterator ConstRemoteDeviceListIterator
Definition: PcapRemoteDeviceList.h:55
pcpp::PcapRemoteDeviceList::getRemoteMachinePort
uint16_t getRemoteMachinePort() const
Definition: PcapRemoteDeviceList.h:96
pcpp::PcapRemoteDevice
Definition: PcapRemoteDevice.h:79
pcpp::PcapRemoteDeviceList::RemoteDeviceListIterator
std::vector< PcapRemoteDevice * >::iterator RemoteDeviceListIterator
Definition: PcapRemoteDeviceList.h:50
pcpp::PcapRemoteDeviceList
Definition: PcapRemoteDeviceList.h:28