The abstract class contains core of HTTP scanning of network. Derivated classes will have to implement methods to prepare HTTP request and if the response is from right device.
More...
#include <AbstractHTTPScanner.h>
|
| AbstractHTTPScanner (const std::string &path, uint16_t port, const Poco::Net::IPAddress &minNetMask) |
|
std::vector
< Poco::Net::SocketAddress > | scan (const uint32_t maxResponseLength) |
| It executes the scan of proper network interfaces. More...
|
|
void | cancel () |
|
void | setPath (const std::string &path) |
|
void | setPort (Poco::UInt16 port) |
|
void | setMinNetMask (const Poco::Net::IPAddress &minNetMask) |
|
void | setPingTimeout (const Poco::Timespan &pingTimeout) |
|
void | setHTTPTimeout (const Poco::Timespan &httpTimeout) |
|
void | setBlackList (const std::set< std::string > &set) |
|
std::string | path () |
|
Poco::UInt16 | port () |
|
|
virtual void | prepareRequest (Poco::Net::HTTPRequest &request)=0 |
|
virtual bool | isValidResponse (const std::string &response)=0 |
| It defines if the response is valid or not. More...
|
|
void | probeInterface (StopControl::Run &run, const Poco::Net::NetworkInterface &interface, std::vector< Poco::Net::SocketAddress > &devices, const Poco::Int64 maxResponseLength) |
| It explores network interface. More...
|
|
void | probeAddressRange (StopControl::Run &run, const IPAddressRange &range, std::vector< Poco::Net::SocketAddress > &devices, const Poco::Int64 maxResponseLength) |
| It explores IP address range. More...
|
|
HTTPEntireResponse | sendRequest (const Poco::Net::SocketAddress &socketAddress, const Poco::Int64 maxResponseLength) |
| It sends HTTP request. More...
|
|
bool | addressIncompatible (const Poco::Net::NetworkInterface::AddressTuple &addressTuple) const |
|
std::vector
< Poco::Net::NetworkInterface > | listNetworkInterfaces () |
|
void | setupLogger (Poco::Logger *logger=0) const |
|
Poco::Logger & | logger () const |
|
| Loggable (const ClassInfo &info) |
|
| Loggable (const std::type_info &info) |
|
|
static Poco::Logger & | forMethod (const char *name) |
|
static Poco::Logger & | forClass (const ClassInfo &info) |
|
static Poco::Logger & | forClass (const std::type_info &info) |
|
template<typename T > |
static Poco::Logger & | forInstance (const T *i) |
|
static void | configureSimple (Poco::Logger &logger, const std::string &level) |
|
static void | logException (Poco::Logger &logger, const Poco::Message::Priority priority, const Poco::Exception &e, const char *file, size_t line) |
|
The abstract class contains core of HTTP scanning of network. Derivated classes will have to implement methods to prepare HTTP request and if the response is from right device.
BeeeOn::AbstractHTTPScanner::AbstractHTTPScanner |
( |
const std::string & |
path, |
|
|
uint16_t |
port, |
|
|
const Poco::Net::IPAddress & |
minNetMask |
|
) |
| |
- Parameters
-
path | Defines path of HTTP request. |
port | Defines receiver's port. |
minNetMask | Defines minimal range of exploring IP address. |
virtual bool BeeeOn::AbstractHTTPScanner::isValidResponse |
( |
const std::string & |
response | ) |
|
|
protectedpure virtual |
It defines if the response is valid or not.
- Parameters
-
response | Response message. |
- Returns
- If the response is valid or not.
Implemented in BeeeOn::VPTHTTPScanner.
vector< NetworkInterface > AbstractHTTPScanner::listNetworkInterfaces |
( |
| ) |
|
|
protected |
- Returns
- Vector of active network interfaces.
void AbstractHTTPScanner::probeAddressRange |
( |
StopControl::Run & |
run, |
|
|
const IPAddressRange & |
range, |
|
|
std::vector< Poco::Net::SocketAddress > & |
devices, |
|
|
const Poco::Int64 |
maxResponseLength |
|
) |
| |
|
protected |
It explores IP address range.
- Parameters
-
range | Exploring IP address range. |
devices | Structure where are found devices saved. |
maxResponseLength | Defines maximal length of response message which will be process. |
void AbstractHTTPScanner::probeInterface |
( |
StopControl::Run & |
run, |
|
|
const Poco::Net::NetworkInterface & |
interface, |
|
|
std::vector< Poco::Net::SocketAddress > & |
devices, |
|
|
const Poco::Int64 |
maxResponseLength |
|
) |
| |
|
protected |
It explores network interface.
- Parameters
-
interafce | Exploring interface. |
devices | Structure where are found devices saved. |
maxResponseLength | Defines maximal length of response message which will be process. |
vector< SocketAddress > AbstractHTTPScanner::scan |
( |
const uint32_t |
maxResponseLength | ) |
|
It executes the scan of proper network interfaces.
- Parameters
-
maxResponseLength | Defines maximal length of response message which will be process. |
- Returns
- Vector of SocketAddress belongs to found devices.
HTTPEntireResponse AbstractHTTPScanner::sendRequest |
( |
const Poco::Net::SocketAddress & |
socketAddress, |
|
|
const Poco::Int64 |
maxResponseLength |
|
) |
| |
|
protected |
It sends HTTP request.
- Parameters
-
socketAddress | Address of receiver. |
maxResponseLength | Defines maximal length of response message which will be process. |
- Returns
- HTTP response.
The documentation for this class was generated from the following files:
- /var/lib/jenkins/workspace/beeeon-gateway-master/src/net/AbstractHTTPScanner.h
- /var/lib/jenkins/workspace/beeeon-gateway-master/src/net/AbstractHTTPScanner.cpp