5 #include <Poco/Net/HTTPRequest.h>
6 #include <Poco/Net/IPAddress.h>
7 #include <Poco/Net/NetworkInterface.h>
8 #include <Poco/Net/SocketAddress.h>
9 #include <Poco/Timespan.h>
11 #include "loop/StopControl.h"
12 #include "net/HTTPEntireResponse.h"
13 #include "net/IPAddressRange.h"
14 #include "util/Loggable.h"
32 AbstractHTTPScanner(
const std::string& path, uint16_t port,
const Poco::Net::IPAddress& minNetMask);
41 std::vector<Poco::Net::SocketAddress>
scan(
const uint32_t maxResponseLength);
45 void setPath(
const std::string& path);
46 void setPort(Poco::UInt16 port);
47 void setMinNetMask(
const Poco::Net::IPAddress& minNetMask);
48 void setPingTimeout(
const Poco::Timespan& pingTimeout);
49 void setHTTPTimeout(
const Poco::Timespan& httpTimeout);
50 void setBlackList(
const std::set<std::string>& set);
56 virtual void prepareRequest(Poco::Net::HTTPRequest& request) = 0;
73 const Poco::Net::NetworkInterface& interface,
74 std::vector<Poco::Net::SocketAddress>& devices,
75 const Poco::Int64 maxResponseLength);
87 std::vector<Poco::Net::SocketAddress>& devices,
88 const Poco::Int64 maxResponseLength);
98 const Poco::Int64 maxResponseLength);
100 bool addressIncompatible(
const Poco::Net::NetworkInterface::AddressTuple& addressTuple)
const;
110 Poco::Net::IPAddress m_minNetMask;
111 Poco::Timespan m_pingTimeout;
112 Poco::Timespan m_httpTimeout;
113 std::set<std::string> m_blackList;
HTTPEntireResponse sendRequest(const Poco::Net::SocketAddress &socketAddress, const Poco::Int64 maxResponseLength)
It sends HTTP request.
Definition: AbstractHTTPScanner.cpp:177
Helper class for managing a common stoppable loop situation:
Definition: StopControl.h:35
Definition: IPAddressRange.h:19
std::vector< Poco::Net::SocketAddress > scan(const uint32_t maxResponseLength)
It executes the scan of proper network interfaces.
Definition: AbstractHTTPScanner.cpp:74
Definition: HTTPEntireResponse.h:13
std::vector< Poco::Net::NetworkInterface > listNetworkInterfaces()
Definition: AbstractHTTPScanner.cpp:207
void probeAddressRange(StopControl::Run &run, const IPAddressRange &range, std::vector< Poco::Net::SocketAddress > &devices, const Poco::Int64 maxResponseLength)
It explores IP address range.
Definition: AbstractHTTPScanner.cpp:125
StopControl implements the stop mechanism generically.
Definition: StopControl.h:12
virtual bool isValidResponse(const std::string &response)=0
It defines if the response is valid or not.
void probeInterface(StopControl::Run &run, const Poco::Net::NetworkInterface &interface, std::vector< Poco::Net::SocketAddress > &devices, const Poco::Int64 maxResponseLength)
It explores network interface.
Definition: AbstractHTTPScanner.cpp:95
Definition: Loggable.h:19
The abstract class contains core of HTTP scanning of network. Derivated classes will have to implemen...
Definition: AbstractHTTPScanner.h:24